Skip to content

Commit

Permalink
feat(data/nat/fib): add a strict monotonicity lemma.
Browse files Browse the repository at this point in the history
With thanks to @b-mehta and @dwarn.
  • Loading branch information
Julian committed Apr 21, 2021
1 parent f08fe5f commit 38bbe7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/data/nat/fib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ 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

/-- If `2 ≤ n`, `fib` is strictly monotone. -/
lemma fib_add_two_strict_mono : strict_mono (λ n, fib (n + 2)) := begin
apply strict_mono.nat,
intro n,
conv_rhs { rw fib_succ_succ, },
exact lt_add_of_pos_left _ (fib_pos succ_pos'),
end

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 38bbe7e

Please sign in to comment.