l3lab/ntp-mathlib huggingface dataset:
/-- The minimal non-unital subalgebra that includes `s`. -/
def adjoin (s : Set A) : NonUnitalSubalgebra R A :=
  { Submodule.span R (NonUnitalSubsemiring.closure s : Set A) with
    mul_mem' :=
      @fun a b (ha : a ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A))
        (hb : b ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A)) =>
      show a * b ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A) by
        refine' Submodule.span_induction ha _ _ _ _
        · refine' Submodule.span_induction hb _ _ _ _
          · exact fun x (hx : x ∈ NonUnitalSubsemiring.closure s) y
              (hy : y ∈ NonUnitalSubsemiring.closure s) => Submodule.subset_span (mul_mem hy hx)
          · exact fun x _hx => (mul_zero x).symm ▸ Submodule.zero_mem _
          · exact fun x y hx hy z hz => (mul_add z x y).symm ▸ add_mem (hx z hz) (hy z hz)
          · exact fun r x hx y hy => (mul_smul_comm r y x).symm ▸ SMulMemClass.smul_mem r (hx y hy)
        · 

Proof state:
case refine'_2
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
src✝ : Submodule R A := Submodule.span R ↑(NonUnitalSubsemiring.closure s)
a b : A
ha : a ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)
hb : b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)
⊢ 0 * b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)

Next tactic:
exact (zero_mul b).symm ▸ Submodule.zero_mem _
/-- The minimal non-unital subalgebra that includes `s`. -/
def adjoin (s : Set A) : NonUnitalSubalgebra R A :=
  { Submodule.span R (NonUnitalSubsemiring.closure s : Set A) with
    mul_mem' :=
      @fun a b (ha : a ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A))
        (hb : b ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A)) =>
      show a * b ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A) by
        refine' Submodule.span_induction ha _ _ _ _
        · refine' Submodule.span_induction hb _ _ _ _
          · exact fun x (hx : x ∈ NonUnitalSubsemiring.closure s) y
              (hy : y ∈ NonUnitalSubsemiring.closure s) => Submodule.subset_span (mul_mem hy hx)
          · exact fun x _hx => (mul_zero x).symm ▸ Submodule.zero_mem _
          · exact fun x y hx hy z hz => (mul_add z x y).symm ▸ add_mem (hx z hz) (hy z hz)
          · exact fun r x hx y hy => (mul_smul_comm r y x).symm ▸ SMulMemClass.smul_mem r (hx y hy)
        · exact (zero_mul b).symm ▸ Submodule.zero_mem _
        · 

Proof state:
case refine'_3
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
src✝ : Submodule R A := Submodule.span R ↑(NonUnitalSubsemiring.closure s)
a b : A
ha : a ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)
hb : b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)
⊢ ∀ (x y : A),
    x * b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s) →
      y * b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s) →
        (x + y) * b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)

Next tactic:
exact fun x y => (add_mul x y b).symm ▸ add_mem
/-- The minimal non-unital subalgebra that includes `s`. -/
def adjoin (s : Set A) : NonUnitalSubalgebra R A :=
  { Submodule.span R (NonUnitalSubsemiring.closure s : Set A) with
    mul_mem' :=
      @fun a b (ha : a ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A))
        (hb : b ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A)) =>
      show a * b ∈ Submodule.span R (NonUnitalSubsemiring.closure s : Set A) by
        refine' Submodule.span_induction ha _ _ _ _
        · refine' Submodule.span_induction hb _ _ _ _
          · exact fun x (hx : x ∈ NonUnitalSubsemiring.closure s) y
              (hy : y ∈ NonUnitalSubsemiring.closure s) => Submodule.subset_span (mul_mem hy hx)
          · exact fun x _hx => (mul_zero x).symm ▸ Submodule.zero_mem _
          · exact fun x y hx hy z hz => (mul_add z x y).symm ▸ add_mem (hx z hz) (hy z hz)
          · exact fun r x hx y hy => (mul_smul_comm r y x).symm ▸ SMulMemClass.smul_mem r (hx y hy)
        · exact (zero_mul b).symm ▸ Submodule.zero_mem _
        · exact fun x y => (add_mul x y b).symm ▸ add_mem
        · 

