l3lab/ntp-mathlib huggingface dataset:
instance : Zero (A →⋆ₙₐ[R] B) :=
  ⟨{ (0 : NonUnitalAlgHom R A B) with map_star' := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
D : Type u_5
inst✝⁶ : Monoid R
inst✝⁵ : NonUnitalNonAssocSemiring A
inst✝⁴ : DistribMulAction R A
inst✝³ : StarAddMonoid A
inst✝² : NonUnitalNonAssocSemiring B
inst✝¹ : DistribMulAction R B
inst✝ : StarAddMonoid B
src✝ : A →ₙₐ[R] B := 0
⊢ ∀ (a : A),
    MulActionHom.toFun
        { toDistribMulActionHom := src✝.toDistribMulActionHom,
              map_mul' :=
                (_ :
                  ∀ (x y : A),
                    MulActionHom.toFun src✝.toMulActionHom (x * y) =
                      MulActionHom.toFun src✝.toMulActionHom x *
                        MulActionHom.toFun src✝.toMulActionHom y) }.toDistribMulActionHom.toMulActionHom
        (star a) =
      star
        (MulActionHom.toFun
          { toDistribMulActionHom := src✝.toDistribMulActionHom,
                map_mul' :=
                  (_ :
                    ∀ (x y : A),
                      MulActionHom.toFun src✝.toMulActionHom (x * y) =
                        MulActionHom.toFun src✝.toMulActionHom x *
                          MulActionHom.toFun src✝.toMulActionHom y) }.toDistribMulActionHom.toMulActionHom
          a)

Next tactic:
simp
instance : StarAlgHomClass (A →⋆ₐ[R] B) R A B
    where
  coe f := f.toFun
  coe_injective' := by 

Proof state:
F : Type u_1
R : Type u_2
A : Type u_3
B : Type u_4
C : Type u_5
D : Type u_6
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring A
inst✝¹⁰ : Algebra R A
inst✝⁹ : Star A
inst✝⁸ : Semiring B
inst✝⁷ : Algebra R B
inst✝⁶ : Star B
inst✝⁵ : Semiring C
inst✝⁴ : Algebra R C
inst✝³ : Star C
inst✝² : Semiring D
inst✝¹ : Algebra R D
inst✝ : Star D
⊢ Function.Injective fun f => f.toFun

Next tactic:
rintro ⟨⟨⟨⟨⟨f, _⟩, _⟩, _⟩, _⟩, _⟩ ⟨⟨⟨⟨⟨g, _⟩, _⟩, _⟩, _⟩, _⟩ h
@[simp]
theorem mk_coe (f : A →⋆ₐ[R] B) (h₁ h₂ h₃ h₄ h₅ h₆) :
    (⟨⟨⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A →⋆ₐ[R] B) = f := by
  

Proof state:
F : Type u_1
R : Type u_2
A : Type u_3
B : Type u_4
C : Type u_5
D : Type u_6
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring A
inst✝¹⁰ : Algebra R A
inst✝⁹ : Star A
inst✝⁸ : Semiring B
inst✝⁷ : Algebra R B
inst✝⁶ : Star B
inst✝⁵ : Semiring C
inst✝⁴ : Algebra R C
inst✝³ : Star C
inst✝² : Semiring D
inst✝¹ : Algebra R D
inst✝ : Star D
f : A →⋆ₐ[R] B
h₁ : f 1 = 1
h₂ :
  ∀ (x y : A),
    OneHom.toFun { toFun := ⇑f, map_one' := h₁ } (x * y) =
      OneHom.toFun { toFun := ⇑f, map_one' := h₁ } x * OneHom.toFun { toFun := ⇑f, map_one' := h₁ } y
h₃ : OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) 0 = 0
h₄ :
  ∀ (x y : A),
    OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) (x + y) =
      OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) x +
        OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) y
