Skip to content

Commit

Permalink
feat(data/nat/choose/basic): add some inequalities showing that choos…
Browse files Browse the repository at this point in the history
…e is monotonic in the first argument (#10102)

From flt-regular
  • Loading branch information
alexjbest committed Nov 4, 2021
1 parent 1f0d878 commit 211bdff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/data/nat/choose/basic.lean
Expand Up @@ -267,4 +267,21 @@ begin
apply zero_le }
end

/-! #### Inequalities about increasing the first argument -/

lemma choose_le_succ (a c : ℕ) : choose a c ≤ choose a.succ c :=
by cases c; simp [nat.choose_succ_succ]

lemma choose_le_add (a b c : ℕ) : choose a c ≤ choose (a + b) c :=
begin
induction b with b_n b_ih,
{ simp, },
exact le_trans b_ih (choose_le_succ (a + b_n) c),
end

lemma choose_le_choose {a b : ℕ} (c : ℕ) (h : a ≤ b) : choose a c ≤ choose b c :=
(add_tsub_cancel_of_le h) ▸ choose_le_add a (b - a) c

lemma choose_mono (b : ℕ) : monotone (λ a, choose a b) := λ _ _, choose_le_choose b

end nat

0 comments on commit 211bdff

Please sign in to comment.