awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
⊢ Eq (α := Submodule R A)
    ((Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A) (StarSubalgebra.toSubalgebra (adjoin R s)) :
      Submodule R A)
    (span R (↑(Submonoid.closure (s ∪ star s)) : Set A) : Submodule R A)
have rw : Eq (α := Submodule R A)
  ((Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A) (Algebra.adjoin R (s ∪ star s)) : Submodule R A)
  (span R (↑(Submonoid.closure (s ∪ star s)) : Set A) : Submodule R A)
Tactic: rw [adjoin_toSubalgebra, Algebra.adjoin_eq_span]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
rw :
  Eq (α := Submodule R A)
    ((Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A) (Algebra.adjoin R (s ∪ star s)) : Submodule R A)
    (span R (↑(Submonoid.closure (s ∪ star s)) : Set A) : Submodule R A)
⊢ Eq (α := Submodule R A)
    ((Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A) (StarSubalgebra.toSubalgebra (adjoin R s)) :
      Submodule R A)
    (span R (↑(Submonoid.closure (s ∪ star s)) : Set A) : Submodule R A)
have rw₁ : Eq (α := Submodule R A) (span R (↑(Submonoid.closure (s ∪ star s)) : Set A))
  (span R (↑(Submonoid.closure (s ∪ star s)) : Set A))
Tactic: rw [adjoin_toSubalgebra, Algebra.adjoin_eq_span]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : NonUnitalStarSubalgebra R A
⊢ (Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A)
      (StarSubalgebra.toSubalgebra (adjoin R (↑s : Set A))) =
    R ∙ 1 ⊔ s.toSubmodule
