Skip to content

Commit

Permalink
feat: Nat.lt_pow_self
Browse files Browse the repository at this point in the history
  • Loading branch information
tydeu committed Nov 24, 2024
1 parent 4600bb1 commit 31deebd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Init/Data/Nat/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,18 @@ protected theorem pow_lt_pow_iff_pow_mul_le_pow {a n m : Nat} (h : 1 < a) :
rw [←Nat.pow_add_one, Nat.pow_le_pow_iff_right (by omega), Nat.pow_lt_pow_iff_right (by omega)]
omega

protected theorem lt_pow_self {n a : Nat} (h : 1 < a) : n < a ^ n := by
induction n with
| zero => exact Nat.zero_lt_one
| succ _ ih => exact Nat.lt_of_lt_of_le (Nat.add_lt_add_right ih 1) (Nat.pow_lt_pow_succ h)

protected theorem lt_two_pow : n < 2 ^ n :=
Nat.lt_pow_self Nat.one_lt_two

@[simp]
protected theorem mod_two_pow : n % 2 ^ n = n :=
Nat.mod_eq_of_lt Nat.lt_two_pow

@[simp]
theorem two_pow_pred_mul_two (h : 0 < w) :
2 ^ (w - 1) * 2 = 2 ^ w := by
Expand Down

0 comments on commit 31deebd

Please sign in to comment.