Skip to content

Commit f7c1d6e

Browse files
committed
feat(Order/Defs/LinearOrder): min_ind and max_ind (leanprover-community#35880)
It will be used to simplify the proofs of other lemmas in a subsequent PR.
1 parent 47ed25d commit f7c1d6e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Mathlib/Order/Defs/LinearOrder.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ lemma min_def (a b : α) : min a b = if a ≤ b then a else b := LinearOrder.min
132132
@[grind =]
133133
lemma max_def (a b : α) : max a b = if a ≤ b then b else a := LinearOrder.max_def a b
134134

135+
theorem min_ind {motive : α → Prop} (ha : a ≤ b → motive a) (hb : b ≤ a → motive b) :
136+
motive (min a b) := by
137+
rw [min_def]; split_ifs with h
138+
exacts [ha h, hb (le_of_not_ge h)]
139+
140+
@[to_dual existing (attr := elab_as_elim)]
141+
theorem max_ind {motive : α → Prop} (ha : b ≤ a → motive a) (hb : a ≤ b → motive b) :
142+
motive (max a b) := by
143+
rw [max_def]; split_ifs with h
144+
exacts [hb h, ha (le_of_not_ge h)]
145+
135146
@[to_dual existing max_def]
136147
theorem min_def' (a b : α) : min a b = if b ≤ a then b else a := by
137148
obtain h | h | h := lt_trichotomy a b <;> simp [le_of_lt, not_le_of_gt, h, min_def]

0 commit comments

Comments
 (0)