have rw : span R (↑(Submonoid.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
Tactic: rw [adjoin_eq_span, Submonoid.closure_eq_one_union, span_union,
    ← NonUnitalStarAlgebra.adjoin_eq_span, NonUnitalStarAlgebra.adjoin_eq]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : NonUnitalStarSubalgebra R A
rw : span R (↑(Submonoid.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
⊢ (Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A)
      (StarSubalgebra.toSubalgebra (adjoin R (↑s : Set A))) =
    R ∙ 1 ⊔ s.toSubmodule
have rw₁ : span R ({1} ∪ (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A)) = R ∙ 1 ⊔ s.toSubmodule
Tactic: rw [adjoin_eq_span, Submonoid.closure_eq_one_union, span_union,
    ← NonUnitalStarAlgebra.adjoin_eq_span, NonUnitalStarAlgebra.adjoin_eq]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : NonUnitalStarSubalgebra R A
rw : span R (↑(Submonoid.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
rw₁ : span R ({1} ∪ (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A)) = R ∙ 1 ⊔ s.toSubmodule
⊢ (Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A)
      (StarSubalgebra.toSubalgebra (adjoin R (↑s : Set A))) =
    R ∙ 1 ⊔ s.toSubmodule
have rw₂ : R ∙ 1 ⊔ span R (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
Tactic: rw [adjoin_eq_span, Submonoid.closure_eq_one_union, span_union,
    ← NonUnitalStarAlgebra.adjoin_eq_span, NonUnitalStarAlgebra.adjoin_eq]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : NonUnitalStarSubalgebra R A
rw : span R (↑(Submonoid.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
rw₁ : span R ({1} ∪ (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A)) = R ∙ 1 ⊔ s.toSubmodule
rw₂ : R ∙ 1 ⊔ span R (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
⊢ (Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A)
      (StarSubalgebra.toSubalgebra (adjoin R (↑s : Set A))) =
    R ∙ 1 ⊔ s.toSubmodule
have rw₃ : R ∙ 1 ⊔
    NonUnitalSubalgebra.toSubmodule
      (NonUnitalStarSubalgebra.toNonUnitalSubalgebra (NonUnitalStarAlgebra.adjoin R (↑s : Set A))) =
  R ∙ 1 ⊔ s.toSubmodule
Tactic: rw [adjoin_eq_span, Submonoid.closure_eq_one_union, span_union,
    ← NonUnitalStarAlgebra.adjoin_eq_span, NonUnitalStarAlgebra.adjoin_eq]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : NonUnitalStarSubalgebra R A
rw : span R (↑(Submonoid.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
rw₁ : span R ({1} ∪ (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A)) = R ∙ 1 ⊔ s.toSubmodule
rw₂ : R ∙ 1 ⊔ span R (↑(Subsemigroup.closure ((↑s : Set A) ∪ star (↑s : Set A))) : Set A) = R ∙ 1 ⊔ s.toSubmodule
rw₃ :
  R ∙ 1 ⊔
      NonUnitalSubalgebra.toSubmodule
        (NonUnitalStarSubalgebra.toNonUnitalSubalgebra (NonUnitalStarAlgebra.adjoin R (↑s : Set A))) =
    R ∙ 1 ⊔ s.toSubmodule
⊢ (Subalgebra.toSubmodule : (a : Subalgebra R A) → Submodule R A)
      (StarSubalgebra.toSubalgebra (adjoin R (↑s : Set A))) =
    R ∙ 1 ⊔ s.toSubmodule
have rw₄ : R ∙ 1 ⊔ s.toSubmodule = R ∙ 1 ⊔ s.toSubmodule
Tactic: rw [adjoin_eq_span, Submonoid.closure_eq_one_union, span_union,
    ← NonUnitalStarAlgebra.adjoin_eq_span, NonUnitalStarAlgebra.adjoin_eq]
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p : (x : A) → Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x → Prop
mem : ∀ (x : A) (h : x ∈ s), p x ⋯
algebraMap : ∀ (r : R), p ((Algebra.algebraMap R A : (a : R) → A) r) ⋯
add :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x + y) ⋯
mul :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x * y) ⋯
star : ∀ (x : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x), p x hx → p (Star.star x) ⋯
a : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
⊢ p a ha
have refine : ∀ (x : A) (hx : x ∈ s ∪ Star.star s), p x sorry
Tactic: refine Algebra.adjoin_induction (fun x hx ↦ ?_) algebraMap add mul ha
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (hypothesis)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p : (x : A) → Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x → Prop
mem : ∀ (x : A) (h : x ∈ s), p x ⋯
algebraMap : ∀ (r : R), p ((Algebra.algebraMap R A : (a : R) → A) r) ⋯
add :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x + y) ⋯
mul :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x * y) ⋯
star : ∀ (x : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x), p x hx → p (Star.star x) ⋯
a : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
x : A
hx : x ∈ s ∪ Star.star s
⊢ p x ⋯
have hx₁ : x ∈ s ∨ Star.star x ∈ s
Tactic: push _ ∈ _ at hx
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p : (x : A) → Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x → Prop
mem : ∀ (x : A) (h : x ∈ s), p x ⋯
algebraMap : ∀ (r : R), p ((Algebra.algebraMap R A : (a : R) → A) r) ⋯
add :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x + y) ⋯
mul :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x * y) ⋯
star : ∀ (x : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x), p x hx → p (Star.star x) ⋯
a : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
x : A
hx_1 : x ∈ s ∪ Star.star s
hx : x ∈ s ∨ Star.star x ∈ s
⊢ p x ⋯
have inl : ∀ (hx : x ∈ s), p x sorry
Tactic: obtain (hx | hx) := hx
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p : (x : A) → Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x → Prop
mem : ∀ (x : A) (h : x ∈ s), p x ⋯
algebraMap : ∀ (r : R), p ((Algebra.algebraMap R A : (a : R) → A) r) ⋯
add :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x + y) ⋯
mul :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x hx → p y hy → p (x * y) ⋯
star : ∀ (x : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x), p x hx → p (Star.star x) ⋯
a : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
x : A
hx_1 : x ∈ s ∪ Star.star s
hx : x ∈ s ∨ Star.star x ∈ s
inl : ∀ (hx : x ∈ s), p x ⋯
⊢ p x ⋯
have inr : ∀ (hx : Star.star x ∈ s), p x sorry
Tactic: obtain (hx | hx) := hx
Cleared hypotheses: hx
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p :
  (x y : A) →
    Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x →
      Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y → Prop
mem_mem : ∀ (x y : A) (hx : x ∈ s) (hy : y ∈ s), p x y ⋯ ⋯
algebraMap_both : ∀ (r₁ r₂ : R), p ((algebraMap R A : (a : R) → A) r₁) ((algebraMap R A : (a : R) → A) r₂) ⋯ ⋯
algebraMap_left : ∀ (r : R) (x : A) (hx : x ∈ s), p ((algebraMap R A : (a : R) → A) r) x ⋯ ⋯
algebraMap_right : ∀ (r : R) (x : A) (hx : x ∈ s), p x ((algebraMap R A : (a : R) → A) r) ⋯ ⋯
add_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x + y) z ⋯ hz
add_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y + z) hx ⋯
mul_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x * y) z ⋯ hz
mul_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y * z) hx ⋯
star_left :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p (star x) y ⋯ hy
star_right :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p x (star y) hx ⋯
a b : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
z : A
hz : z ∈ s
⊢ p a z ha ⋯
have mem : ∀ (x : A) (h : x ∈ s), p x z sorry sorry
Tactic: induction ha using adjoin_induction with
    | mem _ h => exact mem_mem _ _ h hz
    | algebraMap _ => exact algebraMap_left _ _ hz
    | mul _ _ _ _ h₁ h₂ => exact mul_left _ _ _ _ _ _ h₁ h₂
    | add _ _ _ _ h₁ h₂ => exact add_left _ _ _ _ _ _ h₁ h₂
    | star _ _ h => exact star_left _ _ _ _ h
Cleared hypotheses: ha
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p :
  (x y : A) →
    Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x →
      Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y → Prop
mem_mem : ∀ (x y : A) (hx : x ∈ s) (hy : y ∈ s), p x y ⋯ ⋯
algebraMap_both : ∀ (r₁ r₂ : R), p ((algebraMap R A : (a : R) → A) r₁) ((algebraMap R A : (a : R) → A) r₂) ⋯ ⋯
algebraMap_left : ∀ (r : R) (x : A) (hx : x ∈ s), p ((algebraMap R A : (a : R) → A) r) x ⋯ ⋯
algebraMap_right : ∀ (r : R) (x : A) (hx : x ∈ s), p x ((algebraMap R A : (a : R) → A) r) ⋯ ⋯
add_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x + y) z ⋯ hz
add_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y + z) hx ⋯
mul_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x * y) z ⋯ hz
mul_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y * z) hx ⋯
star_left :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p (star x) y ⋯ hy
star_right :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p x (star y) hx ⋯
a b : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
z : A
hz : z ∈ s
mem : ∀ (x : A) (h : x ∈ s), p x z ⋯ ⋯
⊢ p a z ha ⋯
have mem₁ : ∀ (r : R), p ((algebraMap R A : (a : R) → A) r) z sorry sorry
Tactic: induction ha using adjoin_induction with
    | mem _ h => exact mem_mem _ _ h hz
    | algebraMap _ => exact algebraMap_left _ _ hz
    | mul _ _ _ _ h₁ h₂ => exact mul_left _ _ _ _ _ _ h₁ h₂
    | add _ _ _ _ h₁ h₂ => exact add_left _ _ _ _ _ _ h₁ h₂
    | star _ _ h => exact star_left _ _ _ _ h
