Skip to content

Commit

Permalink
feat(data/nat/fib): add a strict monotonicity lemma. (#7317)
Browse files Browse the repository at this point in the history
Prove strict monotonicity of `fib (n + 2)`.

With thanks to @b-mehta and @dwarn.
  • Loading branch information
Julian committed Apr 25, 2021
1 parent 4e0c460 commit 9526061
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data/nat/fib.lean
Expand Up @@ -82,6 +82,10 @@ lemma fib_le_fib_succ {n : ℕ} : fib n ≤ fib (n + 1) := by { cases n; simp [f
@[mono] lemma fib_mono : monotone fib :=
monotone_of_monotone_nat $ λ _, fib_le_fib_succ

/-- `fib (n + 2)` is strictly monotone. -/
lemma fib_add_two_strict_mono : strict_mono (λ n, fib (n + 2)) :=
strict_mono.nat $ λ n, lt_add_of_pos_left _ $ fib_pos succ_pos'

lemma le_fib_self {n : ℕ} (five_le_n : 5 ≤ n) : n ≤ fib n :=
begin
induction five_le_n with n five_le_n IH,
Expand Down

0 comments on commit 9526061

Please sign in to comment.