l3lab/ntp-mathlib huggingface dataset:
theorem KaehlerDifferential.kerTotal_eq :
    LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S)) =
      KaehlerDifferential.kerTotal R S := by
  apply le_antisymm
  · conv_rhs => rw [← (KaehlerDifferential.kerTotal R S).ker_mkQ]
    rw [← KaehlerDifferential.derivationQuotKerTotal_lift_comp_total]
    exact LinearMap.ker_le_ker_comp _ _
  · rw [KaehlerDifferential.kerTotal, Submodule.span_le]
    rintro _ ((⟨⟨x, y⟩, rfl⟩ | ⟨⟨x, y⟩, rfl⟩) | ⟨x, rfl⟩) <;> dsimp <;> 

Proof state:
case a.inr.intro
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
x : R
⊢ (fun₀ | (algebraMap R S) x => 1) ∈ ↑(LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))

Next tactic:
simp [LinearMap.mem_ker]
theorem KaehlerDifferential.total_surjective :
    Function.Surjective (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S)) := by
  

Proof state:
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
⊢ Function.Surjective ⇑(Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))

Next tactic:
rw [← LinearMap.range_eq_top, Finsupp.range_total, KaehlerDifferential.span_range_derivation]
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      

Proof state:
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
⊢ Function.LeftInverse ⇑(Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S))
    { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom.toFun

Next tactic:
intro x
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      

Proof state:
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : (S →₀ S) ⧸ kerTotal R S
⊢ (Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S))
      (AddHom.toFun
        { toAddHom := src✝.toAddHom,
            map_smul' :=
              (_ :
                ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        x) =
    x

Next tactic:
obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      

Proof state:
case intro
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : S →₀ S
⊢ (Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S))
      (AddHom.toFun
        { toAddHom := src✝.toAddHom,
            map_smul' :=
              (_ :
                ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        ((Submodule.mkQ (kerTotal R S)) x)) =
    (Submodule.mkQ (kerTotal R S)) x

Next tactic:
exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
    right_inv := by
      

Proof state:
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
⊢ Function.RightInverse ⇑(Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S))
    { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom.toFun

Next tactic:
intro x
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
    right_inv := by
      intro x
      

Proof state:
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : Ω[S⁄R]
⊢ AddHom.toFun
      { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ((Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S)) x) =
    x

Next tactic:
obtain ⟨x, rfl⟩ := KaehlerDifferential.total_surjective R S x
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
    right_inv := by
      intro x
      obtain ⟨x, rfl⟩ := KaehlerDifferential.total_surjective R S x
      

Proof state:
case intro
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : S →₀ S
⊢ AddHom.toFun
      { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ((Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S)) ((Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x)) =
    (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x

Next tactic:
have := LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S) x
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
    right_inv := by
      intro x
      obtain ⟨x, rfl⟩ := KaehlerDifferential.total_surjective R S x
      have := LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S) x
      

Proof state:
case intro
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : S →₀ S
this :
  (Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S) ∘ₗ Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x =
    (Submodule.mkQ (kerTotal R S)) x
⊢ AddHom.toFun
      { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ((Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S)) ((Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x)) =
    (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x

Next tactic:
rw [LinearMap.comp_apply] at this
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
    right_inv := by
      intro x
      obtain ⟨x, rfl⟩ := KaehlerDifferential.total_surjective R S x
      have := LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S) x
      rw [LinearMap.comp_apply] at this
      

Proof state:
case intro
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : S →₀ S
this :
  (Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S)) ((Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x) =
    (Submodule.mkQ (kerTotal R S)) x
⊢ AddHom.toFun
      { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ((Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S)) ((Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x)) =
    (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x

Next tactic:
rw [this]
/-- `Ω[S⁄R]` is isomorphic to `S` copies of `S` with kernel `KaehlerDifferential.kerTotal`. -/
@[simps!]
noncomputable def KaehlerDifferential.quotKerTotalEquiv :
    ((S →₀ S) ⧸ KaehlerDifferential.kerTotal R S) ≃ₗ[S] Ω[S⁄R] :=
  { (KaehlerDifferential.kerTotal R S).liftQ
      (Finsupp.total S (Ω[S⁄R]) S (KaehlerDifferential.D R S))
      (KaehlerDifferential.kerTotal_eq R S).ge with
    invFun := (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential
    left_inv := by
      intro x
      obtain ⟨x, rfl⟩ := Submodule.mkQ_surjective _ x
      exact
        LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S : _) x
    right_inv := by
      intro x
      obtain ⟨x, rfl⟩ := KaehlerDifferential.total_surjective R S x
      have := LinearMap.congr_fun (KaehlerDifferential.derivationQuotKerTotal_lift_comp_total R S) x
      rw [LinearMap.comp_apply] at this
      rw [this]
      

Proof state:
case intro
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
src✝ : (S →₀ S) ⧸ kerTotal R S →ₗ[S] Ω[S⁄R] :=
  Submodule.liftQ (kerTotal R S) (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S))
    (_ : kerTotal R S ≤ LinearMap.ker (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)))
x : S →₀ S
this :
  (Derivation.liftKaehlerDifferential (derivationQuotKerTotal R S)) ((Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x) =
    (Submodule.mkQ (kerTotal R S)) x
⊢ AddHom.toFun
      { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : S) (x : (S →₀ S) ⧸ kerTotal R S),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id S) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ((Submodule.mkQ (kerTotal R S)) x) =
    (Finsupp.total S (Ω[S⁄R]) S ⇑(D R S)) x

Next tactic:
rfl
theorem KaehlerDifferential.quotKerTotalEquiv_symm_comp_D :
    (KaehlerDifferential.quotKerTotalEquiv R S).symm.toLinearMap.compDer
        (KaehlerDifferential.D R S) =
      KaehlerDifferential.derivationQuotKerTotal R S := by
  

Proof state:
R : Type u
S : Type v
inst✝⁶ : CommRing R
inst✝⁵ : CommRing S
inst✝⁴ : Algebra R S
M : Type u_1
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : Module S M
inst✝ : IsScalarTower R S M
⊢ (LinearMap.compDer ↑(LinearEquiv.symm (quotKerTotalEquiv R S))) (D R S) = derivationQuotKerTotal R S

Next tactic:
convert (KaehlerDifferential.derivationQuotKerTotal R S).liftKaehlerDifferential_comp
theorem KaehlerDifferential.kerTotal_map (h : Function.Surjective (algebraMap A B)) :
    (KaehlerDifferential.kerTotal R A).map finsupp_map ⊔
        Submodule.span A (Set.range fun x : S => single (algebraMap S B x) (1 : B)) =
      (KaehlerDifferential.kerTotal S B).restrictScalars _ := by
  

Proof state:
R : Type u
S : Type v
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing S
inst✝¹² : Algebra R S
M : Type u_1
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Module R M
inst✝⁹ : Module S M
inst✝⁸ : IsScalarTower R S M
A : Type u_2
B : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra S B
inst✝³ : Algebra R B
inst✝² : Algebra A B
inst✝¹ : IsScalarTower R S B
inst✝ : IsScalarTower R A B
h : Function.Surjective ⇑(algebraMap A B)
⊢ Submodule.map (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
        (kerTotal R A) ⊔
      Submodule.span A (Set.range fun x => fun₀ | (algebraMap S B) x => 1) =
    Submodule.restrictScalars A (kerTotal S B)

Next tactic:
rw [KaehlerDifferential.kerTotal, Submodule.map_span, KaehlerDifferential.kerTotal,
    Submodule.restrictScalars_span _ _ h]
theorem KaehlerDifferential.kerTotal_map (h : Function.Surjective (algebraMap A B)) :
    (KaehlerDifferential.kerTotal R A).map finsupp_map ⊔
        Submodule.span A (Set.range fun x : S => single (algebraMap S B x) (1 : B)) =
      (KaehlerDifferential.kerTotal S B).restrictScalars _ := by
  rw [KaehlerDifferential.kerTotal, Submodule.map_span, KaehlerDifferential.kerTotal,
    Submodule.restrictScalars_span _ _ h]
  -- Porting note: the proof is diverging from the mathlib3 proof here.
  -- `map_sub` and `map_add` are not firing so we need to use `LinearMap.map_*` instead
  

Proof state:
R : Type u
S : Type v
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing S
inst✝¹² : Algebra R S
M : Type u_1
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Module R M
inst✝⁹ : Module S M
inst✝⁸ : IsScalarTower R S M
A : Type u_2
B : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra S B
inst✝³ : Algebra R B
inst✝² : Algebra A B
inst✝¹ : IsScalarTower R S B
inst✝ : IsScalarTower R A B
h : Function.Surjective ⇑(algebraMap A B)
⊢ Submodule.span A
        (⇑(Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B)) ''
          (((Set.range fun x => ((fun₀ | x.1 => 1) + fun₀ | x.2 => 1) - fun₀ | x.1 + x.2 => 1) ∪
              Set.range fun x => ((fun₀ | x.2 => x.1) + fun₀ | x.1 => x.2) - fun₀ | x.1 * x.2 => 1) ∪
            Set.range fun x => fun₀ | (algebraMap R A) x => 1)) ⊔
      Submodule.span A (Set.range fun x => fun₀ | (algebraMap S B) x => 1) =
    Submodule.span A
      (((Set.range fun x => ((fun₀ | x.1 => 1) + fun₀ | x.2 => 1) - fun₀ | x.1 + x.2 => 1) ∪
          Set.range fun x => ((fun₀ | x.2 => x.1) + fun₀ | x.1 => x.2) - fun₀ | x.1 * x.2 => 1) ∪
        Set.range fun x => fun₀ | (algebraMap S B) x => 1)

Next tactic:
simp_rw [Set.image_union, Submodule.span_union, ← Set.image_univ, Set.image_image, Set.image_univ,
    LinearMap.map_sub, LinearMap.map_add]
theorem KaehlerDifferential.kerTotal_map (h : Function.Surjective (algebraMap A B)) :
    (KaehlerDifferential.kerTotal R A).map finsupp_map ⊔
        Submodule.span A (Set.range fun x : S => single (algebraMap S B x) (1 : B)) =
      (KaehlerDifferential.kerTotal S B).restrictScalars _ := by
  rw [KaehlerDifferential.kerTotal, Submodule.map_span, KaehlerDifferential.kerTotal,
    Submodule.restrictScalars_span _ _ h]
  -- Porting note: the proof is diverging from the mathlib3 proof here.
  -- `map_sub` and `map_add` are not firing so we need to use `LinearMap.map_*` instead
  simp_rw [Set.image_union, Submodule.span_union, ← Set.image_univ, Set.image_image, Set.image_univ,
    LinearMap.map_sub, LinearMap.map_add]
  

Proof state:
R : Type u
S : Type v
inst✝¹⁴ : CommRing R
inst✝¹³ : CommRing S
inst✝¹² : Algebra R S
M : Type u_1
inst✝¹¹ : AddCommGroup M
inst✝¹⁰ : Module R M
inst✝⁹ : Module S M
inst✝⁸ : IsScalarTower R S M
A : Type u_2
B : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R A
inst✝⁴ : Algebra S B
inst✝³ : Algebra R B
inst✝² : Algebra A B
inst✝¹ : IsScalarTower R S B
inst✝ : IsScalarTower R A B
h : Function.Surjective ⇑(algebraMap A B)
⊢ Submodule.span A
            (Set.range fun x =>
              (((Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
                    fun₀ | x.1 => 1) +
                  (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
                    fun₀ | x.2 => 1) -
                (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
                  fun₀ | x.1 + x.2 => 1) ⊔
          Submodule.span A
            (Set.range fun x =>
              (((Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
                    fun₀ | x.2 => x.1) +
                  (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
                    fun₀ | x.1 => x.2) -
                (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
                  fun₀ | x.1 * x.2 => 1) ⊔
        Submodule.span A
          (Set.range fun x =>
            (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
              fun₀ | (algebraMap R A) x => 1) ⊔
      Submodule.span A (Set.range fun x => fun₀ | (algebraMap S B) x => 1) =
    Submodule.span A (Set.range fun x => ((fun₀ | x.1 => 1) + fun₀ | x.2 => 1) - fun₀ | x.1 + x.2 => 1) ⊔
        Submodule.span A (Set.range fun x => ((fun₀ | x.2 => x.1) + fun₀ | x.1 => x.2) - fun₀ | x.1 * x.2 => 1) ⊔
      Submodule.span A (Set.range fun x => fun₀ | (algebraMap S B) x => 1)

Next tactic:
simp only [LinearMap.comp_apply, Finsupp.lmapDomain_apply, Finsupp.mapDomain_single,
    Finsupp.mapRange.linearMap_apply, Finsupp.mapRange_single, Algebra.linearMap_apply,
    map_one, map_add, map_mul]