Skip to content

Commit b1465e7

Browse files
authored
chore: golf a proof (#419)
Use `Nat.strong_induction_on` in `LocallyNameless.Untyped.Term.ind_on_depth`.
1 parent be738a8 commit b1465e7

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

  • Cslib/Languages/LambdaCalculus/LocallyNameless/Untyped

Cslib/Languages/LambdaCalculus/LocallyNameless/Untyped/LcAt.lean

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,10 @@ protected lemma ind_on_depth (P : Term Var → Prop) (bvar : ∀ i, P (bvar i))
4646
(app : ∀ M N, P M → P N → P (app M N))
4747
(abs : ∀ M, P M → (∀ N, N.depth ≤ M.depth → P N) → P M.abs)
4848
(M : Term Var) : P M := by
49-
have h {d : ℕ} {M : Term Var} (p : M.depth ≤ d) : P M := by
50-
induction d generalizing M with
51-
| zero => induction M <;> grind
52-
| succ =>
53-
induction M with
54-
| abs M' => apply abs M' <;> grind
55-
| _ => grind [sup_le_iff]
56-
exact h M.depth.le_refl
49+
induction h : M.depth using Nat.strong_induction_on generalizing M with | _ n ih
50+
induction M with
51+
| abs M' => apply abs M' <;> grind
52+
| _ => grind [sup_le_iff]
5753

5854
/-- The depth of the lambda expression doesn't change by opening at i-th bound variable
5955
for some free variable. -/

0 commit comments

Comments
 (0)