l3lab/ntp-mathlib huggingface dataset:
/-- The forwards direction of the universal property; an algebra morphism out of the graded tensor
product can be assembed from maps on each component that (anti)commute on pure elements of the
corresponding graded algebras. -/
def lift (f : A →ₐ[R] C) (g : B →ₐ[R] C)
    (h_anti_commutes : ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), f a * g b = (-1 : ℤˣ)^(j * i) • (g b * f a)) :
    (𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C :=
  AlgHom.ofLinearMap
    (LinearMap.mul' R C
      ∘ₗ (TensorProduct.map f.toLinearMap g.toLinearMap)
      ∘ₗ ((of R 𝒜 ℬ).symm : 𝒜 ᵍ⊗[R] ℬ →ₗ[R] A ⊗[R] B))
    (by dsimp [Algebra.TensorProduct.one_def]; simp only [_root_.map_one, mul_one])
    (by
      rw [LinearMap.map_mul_iff]
      ext a₁ : 3
      refine DirectSum.decompose_lhom_ext ℬ fun j₁ => ?_
      ext b₁ : 3
      refine DirectSum.decompose_lhom_ext 𝒜 fun i₂ => ?_
      ext a₂ b₂ : 2
      dsimp
      rw [tmul_coe_mul_coe_tmul]
      rw [@Units.smul_def _ _ (_) (_), zsmul_eq_smul_cast R, map_smul, map_smul, map_smul]
      rw [← zsmul_eq_smul_cast R, ← @Units.smul_def _ _ (_) (_)]
      rw [of_symm_of, map_tmul, LinearMap.mul'_apply]
      

Proof state:
case h.a.h.h.h.a.h.h
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1000162
inst✝¹ : Ring C
inst✝ : Algebra R C
f : A →ₐ[R] C
g : B →ₐ[R] C
h_anti_commutes : ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), f ↑a * g ↑b = (-1) ^ (j * i) • (g ↑b * f ↑a)
a₁ : A
j₁ : ι
b₁ : ↥(ℬ j₁)
i₂ : ι
a₂ : ↥(𝒜 i₂)
b₂ : B
⊢ (-1) ^ (j₁ * i₂) • ((AlgHom.toLinearMap f) (a₁ * ↑a₂) * (AlgHom.toLinearMap g) (↑b₁ * b₂)) =
    f a₁ * g ↑b₁ * (f ↑a₂ * g b₂)

Next tactic:
simp_rw [AlgHom.toLinearMap_apply, _root_.map_mul]
/-- The forwards direction of the universal property; an algebra morphism out of the graded tensor
product can be assembed from maps on each component that (anti)commute on pure elements of the
corresponding graded algebras. -/
def lift (f : A →ₐ[R] C) (g : B →ₐ[R] C)
    (h_anti_commutes : ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), f a * g b = (-1 : ℤˣ)^(j * i) • (g b * f a)) :
    (𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C :=
  AlgHom.ofLinearMap
    (LinearMap.mul' R C
      ∘ₗ (TensorProduct.map f.toLinearMap g.toLinearMap)
      ∘ₗ ((of R 𝒜 ℬ).symm : 𝒜 ᵍ⊗[R] ℬ →ₗ[R] A ⊗[R] B))
    (by dsimp [Algebra.TensorProduct.one_def]; simp only [_root_.map_one, mul_one])
    (by
      rw [LinearMap.map_mul_iff]
      ext a₁ : 3
      refine DirectSum.decompose_lhom_ext ℬ fun j₁ => ?_
      ext b₁ : 3
      refine DirectSum.decompose_lhom_ext 𝒜 fun i₂ => ?_
      ext a₂ b₂ : 2
      dsimp
      rw [tmul_coe_mul_coe_tmul]
      rw [@Units.smul_def _ _ (_) (_), zsmul_eq_smul_cast R, map_smul, map_smul, map_smul]
      rw [← zsmul_eq_smul_cast R, ← @Units.smul_def _ _ (_) (_)]
      rw [of_symm_of, map_tmul, LinearMap.mul'_apply]
      simp_rw [AlgHom.toLinearMap_apply, _root_.map_mul]
      

Proof state:
case h.a.h.h.h.a.h.h
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1000162
inst✝¹ : Ring C
inst✝ : Algebra R C
f : A →ₐ[R] C
g : B →ₐ[R] C
h_anti_commutes : ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), f ↑a * g ↑b = (-1) ^ (j * i) • (g ↑b * f ↑a)
a₁ : A
j₁ : ι
b₁ : ↥(ℬ j₁)
i₂ : ι
a₂ : ↥(𝒜 i₂)
b₂ : B
⊢ (-1) ^ (j₁ * i₂) • (f a₁ * f ↑a₂ * (g ↑b₁ * g b₂)) = f a₁ * g ↑b₁ * (f ↑a₂ * g b₂)

Next tactic:
simp_rw [mul_assoc (f a₁), ← mul_assoc _ _ (g b₂), h_anti_commutes, mul_smul_comm,
        smul_mul_assoc, smul_smul, Int.units_mul_self, one_smul]
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
F : 𝒜 ᵍ⊗[R] ℬ →ₐ[R] C
i j : ι
a : ↥(𝒜 i)
b : ↥(ℬ j)
⊢ (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
      (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
    (-1) ^ (j * i) •
      ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
        (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)

Next tactic:
dsimp
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
F : 𝒜 ᵍ⊗[R] ℬ →ₐ[R] C
i j : ι
a : ↥(𝒜 i)
b : ↥(ℬ j)
⊢ F (↑a ᵍ⊗ₜ[R] 1) * F (1 ᵍ⊗ₜ[R] ↑b) = (-1) ^ (j * i) • (F (1 ᵍ⊗ₜ[R] ↑b) * F (↑a ᵍ⊗ₜ[R] 1))

Next tactic:
rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by 

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
fg : { fg // ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), fg.1 ↑a * fg.2 ↑b = (-1) ^ (j * i) • (fg.2 ↑b * fg.1 ↑a) }
⊢ (fun F =>
        { val := (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)),
          property :=
            (_ :
              ∀ (i j : ι) (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
                    (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
                  (-1) ^ (j * i) •
                    ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
                      (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)) })
      ((fun fg =>
          lift 𝒜 ℬ (↑fg).1 (↑fg).2
            (_ :
              ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                (↑fg).1 ↑a * (↑fg).2 ↑b = (-1) ^ (j * i) • ((↑fg).2 ↑b * (↑fg).1 ↑a)))
        fg) =
    fg

Next tactic:
ext
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (

Proof state:
case a.a.H
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
fg : { fg // ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), fg.1 ↑a * fg.2 ↑b = (-1) ^ (j * i) • (fg.2 ↑b * fg.1 ↑a) }
x✝ : A
⊢ (↑((fun F =>
              { val := (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)),
                property :=
                  (_ :
                    ∀ (i j : ι) (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                      (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
                          (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
                        (-1) ^ (j * i) •
                          ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
                            (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)) })
            ((fun fg =>
                lift 𝒜 ℬ (↑fg).1 (↑fg).2
                  (_ :
                    ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                      (↑fg).1 ↑a * (↑fg).2 ↑b = (-1) ^ (j * i) • ((↑fg).2 ↑b * (↑fg).1 ↑a)))
              fg))).1
      x✝ =
    (↑fg).1 x✝

Next tactic:
dsimp
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (dsimp; 

Proof state:
case a.a.H
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
fg : { fg // ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), fg.1 ↑a * fg.2 ↑b = (-1) ^ (j * i) • (fg.2 ↑b * fg.1 ↑a) }
x✝ : A
⊢ (↑fg).1 x✝ * (↑fg).2 1 = (↑fg).1 x✝

Next tactic:
simp only [_root_.map_one, mul_one, one_mul]
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (

Proof state:
case a.a.H
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
fg : { fg // ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), fg.1 ↑a * fg.2 ↑b = (-1) ^ (j * i) • (fg.2 ↑b * fg.1 ↑a) }
x✝ : B
⊢ (↑((fun F =>
              { val := (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)),
                property :=
                  (_ :
                    ∀ (i j : ι) (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                      (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
                          (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
                        (-1) ^ (j * i) •
                          ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
                            (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)) })
            ((fun fg =>
                lift 𝒜 ℬ (↑fg).1 (↑fg).2
                  (_ :
                    ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                      (↑fg).1 ↑a * (↑fg).2 ↑b = (-1) ^ (j * i) • ((↑fg).2 ↑b * (↑fg).1 ↑a)))
              fg))).2
      x✝ =
    (↑fg).2 x✝

Next tactic:
dsimp
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (dsimp; 

Proof state:
case a.a.H
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
fg : { fg // ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)), fg.1 ↑a * fg.2 ↑b = (-1) ^ (j * i) • (fg.2 ↑b * fg.1 ↑a) }
x✝ : B
⊢ (↑fg).1 1 * (↑fg).2 x✝ = (↑fg).2 x✝

Next tactic:
simp only [_root_.map_one, mul_one, one_mul]
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (dsimp; simp only [_root_.map_one, mul_one, one_mul])
  right_inv F := by
    

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
F : 𝒜 ᵍ⊗[R] ℬ →ₐ[R] C
⊢ (fun fg =>
        lift 𝒜 ℬ (↑fg).1 (↑fg).2
          (_ :
            ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
              (↑fg).1 ↑a * (↑fg).2 ↑b = (-1) ^ (j * i) • ((↑fg).2 ↑b * (↑fg).1 ↑a)))
      ((fun F =>
          { val := (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)),
            property :=
              (_ :
                ∀ (i j : ι) (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                  (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
                      (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
                    (-1) ^ (j * i) •
                      ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
                        (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)) })
        F) =
    F

Next tactic:
apply AlgHom.toLinearMap_injective
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (dsimp; simp only [_root_.map_one, mul_one, one_mul])
  right_inv F := by
    apply AlgHom.toLinearMap_injective
    

Proof state:
case a
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
F : 𝒜 ᵍ⊗[R] ℬ →ₐ[R] C
⊢ AlgHom.toLinearMap
      ((fun fg =>
          lift 𝒜 ℬ (↑fg).1 (↑fg).2
            (_ :
              ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                (↑fg).1 ↑a * (↑fg).2 ↑b = (-1) ^ (j * i) • ((↑fg).2 ↑b * (↑fg).1 ↑a)))
        ((fun F =>
            { val := (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)),
              property :=
                (_ :
                  ∀ (i j : ι) (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                    (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
                        (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
                      (-1) ^ (j * i) •
                        ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
                          (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)) })
          F)) =
    AlgHom.toLinearMap F

Next tactic:
ext
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (dsimp; simp only [_root_.map_one, mul_one, one_mul])
  right_inv F := by
    apply AlgHom.toLinearMap_injective
    ext
    

Proof state:
case a.h.a.h.h
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
F : 𝒜 ᵍ⊗[R] ℬ →ₐ[R] C
x✝¹ : A
x✝ : B
⊢ ((AlgebraTensorModule.curry
          (AlgHom.toLinearMap
              ((fun fg =>
                  lift 𝒜 ℬ (↑fg).1 (↑fg).2
                    (_ :
                      ∀ ⦃i j : ι⦄ (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                        (↑fg).1 ↑a * (↑fg).2 ↑b = (-1) ^ (j * i) • ((↑fg).2 ↑b * (↑fg).1 ↑a)))
                ((fun F =>
                    { val := (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)),
                      property :=
                        (_ :
                          ∀ (i j : ι) (a : ↥(𝒜 i)) (b : ↥(ℬ j)),
                            (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a *
                                (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b =
                              (-1) ^ (j * i) •
                                ((AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).2 ↑b *
                                  (AlgHom.comp F (includeLeft 𝒜 ℬ), AlgHom.comp F (includeRight 𝒜 ℬ)).1 ↑a)) })
                  F)) ∘ₗ
            ↑(of R 𝒜 ℬ)))
        x✝¹)
      x✝ =
    ((AlgebraTensorModule.curry (AlgHom.toLinearMap F ∘ₗ ↑(of R 𝒜 ℬ))) x✝¹) x✝

Next tactic:
dsimp
/-- The universal property of the graded tensor product; every algebra morphism uniquely factors
as a pair of algebra morphisms that anticommute with respect to the grading. -/
def liftEquiv :
    { fg : (A →ₐ[R] C) × (B →ₐ[R] C) //
        ∀ ⦃i j⦄ (a : 𝒜 i) (b : ℬ j), fg.1 a * fg.2 b = (-1 : ℤˣ)^(j * i) • (fg.2 b * fg.1 a)} ≃
      ((𝒜 ᵍ⊗[R] ℬ) →ₐ[R] C) where
  toFun fg := lift 𝒜 ℬ _ _ fg.prop
  invFun F := ⟨(F.comp (includeLeft 𝒜 ℬ), F.comp (includeRight 𝒜 ℬ)), fun i j a b => by
    dsimp
    rw [← F.map_mul, ← F.map_mul, tmul_coe_mul_coe_tmul, one_mul, mul_one, AlgHom.map_smul_of_tower,
      tmul_one_mul_one_tmul, smul_smul, Int.units_mul_self, one_smul]⟩
  left_inv fg := by ext <;> (dsimp; simp only [_root_.map_one, mul_one, one_mul])
  right_inv F := by
    apply AlgHom.toLinearMap_injective
    ext
    dsimp
    

Proof state:
case a.h.a.h.h
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1092606
inst✝¹ : Ring C
inst✝ : Algebra R C
F : 𝒜 ᵍ⊗[R] ℬ →ₐ[R] C
x✝¹ : A
x✝ : B
⊢ F (x✝¹ ᵍ⊗ₜ[R] 1) * F (1 ᵍ⊗ₜ[R] x✝) = F ((of R 𝒜 ℬ) (x✝¹ ⊗ₜ[R] x✝))

Next tactic:
rw [← F.map_mul, tmul_one_mul_one_tmul]
/-- The non-trivial symmetric braiding, sending $a \otimes b$ to
$(-1)^{\deg a' \deg b} (b \otimes a)$. -/
def comm : (𝒜 ᵍ⊗[R] ℬ) ≃ₐ[R] (ℬ ᵍ⊗[R] 𝒜) :=
  AlgEquiv.ofLinearEquiv
    (auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R _ _ ≪≫ₗ (auxEquiv R ℬ 𝒜).symm)
    (by
      

Proof state:
R : Type u_1
ι : Type u_2
A : Type u_3
B : Type u_4
inst✝¹¹ : CommSemiring ι
inst✝¹⁰ : Module ι (Additive ℤˣ)
inst✝⁹ : DecidableEq ι
inst✝⁸ : CommRing R
inst✝⁷ : Ring A
inst✝⁶ : Ring B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra R B
𝒜 : ι → Submodule R A
ℬ : ι → Submodule R B
inst✝³ : GradedAlgebra 𝒜
inst✝² : GradedAlgebra ℬ
C : Type ?u.1142099
inst✝¹ : Ring C
inst✝ : Algebra R C
⊢ ((auxEquiv R 𝒜 ℬ ≪≫ₗ gradedComm R (fun i => ↥(𝒜 i)) fun i => ↥(ℬ i)) ≪≫ₗ LinearEquiv.symm (auxEquiv R ℬ 𝒜)) 1 = 1

Next tactic:
dsimp