Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 6da9b21

Browse files
sgouezeljohoelzl
authored andcommitted
le_induction
1 parent 60efaec commit 6da9b21

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/data/nat/basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,5 +859,10 @@ lemma with_bot.add_eq_one_iff : ∀ {n m : with_bot ℕ}, n + m = 1 ↔ (n = 0
859859
| (some n) (some (m + 1)) := by erw [with_bot.coe_eq_coe, with_bot.coe_eq_coe, with_bot.coe_eq_coe,
860860
with_bot.coe_eq_coe, with_bot.coe_eq_coe]; simp [nat.add_succ, nat.succ_inj', nat.succ_ne_zero]
861861

862+
-- induction
863+
864+
@[elab_as_eliminator] lemma le_induction {P : nat → Prop} {m} (h0 : P m) (h1 : ∀ n ≥ m, P n → P (n + 1)) :
865+
∀ n ≥ m, P n :=
866+
by apply nat.less_than_or_equal.rec h0; exact h1
862867

863868
end nat

0 commit comments

Comments
 (0)