Cleared hypotheses: ha
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p :
  (x y : A) →
    Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x →
      Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y → Prop
mem_mem : ∀ (x y : A) (hx : x ∈ s) (hy : y ∈ s), p x y ⋯ ⋯
algebraMap_both : ∀ (r₁ r₂ : R), p ((algebraMap R A : (a : R) → A) r₁) ((algebraMap R A : (a : R) → A) r₂) ⋯ ⋯
algebraMap_left : ∀ (r : R) (x : A) (hx : x ∈ s), p ((algebraMap R A : (a : R) → A) r) x ⋯ ⋯
algebraMap_right : ∀ (r : R) (x : A) (hx : x ∈ s), p x ((algebraMap R A : (a : R) → A) r) ⋯ ⋯
add_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x + y) z ⋯ hz
add_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y + z) hx ⋯
mul_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x * y) z ⋯ hz
mul_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y * z) hx ⋯
star_left :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p (star x) y ⋯ hy
star_right :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p x (star y) hx ⋯
a b : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
z : A
hz : z ∈ s
mem : ∀ (x : A) (h : x ∈ s), p x z ⋯ ⋯
mem₁ : ∀ (r : R), p ((algebraMap R A : (a : R) → A) r) z ⋯ ⋯
⊢ p a z ha ⋯
have mem₂ : ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
  (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y) (h₁ : p x z hx sorry) (h₂ : p y z hy sorry), p (x * y) z sorry sorry
