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

Commit 0437938

Browse files
committed
chore(order/*): golf 2 proofs (#17095)
1 parent a2a1963 commit 0437938

File tree

2 files changed

+10
-26
lines changed

2 files changed

+10
-26
lines changed

src/order/atoms.lean

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ section atomic
156156
variables [partial_order α] (α)
157157

158158
/-- A lattice is atomic iff every element other than `⊥` has an atom below it. -/
159-
class is_atomic [order_bot α] : Prop :=
159+
@[mk_iff] class is_atomic [order_bot α] : Prop :=
160160
(eq_bot_or_exists_atom_le : ∀ (b : α), b = ⊥ ∨ ∃ (a : α), is_atom a ∧ a ≤ b)
161161

162162
/-- A lattice is coatomic iff every element other than `⊤` has a coatom above it. -/
163-
class is_coatomic [order_top α] : Prop :=
163+
@[mk_iff] class is_coatomic [order_top α] : Prop :=
164164
(eq_top_or_exists_le_coatom : ∀ (b : α), b = ⊤ ∨ ∃ (a : α), is_coatom a ∧ b ≤ a)
165165

166166
export is_atomic (eq_bot_or_exists_atom_le) is_coatomic (eq_top_or_exists_le_coatom)
@@ -678,25 +678,14 @@ lemma is_simple_order [bounded_order α] [bounded_order β] [h : is_simple_order
678678
is_simple_order α :=
679679
f.is_simple_order_iff.mpr h
680680

681-
lemma is_atomic_iff [order_bot α] [order_bot β] (f : α ≃o β) : is_atomic α ↔ is_atomic β :=
682-
begin
683-
suffices : (∀ b : α, b = ⊥ ∨ ∃ (a : α), is_atom a ∧ a ≤ b) ↔
684-
(∀ b : β, b = ⊥ ∨ ∃ (a : β), is_atom a ∧ a ≤ b),
685-
from ⟨λ ⟨p⟩, ⟨this.mp p⟩, λ ⟨p⟩, ⟨this.mpr p⟩⟩,
686-
apply f.to_equiv.forall_congr,
687-
simp_rw [rel_iso.coe_fn_to_equiv],
688-
intro b, apply or_congr,
689-
{ rw [f.apply_eq_iff_eq_symm_apply, map_bot], },
690-
{ split,
691-
{ exact λ ⟨a, ha⟩, ⟨f a, ⟨(f.is_atom_iff a).mpr ha.1, f.le_iff_le.mpr ha.2⟩⟩, },
692-
{ rintros ⟨b, ⟨hb1, hb2⟩⟩,
693-
refine ⟨f.symm b, ⟨(f.symm.is_atom_iff b).mpr hb1, _⟩⟩,
694-
rwa [←f.le_iff_le, f.apply_symm_apply], }, },
695-
end
681+
protected lemma is_atomic_iff [order_bot α] [order_bot β] (f : α ≃o β) :
682+
is_atomic α ↔ is_atomic β :=
683+
by simp only [is_atomic_iff, f.surjective.forall, f.surjective.exists, ← map_bot f, f.eq_iff_eq,
684+
f.le_iff_le, f.is_atom_iff]
696685

697-
lemma is_coatomic_iff [order_top α] [order_top β] (f : α ≃o β) : is_coatomic α ↔ is_coatomic β :=
698-
by { rw [←is_atomic_dual_iff_is_coatomic, ←is_atomic_dual_iff_is_coatomic],
699-
exact f.dual.is_atomic_iff }
686+
protected lemma is_coatomic_iff [order_top α] [order_top β] (f : α ≃o β) :
687+
is_coatomic α ↔ is_coatomic β :=
688+
by simp only [← is_atomic_dual_iff_is_coatomic, f.dual.is_atomic_iff]
700689

701690
end order_iso
702691

src/order/filter/bases.lean

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,7 @@ variables {l l' : filter α} {p : ι → Prop} {s : ι → set α} {t : set α}
205205

206206
lemma has_basis_generate (s : set (set α)) :
207207
(generate s).has_basis (λ t, set.finite t ∧ t ⊆ s) (λ t, ⋂₀ t) :=
208-
begin
209-
intro U,
210-
rw mem_generate_iff,
211-
apply exists_congr,
212-
tauto
213-
end
208+
⟨λ U, by simp only [mem_generate_iff, exists_prop, and.assoc, and.left_comm]⟩
214209

215210
/-- The smallest filter basis containing a given collection of sets. -/
216211
def filter_basis.of_sets (s : set (set α)) : filter_basis α :=

0 commit comments

Comments
 (0)