lean4-htt/tests/elab/structuralEqns4.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

44 lines
1,020 B
Text

inductive N where | zero | succ (n : N)
/--
info: protected theorem N.brecOn.eq.{u} : ∀ {motive : N → Sort u} (t : N) (F_1 : (t : N) → N.below t → motive t),
N.brecOn t F_1 = F_1 t (N.brecOn.go t F_1).2
-/
#guard_msgs in #print sig N.brecOn.eq
-- set_option trace.Elab.definition.structural.eqns true
def g (i : Nat) (j : N) : N :=
if i < 5 then .zero else
match j with
| .zero => N.zero.succ
| .succ j => g i j
termination_by structural j
/--
info: theorem g.eq_def : ∀ (i : Nat) (j : N),
g i j =
if i < 5 then N.zero
else
match j with
| N.zero => N.zero.succ
| j.succ => g i j
-/
#guard_msgs(pass trace, all) in #print sig g.eq_def
def N.beq : (m n : N) → Bool
| .zero, .zero => true
| .succ m, .succ n => N.beq m n
| _, _ => false
/--
info: theorem N.beq.eq_def : ∀ (x x_1 : N),
x.beq x_1 =
match x, x_1 with
| N.zero, N.zero => true
| m.succ, n.succ => m.beq n
| x, x_2 => false
-/
#guard_msgs(pass trace, all) in #print sig N.beq.eq_def