Skip to content

Commit c441f7b

Browse files
committed
feat: add closure_insert_one etc (#23159)
1 parent fb92bc7 commit c441f7b

File tree

5 files changed

+110
-9
lines changed

5 files changed

+110
-9
lines changed

Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,17 +525,49 @@ theorem adjoin_union (s t : Set A) : adjoin R (s ∪ t) = adjoin R s ⊔ adjoin
525525
variable (R A)
526526

527527
@[simp]
528-
theorem adjoin_empty : adjoin R (∅ : Set A) = ⊥ :=
529-
show adjoin R ⊥ = ⊥ by
530-
apply GaloisConnection.l_bot
531-
exact Algebra.gc
528+
theorem adjoin_empty : adjoin R (∅ : Set A) = ⊥ := Algebra.gc.l_bot
532529

533530
@[simp]
534-
theorem adjoin_univ : adjoin R (Set.univ : Set A) = ⊤ :=
535-
eq_top_iff.2 fun _x => subset_adjoin <| Set.mem_univ _
531+
theorem adjoin_univ : adjoin R (Set.univ : Set A) = ⊤ := Algebra.gi.l_top
532+
533+
variable {R} in
534+
@[simp]
535+
theorem adjoin_singleton_algebraMap (x : R) : adjoin R {algebraMap R A x} = ⊥ :=
536+
bot_unique <| adjoin_le <| Set.singleton_subset_iff.mpr <| Subalgebra.algebraMap_mem _ _
537+
538+
@[simp]
539+
theorem adjoin_singleton_natCast (n : ℕ) : adjoin R {(n : A)} = ⊥ := by
540+
simpa using adjoin_singleton_algebraMap A (n : R)
541+
542+
@[simp]
543+
theorem adjoin_singleton_zero : adjoin R ({0} : Set A) = ⊥ :=
544+
mod_cast adjoin_singleton_natCast R A 0
545+
546+
@[simp]
547+
theorem adjoin_singleton_one : adjoin R ({1} : Set A) = ⊥ :=
548+
mod_cast adjoin_singleton_natCast R A 1
536549

537550
variable {A} (s)
538551

552+
variable {R} in
553+
@[simp]
554+
theorem adjoin_insert_algebraMap (x : R) (s : Set A) :
555+
adjoin R (insert (algebraMap R A x) s) = adjoin R s := by
556+
rw [Set.insert_eq, adjoin_union]
557+
simp
558+
559+
@[simp]
560+
theorem adjoin_insert_natCast (n : ℕ) (s : Set A) : adjoin R (insert (n : A) s) = adjoin R s :=
561+
mod_cast adjoin_insert_algebraMap (n : R) s
562+
563+
@[simp]
564+
theorem adjoin_insert_zero (s : Set A) : adjoin R (insert 0 s) = adjoin R s :=
565+
mod_cast adjoin_insert_natCast R 0 s
566+
567+
@[simp]
568+
theorem adjoin_insert_one (s : Set A) : adjoin R (insert 1 s) = adjoin R s :=
569+
mod_cast adjoin_insert_natCast R 1 s
570+
539571
theorem adjoin_eq_span : Subalgebra.toSubmodule (adjoin R s) = span R (Submonoid.closure s) := by
540572
apply le_antisymm
541573
· intro r hr
@@ -645,9 +677,6 @@ lemma commute_of_mem_adjoin_self {a b : A} (hb : b ∈ adjoin R {a}) :
645677

646678
variable (R)
647679

648-
theorem adjoin_singleton_one : adjoin R ({1} : Set A) = ⊥ :=
649-
eq_bot_iff.2 <| adjoin_le <| Set.singleton_subset_iff.2 <| SetLike.mem_coe.2 <| one_mem _
650-
651680
theorem self_mem_adjoin_singleton (x : A) : x ∈ adjoin R ({x} : Set A) :=
652681
Algebra.subset_adjoin (Set.mem_singleton_iff.mpr rfl)
653682

@@ -672,6 +701,14 @@ section Ring
672701
variable [CommRing R] [Ring A]
673702
variable [Algebra R A] {s t : Set A}
674703

704+
@[simp]
705+
theorem adjoin_singleton_intCast (n : ℤ) : adjoin R {(n : A)} = ⊥ := by
706+
simpa using adjoin_singleton_algebraMap A (n : R)
707+
708+
@[simp]
709+
theorem adjoin_insert_intCast (n : ℤ) (s : Set A) : adjoin R (insert (n : A) s) = adjoin R s := by
710+
simpa using adjoin_insert_algebraMap (n : R) s
711+
675712
theorem mem_adjoin_iff {s : Set A} {x : A} :
676713
x ∈ adjoin R s ↔ x ∈ Subring.closure (Set.range (algebraMap R A) ∪ s) :=
677714
fun hx =>

Mathlib/Algebra/Group/Subgroup/Lattice.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,11 @@ theorem closure_eq_top_of_mclosure_eq_top {S : Set G} (h : Submonoid.closure S =
470470
closure S = ⊤ :=
471471
(eq_top_iff' _).2 fun _ => le_closure_toSubmonoid _ <| h.symm ▸ trivial
472472

473+
@[to_additive (attr := simp)]
474+
theorem closure_insert_one (s : Set G) : closure (insert 1 s) = closure s := by
475+
rw [insert_eq, closure_union]
476+
simp [one_mem]
477+
473478
theorem toAddSubgroup_closure (S : Set G) :
474479
(Subgroup.closure S).toAddSubgroup = AddSubgroup.closure (Additive.toMul ⁻¹' S) :=
475480
le_antisymm (toAddSubgroup.le_symm_apply.mp <|

Mathlib/Algebra/Group/Submonoid/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ theorem closure_iUnion {ι} (s : ι → Set M) : closure (⋃ i, s i) = ⨆ i, c
268268
theorem closure_singleton_le_iff_mem (m : M) (p : Submonoid M) : closure {m} ≤ p ↔ m ∈ p := by
269269
rw [closure_le, singleton_subset_iff, SetLike.mem_coe]
270270

271+
@[to_additive (attr := simp)]
272+
theorem closure_insert_one (s : Set M) : closure (insert 1 s) = closure s := by
273+
rw [insert_eq, closure_union, sup_eq_right, closure_singleton_le_iff_mem]
274+
apply one_mem
275+
271276
@[to_additive]
272277
theorem mem_iSup {ι : Sort*} (p : ι → Submonoid M) {m : M} :
273278
(m ∈ ⨆ i, p i) ↔ ∀ N, (∀ i, p i ≤ N) → m ∈ N := by

Mathlib/Algebra/Ring/Subring/Basic.lean

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,37 @@ theorem closure_iUnion {ι} (s : ι → Set R) : closure (⋃ i, s i) = ⨆ i, c
634634
theorem closure_sUnion (s : Set (Set R)) : closure (⋃₀ s) = ⨆ t ∈ s, closure t :=
635635
(Subring.gi R).gc.l_sSup
636636

637+
@[simp]
638+
theorem closure_singleton_intCast (n : ℤ) : closure {(n : R)} = ⊥ :=
639+
bot_unique <| closure_le.2 <| Set.singleton_subset_iff.mpr <| intCast_mem _ _
640+
641+
@[simp]
642+
theorem closure_singleton_natCast (n : ℕ) : closure {(n : R)} = ⊥ :=
643+
mod_cast closure_singleton_intCast n
644+
645+
@[simp]
646+
theorem closure_singleton_zero : closure {(0 : R)} = ⊥ := mod_cast closure_singleton_natCast 0
647+
648+
@[simp]
649+
theorem closure_singleton_one : closure {(1 : R)} = ⊥ := mod_cast closure_singleton_natCast 1
650+
651+
@[simp]
652+
theorem closure_insert_intCast (n : ℤ) (s : Set R) : closure (insert (n : R) s) = closure s := by
653+
rw [Set.insert_eq, closure_union]
654+
simp
655+
656+
@[simp]
657+
theorem closure_insert_natCast (n : ℕ) (s : Set R) : closure (insert (n : R) s) = closure s :=
658+
mod_cast closure_insert_intCast n s
659+
660+
@[simp]
661+
theorem closure_insert_zero (s : Set R) : closure (insert 0 s) = closure s :=
662+
mod_cast closure_insert_natCast 0 s
663+
664+
@[simp]
665+
theorem closure_insert_one (s : Set R) : closure (insert 1 s) = closure s :=
666+
mod_cast closure_insert_natCast 1 s
667+
637668
theorem map_sup (s t : Subring R) (f : R →+* S) : (s ⊔ t).map f = s.map f ⊔ t.map f :=
638669
(gc_map_comap f).l_sup
639670

Mathlib/Algebra/Ring/Subsemiring/Basic.lean

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,29 @@ theorem closure_iUnion {ι} (s : ι → Set R) : closure (⋃ i, s i) = ⨆ i, c
563563
theorem closure_sUnion (s : Set (Set R)) : closure (⋃₀ s) = ⨆ t ∈ s, closure t :=
564564
(Subsemiring.gi R).gc.l_sSup
565565

566+
@[simp]
567+
theorem closure_singleton_natCast (n : ℕ) : closure {(n : R)} = ⊥ :=
568+
bot_unique <| closure_le.2 <| Set.singleton_subset_iff.mpr <| natCast_mem _ _
569+
570+
@[simp]
571+
theorem closure_singleton_zero : closure {(0 : R)} = ⊥ := mod_cast closure_singleton_natCast 0
572+
573+
@[simp]
574+
theorem closure_singleton_one : closure {(1 : R)} = ⊥ := mod_cast closure_singleton_natCast 1
575+
576+
@[simp]
577+
theorem closure_insert_natCast (n : ℕ) (s : Set R) : closure (insert (n : R) s) = closure s := by
578+
rw [Set.insert_eq, closure_union]
579+
simp
580+
581+
@[simp]
582+
theorem closure_insert_zero (s : Set R) : closure (insert 0 s) = closure s :=
583+
mod_cast closure_insert_natCast 0 s
584+
585+
@[simp]
586+
theorem closure_insert_one (s : Set R) : closure (insert 1 s) = closure s :=
587+
mod_cast closure_insert_natCast 1 s
588+
566589
theorem map_sup (s t : Subsemiring R) (f : R →+* S) : (s ⊔ t).map f = s.map f ⊔ t.map f :=
567590
(gc_map_comap f).l_sup
568591

0 commit comments

Comments
 (0)