Proof state:
case refine'_4
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
src✝ : Submodule R A := Submodule.span R ↑(NonUnitalSubsemiring.closure s)
a b : A
ha : a ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)
hb : b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)
⊢ ∀ (a : R) (x : A),
    x * b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s) →
      a • x * b ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure s)

Next tactic:
exact fun r x hx => (smul_mul_assoc r x b).symm ▸ SMulMemClass.smul_mem r hx
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ p { val := b, property := hb }

Next tactic:
refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
    

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ ∃ (x : b ∈ adjoin R s), p { val := b, property := x }

Next tactic:
apply adjoin_induction hb
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
    apply adjoin_induction hb
    · 

Proof state:
case Hs
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ ∀ x ∈ s, ∃ (x_1 : x ∈ adjoin R s), p { val := x, property := x_1 }

Next tactic:
exact fun x hx => ⟨subset_adjoin R hx, Hs x hx⟩
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
    apply adjoin_induction hb
    · exact fun x hx => ⟨subset_adjoin R hx, Hs x hx⟩
    · 

Proof state:
case Hadd
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ ∀ (x y : A),
    (∃ (x_1 : x ∈ adjoin R s), p { val := x, property := x_1 }) →
      (∃ (x : y ∈ adjoin R s), p { val := y, property := x }) →
        ∃ (x_1 : x + y ∈ adjoin R s), p { val := x + y, property := x_1 }

Next tactic:
exact fun x y hx hy => Exists.elim hx <| fun hx' hx => Exists.elim hy <| fun hy' hy =>
        ⟨add_mem hx' hy', Hadd _ _ hx hy⟩
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
    apply adjoin_induction hb
    · exact fun x hx => ⟨subset_adjoin R hx, Hs x hx⟩
    · exact fun x y hx hy => Exists.elim hx <| fun hx' hx => Exists.elim hy <| fun hy' hy =>
        ⟨add_mem hx' hy', Hadd _ _ hx hy⟩
    · 

Proof state:
case H0
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ ∃ (x : 0 ∈ adjoin R s), p { val := 0, property := x }

Next tactic:
exact ⟨_, H0⟩
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
    apply adjoin_induction hb
    · exact fun x hx => ⟨subset_adjoin R hx, Hs x hx⟩
    · exact fun x y hx hy => Exists.elim hx <| fun hx' hx => Exists.elim hy <| fun hy' hy =>
        ⟨add_mem hx' hy', Hadd _ _ hx hy⟩
    · exact ⟨_, H0⟩
    · 

Proof state:
case Hmul
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ ∀ (x y : A),
    (∃ (x_1 : x ∈ adjoin R s), p { val := x, property := x_1 }) →
      (∃ (x : y ∈ adjoin R s), p { val := y, property := x }) →
        ∃ (x_1 : x * y ∈ adjoin R s), p { val := x * y, property := x_1 }

Next tactic:
exact fun x y hx hy => Exists.elim hx <| fun hx' hx => Exists.elim hy <| fun hy' hy =>
        ⟨mul_mem hx' hy', Hmul _ _ hx hy⟩
