l3lab/ntp-mathlib huggingface dataset:
/-- Copy of a non-unital star subalgebra with a new `carrier` equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (S : NonUnitalStarSubalgebra R A) (s : Set A) (hs : s = ↑S) :
    NonUnitalStarSubalgebra R A :=
  { S.toNonUnitalSubalgebra.copy s hs with
    star_mem' := @fun x (hx : x ∈ s) => by
      

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
S : NonUnitalStarSubalgebra R A
s : Set A
hs : s = ↑S
src✝ : NonUnitalSubalgebra R A := NonUnitalSubalgebra.copy S.toNonUnitalSubalgebra s hs
x : A
hx : x ∈ s
⊢ star x ∈
    { toNonUnitalSubsemiring := src✝.toNonUnitalSubsemiring,
              smul_mem' :=
                (_ :
                  ∀ (c : R) {x : A},
                    x ∈ src✝.carrier →
                      c • x ∈ src✝.carrier) }.toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
show star x ∈ s
/-- Copy of a non-unital star subalgebra with a new `carrier` equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (S : NonUnitalStarSubalgebra R A) (s : Set A) (hs : s = ↑S) :
    NonUnitalStarSubalgebra R A :=
  { S.toNonUnitalSubalgebra.copy s hs with
    star_mem' := @fun x (hx : x ∈ s) => by
      show star x ∈ s
      

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
S : NonUnitalStarSubalgebra R A
s : Set A
hs : s = ↑S
src✝ : NonUnitalSubalgebra R A := NonUnitalSubalgebra.copy S.toNonUnitalSubalgebra s hs
x : A
hx : x ∈ s
⊢ star x ∈ s

Next tactic:
rw [hs] at hx ⊢
/-- Copy of a non-unital star subalgebra with a new `carrier` equal to the old one.
Useful to fix definitional equalities. -/
protected def copy (S : NonUnitalStarSubalgebra R A) (s : Set A) (hs : s = ↑S) :
    NonUnitalStarSubalgebra R A :=
  { S.toNonUnitalSubalgebra.copy s hs with
    star_mem' := @fun x (hx : x ∈ s) => by
      show star x ∈ s
      rw [hs] at hx ⊢
      

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
S : NonUnitalStarSubalgebra R A
s : Set A
hs : s = ↑S
src✝ : NonUnitalSubalgebra R A := NonUnitalSubalgebra.copy S.toNonUnitalSubalgebra s hs
x : A
hx : x ∈ ↑S
⊢ star x ∈ ↑S

Next tactic:
exact S.star_mem' hx
theorem toNonUnitalSubring_injective {R : Type u} {A : Type v} [CommRing R] [NonUnitalRing A]
    [Module R A] [Star A] :
    Function.Injective (toNonUnitalSubring : NonUnitalStarSubalgebra R A → NonUnitalSubring A) :=
  fun S T h => ext fun x => by 

Proof state:
F : Type v'
R' : Type u'
R✝ : Type u
A✝ : Type v
B : Type w
C : Type w'
inst✝¹⁴ : CommSemiring R✝
inst✝¹³ : NonUnitalNonAssocSemiring A✝
inst✝¹² : Module R✝ A✝
inst✝¹¹ : Star A✝
inst✝¹⁰ : NonUnitalNonAssocSemiring B
inst✝⁹ : Module R✝ B
inst✝⁸ : Star B
inst✝⁷ : NonUnitalNonAssocSemiring C
inst✝⁶ : Module R✝ C
inst✝⁵ : Star C
inst✝⁴ : NonUnitalStarAlgHomClass F R✝ A✝ B
S✝ : NonUnitalStarSubalgebra R✝ A✝
R : Type u
A : Type v
inst✝³ : CommRing R
inst✝² : NonUnitalRing A
inst✝¹ : Module R A
inst✝ : Star A
S T : NonUnitalStarSubalgebra R A
h : toNonUnitalSubring S = toNonUnitalSubring T
x : A
⊢ x ∈ S ↔ x ∈ T

Next tactic:
rw [← mem_toNonUnitalSubring, ← mem_toNonUnitalSubring, h]
/-- The forgetful map from `NonUnitalStarSubalgebra` to `NonUnitalSubalgebra` as an
`OrderEmbedding` -/
def toNonUnitalSubalgebra' : NonUnitalStarSubalgebra R A ↪o NonUnitalSubalgebra R A where
  toEmbedding :=
    { toFun := fun S => S.toNonUnitalSubalgebra
      inj' := fun S T h => ext <| by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
S✝ S T : NonUnitalStarSubalgebra R A
h : (fun S => S.toNonUnitalSubalgebra) S = (fun S => S.toNonUnitalSubalgebra) T
⊢ ∀ (x : A), x ∈ S ↔ x ∈ T

Next tactic:
apply SetLike.ext_iff.1 h
/-- Transport a non-unital star subalgebra via a non-unital star algebra homomorphism. -/
def map (f : F) (S : NonUnitalStarSubalgebra R A) : NonUnitalStarSubalgebra R B where
  toNonUnitalSubalgebra := S.toNonUnitalSubalgebra.map (f : A →ₙₐ[R] B)
  star_mem' := by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
S✝ : NonUnitalStarSubalgebra R A
f : F
S : NonUnitalStarSubalgebra R A
⊢ ∀ {a : B},
    a ∈
        (NonUnitalSubalgebra.map (↑f)
                  S.toNonUnitalSubalgebra).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier →
      star a ∈
        (NonUnitalSubalgebra.map (↑f)
                  S.toNonUnitalSubalgebra).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
rintro _ ⟨a, ha, rfl⟩
/-- Transport a non-unital star subalgebra via a non-unital star algebra homomorphism. -/
def map (f : F) (S : NonUnitalStarSubalgebra R A) : NonUnitalStarSubalgebra R B where
  toNonUnitalSubalgebra := S.toNonUnitalSubalgebra.map (f : A →ₙₐ[R] B)
  star_mem' := by rintro _ ⟨a, ha, rfl⟩; 

Proof state:
case intro.intro
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
S✝ : NonUnitalStarSubalgebra R A
f : F
S : NonUnitalStarSubalgebra R A
a : A
ha : a ∈ ↑S.toNonUnitalSubsemiring
⊢ star (↑↑f a) ∈
    (NonUnitalSubalgebra.map (↑f)
              S.toNonUnitalSubalgebra).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
exact ⟨star a, star_mem (s := S) ha, map_star f a⟩
/-- Range of an `NonUnitalAlgHom` as a `NonUnitalStarSubalgebra`. -/
protected def range (φ : F) : NonUnitalStarSubalgebra R B where
  toNonUnitalSubalgebra := NonUnitalAlgHom.range (φ : A →ₙₐ[R] B)
  star_mem' := by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
φ : F
⊢ ∀ {a : B},
    a ∈ (NonUnitalAlgHom.range ↑φ).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier →
      star a ∈ (NonUnitalAlgHom.range ↑φ).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
rintro _ ⟨a, rfl⟩
/-- Range of an `NonUnitalAlgHom` as a `NonUnitalStarSubalgebra`. -/
protected def range (φ : F) : NonUnitalStarSubalgebra R B where
  toNonUnitalSubalgebra := NonUnitalAlgHom.range (φ : A →ₙₐ[R] B)
  star_mem' := by rintro _ ⟨a, rfl⟩; 

Proof state:
case intro
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
φ : F
a : A
⊢ star (↑↑φ a) ∈ (NonUnitalAlgHom.range ↑φ).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
exact ⟨star a, map_star φ a⟩
@[simp]
theorem coe_range (φ : F) :
    ((NonUnitalStarAlgHom.range φ : NonUnitalStarSubalgebra R B) : Set B) = Set.range (φ : A → B) :=
  by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
φ : F
⊢ ↑(NonUnitalStarAlgHom.range φ) = Set.range ⇑φ

Next tactic:
ext
@[simp]
theorem coe_range (φ : F) :
    ((NonUnitalStarAlgHom.range φ : NonUnitalStarSubalgebra R B) : Set B) = Set.range (φ : A → B) :=
  by ext; 

Proof state:
case h
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
φ : F
x✝ : B
⊢ x✝ ∈ ↑(NonUnitalStarAlgHom.range φ) ↔ x✝ ∈ Set.range ⇑φ

Next tactic:
rw [SetLike.mem_coe, mem_range]
@[simp]
theorem coe_range (φ : F) :
    ((NonUnitalStarAlgHom.range φ : NonUnitalStarSubalgebra R B) : Set B) = Set.range (φ : A → B) :=
  by ext; rw [SetLike.mem_coe, mem_range]; 

Proof state:
case h
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
φ : F
x✝ : B
⊢ (∃ x, φ x = x✝) ↔ x✝ ∈ Set.range ⇑φ

Next tactic:
rfl
/-- The equalizer of two non-unital star `R`-algebra homomorphisms -/
def equalizer (ϕ ψ : F) : NonUnitalStarSubalgebra R A where
  toNonUnitalSubalgebra := NonUnitalAlgHom.equalizer ϕ ψ
  star_mem' := @fun x (hx : ϕ x = ψ x) => by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹⁰ : CommSemiring R
inst✝⁹ : NonUnitalNonAssocSemiring A
inst✝⁸ : Module R A
inst✝⁷ : Star A
inst✝⁶ : NonUnitalNonAssocSemiring B
inst✝⁵ : Module R B
inst✝⁴ : Star B
inst✝³ : NonUnitalNonAssocSemiring C
inst✝² : Module R C
inst✝¹ : Star C
inst✝ : NonUnitalStarAlgHomClass F R A B
ϕ ψ : F
x : A
hx : ϕ x = ψ x
⊢ star x ∈ (NonUnitalAlgHom.equalizer ϕ ψ).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
simp [map_star, hx]
/-- Restrict a non-unital star algebra homomorphism with a left inverse to an algebra isomorphism
to its range.

This is a computable alternative to `StarAlgEquiv.ofInjective`. -/
def ofLeftInverse' {g : B → A} {f : F} (h : Function.LeftInverse g f) :
    A ≃⋆ₐ[R] NonUnitalStarAlgHom.range f :=
  { NonUnitalStarAlgHom.rangeRestrict f with
    toFun := NonUnitalStarAlgHom.rangeRestrict f
    invFun := g ∘ (NonUnitalStarSubalgebraClass.subtype <| NonUnitalStarAlgHom.range f)
    left_inv := h
    right_inv := fun x =>
      Subtype.ext <|
        let ⟨x', hx'⟩ := (NonUnitalStarAlgHom.mem_range f).mp x.prop
        show f (g x) = x by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalSemiring A
inst✝⁷ : Module R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : Module R B
inst✝³ : Star B
inst✝² : NonUnitalSemiring C
inst✝¹ : Module R C
inst✝ : Star C
hF : NonUnitalStarAlgHomClass F R A B
g : B → A
f : F
h : Function.LeftInverse g ⇑f
src✝ : A →⋆ₙₐ[R] ↥(NonUnitalStarAlgHom.range f) := NonUnitalStarAlgHom.rangeRestrict f
x : ↥(NonUnitalStarAlgHom.range f)
x' : A
hx' : f x' = ↑x
⊢ f (g ↑x) = ↑x

Next tactic:
rw [← hx', h x']
/-- The pointwise `star` of a non-unital subalgebra is a non-unital subalgebra. -/
instance instInvolutiveStar : InvolutiveStar (NonUnitalSubalgebra R A)
    where
  star S :=
    { carrier := star S.carrier
      mul_mem' := @fun x y hx hy => by simpa only [Set.mem_star, NonUnitalSubalgebra.mem_carrier]
        using (star_mul x y).symm ▸ mul_mem hy hx
      add_mem' := @fun x y hx hy => by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
S : NonUnitalSubalgebra R A
x y : A
hx : x ∈ star S.carrier
hy : y ∈ star S.carrier
⊢ x + y ∈ star S.carrier

Next tactic:
simpa only [Set.mem_star, NonUnitalSubalgebra.mem_carrier]
        using (star_add x y).symm ▸ add_mem hx hy
/-- The pointwise `star` of a non-unital subalgebra is a non-unital subalgebra. -/
instance instInvolutiveStar : InvolutiveStar (NonUnitalSubalgebra R A)
    where
  star S :=
    { carrier := star S.carrier
      mul_mem' := @fun x y hx hy => by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
S : NonUnitalSubalgebra R A
x y : A
hx :
  x ∈
    {
          toAddSubsemigroup :=
            { carrier := star S.carrier,
              add_mem' := (_ : ∀ (x y : A), x ∈ star S.carrier → y ∈ star S.carrier → x + y ∈ star S.carrier) },
          zero_mem' := (_ : star 0 ∈ S.toAddSubsemigroup.1) }.toAddSubsemigroup.carrier
hy :
  y ∈
    {
          toAddSubsemigroup :=
            { carrier := star S.carrier,
              add_mem' := (_ : ∀ (x y : A), x ∈ star S.carrier → y ∈ star S.carrier → x + y ∈ star S.carrier) },
          zero_mem' := (_ : star 0 ∈ S.toAddSubsemigroup.1) }.toAddSubsemigroup.carrier
⊢ x * y ∈
    {
          toAddSubsemigroup :=
            { carrier := star S.carrier,
              add_mem' := (_ : ∀ (x y : A), x ∈ star S.carrier → y ∈ star S.carrier → x + y ∈ star S.carrier) },
          zero_mem' := (_ : star 0 ∈ S.toAddSubsemigroup.1) }.toAddSubsemigroup.carrier

Next tactic:
simpa only [Set.mem_star, NonUnitalSubalgebra.mem_carrier]
        using (star_mul x y).symm ▸ mul_mem hy hx
theorem star_mem_star_iff (S : NonUnitalSubalgebra R A) (x : A) : star x ∈ star S ↔ x ∈ S := by
  

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
S : NonUnitalSubalgebra R A
x : A
⊢ star x ∈ star S ↔ x ∈ S

Next tactic:
simp
/-- The star operation on `NonUnitalSubalgebra` commutes with `NonUnitalAlgebra.adjoin`. -/
theorem star_adjoin_comm (s : Set A) :
    star (NonUnitalAlgebra.adjoin R s) = NonUnitalAlgebra.adjoin R (star s) :=
  have this :
    ∀ t : Set A, NonUnitalAlgebra.adjoin R (star t) ≤ star (NonUnitalAlgebra.adjoin R t) := fun t =>
    NonUnitalAlgebra.adjoin_le fun x hx => NonUnitalAlgebra.subset_adjoin R hx
  le_antisymm (by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
s : Set A
this : ∀ (t : Set A), NonUnitalAlgebra.adjoin R (star t) ≤ star (NonUnitalAlgebra.adjoin R t)
⊢ star (NonUnitalAlgebra.adjoin R s) ≤ NonUnitalAlgebra.adjoin R (star s)

Next tactic:
simpa only [star_star] using NonUnitalSubalgebra.star_mono (this (star s))
/-- The `NonUnitalStarSubalgebra` obtained from `S : NonUnitalSubalgebra R A` by taking the
smallest non-unital subalgebra containing both `S` and `star S`. -/
@[simps!]
def starClosure (S : NonUnitalSubalgebra R A) : NonUnitalStarSubalgebra R A where
  toNonUnitalSubalgebra := S ⊔ star S
  star_mem' := @fun a (ha : a ∈ S ⊔ star S) => show star a ∈ S ⊔ star S by
    

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
S : NonUnitalSubalgebra R A
a : A
ha : a ∈ S ⊔ star S
⊢ star a ∈ S ⊔ star S

Next tactic:
simp only [← mem_star_iff _ a, ← (@NonUnitalAlgebra.gi R A _ _ _ _ _).l_sup_u _ _] at *
/-- The `NonUnitalStarSubalgebra` obtained from `S : NonUnitalSubalgebra R A` by taking the
smallest non-unital subalgebra containing both `S` and `star S`. -/
@[simps!]
def starClosure (S : NonUnitalSubalgebra R A) : NonUnitalStarSubalgebra R A where
  toNonUnitalSubalgebra := S ⊔ star S
  star_mem' := @fun a (ha : a ∈ S ⊔ star S) => show star a ∈ S ⊔ star S by
    simp only [← mem_star_iff _ a, ← (@NonUnitalAlgebra.gi R A _ _ _ _ _).l_sup_u _ _] at *
    

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
S : NonUnitalSubalgebra R A
a : A
ha : a ∈ NonUnitalAlgebra.adjoin R (↑S ⊔ ↑(star S))
⊢ a ∈ star (NonUnitalAlgebra.adjoin R (↑S ⊔ ↑(star S)))

Next tactic:
convert ha using 2
/-- The `NonUnitalStarSubalgebra` obtained from `S : NonUnitalSubalgebra R A` by taking the
smallest non-unital subalgebra containing both `S` and `star S`. -/
@[simps!]
def starClosure (S : NonUnitalSubalgebra R A) : NonUnitalStarSubalgebra R A where
  toNonUnitalSubalgebra := S ⊔ star S
  star_mem' := @fun a (ha : a ∈ S ⊔ star S) => show star a ∈ S ⊔ star S by
    simp only [← mem_star_iff _ a, ← (@NonUnitalAlgebra.gi R A _ _ _ _ _).l_sup_u _ _] at *
    convert ha using 2
    

Proof state:
case h.e'_5
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
S : NonUnitalSubalgebra R A
a : A
ha : a ∈ NonUnitalAlgebra.adjoin R (↑S ⊔ ↑(star S))
⊢ star (NonUnitalAlgebra.adjoin R (↑S ⊔ ↑(star S))) = NonUnitalAlgebra.adjoin R (↑S ⊔ ↑(star S))

Next tactic:
simp only [Set.sup_eq_union, star_adjoin_comm, Set.union_star, coe_star, star_star,
      Set.union_comm]
/-- The minimal non-unital subalgebra that includes `s`. -/
def adjoin (s : Set A) : NonUnitalStarSubalgebra R A where
  toNonUnitalSubalgebra := NonUnitalAlgebra.adjoin R (s ∪ star s)
  star_mem' _ := by
    

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
hF : NonUnitalStarAlgHomClass F R A B
s : Set A
a✝ : A
x✝ : a✝ ∈ (NonUnitalAlgebra.adjoin R (s ∪ star s)).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier
⊢ star a✝ ∈ (NonUnitalAlgebra.adjoin R (s ∪ star s)).toNonUnitalSubsemiring.toAddSubmonoid.toAddSubsemigroup.carrier

Next tactic:
rwa [NonUnitalSubalgebra.mem_carrier, ← NonUnitalSubalgebra.mem_star_iff,
      NonUnitalSubalgebra.star_adjoin_comm, Set.union_star, star_star, Set.union_comm]
protected theorem gc : GaloisConnection (adjoin R : Set A → NonUnitalStarSubalgebra R A) (↑) := by
  

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
hF : NonUnitalStarAlgHomClass F R A B
⊢ GaloisConnection (adjoin R) SetLike.coe

Next tactic:
intro s S
protected theorem gc : GaloisConnection (adjoin R : Set A → NonUnitalStarSubalgebra R A) (↑) := by
  intro s S
  

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
hF : NonUnitalStarAlgHomClass F R A B
s : Set A
S : NonUnitalStarSubalgebra R A
⊢ adjoin R s ≤ S ↔ s ≤ ↑S

Next tactic:
rw [← toNonUnitalSubalgebra_le_iff, adjoin_toNonUnitalSubalgebra,
    NonUnitalAlgebra.adjoin_le_iff, coe_toNonUnitalSubalgebra]
protected theorem gc : GaloisConnection (adjoin R : Set A → NonUnitalStarSubalgebra R A) (↑) := by
  intro s S
  rw [← toNonUnitalSubalgebra_le_iff, adjoin_toNonUnitalSubalgebra,
    NonUnitalAlgebra.adjoin_le_iff, coe_toNonUnitalSubalgebra]
  

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
hF : NonUnitalStarAlgHomClass F R A B
s : Set A
S : NonUnitalStarSubalgebra R A
⊢ s ∪ star s ⊆ ↑S ↔ s ≤ ↑S

Next tactic:
exact ⟨fun h => (Set.subset_union_left s _).trans h,
    fun h => Set.union_subset h fun x hx => star_star x ▸ star_mem (show star x ∈ S from h hx)⟩
@[simp]
theorem top_toNonUnitalSubalgebra :
    (⊤ : NonUnitalStarSubalgebra R A).toNonUnitalSubalgebra = ⊤ := by 

Proof state:
F : Type v'
R' : Type u'
R : Type u
A : Type v
B : Type w
C : Type w'
inst✝¹³ : CommSemiring R
inst✝¹² : StarRing R
inst✝¹¹ : NonUnitalSemiring A
inst✝¹⁰ : StarRing A
inst✝⁹ : Module R A
inst✝⁸ : IsScalarTower R A A
inst✝⁷ : SMulCommClass R A A
inst✝⁶ : StarModule R A
inst✝⁵ : NonUnitalSemiring B
inst✝⁴ : StarRing B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : StarModule R B
hF : NonUnitalStarAlgHomClass F R A B
⊢ ⊤.toNonUnitalSubalgebra = ⊤

Next tactic:
ext