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

Commit 96bae07

Browse files
committed
feat(order/complete_lattice): add complete_lattice.independent_pair (#12565)
This makes `complete_lattice.independent` easier to work with in the degenerate case.
1 parent 7e5ac6a commit 96bae07

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

counterexamples/direct_sum_is_internal.lean

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,10 @@ end
5454

5555
def with_sign.independent : complete_lattice.independent with_sign :=
5656
begin
57+
refine (complete_lattice.independent_pair units_int.one_ne_neg_one _).mpr
58+
with_sign.is_compl.disjoint,
5759
intros i,
58-
rw [←finset.sup_univ_eq_supr, units_int.univ, finset.sup_insert, finset.sup_singleton],
59-
fin_cases i,
60-
{ convert with_sign.is_compl.disjoint,
61-
convert bot_sup_eq,
62-
{ exact supr_neg (not_not_intro rfl), },
63-
{ rw supr_pos units_int.one_ne_neg_one.symm } },
64-
{ convert with_sign.is_compl.disjoint.symm,
65-
convert sup_bot_eq,
66-
{ exact supr_neg (not_not_intro rfl), },
67-
{ rw supr_pos units_int.one_ne_neg_one } },
60+
fin_cases i; simp,
6861
end
6962

7063
lemma with_sign.supr : supr with_sign = ⊤ :=

src/data/set/basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,16 @@ lemma insert_diff_self_of_not_mem {a : α} {s : set α} (h : a ∉ s) :
10601060
insert a s \ {a} = s :=
10611061
by { ext, simp [and_iff_left_of_imp (λ hx : x ∈ s, show x ≠ a, from λ hxa, h $ hxa ▸ hx)] }
10621062

1063+
@[simp] lemma insert_diff_eq_singleton {a : α} {s : set α} (h : a ∉ s) :
1064+
insert a s \ s = {a} :=
1065+
begin
1066+
ext,
1067+
rw [set.mem_diff, set.mem_insert_iff, set.mem_singleton_iff, or_and_distrib_right,
1068+
and_not_self, or_false, and_iff_left_iff_imp],
1069+
rintro rfl,
1070+
exact h,
1071+
end
1072+
10631073
lemma insert_inter_of_mem {s₁ s₂ : set α} {a : α} (h : a ∈ s₂) :
10641074
insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂) :=
10651075
by simp [set.insert_inter, h]

src/order/complete_lattice.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,19 @@ theorem set_independent.mono {t : set α} (hst : t ⊆ s) :
13481348
lemma set_independent.disjoint {x y : α} (hx : x ∈ s) (hy : y ∈ s) (h : x ≠ y) : disjoint x y :=
13491349
disjoint_Sup_right (hs hx) ((mem_diff y).mpr ⟨hy, by simp [h.symm]⟩)
13501350

1351+
lemma set_independent_pair {a b : α} (hab : a ≠ b) :
1352+
set_independent ({a, b} : set α) ↔ disjoint a b :=
1353+
begin
1354+
split,
1355+
{ intro h,
1356+
exact h.disjoint (mem_insert _ _) (mem_insert_of_mem _ (mem_singleton _)) hab, },
1357+
{ rintros h c ((rfl : c = a) | (rfl : c = b)),
1358+
{ convert h using 1,
1359+
simp [hab, Sup_singleton] },
1360+
{ convert h.symm using 1,
1361+
simp [hab, Sup_singleton] }, },
1362+
end
1363+
13511364
include hs
13521365

13531366
/-- If the elements of a set are independent, then any element is disjoint from the `Sup` of some
@@ -1422,6 +1435,20 @@ lemma independent.comp {ι ι' : Sort*} {α : Type*} [complete_lattice α]
14221435
exact supr_le_supr_const hf.ne,
14231436
end
14241437

1438+
lemma independent_pair {i j : ι} (hij : i ≠ j) (huniv : ∀ k, k = i ∨ k = j):
1439+
independent t ↔ disjoint (t i) (t j) :=
1440+
begin
1441+
split,
1442+
{ intro h,
1443+
exact h.disjoint hij, },
1444+
{ rintros h k,
1445+
obtain rfl | rfl := huniv k,
1446+
{ refine h.mono_right (supr_le $ λ i, supr_le $ λ hi, eq.le _),
1447+
rw (huniv i).resolve_left hi },
1448+
{ refine h.symm.mono_right (supr_le $ λ j, supr_le $ λ hj, eq.le _),
1449+
rw (huniv j).resolve_right hj } },
1450+
end
1451+
14251452
/-- Composing an indepedent indexed family with an order isomorphism on the elements results in
14261453
another indepedendent indexed family. -/
14271454
lemma independent.map_order_iso {ι : Sort*} {α β : Type*}

0 commit comments

Comments
 (0)