/-- The difference with `NonUnitalAlgebra.adjoin_induction` is that this acts on the subtype. -/
lemma adjoin_induction' {s : Set A} {p : adjoin R s → Prop} (a : adjoin R s)
    (Hs : ∀ x (h : x ∈ s), p ⟨x, subset_adjoin R h⟩)
    (Hadd : ∀ x y, p x → p y → p (x + y)) (H0 : p 0)
    (Hmul : ∀ x y, p x → p y → p (x * y)) (Hsmul : ∀ (r : R) x, p x → p (r • x)) : p a :=
  Subtype.recOn a <| fun b hb => by
    refine Exists.elim ?_ (fun (hb : b ∈ adjoin R s) (hc : p ⟨b, hb⟩) => hc)
    apply adjoin_induction hb
    · exact fun x hx => ⟨subset_adjoin R hx, Hs x hx⟩
    · exact fun x y hx hy => Exists.elim hx <| fun hx' hx => Exists.elim hy <| fun hy' hy =>
        ⟨add_mem hx' hy', Hadd _ _ hx hy⟩
    · exact ⟨_, H0⟩
    · exact fun x y hx hy => Exists.elim hx <| fun hx' hx => Exists.elim hy <| fun hy' hy =>
        ⟨mul_mem hx' hy', Hmul _ _ hx hy⟩
    · 

Proof state:
case Hsmul
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
s : Set A
p : ↥(adjoin R s) → Prop
a : ↥(adjoin R s)
Hs : ∀ (x : A) (h : x ∈ s), p { val := x, property := (_ : x ∈ ↑(adjoin R s)) }
Hadd : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x + y)
H0 : p 0
Hmul : ∀ (x y : ↥(adjoin R s)), p x → p y → p (x * y)
Hsmul : ∀ (r : R) (x : ↥(adjoin R s)), p x → p (r • x)
b : A
hb : b ∈ adjoin R s
⊢ ∀ (r : R) (x : A),
    (∃ (x_1 : x ∈ adjoin R s), p { val := x, property := x_1 }) →
      ∃ (x_1 : r • x ∈ adjoin R s), p { val := r • x, property := x_1 }

Next tactic:
exact fun r x hx => Exists.elim hx <| fun hx' hx =>
        ⟨SMulMemClass.smul_mem r hx', Hsmul r _ hx⟩
@[simp]
theorem adjoin_empty : adjoin R (∅ : Set A) = ⊥ :=
  show adjoin R ⊥ = ⊥ by 

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
⊢ adjoin R ⊥ = ⊥

Next tactic:
apply GaloisConnection.l_bot
@[simp]
theorem adjoin_empty : adjoin R (∅ : Set A) = ⊥ :=
  show adjoin R ⊥ = ⊥ by apply GaloisConnection.l_bot; 

Proof state:
case gc
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
⊢ GaloisConnection (adjoin R) ?u
case u
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
⊢ NonUnitalSubalgebra R A → Set A

Next tactic:
exact NonUnitalAlgebra.gc
theorem mem_sup_left {S T : NonUnitalSubalgebra R A} : ∀ {x : A}, x ∈ S → x ∈ S ⊔ T := by
  

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S T : NonUnitalSubalgebra R A
⊢ ∀ {x : A}, x ∈ S → x ∈ S ⊔ T

Next tactic:
rw [← SetLike.le_def]
theorem mem_sup_left {S T : NonUnitalSubalgebra R A} : ∀ {x : A}, x ∈ S → x ∈ S ⊔ T := by
  rw [← SetLike.le_def]
  

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S T : NonUnitalSubalgebra R A
⊢ S ≤ S ⊔ T

Next tactic:
exact le_sup_left
theorem mem_sup_right {S T : NonUnitalSubalgebra R A} : ∀ {x : A}, x ∈ T → x ∈ S ⊔ T := by
  

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S T : NonUnitalSubalgebra R A
⊢ ∀ {x : A}, x ∈ T → x ∈ S ⊔ T

Next tactic:
rw [← SetLike.le_def]
theorem mem_sup_right {S T : NonUnitalSubalgebra R A} : ∀ {x : A}, x ∈ T → x ∈ S ⊔ T := by
  rw [← SetLike.le_def]
  

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S T : NonUnitalSubalgebra R A
⊢ T ≤ S ⊔ T

