|
| 1 | +/- |
| 2 | +Copyright (c) 2023 Yael Dillies. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Yael Dillies |
| 5 | +-/ |
| 6 | +import Batteries.Tactic.Init |
| 7 | +import Mathlib.Data.One.Defs |
| 8 | +import Mathlib.Tactic.ToAdditive |
| 9 | +import Mathlib.Tactic.Lemma |
| 10 | + |
| 11 | +/-! # Lemmas about inequalities with `1`. -/ |
| 12 | + |
| 13 | +variable {α : Type _} |
| 14 | + |
| 15 | +section dite |
| 16 | +variable [One α] {p : Prop} [Decidable p] {a : p → α} {b : ¬ p → α} |
| 17 | + |
| 18 | +@[to_additive dite_nonneg] |
| 19 | +lemma one_le_dite [LE α] (ha : ∀ h, 1 ≤ a h) (hb : ∀ h, 1 ≤ b h) : 1 ≤ dite p a b := by |
| 20 | + split; exacts [ha ‹_›, hb ‹_›] |
| 21 | + |
| 22 | +@[to_additive] |
| 23 | +lemma dite_le_one [LE α] (ha : ∀ h, a h ≤ 1) (hb : ∀ h, b h ≤ 1) : dite p a b ≤ 1 := by |
| 24 | + split; exacts [ha ‹_›, hb ‹_›] |
| 25 | + |
| 26 | +@[to_additive dite_pos] |
| 27 | +lemma one_lt_dite [LT α] (ha : ∀ h, 1 < a h) (hb : ∀ h, 1 < b h) : 1 < dite p a b := by |
| 28 | + split; exacts [ha ‹_›, hb ‹_›] |
| 29 | + |
| 30 | +@[to_additive] |
| 31 | +lemma dite_lt_one [LT α] (ha : ∀ h, a h < 1) (hb : ∀ h, b h < 1) : dite p a b < 1 := by |
| 32 | + split; exacts [ha ‹_›, hb ‹_›] |
| 33 | + |
| 34 | +end dite |
| 35 | + |
| 36 | +section |
| 37 | +variable [One α] {p : Prop} [Decidable p] {a b : α} |
| 38 | + |
| 39 | +@[to_additive ite_nonneg] |
| 40 | +lemma one_le_ite [LE α] (ha : 1 ≤ a) (hb : 1 ≤ b) : 1 ≤ ite p a b := by split <;> assumption |
| 41 | + |
| 42 | +@[to_additive] |
| 43 | +lemma ite_le_one [LE α] (ha : a ≤ 1) (hb : b ≤ 1) : ite p a b ≤ 1 := by split <;> assumption |
| 44 | + |
| 45 | +@[to_additive ite_pos] |
| 46 | +lemma one_lt_ite [LT α] (ha : 1 < a) (hb : 1 < b) : 1 < ite p a b := by split <;> assumption |
| 47 | + |
| 48 | +@[to_additive] |
| 49 | +lemma ite_lt_one [LT α] (ha : a < 1) (hb : b < 1) : ite p a b < 1 := by split <;> assumption |
| 50 | + |
| 51 | +end |
0 commit comments