h₅ :
  ∀ (r : R),
    OneHom.toFun
        (↑↑{ toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
              map_add' := h₄ })
        ((algebraMap R A) r) =
      (algebraMap R B) r
h₆ :
  ∀ (x : A),
    OneHom.toFun
        (↑↑↑{
                toRingHom :=
                  { toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
                    map_add' := h₄ },
                commutes' := h₅ })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{
                  toRingHom :=
                    { toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
                      map_add' := h₄ },
                  commutes' := h₅ })
          x)
⊢ {
      toAlgHom :=
        {
          toRingHom :=
            { toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
              map_add' := h₄ },
          commutes' := h₅ },
      map_star' := h₆ } =
    f

Next tactic:
ext
@[simp]
theorem mk_coe (f : A →⋆ₐ[R] B) (h₁ h₂ h₃ h₄ h₅ h₆) :
    (⟨⟨⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩, h₅⟩, h₆⟩ : A →⋆ₐ[R] B) = f := by
  ext
  

Proof state:
case h
F : Type u_1
R : Type u_2
A : Type u_3
B : Type u_4
C : Type u_5
D : Type u_6
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring A
inst✝¹⁰ : Algebra R A
inst✝⁹ : Star A
inst✝⁸ : Semiring B
inst✝⁷ : Algebra R B
inst✝⁶ : Star B
inst✝⁵ : Semiring C
inst✝⁴ : Algebra R C
inst✝³ : Star C
inst✝² : Semiring D
inst✝¹ : Algebra R D
inst✝ : Star D
f : A →⋆ₐ[R] B
h₁ : f 1 = 1
h₂ :
  ∀ (x y : A),
    OneHom.toFun { toFun := ⇑f, map_one' := h₁ } (x * y) =
      OneHom.toFun { toFun := ⇑f, map_one' := h₁ } x * OneHom.toFun { toFun := ⇑f, map_one' := h₁ } y
h₃ : OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) 0 = 0
h₄ :
  ∀ (x y : A),
    OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) (x + y) =
      OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) x +
        OneHom.toFun (↑{ toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }) y
h₅ :
  ∀ (r : R),
    OneHom.toFun
        (↑↑{ toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
              map_add' := h₄ })
        ((algebraMap R A) r) =
      (algebraMap R B) r
h₆ :
  ∀ (x : A),
    OneHom.toFun
        (↑↑↑{
                toRingHom :=
                  { toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
                    map_add' := h₄ },
                commutes' := h₅ })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{
                  toRingHom :=
                    { toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
                      map_add' := h₄ },
                  commutes' := h₅ })
          x)
x✝ : A
⊢ {
        toAlgHom :=
          {
            toRingHom :=
              { toMonoidHom := { toOneHom := { toFun := ⇑f, map_one' := h₁ }, map_mul' := h₂ }, map_zero' := h₃,
                map_add' := h₄ },
            commutes' := h₅ },
        map_star' := h₆ }
      x✝ =
    f x✝

Next tactic:
rfl
/-- `algebraMap R A` as a `StarAlgHom` when `A` is a star algebra over `R`. -/
@[simps]
def ofId (R A : Type*) [CommSemiring R] [StarRing R] [Semiring A] [StarMul A]
    [Algebra R A] [StarModule R A] : R →⋆ₐ[R] A :=
  { Algebra.ofId R A with
    toFun := algebraMap R A
    map_star' := by 

Proof state:
F : Type u_1
R✝ : Type u_2
A✝ : Type u_3
B : Type u_4
C : Type u_5
D : Type u_6
inst✝¹⁸ : CommSemiring R✝
inst✝¹⁷ : Semiring A✝
inst✝¹⁶ : Algebra R✝ A✝
inst✝¹⁵ : Star A✝
inst✝¹⁴ : Semiring B
inst✝¹³ : Algebra R✝ B
inst✝¹² : Star B
inst✝¹¹ : Semiring C
inst✝¹⁰ : Algebra R✝ C
inst✝⁹ : Star C
inst✝⁸ : Semiring D
inst✝⁷ : Algebra R✝ D
inst✝⁶ : Star D
R : Type u_7
A : Type u_8
inst✝⁵ : CommSemiring R
inst✝⁴ : StarRing R
inst✝³ : Semiring A
inst✝² : StarMul A
inst✝¹ : Algebra R A
inst✝ : StarModule R A
src✝ : R →ₐ[R] A := Algebra.ofId R A
⊢ ∀ (x : R),
    OneHom.toFun
        (↑↑↑{
                toRingHom :=
                  {
                    toMonoidHom :=
                      { toOneHom := { toFun := ⇑(algebraMap R A), map_one' := (_ : OneHom.toFun (↑↑↑src✝) 1 = 1) },
                        map_mul' :=
                          (_ :
                            ∀ (x y : R),
                              OneHom.toFun (↑↑↑src✝) (x * y) = OneHom.toFun (↑↑↑src✝) x * OneHom.toFun (↑↑↑src✝) y) },
                    map_zero' := (_ : OneHom.toFun (↑↑↑src✝) 0 = 0),
                    map_add' :=
                      (_ :
                        ∀ (x y : R),
                          OneHom.toFun (↑↑↑src✝) (x + y) = OneHom.toFun (↑↑↑src✝) x + OneHom.toFun (↑↑↑src✝) y) },
                commutes' := (_ : ∀ (r : R), OneHom.toFun (↑↑↑src✝) ((algebraMap R R) r) = (algebraMap R A) r) })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{
                  toRingHom :=
                    {
                      toMonoidHom :=
                        { toOneHom := { toFun := ⇑(algebraMap R A), map_one' := (_ : OneHom.toFun (↑↑↑src✝) 1 = 1) },
                          map_mul' :=
                            (_ :
                              ∀ (x y : R),
                                OneHom.toFun (↑↑↑src✝) (x * y) = OneHom.toFun (↑↑↑src✝) x * OneHom.toFun (↑↑↑src✝) y) },
                      map_zero' := (_ : OneHom.toFun (↑↑↑src✝) 0 = 0),
                      map_add' :=
                        (_ :
                          ∀ (x y : R),
                            OneHom.toFun (↑↑↑src✝) (x + y) = OneHom.toFun (↑↑↑src✝) x + OneHom.toFun (↑↑↑src✝) y) },
                  commutes' := (_ : ∀ (r : R), OneHom.toFun (↑↑↑src✝) ((algebraMap R R) r) = (algebraMap R A) r) })
          x)

Next tactic:
simp [Algebra.algebraMap_eq_smul_one]
/-- The composition of ⋆-algebra homomorphisms, as a ⋆-algebra homomorphism. -/
def comp (f : B →⋆ₐ[R] C) (g : A →⋆ₐ[R] B) : A →⋆ₐ[R] C :=
  { f.toAlgHom.comp g.toAlgHom with
    map_star' := by
      

Proof state:
F : Type u_1
R : Type u_2
A : Type u_3
B : Type u_4
C : Type u_5
D : Type u_6
inst✝¹² : CommSemiring R
inst✝¹¹ : Semiring A
inst✝¹⁰ : Algebra R A
inst✝⁹ : Star A
inst✝⁸ : Semiring B
inst✝⁷ : Algebra R B
inst✝⁶ : Star B
inst✝⁵ : Semiring C
inst✝⁴ : Algebra R C
inst✝³ : Star C
inst✝² : Semiring D
inst✝¹ : Algebra R D
inst✝ : Star D
f : B →⋆ₐ[R] C
g : A →⋆ₐ[R] B
src✝ : A →ₐ[R] C := AlgHom.comp f.toAlgHom g.toAlgHom
⊢ ∀ (x : A),
    OneHom.toFun
        (↑↑↑{ toRingHom := ↑src✝,
                commutes' := (_ : ∀ (r : R), OneHom.toFun (↑↑↑src✝) ((algebraMap R A) r) = (algebraMap R C) r) })
        (star x) =
      star
        (OneHom.toFun
          (↑↑↑{ toRingHom := ↑src✝,
                  commutes' := (_ : ∀ (r : R), OneHom.toFun (↑↑↑src✝) ((algebraMap R A) r) = (algebraMap R C) r) })
          x)

Next tactic:
simp only [map_star, AlgHom.toFun_eq_coe, AlgHom.coe_comp, coe_toAlgHom,
        Function.comp_apply, eq_self_iff_true, forall_const]
/-- The `Pi.prod` of two morphisms is a morphism. -/
@[simps!]
def prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : A →⋆ₙₐ[R] B × C :=
  { f.toNonUnitalAlgHom.prod g.toNonUnitalAlgHom with
    map_star' := fun x => by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B
g : A →⋆ₙₐ[R] C
src✝ : A →ₙₐ[R] B × C := NonUnitalAlgHom.prod f.toNonUnitalAlgHom g.toNonUnitalAlgHom
x : A
⊢ MulActionHom.toFun
      { toDistribMulActionHom := src✝.toDistribMulActionHom,
            map_mul' :=
              (_ :
                ∀ (x y : A),
                  MulActionHom.toFun src✝.toMulActionHom (x * y) =
                    MulActionHom.toFun src✝.toMulActionHom x *
                      MulActionHom.toFun src✝.toMulActionHom y) }.toDistribMulActionHom.toMulActionHom
      (star x) =
    star
      (MulActionHom.toFun
        { toDistribMulActionHom := src✝.toDistribMulActionHom,
              map_mul' :=
                (_ :
                  ∀ (x y : A),
                    MulActionHom.toFun src✝.toMulActionHom (x * y) =
                      MulActionHom.toFun src✝.toMulActionHom x *
                        MulActionHom.toFun src✝.toMulActionHom y) }.toDistribMulActionHom.toMulActionHom
        x)

Next tactic:
simp [map_star, Prod.star_def]
@[simp]
theorem fst_prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : (fst R B C).comp (prod f g) = f := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B
g : A →⋆ₙₐ[R] C
⊢ comp (fst R B C) (prod f g) = f

Next tactic:
ext
@[simp]
theorem fst_prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : (fst R B C).comp (prod f g) = f := by
  ext; 

Proof state:
case h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B
g : A →⋆ₙₐ[R] C
x✝ : A
⊢ (comp (fst R B C) (prod f g)) x✝ = f x✝

Next tactic:
rfl
@[simp]
theorem snd_prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : (snd R B C).comp (prod f g) = g := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B
g : A →⋆ₙₐ[R] C
⊢ comp (snd R B C) (prod f g) = g

Next tactic:
ext
@[simp]
theorem snd_prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : (snd R B C).comp (prod f g) = g := by
  ext; 

Proof state:
case h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B
g : A →⋆ₙₐ[R] C
x✝ : A
⊢ (comp (snd R B C) (prod f g)) x✝ = g x✝

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C)
⊢ (fun f => (comp (fst R B C) f, comp (snd R B C) f)) ((fun f => prod f.1 f.2) f) = f

Next tactic:
ext
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> 

Proof state:
case a.h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C)
x✝ : A
⊢ ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) ((fun f => prod f.1 f.2) f)).1 x✝ = f.1 x✝

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> 

Proof state:
case a.h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C)
x✝ : A
⊢ ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) ((fun f => prod f.1 f.2) f)).2 x✝ = f.2 x✝

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> rfl
  right_inv f := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B × C
⊢ (fun f => prod f.1 f.2) ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) f) = f

Next tactic:
ext
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> rfl
  right_inv f := by ext <;> 

Proof state:
case h.a
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B × C
x✝ : A
⊢ (((fun f => prod f.1 f.2) ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) f)) x✝).1 = (f x✝).1

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₙₐ[R] B) × (A →⋆ₙₐ[R] C) ≃ (A →⋆ₙₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> rfl
  right_inv f := by ext <;> 

Proof state:
case h.a
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : Monoid R
inst✝⁸ : NonUnitalNonAssocSemiring A
inst✝⁷ : DistribMulAction R A
inst✝⁶ : Star A
inst✝⁵ : NonUnitalNonAssocSemiring B
inst✝⁴ : DistribMulAction R B
inst✝³ : Star B
inst✝² : NonUnitalNonAssocSemiring C
inst✝¹ : DistribMulAction R C
inst✝ : Star C
f : A →⋆ₙₐ[R] B × C
x✝ : A
⊢ (((fun f => prod f.1 f.2) ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) f)) x✝).2 = (f x✝).2

Next tactic:
rfl
/-- The `Pi.prod` of two morphisms is a morphism. -/
@[simps!]
def prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : A →⋆ₐ[R] B × C :=
  { f.toAlgHom.prod g.toAlgHom with map_star' := fun x => by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : A →⋆ₐ[R] B
g : A →⋆ₐ[R] C
src✝ : A →ₐ[R] B × C := AlgHom.prod f.toAlgHom g.toAlgHom
x : A
⊢ OneHom.toFun
      (↑↑↑{ toRingHom := ↑src✝,
              commutes' := (_ : ∀ (r : R), OneHom.toFun (↑↑↑src✝) ((algebraMap R A) r) = (algebraMap R (B × C)) r) })
      (star x) =
    star
      (OneHom.toFun
        (↑↑↑{ toRingHom := ↑src✝,
                commutes' := (_ : ∀ (r : R), OneHom.toFun (↑↑↑src✝) ((algebraMap R A) r) = (algebraMap R (B × C)) r) })
        x)

Next tactic:
simp [Prod.star_def, map_star]
@[simp]
theorem fst_prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : (fst R B C).comp (prod f g) = f := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : A →⋆ₐ[R] B
g : A →⋆ₐ[R] C
⊢ comp (fst R B C) (prod f g) = f

Next tactic:
ext
@[simp]
theorem fst_prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : (fst R B C).comp (prod f g) = f := by
  ext; 

Proof state:
case h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : A →⋆ₐ[R] B
g : A →⋆ₐ[R] C
x✝ : A
⊢ (comp (fst R B C) (prod f g)) x✝ = f x✝

Next tactic:
rfl
@[simp]
theorem snd_prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : (snd R B C).comp (prod f g) = g := by
  

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : A →⋆ₐ[R] B
g : A →⋆ₐ[R] C
⊢ comp (snd R B C) (prod f g) = g

Next tactic:
ext
@[simp]
theorem snd_prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : (snd R B C).comp (prod f g) = g := by
  ext; 

Proof state:
case h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : A →⋆ₐ[R] B
g : A →⋆ₐ[R] C
x✝ : A
⊢ (comp (snd R B C) (prod f g)) x✝ = g x✝

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C) ≃ (A →⋆ₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C)
⊢ (fun f => (comp (fst R B C) f, comp (snd R B C) f)) ((fun f => prod f.1 f.2) f) = f

Next tactic:
ext
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C) ≃ (A →⋆ₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> 

Proof state:
case a.h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C)
x✝ : A
⊢ ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) ((fun f => prod f.1 f.2) f)).1 x✝ = f.1 x✝

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C) ≃ (A →⋆ₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> 

Proof state:
case a.h
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C)
x✝ : A
⊢ ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) ((fun f => prod f.1 f.2) f)).2 x✝ = f.2 x✝

Next tactic:
rfl
/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →⋆ₐ[R] B) × (A →⋆ₐ[R] C) ≃ (A →⋆ₐ[R] B × C)
    where
  toFun f := f.1.prod f.2
  invFun f := ((fst _ _ _).comp f, (snd _ _ _).comp f)
  left_inv f := by ext <;> rfl
  right_inv f := by 

Proof state:
R : Type u_1
A : Type u_2
B : Type u_3
C : Type u_4
inst✝⁹ : CommSemiring R
inst✝⁸ : Semiring A
inst✝⁷ : Algebra R A
inst✝⁶ : Star A
inst✝⁵ : Semiring B
inst✝⁴ : Algebra R B
inst✝³ : Star B
inst✝² : Semiring C
inst✝¹ : Algebra R C
inst✝ : Star C
f : A →⋆ₐ[R] B × C
⊢ (fun f => prod f.1 f.2) ((fun f => (comp (fst R B C) f, comp (snd R B C) f)) f) = f

Next tactic:
ext