Files
lean4/tests/elab/4230.lean
Garmelon 08eb78a5b2 chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

26 lines
644 B
Lean4

def copy (curr : Nat) (input : Array Nat) (output : Array Nat) : Array Nat :=
if hcurr:curr < input.size then
copy (curr + 1) input (output.push (input[curr]'hcurr))
else
output
termination_by input.size - curr
/--
info: Try this:
[apply] termination_by input.size - curr
-/
#guard_msgs(drop warning, info) in
theorem foo (curr : Nat) (input : Array Nat) (output : Array Nat)
: (idx : Nat) (hidx1 : idx < curr),
(copy curr input output)[idx]'sorry
=
output[idx]'sorry := by
intro idx hidx
unfold copy
split
. rw [foo]
. rw [Array.getElem_push_lt]
. omega
. rfl
termination_by?