l3lab/ntp-mathlib huggingface dataset:
/-- *Engel's theorem*.

Note that this implies all traditional forms of Engel's theorem via
`LieModule.nontrivial_max_triv_of_isNilpotent`, `LieModule.isNilpotent_iff_forall`,
`LieAlgebra.isNilpotent_iff_forall`. -/
theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.IsEngelian R L := by
  intro M _i1 _i2 _i3 _i4 h
  rw [← isNilpotent_range_toEndomorphism_iff]
  let L' := (toEndomorphism R L M).range
  replace h : ∀ y : L', _root_.IsNilpotent (y : Module.End R M)
  · rintro ⟨-, ⟨y, rfl⟩⟩
    simp [h]
  change LieModule.IsNilpotent R L' M
  let s := {K : LieSubalgebra R L' | LieAlgebra.IsEngelian R K}
  have hs : s.Nonempty := ⟨⊥, LieAlgebra.isEngelian_of_subsingleton⟩
  suffices ⊤ ∈ s by
    rw [← isNilpotent_of_top_iff]
    apply this M
    simp [LieSubalgebra.toEndomorphism_eq, h]
  have : ∀ K ∈ s, K ≠ ⊤ → ∃ K' ∈ s, K < K' := by
    rintro K (hK₁ : LieAlgebra.IsEngelian R K) hK₂
    apply LieAlgebra.exists_engelian_lieSubalgebra_of_lt_normalizer hK₁
    apply lt_of_le_of_ne K.le_normalizer
    rw [Ne.def, eq_comm, K.normalizer_eq_self_iff, ← Ne.def, ←
      LieSubmodule.nontrivial_iff_ne_bot R K]
    have : Nontrivial (L' ⧸ K.toLieSubmodule) := by
      replace hK₂ : K.toLieSubmodule ≠ ⊤ := by
        rwa [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, K.coe_toLieSubmodule,
          LieSubmodule.top_coeSubmodule, ← LieSubalgebra.top_coe_submodule,
          K.coe_to_submodule_eq_iff]
      exact Submodule.Quotient.nontrivial_of_lt_top _ hK₂.lt_top
    have : LieModule.IsNilpotent R K (L' ⧸ K.toLieSubmodule) := by
      -- Porting note: was refine' hK₁ _ fun x => _
      apply hK₁
      intro x
      have hx := LieAlgebra.isNilpotent_ad_of_isNilpotent (h x)
      apply Module.End.IsNilpotent.mapQ ?_ hx
      -- Porting note: mathlib3 solved this on its own with `submodule.mapq_linear._proof_5`
      intro X HX
      

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M✝ : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M✝
inst✝³ : Module R M✝
inst✝² : LieRingModule L M✝
inst✝¹ : LieModule R L M✝
inst✝ : IsNoetherian R L
M : Type u_1
_i1 : AddCommGroup M
_i2 : Module R M
_i3 : LieRingModule L M
_i4 : LieModule R L M
L' : LieSubalgebra R (Module.End R M) := LieHom.range (toEndomorphism R L M)
h : ∀ (y : ↥L'), _root_.IsNilpotent ↑y
s : Set (LieSubalgebra R ↥L') := {K | IsEngelian R ↥K}
hs : Set.Nonempty s
K : LieSubalgebra R ↥L'
hK₁ : IsEngelian R ↥K
hK₂ : K ≠ ⊤
this : Nontrivial (↥L' ⧸ LieSubalgebra.toLieSubmodule K)
x : ↥K
hx : _root_.IsNilpotent ((ad R ↥L') ↑x)
X : ↥L'
HX : X ∈ ↑(LieSubalgebra.toLieSubmodule K)
⊢ X ∈ Submodule.comap ((ad R ↥L') ↑x) ↑(LieSubalgebra.toLieSubmodule K)

Next tactic:
simp only [LieSubalgebra.coe_toLieSubmodule, LieSubalgebra.mem_coe_submodule] at HX
/-- *Engel's theorem*.

Note that this implies all traditional forms of Engel's theorem via
`LieModule.nontrivial_max_triv_of_isNilpotent`, `LieModule.isNilpotent_iff_forall`,
`LieAlgebra.isNilpotent_iff_forall`. -/
theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.IsEngelian R L := by
  intro M _i1 _i2 _i3 _i4 h
  rw [← isNilpotent_range_toEndomorphism_iff]
  let L' := (toEndomorphism R L M).range
  replace h : ∀ y : L', _root_.IsNilpotent (y : Module.End R M)
  · rintro ⟨-, ⟨y, rfl⟩⟩
    simp [h]
  change LieModule.IsNilpotent R L' M
  let s := {K : LieSubalgebra R L' | LieAlgebra.IsEngelian R K}
  have hs : s.Nonempty := ⟨⊥, LieAlgebra.isEngelian_of_subsingleton⟩
  suffices ⊤ ∈ s by
    rw [← isNilpotent_of_top_iff]
    apply this M
    simp [LieSubalgebra.toEndomorphism_eq, h]
  have : ∀ K ∈ s, K ≠ ⊤ → ∃ K' ∈ s, K < K' := by
    rintro K (hK₁ : LieAlgebra.IsEngelian R K) hK₂
    apply LieAlgebra.exists_engelian_lieSubalgebra_of_lt_normalizer hK₁
    apply lt_of_le_of_ne K.le_normalizer
    rw [Ne.def, eq_comm, K.normalizer_eq_self_iff, ← Ne.def, ←
      LieSubmodule.nontrivial_iff_ne_bot R K]
    have : Nontrivial (L' ⧸ K.toLieSubmodule) := by
      replace hK₂ : K.toLieSubmodule ≠ ⊤ := by
        rwa [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, K.coe_toLieSubmodule,
          LieSubmodule.top_coeSubmodule, ← LieSubalgebra.top_coe_submodule,
          K.coe_to_submodule_eq_iff]
      exact Submodule.Quotient.nontrivial_of_lt_top _ hK₂.lt_top
    have : LieModule.IsNilpotent R K (L' ⧸ K.toLieSubmodule) := by
      -- Porting note: was refine' hK₁ _ fun x => _
      apply hK₁
      intro x
      have hx := LieAlgebra.isNilpotent_ad_of_isNilpotent (h x)
      apply Module.End.IsNilpotent.mapQ ?_ hx
      -- Porting note: mathlib3 solved this on its own with `submodule.mapq_linear._proof_5`
      intro X HX
      simp only [LieSubalgebra.coe_toLieSubmodule, LieSubalgebra.mem_coe_submodule] at HX
      

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M✝ : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M✝
inst✝³ : Module R M✝
inst✝² : LieRingModule L M✝
inst✝¹ : LieModule R L M✝
inst✝ : IsNoetherian R L
M : Type u_1
_i1 : AddCommGroup M
_i2 : Module R M
_i3 : LieRingModule L M
_i4 : LieModule R L M
L' : LieSubalgebra R (Module.End R M) := LieHom.range (toEndomorphism R L M)
h : ∀ (y : ↥L'), _root_.IsNilpotent ↑y
s : Set (LieSubalgebra R ↥L') := {K | IsEngelian R ↥K}
hs : Set.Nonempty s
K : LieSubalgebra R ↥L'
hK₁ : IsEngelian R ↥K
hK₂ : K ≠ ⊤
this : Nontrivial (↥L' ⧸ LieSubalgebra.toLieSubmodule K)
x : ↥K
hx : _root_.IsNilpotent ((ad R ↥L') ↑x)
X : ↥L'
HX : X ∈ K
⊢ X ∈ Submodule.comap ((ad R ↥L') ↑x) ↑(LieSubalgebra.toLieSubmodule K)

Next tactic:
simp only [LieSubalgebra.coe_toLieSubmodule, Submodule.mem_comap, ad_apply,
        LieSubalgebra.mem_coe_submodule]
/-- *Engel's theorem*.

Note that this implies all traditional forms of Engel's theorem via
`LieModule.nontrivial_max_triv_of_isNilpotent`, `LieModule.isNilpotent_iff_forall`,
`LieAlgebra.isNilpotent_iff_forall`. -/
theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.IsEngelian R L := by
  intro M _i1 _i2 _i3 _i4 h
  rw [← isNilpotent_range_toEndomorphism_iff]
  let L' := (toEndomorphism R L M).range
  replace h : ∀ y : L', _root_.IsNilpotent (y : Module.End R M)
  · rintro ⟨-, ⟨y, rfl⟩⟩
    simp [h]
  change LieModule.IsNilpotent R L' M
  let s := {K : LieSubalgebra R L' | LieAlgebra.IsEngelian R K}
  have hs : s.Nonempty := ⟨⊥, LieAlgebra.isEngelian_of_subsingleton⟩
  suffices ⊤ ∈ s by
    rw [← isNilpotent_of_top_iff]
    apply this M
    simp [LieSubalgebra.toEndomorphism_eq, h]
  have : ∀ K ∈ s, K ≠ ⊤ → ∃ K' ∈ s, K < K' := by
    rintro K (hK₁ : LieAlgebra.IsEngelian R K) hK₂
    apply LieAlgebra.exists_engelian_lieSubalgebra_of_lt_normalizer hK₁
    apply lt_of_le_of_ne K.le_normalizer
    rw [Ne.def, eq_comm, K.normalizer_eq_self_iff, ← Ne.def, ←
      LieSubmodule.nontrivial_iff_ne_bot R K]
    have : Nontrivial (L' ⧸ K.toLieSubmodule) := by
      replace hK₂ : K.toLieSubmodule ≠ ⊤ := by
        rwa [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, K.coe_toLieSubmodule,
          LieSubmodule.top_coeSubmodule, ← LieSubalgebra.top_coe_submodule,
          K.coe_to_submodule_eq_iff]
      exact Submodule.Quotient.nontrivial_of_lt_top _ hK₂.lt_top
    have : LieModule.IsNilpotent R K (L' ⧸ K.toLieSubmodule) := by
      -- Porting note: was refine' hK₁ _ fun x => _
      apply hK₁
      intro x
      have hx := LieAlgebra.isNilpotent_ad_of_isNilpotent (h x)
      apply Module.End.IsNilpotent.mapQ ?_ hx
      -- Porting note: mathlib3 solved this on its own with `submodule.mapq_linear._proof_5`
      intro X HX
      simp only [LieSubalgebra.coe_toLieSubmodule, LieSubalgebra.mem_coe_submodule] at HX
      simp only [LieSubalgebra.coe_toLieSubmodule, Submodule.mem_comap, ad_apply,
        LieSubalgebra.mem_coe_submodule]
      

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M✝ : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M✝
inst✝³ : Module R M✝
inst✝² : LieRingModule L M✝
inst✝¹ : LieModule R L M✝
inst✝ : IsNoetherian R L
M : Type u_1
_i1 : AddCommGroup M
_i2 : Module R M
_i3 : LieRingModule L M
_i4 : LieModule R L M
L' : LieSubalgebra R (Module.End R M) := LieHom.range (toEndomorphism R L M)
h : ∀ (y : ↥L'), _root_.IsNilpotent ↑y
s : Set (LieSubalgebra R ↥L') := {K | IsEngelian R ↥K}
hs : Set.Nonempty s
K : LieSubalgebra R ↥L'
hK₁ : IsEngelian R ↥K
hK₂ : K ≠ ⊤
this : Nontrivial (↥L' ⧸ LieSubalgebra.toLieSubmodule K)
x : ↥K
hx : _root_.IsNilpotent ((ad R ↥L') ↑x)
X : ↥L'
HX : X ∈ K
⊢ ⁅↑x, X⁆ ∈ K

Next tactic:
exact LieSubalgebra.lie_mem K x.prop HX
/-- *Engel's theorem*.

Note that this implies all traditional forms of Engel's theorem via
`LieModule.nontrivial_max_triv_of_isNilpotent`, `LieModule.isNilpotent_iff_forall`,
`LieAlgebra.isNilpotent_iff_forall`. -/
theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.IsEngelian R L := by
  intro M _i1 _i2 _i3 _i4 h
  rw [← isNilpotent_range_toEndomorphism_iff]
  let L' := (toEndomorphism R L M).range
  replace h : ∀ y : L', _root_.IsNilpotent (y : Module.End R M)
  · rintro ⟨-, ⟨y, rfl⟩⟩
    simp [h]
  change LieModule.IsNilpotent R L' M
  let s := {K : LieSubalgebra R L' | LieAlgebra.IsEngelian R K}
  have hs : s.Nonempty := ⟨⊥, LieAlgebra.isEngelian_of_subsingleton⟩
  suffices ⊤ ∈ s by
    rw [← isNilpotent_of_top_iff]
    apply this M
    simp [LieSubalgebra.toEndomorphism_eq, h]
  have : ∀ K ∈ s, K ≠ ⊤ → ∃ K' ∈ s, K < K' := by
    rintro K (hK₁ : LieAlgebra.IsEngelian R K) hK₂
    apply LieAlgebra.exists_engelian_lieSubalgebra_of_lt_normalizer hK₁
    apply lt_of_le_of_ne K.le_normalizer
    rw [Ne.def, eq_comm, K.normalizer_eq_self_iff, ← Ne.def, ←
      LieSubmodule.nontrivial_iff_ne_bot R K]
    have : Nontrivial (L' ⧸ K.toLieSubmodule) := by
      replace hK₂ : K.toLieSubmodule ≠ ⊤ := by
        rwa [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, K.coe_toLieSubmodule,
          LieSubmodule.top_coeSubmodule, ← LieSubalgebra.top_coe_submodule,
          K.coe_to_submodule_eq_iff]
      exact Submodule.Quotient.nontrivial_of_lt_top _ hK₂.lt_top
    have : LieModule.IsNilpotent R K (L' ⧸ K.toLieSubmodule) := by
      -- Porting note: was refine' hK₁ _ fun x => _
      apply hK₁
      intro x
      have hx := LieAlgebra.isNilpotent_ad_of_isNilpotent (h x)
      apply Module.End.IsNilpotent.mapQ ?_ hx
      -- Porting note: mathlib3 solved this on its own with `submodule.mapq_linear._proof_5`
      intro X HX
      simp only [LieSubalgebra.coe_toLieSubmodule, LieSubalgebra.mem_coe_submodule] at HX
      simp only [LieSubalgebra.coe_toLieSubmodule, Submodule.mem_comap, ad_apply,
        LieSubalgebra.mem_coe_submodule]
      exact LieSubalgebra.lie_mem K x.prop HX
    

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M✝ : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M✝
inst✝³ : Module R M✝
inst✝² : LieRingModule L M✝
inst✝¹ : LieModule R L M✝
inst✝ : IsNoetherian R L
M : Type u_1
_i1 : AddCommGroup M
_i2 : Module R M
_i3 : LieRingModule L M
_i4 : LieModule R L M
L' : LieSubalgebra R (Module.End R M) := LieHom.range (toEndomorphism R L M)
h : ∀ (y : ↥L'), _root_.IsNilpotent ↑y
s : Set (LieSubalgebra R ↥L') := {K | IsEngelian R ↥K}
hs : Set.Nonempty s
K : LieSubalgebra R ↥L'
hK₁ : IsEngelian R ↥K
hK₂ : K ≠ ⊤
this✝ : Nontrivial (↥L' ⧸ LieSubalgebra.toLieSubmodule K)
this : LieModule.IsNilpotent R (↥K) (↥L' ⧸ LieSubalgebra.toLieSubmodule K)
⊢ Nontrivial ↥↑(maxTrivSubmodule R (↥K) (↥L' ⧸ LieSubalgebra.toLieSubmodule K))

Next tactic:
exact nontrivial_max_triv_of_isNilpotent R K (L' ⧸ K.toLieSubmodule)
/-- *Engel's theorem*.

Note that this implies all traditional forms of Engel's theorem via
`LieModule.nontrivial_max_triv_of_isNilpotent`, `LieModule.isNilpotent_iff_forall`,
`LieAlgebra.isNilpotent_iff_forall`. -/
theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.IsEngelian R L := by
  intro M _i1 _i2 _i3 _i4 h
  rw [← isNilpotent_range_toEndomorphism_iff]
  let L' := (toEndomorphism R L M).range
  replace h : ∀ y : L', _root_.IsNilpotent (y : Module.End R M)
  · rintro ⟨-, ⟨y, rfl⟩⟩
    simp [h]
  change LieModule.IsNilpotent R L' M
  let s := {K : LieSubalgebra R L' | LieAlgebra.IsEngelian R K}
  have hs : s.Nonempty := ⟨⊥, LieAlgebra.isEngelian_of_subsingleton⟩
  suffices ⊤ ∈ s by
    rw [← isNilpotent_of_top_iff]
    apply this M
    simp [LieSubalgebra.toEndomorphism_eq, h]
  have : ∀ K ∈ s, K ≠ ⊤ → ∃ K' ∈ s, K < K' := by
    rintro K (hK₁ : LieAlgebra.IsEngelian R K) hK₂
    apply LieAlgebra.exists_engelian_lieSubalgebra_of_lt_normalizer hK₁
    apply lt_of_le_of_ne K.le_normalizer
    rw [Ne.def, eq_comm, K.normalizer_eq_self_iff, ← Ne.def, ←
      LieSubmodule.nontrivial_iff_ne_bot R K]
    have : Nontrivial (L' ⧸ K.toLieSubmodule) := by
      replace hK₂ : K.toLieSubmodule ≠ ⊤ := by
        rwa [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, K.coe_toLieSubmodule,
          LieSubmodule.top_coeSubmodule, ← LieSubalgebra.top_coe_submodule,
          K.coe_to_submodule_eq_iff]
      exact Submodule.Quotient.nontrivial_of_lt_top _ hK₂.lt_top
    have : LieModule.IsNilpotent R K (L' ⧸ K.toLieSubmodule) := by
      -- Porting note: was refine' hK₁ _ fun x => _
      apply hK₁
      intro x
      have hx := LieAlgebra.isNilpotent_ad_of_isNilpotent (h x)
      apply Module.End.IsNilpotent.mapQ ?_ hx
      -- Porting note: mathlib3 solved this on its own with `submodule.mapq_linear._proof_5`
      intro X HX
      simp only [LieSubalgebra.coe_toLieSubmodule, LieSubalgebra.mem_coe_submodule] at HX
      simp only [LieSubalgebra.coe_toLieSubmodule, Submodule.mem_comap, ad_apply,
        LieSubalgebra.mem_coe_submodule]
      exact LieSubalgebra.lie_mem K x.prop HX
    exact nontrivial_max_triv_of_isNilpotent R K (L' ⧸ K.toLieSubmodule)
  haveI _i5 : IsNoetherian R L' := by
    -- Porting note: was
    -- isNoetherian_of_surjective L _ (LinearMap.range_rangeRestrict (toEndomorphism R L M))
    -- abusing the relation between `LieHom.rangeRestrict` and `LinearMap.rangeRestrict`
    

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M✝ : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M✝
inst✝³ : Module R M✝
inst✝² : LieRingModule L M✝
inst✝¹ : LieModule R L M✝
inst✝ : IsNoetherian R L
M : Type u_1
_i1 : AddCommGroup M
_i2 : Module R M
_i3 : LieRingModule L M
_i4 : LieModule R L M
L' : LieSubalgebra R (Module.End R M) := LieHom.range (toEndomorphism R L M)
h : ∀ (y : ↥L'), _root_.IsNilpotent ↑y
s : Set (LieSubalgebra R ↥L') := {K | IsEngelian R ↥K}
hs : Set.Nonempty s
this : ∀ K ∈ s, K ≠ ⊤ → ∃ K' ∈ s, K < K'
⊢ IsNoetherian R ↥L'

Next tactic:
refine isNoetherian_of_surjective L (LieHom.rangeRestrict (toEndomorphism R L M)) ?_
/-- Engel's theorem. -/
theorem LieModule.isNilpotent_iff_forall' [IsNoetherian R M] :
    LieModule.IsNilpotent R L M ↔ ∀ x, _root_.IsNilpotent <| toEndomorphism R L M x := by
  

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : IsNoetherian R M
⊢ IsNilpotent R L M ↔ ∀ (x : L), _root_.IsNilpotent ((toEndomorphism R L M) x)

Next tactic:
rw [← isNilpotent_range_toEndomorphism_iff, LieModule.isNilpotent_iff_forall]
/-- Engel's theorem. -/
theorem LieModule.isNilpotent_iff_forall' [IsNoetherian R M] :
    LieModule.IsNilpotent R L M ↔ ∀ x, _root_.IsNilpotent <| toEndomorphism R L M x := by
  rw [← isNilpotent_range_toEndomorphism_iff, LieModule.isNilpotent_iff_forall]; 

Proof state:
R : Type u₁
L : Type u₂
L₂ : Type u₃
M : Type u₄
inst✝⁹ : CommRing R
inst✝⁸ : LieRing L
inst✝⁷ : LieAlgebra R L
inst✝⁶ : LieRing L₂
inst✝⁵ : LieAlgebra R L₂
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : IsNoetherian R M
⊢ (∀ (x : ↥(LieHom.range (toEndomorphism R L M))),
      _root_.IsNilpotent ((toEndomorphism R (↥(LieHom.range (toEndomorphism R L M))) M) x)) ↔
    ∀ (x : L), _root_.IsNilpotent ((toEndomorphism R L M) x)

Next tactic:
simp
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
⊢ PushoutCocone f g

Next tactic:
letI := RingHom.toAlgebra f
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this : Algebra ↑R ↑A := RingHom.toAlgebra f
⊢ PushoutCocone f g

Next tactic:
letI := RingHom.toAlgebra g
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  

Proof state:
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ PushoutCocone f g

Next tactic:
fapply Limits.PushoutCocone.mk
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  

Proof state:
case W
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ CommRingCat
case inl
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ A ⟶ ?W
case inr
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶ ?W
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ f ≫ ?inl = g ≫ ?inr

Next tactic:
show CommRingCat
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; 

Proof state:
case W
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ CommRingCat
case inl
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ A ⟶
    let_fun this := ?W;
    this
case inr
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶
    let_fun this := ?W;
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ f ≫ ?inl = g ≫ ?inr

Next tactic:
exact CommRingCat.of (A ⊗[R] B)
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  

Proof state:
case inl
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ A ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case inr
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ f ≫ ?inl = g ≫ ?inr

Next tactic:
show A ⟶ _
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; 

Proof state:
case inl
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ A ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case inr
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := ?inl;
      this) =
    g ≫ ?inr

Next tactic:
exact Algebra.TensorProduct.includeLeftRingHom
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; exact Algebra.TensorProduct.includeLeftRingHom
  

Proof state:
case inr
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := Algebra.TensorProduct.includeLeftRingHom;
      this) =
    g ≫ ?inr

Next tactic:
show B ⟶ _
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; exact Algebra.TensorProduct.includeLeftRingHom
  show B ⟶ _; 

Proof state:
case inr
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ B ⟶
    let_fun this := of (↑A ⊗[↑R] ↑B);
    this
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := Algebra.TensorProduct.includeLeftRingHom;
      this) =
    g ≫
      let_fun this := ?inr;
      this

Next tactic:
exact Algebra.TensorProduct.includeRight.toRingHom
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; exact Algebra.TensorProduct.includeLeftRingHom
  show B ⟶ _; exact Algebra.TensorProduct.includeRight.toRingHom
  

Proof state:
case eq
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
⊢ (f ≫
      let_fun this := Algebra.TensorProduct.includeLeftRingHom;
      this) =
    g ≫
      let_fun this := ↑Algebra.TensorProduct.includeRight;
      this

Next tactic:
ext r
/-- The explicit cocone with tensor products as the fibered product in `CommRingCat`. -/
def pushoutCocone : Limits.PushoutCocone f g := by
  letI := RingHom.toAlgebra f
  letI := RingHom.toAlgebra g
  fapply Limits.PushoutCocone.mk
  show CommRingCat; exact CommRingCat.of (A ⊗[R] B)
  show A ⟶ _; exact Algebra.TensorProduct.includeLeftRingHom
  show B ⟶ _; exact Algebra.TensorProduct.includeRight.toRingHom
  ext r
  

Proof state:
case eq.w
R A B : CommRingCat
f : R ⟶ A
g : R ⟶ B
this✝ : Algebra ↑R ↑A := RingHom.toAlgebra f
this : Algebra ↑R ↑B := RingHom.toAlgebra g
r : (forget CommRingCat).obj R
⊢ (f ≫
        let_fun this := Algebra.TensorProduct.includeLeftRingHom;
        this)
      r =
    (g ≫
        let_fun this := ↑Algebra.TensorProduct.includeRight;
        this)
      r

Next tactic:
trans algebraMap R (A ⊗[R] B) r