Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 3124e1d

Browse files
committed
feat(data/finset/lattice): choice-free le_sup_iff and lt_sup_iff (#7584)
Propagate to `finset` the change to `le_sup_iff [is_total α (≤)]` and `lt_sup_iff [is_total α (≤)]` made in #7455.
1 parent bf2750e commit 3124e1d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/data/finset/lattice.lean

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,17 @@ sup_le $ assume b hb, le_sup (h hb)
8181
⟨(λ hs b hb, lt_of_le_of_lt (le_sup hb) hs), finset.cons_induction_on s (λ _, ha)
8282
(λ c t hc, by simpa only [sup_cons, sup_lt_iff, mem_cons, forall_eq_or_imp] using and.imp_right)⟩
8383

84-
@[simp] lemma le_sup_iff [is_total α (≤)] {a : α} (ha : ⊥ < a) : a ≤ s.sup f ↔ (∃ b ∈ s, a ≤ f b) :=
85-
by { rw [←not_iff_not, not_bex], simp only [@not_le (as_linear_order α), sup_lt_iff ha], }
86-
87-
@[simp] lemma lt_sup_iff [is_total α (≤)] {a : α} : a < s.sup f ↔ (∃ b ∈ s, a < f b) :=
88-
by { rw [←not_iff_not, not_bex], simp only [@not_lt (as_linear_order α), sup_le_iff], }
84+
@[simp] lemma le_sup_iff [is_total α (≤)] {a : α} (ha : ⊥ < a) : a ≤ s.sup f ↔ ∃ b ∈ s, a ≤ f b :=
85+
⟨finset.cons_induction_on s (λ h, absurd h (not_le_of_lt ha))
86+
(λ c t hc ih, by simpa using @or.rec _ _ (∃ b, (b = c ∨ b ∈ t) ∧ a ≤ f b)
87+
(λ h, ⟨c, or.inl rfl, h⟩) (λ h, let ⟨b, hb, hle⟩ := ih h in ⟨b, or.inr hb, hle⟩)),
88+
(λ ⟨b, hb, hle⟩, trans hle (le_sup hb))⟩
89+
90+
@[simp] lemma lt_sup_iff [is_total α (≤)] {a : α} : a < s.sup f ↔ ∃ b ∈ s, a < f b :=
91+
⟨finset.cons_induction_on s (λ h, absurd h not_lt_bot)
92+
(λ c t hc ih, by simpa using @or.rec _ _ (∃ b, (b = c ∨ b ∈ t) ∧ a < f b)
93+
(λ h, ⟨c, or.inl rfl, h⟩) (λ h, let ⟨b, hb, hlt⟩ := ih h in ⟨b, or.inr hb, hlt⟩)),
94+
(λ ⟨b, hb, hlt⟩, lt_of_lt_of_le hlt (le_sup hb))⟩
8995

9096
lemma comp_sup_eq_sup_comp [semilattice_sup_bot γ] {s : finset β}
9197
{f : β → α} (g : α → γ) (g_sup : ∀ x y, g (x ⊔ y) = g x ⊔ g y) (bot : g ⊥ = ⊥) :

0 commit comments

Comments
 (0)