Tactic: induction ha using adjoin_induction with
    | mem _ h => exact mem_mem _ _ h hz
    | algebraMap _ => exact algebraMap_left _ _ hz
    | mul _ _ _ _ h₁ h₂ => exact mul_left _ _ _ _ _ _ h₁ h₂
    | add _ _ _ _ h₁ h₂ => exact add_left _ _ _ _ _ _ h₁ h₂
    | star _ _ h => exact star_left _ _ _ _ h
Cleared hypotheses: ha
-- Lean 4 proof step from Mathlib.Algebra.Star.Subalgebra (goal)
Goal:
R : Type u_2
A : Type u_3
inst : CommSemiring R
inst_1 : StarRing R
inst_2 : Semiring A
inst_3 : Algebra R A
inst_4 : StarRing A
inst_5 : StarModule R A
s : Set A
p :
  (x y : A) →
    Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x →
      Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y → Prop
mem_mem : ∀ (x y : A) (hx : x ∈ s) (hy : y ∈ s), p x y ⋯ ⋯
algebraMap_both : ∀ (r₁ r₂ : R), p ((algebraMap R A : (a : R) → A) r₁) ((algebraMap R A : (a : R) → A) r₂) ⋯ ⋯
algebraMap_left : ∀ (r : R) (x : A) (hx : x ∈ s), p ((algebraMap R A : (a : R) → A) r) x ⋯ ⋯
algebraMap_right : ∀ (r : R) (x : A) (hx : x ∈ s), p x ((algebraMap R A : (a : R) → A) r) ⋯ ⋯
add_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x + y) z ⋯ hz
add_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y + z) hx ⋯
mul_left :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x z hx hz → p y z hy hz → p (x * y) z ⋯ hz
mul_right :
  ∀ (x y z : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y)
    (hz : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) z), p x y hx hy → p x z hx hz → p x (y * z) hx ⋯
star_left :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p (star x) y ⋯ hy
star_right :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y), p x y hx hy → p x (star y) hx ⋯
a b : A
ha : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) a
z : A
hz : z ∈ s
mem : ∀ (x : A) (h : x ∈ s), p x z ⋯ ⋯
mem₁ : ∀ (r : R), p ((algebraMap R A : (a : R) → A) r) z ⋯ ⋯
mem₂ :
  ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
    (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y) (h₁ : p x z hx ⋯) (h₂ : p y z hy ⋯), p (x * y) z ⋯ ⋯
⊢ p a z ha ⋯
have mem₃ : ∀ (x y : A) (hx : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) x)
  (hy : Membership.mem (γ := StarSubalgebra R A) (adjoin R s) y) (h₁ : p x z hx sorry) (h₂ : p y z hy sorry), p (x + y) z sorry sorry
Tactic: induction ha using adjoin_induction with
    | mem _ h => exact mem_mem _ _ h hz
    | algebraMap _ => exact algebraMap_left _ _ hz
    | mul _ _ _ _ h₁ h₂ => exact mul_left _ _ _ _ _ _ h₁ h₂
    | add _ _ _ _ h₁ h₂ => exact add_left _ _ _ _ _ _ h₁ h₂
    | star _ _ h => exact star_left _ _ _ _ h
Cleared hypotheses: ha