File tree Expand file tree Collapse file tree 8 files changed +12
-12
lines changed Expand file tree Collapse file tree 8 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ def g (n : Nat) : Nat :=
33 1
44 else
55 4 + g (n - 1 )
6- termination_by n
6+ termination_by (n, 0 )
77 decreasing_by simp_wf; omega
88
99example : g 10000 = id g (id 10000 ) := rfl
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ def fnWFRec (n : Nat) : let α := Nat; α :=
168168 | 0 => 0
169169 | n + 1 => id (let m := n + 1 ; m * fnWFRec (n / 2 ))
170170/--
171- info: @ [ irreducible ] def fnWFRec : Nat →
171+ info: def fnWFRec : Nat →
172172 have α : Type := Nat;
173173 α :=
174174WellFounded.Nat.fix (fun x => x) fun n a =>
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ mutual
1111end
1212
1313/--
14- info: @ [ irreducible ] def Ex1.isEven : Nat → Bool :=
14+ info: def Ex1.isEven : Nat → Bool :=
1515fun a => isEven._mutual (PSum.inl a)
1616-/
1717#guard_msgs in
1818#print isEven
1919
2020/--
21- info: @ [ irreducible ] def Ex1.isOdd : Nat → Bool :=
21+ info: def Ex1.isOdd : Nat → Bool :=
2222fun a => isEven._mutual (PSum.inr a)
2323-/
2424#guard_msgs in
Original file line number Diff line number Diff line change 3434
3535/--
3636info: equations:
37- @ [ defeq ] theorem trailingZeros'.aux.eq_1 : ∀ (i : Int) (hi : i ≠ 0) (acc k_2 : Nat) (x_1 : k_2 + 1 ≠ 0)
37+ theorem trailingZeros'.aux.eq_1 : ∀ (i : Int) (hi : i ≠ 0) (acc k_2 : Nat) (x_1 : k_2 + 1 ≠ 0)
3838 (hk_2 : i.natAbs ≤ k_2 + 1),
3939 trailingZeros'.aux k_2.succ i hi hk_2 acc =
4040 if h : i % 2 = 0 then trailingZeros'.aux k_2 (i / 2) ⋯ ⋯ (acc + 1) else acc
7777
7878/--
7979info: equations:
80- @ [ defeq ] theorem trailingZeros2'.aux.eq_1 : ∀ (i : Int) (hi : i ≠ 0) (acc k_2 : Nat) (hk_2 : i.natAbs ≤ k_2 + 1),
80+ theorem trailingZeros2'.aux.eq_1 : ∀ (i : Int) (hi : i ≠ 0) (acc k_2 : Nat) (hk_2 : i.natAbs ≤ k_2 + 1),
8181 trailingZeros2'.aux k_2.succ i hi hk_2 acc =
8282 if h : i % 2 = 0 then trailingZeros2'.aux k_2 (i / 2) ⋯ ⋯ (acc + 1) else acc
8383@[ defeq ] theorem trailingZeros2'.aux.eq_2 : ∀ (i : Int) (hi : i ≠ 0) (acc : Nat) (hk_2 : i.natAbs ≤ 0),
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ termination_by n => n
88info: equations:
99@[ defeq ] theorem foo.eq_1 : foo 0 0 = 0
1010theorem foo.eq_2 : ∀ (x : Nat), (x = 0 → False) → foo 0 x = x
11- @ [ defeq ] theorem foo.eq_3 : ∀ (x n : Nat), foo n.succ x = foo n x
11+ theorem foo.eq_3 : ∀ (x n : Nat), foo n.succ x = foo n x
1212-/
1313#guard_msgs in
1414#print equations foo
@@ -58,7 +58,7 @@ info: equations:
5858 match x with
5959 | 0 => 0
6060 | m => m
61- @ [ defeq ] theorem bar.eq_2 : ∀ (x n : Nat), bar n.succ x = bar n x
61+ theorem bar.eq_2 : ∀ (x n : Nat), bar n.succ x = bar n x
6262-/
6363#guard_msgs in
6464#print equations bar
@@ -125,7 +125,7 @@ info: equations:
125125 match x with
126126 | 0 => 0
127127 | m => m
128- @ [ defeq ] theorem Structural.bar.eq_2 : ∀ (x n : Nat), bar n.succ x = bar n x
128+ theorem Structural.bar.eq_2 : ∀ (x n : Nat), bar n.succ x = bar n x
129129-/
130130#guard_msgs in
131131#print equations bar
Original file line number Diff line number Diff line change 1- @[irreducible] def f : Nat → Nat :=
1+ def f : Nat → Nat :=
22WellFounded.Nat.fix (fun x => x) fun n a =>
33 if h : n = 0 then 1
44 else
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ info: private theorem f_struct.eq_unfold : f_struct = fun x =>
7777-/
7878#guard_msgs in #print sig f_struct.eq_unfold
7979
80- /-- info: private theorem f_wfrec.eq_1 : ∀ (x : Nat), f_wfrec 0 x = x -/
80+ /-- info: @ [ defeq ] private theorem f_wfrec.eq_1 : ∀ (x : Nat), f_wfrec 0 x = x -/
8181#guard_msgs(pass trace, all) in #print sig f_wfrec.eq_1
8282
8383/--
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ info: theorem f_struct.eq_unfold : f_struct = fun x =>
2626-/
2727#guard_msgs in #print sig f_struct.eq_unfold
2828
29- /-- info: theorem f_wfrec.eq_1 : ∀ (x : Nat), f_wfrec 0 x = x -/
29+ /-- info: @ [ defeq ] theorem f_wfrec.eq_1 : ∀ (x : Nat), f_wfrec 0 x = x -/
3030#guard_msgs(pass trace, all) in #print sig f_wfrec.eq_1
3131
3232/--
You can’t perform that action at this time.
0 commit comments