l3lab/ntp-mathlib huggingface dataset:
instance algebra' : Algebra S (tsze R M) :=
  { (TrivSqZeroExt.inlHom R M).comp (algebraMap S R) with
    smul := (· • ·)
    commutes' := fun s x =>
      ext (Algebra.commutes _ _) <|
        show algebraMap S R s • x.snd + op x.fst • (0 : M)
            = x.fst • (0 : M) + op (algebraMap S R s) • x.snd by
          

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁵ : CommSemiring S
inst✝¹⁴ : Semiring R
inst✝¹³ : CommSemiring R'
inst✝¹² : AddCommMonoid M
inst✝¹¹ : Algebra S R
inst✝¹⁰ : Algebra S R'
inst✝⁹ : Module S M
inst✝⁸ : Module R M
inst✝⁷ : Module Rᵐᵒᵖ M
inst✝⁶ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁵ : IsScalarTower S R M
inst✝⁴ : IsScalarTower S Rᵐᵒᵖ M
inst✝³ : Module R' M
inst✝² : Module R'ᵐᵒᵖ M
inst✝¹ : IsCentralScalar R' M
inst✝ : IsScalarTower S R' M
src✝ : S →+* tsze R M := RingHom.comp (inlHom R M) (algebraMap S R)
s : S
x : tsze R M
⊢ (algebraMap S R) s • snd x + op (fst x) • 0 = fst x • 0 + op ((algebraMap S R) s) • snd x

Next tactic:
rw [smul_zero, smul_zero, add_zero, zero_add]
instance algebra' : Algebra S (tsze R M) :=
  { (TrivSqZeroExt.inlHom R M).comp (algebraMap S R) with
    smul := (· • ·)
    commutes' := fun s x =>
      ext (Algebra.commutes _ _) <|
        show algebraMap S R s • x.snd + op x.fst • (0 : M)
            = x.fst • (0 : M) + op (algebraMap S R s) • x.snd by
          rw [smul_zero, smul_zero, add_zero, zero_add]
          

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁵ : CommSemiring S
inst✝¹⁴ : Semiring R
inst✝¹³ : CommSemiring R'
inst✝¹² : AddCommMonoid M
inst✝¹¹ : Algebra S R
inst✝¹⁰ : Algebra S R'
inst✝⁹ : Module S M
inst✝⁸ : Module R M
inst✝⁷ : Module Rᵐᵒᵖ M
inst✝⁶ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁵ : IsScalarTower S R M
inst✝⁴ : IsScalarTower S Rᵐᵒᵖ M
inst✝³ : Module R' M
inst✝² : Module R'ᵐᵒᵖ M
inst✝¹ : IsCentralScalar R' M
inst✝ : IsScalarTower S R' M
src✝ : S →+* tsze R M := RingHom.comp (inlHom R M) (algebraMap S R)
s : S
x : tsze R M
⊢ (algebraMap S R) s • snd x = op ((algebraMap S R) s) • snd x

Next tactic:
rw [Algebra.algebraMap_eq_smul_one, MulOpposite.op_smul, MulOpposite.op_one, smul_assoc,
            one_smul, smul_assoc, one_smul]
instance algebra' : Algebra S (tsze R M) :=
  { (TrivSqZeroExt.inlHom R M).comp (algebraMap S R) with
    smul := (· • ·)
    commutes' := fun s x =>
      ext (Algebra.commutes _ _) <|
        show algebraMap S R s • x.snd + op x.fst • (0 : M)
            = x.fst • (0 : M) + op (algebraMap S R s) • x.snd by
          rw [smul_zero, smul_zero, add_zero, zero_add]
          rw [Algebra.algebraMap_eq_smul_one, MulOpposite.op_smul, MulOpposite.op_one, smul_assoc,
            one_smul, smul_assoc, one_smul]
    smul_def' := fun r x =>
      ext (Algebra.smul_def _ _) <|
        show r • x.2 = algebraMap S R r • x.2 + op x.1 • (0 : M) by
          

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁵ : CommSemiring S
inst✝¹⁴ : Semiring R
inst✝¹³ : CommSemiring R'
inst✝¹² : AddCommMonoid M
inst✝¹¹ : Algebra S R
inst✝¹⁰ : Algebra S R'
inst✝⁹ : Module S M
inst✝⁸ : Module R M
inst✝⁷ : Module Rᵐᵒᵖ M
inst✝⁶ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁵ : IsScalarTower S R M
inst✝⁴ : IsScalarTower S Rᵐᵒᵖ M
inst✝³ : Module R' M
inst✝² : Module R'ᵐᵒᵖ M
inst✝¹ : IsCentralScalar R' M
inst✝ : IsScalarTower S R' M
src✝ : S →+* tsze R M := RingHom.comp (inlHom R M) (algebraMap S R)
r : S
x : tsze R M
⊢ r • x.2 = (algebraMap S R) r • x.2 + op x.1 • 0

Next tactic:
rw [smul_zero, add_zero, algebraMap_smul]
/--
Assemble an algebra morphism `TrivSqZeroExt R M →ₐ[S] A` from separate morphisms on `R` and `M`.

Namely, we require that for an algebra morphism `f : R →ₐ[S] A` and a linear map `g : M →ₗ[S] A`,
we have:

* `g x * g y = 0`: the elements of `M` continue to square to zero.
* `g (r • x) = f r * g x` and `g (op r • x) = g x * f r`: scalar multiplication on the left and
  right is sent to left- and right- multiplication by the image under `f`.

See `TrivSqZeroExt.liftEquiv` for this as an equiv; namely that any such algebra morphism can be
factored in this way.

When `R` is commutative, this can be invoked with `f = Algebra.ofId R A`, which satisfies `hfg` and
`hgf`. This version is captured as an equiv by `TrivSqZeroExt.liftEquivOfComm`. -/
def lift (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r) : tsze R M →ₐ[S] A :=
  AlgHom.ofLinearMap
    ((f.comp <| fstHom S R M).toLinearMap + g ∘ₗ (sndHom R M |>.restrictScalars S))
    (show f 1 + g (0 : M) = 1 by 

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : R →ₐ[S] A
g : M →ₗ[S] A
hg : ∀ (x y : M), g x * g y = 0
hfg : ∀ (r : R) (x : M), g (r • x) = f r * g x
hgf : ∀ (r : R) (x : M), g (op r • x) = g x * f r
⊢ f 1 + g 0 = 1

Next tactic:
rw [map_zero, map_one, add_zero]
/--
Assemble an algebra morphism `TrivSqZeroExt R M →ₐ[S] A` from separate morphisms on `R` and `M`.

Namely, we require that for an algebra morphism `f : R →ₐ[S] A` and a linear map `g : M →ₗ[S] A`,
we have:

* `g x * g y = 0`: the elements of `M` continue to square to zero.
* `g (r • x) = f r * g x` and `g (op r • x) = g x * f r`: scalar multiplication on the left and
  right is sent to left- and right- multiplication by the image under `f`.

See `TrivSqZeroExt.liftEquiv` for this as an equiv; namely that any such algebra morphism can be
factored in this way.

When `R` is commutative, this can be invoked with `f = Algebra.ofId R A`, which satisfies `hfg` and
`hgf`. This version is captured as an equiv by `TrivSqZeroExt.liftEquivOfComm`. -/
def lift (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r) : tsze R M →ₐ[S] A :=
  AlgHom.ofLinearMap
    ((f.comp <| fstHom S R M).toLinearMap + g ∘ₗ (sndHom R M |>.restrictScalars S))
    (show f 1 + g (0 : M) = 1 by rw [map_zero, map_one, add_zero])
    (TrivSqZeroExt.ind fun r₁ m₁ =>
      TrivSqZeroExt.ind fun r₂ m₂ => by
        

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : R →ₐ[S] A
g : M →ₗ[S] A
hg : ∀ (x y : M), g x * g y = 0
hfg : ∀ (r : R) (x : M), g (r • x) = f r * g x
hgf : ∀ (r : R) (x : M), g (op r • x) = g x * f r
r₁ : R
m₁ : M
r₂ : R
m₂ : M
⊢ (AlgHom.toLinearMap (AlgHom.comp f (fstHom S R M)) + g ∘ₗ ↑S (sndHom R M)) ((inl r₁ + inr m₁) * (inl r₂ + inr m₂)) =
    (AlgHom.toLinearMap (AlgHom.comp f (fstHom S R M)) + g ∘ₗ ↑S (sndHom R M)) (inl r₁ + inr m₁) *
      (AlgHom.toLinearMap (AlgHom.comp f (fstHom S R M)) + g ∘ₗ ↑S (sndHom R M)) (inl r₂ + inr m₂)

Next tactic:
dsimp
/--
Assemble an algebra morphism `TrivSqZeroExt R M →ₐ[S] A` from separate morphisms on `R` and `M`.

Namely, we require that for an algebra morphism `f : R →ₐ[S] A` and a linear map `g : M →ₗ[S] A`,
we have:

* `g x * g y = 0`: the elements of `M` continue to square to zero.
* `g (r • x) = f r * g x` and `g (op r • x) = g x * f r`: scalar multiplication on the left and
  right is sent to left- and right- multiplication by the image under `f`.

See `TrivSqZeroExt.liftEquiv` for this as an equiv; namely that any such algebra morphism can be
factored in this way.

When `R` is commutative, this can be invoked with `f = Algebra.ofId R A`, which satisfies `hfg` and
`hgf`. This version is captured as an equiv by `TrivSqZeroExt.liftEquivOfComm`. -/
def lift (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r) : tsze R M →ₐ[S] A :=
  AlgHom.ofLinearMap
    ((f.comp <| fstHom S R M).toLinearMap + g ∘ₗ (sndHom R M |>.restrictScalars S))
    (show f 1 + g (0 : M) = 1 by rw [map_zero, map_one, add_zero])
    (TrivSqZeroExt.ind fun r₁ m₁ =>
      TrivSqZeroExt.ind fun r₂ m₂ => by
        dsimp
        

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : R →ₐ[S] A
g : M →ₗ[S] A
hg : ∀ (x y : M), g x * g y = 0
hfg : ∀ (r : R) (x : M), g (r • x) = f r * g x
hgf : ∀ (r : R) (x : M), g (op r • x) = g x * f r
r₁ : R
m₁ : M
r₂ : R
m₂ : M
⊢ f ((r₁ + 0) * (r₂ + 0)) + g ((r₁ + 0) • (0 + m₂) + (op r₂ + 0) • (0 + m₁)) =
    (f (r₁ + 0) + g (0 + m₁)) * (f (r₂ + 0) + g (0 + m₂))

Next tactic:
simp only [add_zero, zero_add, add_mul, mul_add, smul_mul_smul, hg, smul_zero,
          op_smul_eq_smul]
/--
Assemble an algebra morphism `TrivSqZeroExt R M →ₐ[S] A` from separate morphisms on `R` and `M`.

Namely, we require that for an algebra morphism `f : R →ₐ[S] A` and a linear map `g : M →ₗ[S] A`,
we have:

* `g x * g y = 0`: the elements of `M` continue to square to zero.
* `g (r • x) = f r * g x` and `g (op r • x) = g x * f r`: scalar multiplication on the left and
  right is sent to left- and right- multiplication by the image under `f`.

See `TrivSqZeroExt.liftEquiv` for this as an equiv; namely that any such algebra morphism can be
factored in this way.

When `R` is commutative, this can be invoked with `f = Algebra.ofId R A`, which satisfies `hfg` and
`hgf`. This version is captured as an equiv by `TrivSqZeroExt.liftEquivOfComm`. -/
def lift (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r) : tsze R M →ₐ[S] A :=
  AlgHom.ofLinearMap
    ((f.comp <| fstHom S R M).toLinearMap + g ∘ₗ (sndHom R M |>.restrictScalars S))
    (show f 1 + g (0 : M) = 1 by rw [map_zero, map_one, add_zero])
    (TrivSqZeroExt.ind fun r₁ m₁ =>
      TrivSqZeroExt.ind fun r₂ m₂ => by
        dsimp
        simp only [add_zero, zero_add, add_mul, mul_add, smul_mul_smul, hg, smul_zero,
          op_smul_eq_smul]
        

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : R →ₐ[S] A
g : M →ₗ[S] A
hg : ∀ (x y : M), g x * g y = 0
hfg : ∀ (r : R) (x : M), g (r • x) = f r * g x
hgf : ∀ (r : R) (x : M), g (op r • x) = g x * f r
r₁ : R
m₁ : M
r₂ : R
m₂ : M
⊢ f (r₁ * r₂) + g (r₁ • m₂ + op r₂ • m₁) = f r₁ * f r₂ + g m₁ * f r₂ + f r₁ * g m₂

Next tactic:
rw [← AlgHom.map_mul, LinearMap.map_add, add_comm (g _), add_assoc, hfg, hgf]
@[simp]
theorem lift_apply_inl (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r)
    (r : R) :
    lift f g hg hfg hgf (inl r) = f r :=
  show f r + g 0 = f r by 

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : R →ₐ[S] A
g : M →ₗ[S] A
hg : ∀ (x y : M), g x * g y = 0
hfg : ∀ (r : R) (x : M), g (r • x) = f r * g x
hgf : ∀ (r : R) (x : M), g (op r • x) = g x * f r
r : R
⊢ f r + g 0 = f r

Next tactic:
rw [map_zero, add_zero]
@[simp]
theorem lift_apply_inr (f : R →ₐ[S] A) (g : M →ₗ[S] A)
    (hg : ∀ x y, g x * g y = 0)
    (hfg : ∀ r x, g (r • x) = f r * g x)
    (hgf : ∀ r x, g (op r • x) = g x * f r)
    (m : M) :
    lift f g hg hfg hgf (inr m) = g m :=
  show f 0 + g m = g m by 

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : R →ₐ[S] A
g : M →ₗ[S] A
hg : ∀ (x y : M), g x * g y = 0
hfg : ∀ (r : R) (x : M), g (r • x) = f r * g x
hgf : ∀ (r : R) (x : M), g (op r • x) = g x * f r
m : M
⊢ f 0 + g m = g m

Next tactic:
rw [map_zero, zero_add]
/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A) := by
  

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
⊢ { f // ∀ (x y : M), f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A)

Next tactic:
refine Equiv.trans ?_ liftEquiv
/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A) := by
  refine Equiv.trans ?_ liftEquiv
  

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
⊢ { f // ∀ (x y : M), f x * f y = 0 } ≃
    { fg //
      (∀ (x y : M), fg.2 x * fg.2 y = 0) ∧
        (∀ (r : R') (x : M), fg.2 (r • x) = fg.1 r * fg.2 x) ∧ ∀ (r : R') (x : M), fg.2 (op r • x) = fg.2 x * fg.1 r }

Next tactic:
exact {
    toFun := fun f => ⟨(Algebra.ofId _ _, f.val), f.prop,
      fun r x => by simp [Algebra.smul_def, Algebra.ofId_apply],
      fun r x => by simp [Algebra.smul_def, Algebra.ofId_apply, Algebra.commutes]⟩
    invFun := fun fg => ⟨fg.val.2, fg.prop.1⟩
    left_inv := fun f => rfl
    right_inv := fun fg => Subtype.ext <|
      Prod.ext (AlgHom.toLinearMap_injective <| LinearMap.ext_ring <| by simp)
      rfl }
/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A) := by
  refine Equiv.trans ?_ liftEquiv
  exact {
    toFun := fun f => ⟨(Algebra.ofId _ _, f.val), f.prop,
      fun r x => by 

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : { f // ∀ (x y : M), f x * f y = 0 }
r : R'
x : M
⊢ (Algebra.ofId R' A, ↑f).2 (r • x) = (Algebra.ofId R' A, ↑f).1 r * (Algebra.ofId R' A, ↑f).2 x

Next tactic:
simp [Algebra.smul_def, Algebra.ofId_apply]
/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A) := by
  refine Equiv.trans ?_ liftEquiv
  exact {
    toFun := fun f => ⟨(Algebra.ofId _ _, f.val), f.prop,
      fun r x => by simp [Algebra.smul_def, Algebra.ofId_apply],
      fun r x => by 

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
f : { f // ∀ (x y : M), f x * f y = 0 }
r : R'
x : M
⊢ (Algebra.ofId R' A, ↑f).2 (op r • x) = (Algebra.ofId R' A, ↑f).2 x * (Algebra.ofId R' A, ↑f).1 r

Next tactic:
simp [Algebra.smul_def, Algebra.ofId_apply, Algebra.commutes]
/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A) := by
  refine Equiv.trans ?_ liftEquiv
  exact {
    toFun := fun f => ⟨(Algebra.ofId _ _, f.val), f.prop,
      fun r x => by simp [Algebra.smul_def, Algebra.ofId_apply],
      fun r x => by simp [Algebra.smul_def, Algebra.ofId_apply, Algebra.commutes]⟩
    invFun := fun fg => ⟨fg.val.2, fg.prop.1⟩
    left_inv := fun f => rfl
    right_inv := fun fg => Subtype.ext <|
      Prod.ext (AlgHom.toLinearMap_injective <| LinearMap.ext_ring <| by 

Proof state:
S : Type u_1
R R' : Type u
M : Type v
inst✝¹⁸ : CommSemiring S
inst✝¹⁷ : Semiring R
inst✝¹⁶ : CommSemiring R'
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Algebra S R
inst✝¹³ : Algebra S R'
inst✝¹² : Module S M
inst✝¹¹ : Module R M
inst✝¹⁰ : Module Rᵐᵒᵖ M
inst✝⁹ : SMulCommClass R Rᵐᵒᵖ M
inst✝⁸ : IsScalarTower S R M
inst✝⁷ : IsScalarTower S Rᵐᵒᵖ M
inst✝⁶ : Module R' M
inst✝⁵ : Module R'ᵐᵒᵖ M
inst✝⁴ : IsCentralScalar R' M
inst✝³ : IsScalarTower S R' M
A : Type u_2
inst✝² : Semiring A
inst✝¹ : Algebra S A
inst✝ : Algebra R' A
fg :
  { fg //
    (∀ (x y : M), fg.2 x * fg.2 y = 0) ∧
      (∀ (r : R') (x : M), fg.2 (r • x) = fg.1 r * fg.2 x) ∧ ∀ (r : R') (x : M), fg.2 (op r • x) = fg.2 x * fg.1 r }
⊢ (AlgHom.toLinearMap
        (↑((fun f =>
                { val := (Algebra.ofId R' A, ↑f),
                  property :=
                    (_ :
                      (∀ (x y : M), (Algebra.ofId R' A, ↑f).2 x * (Algebra.ofId R' A, ↑f).2 y = 0) ∧
                        (∀ (r : R') (x : M),
                            (Algebra.ofId R' A, ↑f).2 (r • x) =
                              (Algebra.ofId R' A, ↑f).1 r * (Algebra.ofId R' A, ↑f).2 x) ∧
                          ∀ (r : R') (x : M),
                            (Algebra.ofId R' A, ↑f).2 (op r • x) =
                              (Algebra.ofId R' A, ↑f).2 x * (Algebra.ofId R' A, ↑f).1 r) })
              ((fun fg => { val := (↑fg).2, property := (_ : ∀ (x y : M), (↑fg).2 x * (↑fg).2 y = 0) }) fg))).1)
      1 =
    (AlgHom.toLinearMap (↑fg).1) 1

Next tactic:
simp
/-- Reformulation of `equicontinuousAt_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε := by
  

Proof state:
α : Type u_1
β : Type u_2
ι✝ : Type u_3
inst✝¹ : PseudoMetricSpace α
ι : Type u_4
inst✝ : TopologicalSpace β
F : ι → β → α
x₀ : β
⊢ EquicontinuousAt F x₀ ↔ ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε

Next tactic:
rw [equicontinuousAt_iff_pair]
/-- Reformulation of `equicontinuousAt_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε := by
  rw [equicontinuousAt_iff_pair]
  

Proof state:
α : Type u_1
β : Type u_2
ι✝ : Type u_3
inst✝¹ : PseudoMetricSpace α
ι : Type u_4
inst✝ : TopologicalSpace β
F : ι → β → α
x₀ : β
⊢ (∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U) ↔
    ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε

Next tactic:
constructor
/-- Reformulation of `equicontinuousAt_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε := by
  rw [equicontinuousAt_iff_pair]
  constructor <;> 

Proof state:
case mp
α : Type u_1
β : Type u_2
ι✝ : Type u_3
inst✝¹ : PseudoMetricSpace α
ι : Type u_4
inst✝ : TopologicalSpace β
F : ι → β → α
x₀ : β
⊢ (∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U) →
    ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε

Next tactic:
intro H
/-- Reformulation of `equicontinuousAt_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε := by
  rw [equicontinuousAt_iff_pair]
  constructor <;> 

Proof state:
case mpr
α : Type u_1
β : Type u_2
ι✝ : Type u_3
inst✝¹ : PseudoMetricSpace α
ι : Type u_4
inst✝ : TopologicalSpace β
F : ι → β → α
x₀ : β
⊢ (∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε) →
    ∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U

Next tactic:
intro H
/-- Reformulation of `equicontinuousAt_iff_pair` for families of functions taking values in a
(pseudo) metric space. -/
protected theorem equicontinuousAt_iff_pair {ι : Type*} [TopologicalSpace β] {F : ι → β → α}
    {x₀ : β} :
    EquicontinuousAt F x₀ ↔
      ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ i, dist (F i x) (F i x') < ε := by
  rw [equicontinuousAt_iff_pair]
  constructor <;> intro H
  · 

Proof state:
case mp
α : Type u_1
β : Type u_2
ι✝ : Type u_3
inst✝¹ : PseudoMetricSpace α
ι : Type u_4
inst✝ : TopologicalSpace β
F : ι → β → α
x₀ : β
H : ∀ U ∈ 𝓤 α, ∃ V ∈ 𝓝 x₀, ∀ x ∈ V, ∀ y ∈ V, ∀ (i : ι), (F i x, F i y) ∈ U
⊢ ∀ ε > 0, ∃ U ∈ 𝓝 x₀, ∀ x ∈ U, ∀ x' ∈ U, ∀ (i : ι), dist (F i x) (F i x') < ε

Next tactic:
intro ε hε