Next tactic:
exact le_sup_right
theorem mem_sInf {S : Set (NonUnitalSubalgebra R A)} {x : A} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p := by
  

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S : Set (NonUnitalSubalgebra R A)
x : A
⊢ x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

Next tactic:
simp only [← SetLike.mem_coe, coe_sInf, Set.mem_iInter₂]
@[simp]
theorem sInf_toSubmodule (S : Set (NonUnitalSubalgebra R A)) :
    (sInf S).toSubmodule = sInf (NonUnitalSubalgebra.toSubmodule '' S) :=
  SetLike.coe_injective <| by 

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S : Set (NonUnitalSubalgebra R A)
⊢ ↑(NonUnitalSubalgebra.toSubmodule (sInf S)) = ↑(sInf (NonUnitalSubalgebra.toSubmodule '' S))

Next tactic:
simp
@[simp]
theorem sInf_toNonUnitalSubsemiring (S : Set (NonUnitalSubalgebra R A)) :
    (sInf S).toNonUnitalSubsemiring = sInf (NonUnitalSubalgebra.toNonUnitalSubsemiring '' S) :=
  SetLike.coe_injective <| by 

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
S : Set (NonUnitalSubalgebra R A)
⊢ ↑(sInf S).toNonUnitalSubsemiring = ↑(sInf (NonUnitalSubalgebra.toNonUnitalSubsemiring '' S))

Next tactic:
simp
@[simp, norm_cast]
theorem coe_iInf {ι : Sort*} {S : ι → NonUnitalSubalgebra R A} :
    (↑(⨅ i, S i) : Set A) = ⋂ i, S i := by 

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
ι : Sort u_2
S : ι → NonUnitalSubalgebra R A
⊢ ↑(⨅ i, S i) = ⋂ i, ↑(S i)

Next tactic:
simp [iInf]
theorem mem_iInf {ι : Sort*} {S : ι → NonUnitalSubalgebra R A} {x : A} :
    (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i := by 

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
ι : Sort u_2
S : ι → NonUnitalSubalgebra R A
x : A
⊢ x ∈ ⨅ i, S i ↔ ∀ (i : ι), x ∈ S i

Next tactic:
simp only [iInf, mem_sInf, Set.forall_range_iff]
@[simp]
theorem iInf_toSubmodule {ι : Sort*} (S : ι → NonUnitalSubalgebra R A) :
    (⨅ i, S i).toSubmodule = ⨅ i, (S i).toSubmodule :=
  SetLike.coe_injective <| by 

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
ι : Sort u_2
S : ι → NonUnitalSubalgebra R A
⊢ ↑(NonUnitalSubalgebra.toSubmodule (⨅ i, S i)) = ↑(⨅ i, NonUnitalSubalgebra.toSubmodule (S i))

Next tactic:
simp
theorem mem_bot {x : A} : x ∈ (⊥ : NonUnitalSubalgebra R A) ↔ x = 0 :=
  show x ∈ Submodule.span R (NonUnitalSubsemiring.closure (∅ : Set A) : Set A) ↔ x = 0 by
    

Proof state:
F : Type u_1
R : Type u
A : Type v
B : Type w
inst✝⁹ : CommSemiring R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : Module R A
inst✝⁶ : IsScalarTower R A A
inst✝⁵ : SMulCommClass R A A
inst✝⁴ : NonUnitalNonAssocSemiring B
inst✝³ : Module R B
inst✝² : IsScalarTower R B B
inst✝¹ : SMulCommClass R B B
inst✝ : NonUnitalAlgHomClass F R A B
x : A
⊢ x ∈ Submodule.span R ↑(NonUnitalSubsemiring.closure ∅) ↔ x = 0

Next tactic:
rw [NonUnitalSubsemiring.closure_empty, NonUnitalSubsemiring.coe_bot,
      Submodule.span_zero_singleton, Submodule.mem_bot]