diff --git "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Category_AlgebraCat_Limits.jsonl" "b/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Category_AlgebraCat_Limits.jsonl" deleted file mode 100644--- "a/Extracted/Mathlib/TacticPrediction/Mathlib_Algebra_Category_AlgebraCat_Limits.jsonl" +++ /dev/null @@ -1,32 +0,0 @@ -{"state":"R : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\n⊢ IsLimit (limitCone F)","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n ","nextTactic":"refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_1\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nv : ↑s.pt\n⊢ (fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v) ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · ","nextTactic":"intro j j' f","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_1\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nv : ↑s.pt\nj j' : J\nf : j ⟶ j'\n⊢ (F ⋙ forget (AlgebraCatMax R)).map f ((fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v) j) =\n (fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v) j'","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n ","nextTactic":"exact FunLike.congr_fun (Cone.w s f) v","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_2\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n ","nextTactic":"apply Subtype.ext","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_2.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ ↑((fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1) =\n ↑1","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ","nextTactic":"ext j","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_2.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nj : J\n⊢ ↑((fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1)\n j =\n ↑1 j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n ","nextTactic":"simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_2.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nj : J\n⊢ (s.π.app j) 1 = ↑1 j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n ","nextTactic":"erw [map_one]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_2.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nj : J\n⊢ 1 = ↑1 j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n ","nextTactic":"rfl","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_3\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · ","nextTactic":"intro x y","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_3\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\n⊢ OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : �� {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n ","nextTactic":"apply Subtype.ext","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_3.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\n⊢ ↑(OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y)) =\n ↑(OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y)","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ","nextTactic":"ext j","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_3.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\nj : J\n⊢ ↑(OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y))\n j =\n ↑(OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y)\n j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n ","nextTactic":"simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_3.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\nj : J\n⊢ (s.π.app j) (x * y) =\n ↑({ val := fun j => (s.π.app j) x,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) x) } *\n { val := fun j => (s.π.app j) y,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) y) })\n j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n ","nextTactic":"erw [map_mul]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_3.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\nj : J\n⊢ (s.π.app j) x * (s.π.app j) y =\n ↑({ val := fun j => (s.π.app j) x,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) x) } *\n { val := fun j => (s.π.app j) y,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) y) })\n j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n ","nextTactic":"rfl","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_4\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · ","nextTactic":"simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_4\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ { val := fun j => (s.π.app j) 0,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) 0) } =\n 0","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n ","nextTactic":"apply Subtype.ext","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_4.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ ↑{ val := fun j => (s.π.app j) 0,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) 0) } =\n ↑0","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n ","nextTactic":"dsimp","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_4.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ (fun j => (s.π.app j) 0) = ↑0","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n ","nextTactic":"funext u","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_4.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nu : J\n⊢ (s.π.app u) 0 = ↑0 u","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n ","nextTactic":"erw [map_zero]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_4.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nu : J\n⊢ 0 = ↑0 u","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n ","nextTactic":"rfl","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · ","nextTactic":"intro x y","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\n⊢ OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n ","nextTactic":"simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\n⊢ { val := fun j => (s.π.app j) (x + y),\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) (x + y)) } =\n { val := fun j => (s.π.app j) x,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) x) } +\n { val := fun j => (s.π.app j) y,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) y) }","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n ","nextTactic":"apply Subtype.ext","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\n⊢ ↑{ val := fun j => (s.π.app j) (x + y),\n property :=\n (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) (x + y)) } =\n ↑({ val := fun j => (s.π.app j) x,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) x) } +\n { val := fun j => (s.π.app j) y,\n property := (_ : (fun x => x ∈ Functor.sections (F ⋙ forget (AlgebraCatMax R))) fun j => (s.π.app j) y) })","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n ","nextTactic":"dsimp","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\n⊢ (fun j => (s.π.app j) (x + y)) =\n ↑({ val := fun j => (s.π.app j) x,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) x = (s.π.app j') x) } +\n { val := fun j => (s.π.app j) y,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) y = (s.π.app j') y) })","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n ","nextTactic":"funext u","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\nu : J\n⊢ (s.π.app u) (x + y) =\n ↑({ val := fun j => (s.π.app j) x,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) x = (s.π.app j') x) } +\n { val := fun j => (s.π.app j) y,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) y = (s.π.app j') y) })\n u","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n ","nextTactic":"erw [map_add]","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_5.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nx y : ↑s.pt\nu : J\n⊢ (s.π.app u) x + (s.π.app u) y =\n ↑({ val := fun j => (s.π.app j) x,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) x = (s.π.app j') x) } +\n { val := fun j => (s.π.app j) y,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) y = (s.π.app j') y) })\n u","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n ","nextTactic":"rfl","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_6\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ ∀ (r : R),\n OneHom.toFun\n (↑↑{\n toMonoidHom :=\n {\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y) })\n ((algebraMap R ↑s.pt) r) =\n (algebraMap R ↑(limitCone F).pt) r","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · ","nextTactic":"intro r","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_6\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nr : R\n⊢ OneHom.toFun\n (↑↑{\n toMonoidHom :=\n {\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y) })\n ((algebraMap R ↑s.pt) r) =\n (algebraMap R ↑(limitCone F).pt) r","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n ","nextTactic":"apply Subtype.ext","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_6.a\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nr : R\n⊢ ↑(OneHom.toFun\n (↑↑{\n toMonoidHom :=\n {\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y) })\n ((algebraMap R ↑s.pt) r)) =\n ↑((algebraMap R ↑(limitCone F).pt) r)","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n apply Subtype.ext\n ","nextTactic":"ext j","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n apply Subtype.ext\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_6.a.h\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\nr : R\nj : J\n⊢ ↑(OneHom.toFun\n (↑↑{\n toMonoidHom :=\n {\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y) })\n ((algebraMap R ↑s.pt) r))\n j =\n ↑((algebraMap R ↑(limitCone F).pt) r) j","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n apply Subtype.ext\n ext j\n ","nextTactic":"exact (s.π.app j).commutes r","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n apply Subtype.ext\n ext j\n ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "} -{"state":"case refine'_7\nR : Type u\ninst✝¹ : CommRing R\nJ : Type v\ninst✝ : SmallCategory J\nF : J ⥤ AlgebraCatMax R\ns : Cone F\n⊢ (forget (AlgebraCat R)).map\n ((fun s =>\n {\n toRingHom :=\n {\n toMonoidHom :=\n {\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y) },\n commutes' :=\n (_ :\n ∀ (r : R),\n OneHom.toFun\n (↑↑{\n toMonoidHom :=\n {\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ : ∀ {j j' : J} (f : j ⟶ j'), (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) },\n map_zero' :=\n (_ :\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n 0 =\n 0),\n map_add' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n (x + y) =\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n x +\n OneHom.toFun\n (↑{\n toOneHom :=\n {\n toFun := fun v =>\n { val := fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) },\n map_mul' :=\n (_ :\n ∀ (x y : ↑s.pt),\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n (x * y) =\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n x *\n OneHom.toFun\n {\n toFun := fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) },\n map_one' :=\n (_ :\n (fun v =>\n {\n val := fun j =>\n ((forget (AlgebraCat R)).mapCone s).π.app j v,\n property :=\n (_ :\n ∀ {j j' : J} (f : j ⟶ j'),\n (s.π.app j ≫ F.map f) v = (s.π.app j') v) })\n 1 =\n 1) }\n y) })\n y) })\n ((algebraMap R ↑s.pt) r) =\n (algebraMap R ↑(limitCone F).pt) r) })\n s) =\n IsLimit.lift (Types.limitConeIsLimit (F ⋙ forget (AlgebraCat R))) ((forget (AlgebraCat R)).mapCone s)","srcUpToTactic":"/-\nCopyright (c) 2020 Scott Morrison. All rights reserved.\nReleased under Apache 2.0 license as described in the file LICENSE.\nAuthors: Scott Morrison\n-/\nimport Mathlib.Algebra.Category.AlgebraCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Basic\nimport Mathlib.Algebra.Category.ModuleCat.Limits\nimport Mathlib.Algebra.Category.Ring.Limits\n\n#align_import algebra.category.Algebra.limits from \"leanprover-community/mathlib\"@\"c43486ecf2a5a17479a32ce09e4818924145e90e\"\n\n/-!\n# The category of R-algebras has all limits\n\nFurther, these limits are preserved by the forgetful functor --- that is,\nthe underlying types are just the limits in the category of types.\n-/\n\nset_option linter.uppercaseLean3 false\n\nopen CategoryTheory\n\nopen CategoryTheory.Limits\n\nuniverse v w u\n\n-- `u` is determined by the ring, so can come last\nnoncomputable section\n\nnamespace AlgebraCat\n\nvariable {R : Type u} [CommRing R]\n\nvariable {J : Type v} [SmallCategory J]\n\ninstance semiringObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Semiring ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Semiring (F.obj j)\n#align Algebra.semiring_obj AlgebraCat.semiringObj\n\ninstance algebraObj (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n Algebra R ((F ⋙ forget (AlgebraCat R)).obj j) :=\n inferInstanceAs <| Algebra R (F.obj j)\n#align Algebra.algebra_obj AlgebraCat.algebraObj\n\n/-- The flat sections of a functor into `AlgebraCat R` form a submodule of all sections.\n-/\ndef sectionsSubalgebra (F : J ⥤ AlgebraCatMax.{v, w} R) : Subalgebra R (∀ j, F.obj j) :=\n { SemiRingCat.sectionsSubsemiring\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCatMax.{v, w}) with\n algebraMap_mem' := fun r _ _ f => (F.map f).commutes r }\n#align Algebra.sections_subalgebra AlgebraCat.sectionsSubalgebra\n\ninstance limitSemiring (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Ring.{max v w} (Types.limitCone.{v, w} (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Ring (sectionsSubalgebra F)\n#align Algebra.limit_semiring AlgebraCat.limitSemiring\n\ninstance limitAlgebra (F : J ⥤ AlgebraCatMax.{v, w} R) :\n Algebra R (Types.limitCone (F ⋙ forget (AlgebraCatMax.{v, w} R))).pt :=\n inferInstanceAs <| Algebra R (sectionsSubalgebra F)\n#align Algebra.limit_algebra AlgebraCat.limitAlgebra\n\n/-- `limit.π (F ⋙ forget (AlgebraCat R)) j` as a `AlgHom`. -/\ndef limitπAlgHom (F : J ⥤ AlgebraCatMax.{v, w} R) (j) :\n (Types.limitCone (F ⋙ forget (AlgebraCat R))).pt →ₐ[R]\n (F ⋙ forget (AlgebraCatMax.{v, w} R)).obj j :=\n { SemiRingCat.limitπRingHom\n (F ⋙ forget₂ (AlgebraCat R) RingCat.{max v w} ⋙ forget₂ RingCat SemiRingCat.{max v w}) j with\n commutes' := fun _ => rfl }\n#align Algebra.limit_π_alg_hom AlgebraCat.limitπAlgHom\n\nnamespace HasLimits\n\n-- The next two definitions are used in the construction of `HasLimits (AlgebraCat R)`.\n-- After that, the limits should be constructed using the generic limits API,\n-- e.g. `limit F`, `limit.cone F`, and `limit.isLimit F`.\n/-- Construction of a limit cone in `AlgebraCat R`.\n(Internal use only; use the limits API.)\n-/\ndef limitCone (F : J ⥤ AlgebraCatMax.{v, w} R) : Cone F where\n pt := AlgebraCat.of R (Types.limitCone (F ⋙ forget _)).pt\n π :=\n { app := limitπAlgHom F\n naturality := fun _ _ f =>\n AlgHom.coe_fn_injective ((Types.limitCone (F ⋙ forget _)).π.naturality f) }\n#align Algebra.has_limits.limit_cone AlgebraCat.HasLimits.limitCone\n\n/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n apply Subtype.ext\n ext j\n exact (s.π.app j).commutes r\n · ","nextTactic":"rfl","declUpToTactic":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) := by\n refine'\n IsLimit.ofFaithful (forget (AlgebraCat R)) (Types.limitConeIsLimit.{v, w} _)\n -- Porting note: in mathlib3 the function term\n -- `fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v`\n -- was provided by unification, and the last argument `(fun s => _)` was `(fun s => rfl)`.\n (fun s => ⟨⟨⟨⟨fun v => ⟨fun j => ((forget (AlgebraCat R)).mapCone s).π.app j v, _⟩,\n _⟩, _⟩, _, _⟩, _⟩)\n (fun s => _)\n · intro j j' f\n exact FunLike.congr_fun (Cone.w s f) v\n · -- Porting note: we could add a custom `ext` lemma here.\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_one, Functor.mapCone_π_app]\n erw [map_one]\n rfl\n · intro x y\n apply Subtype.ext\n ext j\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- This used to be as below, but we need `erw` after leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_mul, Functor.mapCone_π_app]\n erw [map_mul]\n rfl\n · simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_zero, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_zero]\n rfl\n · intro x y\n simp only [Functor.comp_obj, Functor.mapCone_pt, Functor.mapCone_π_app,\n forget_map_eq_coe]\n -- The below `simp` was enough before leanprover/lean4#2644\n -- simp [forget_map_eq_coe, AlgHom.map_add, Functor.mapCone_π_app]\n apply Subtype.ext\n dsimp\n funext u\n erw [map_add]\n rfl\n · intro r\n apply Subtype.ext\n ext j\n exact (s.π.app j).commutes r\n · ","declId":"Examples.Mathlib.SplitRw.Mathlib_Algebra_Category_AlgebraCat_Limits.90_0.949D5ifMohAmGHp","decl":"/-- Witness that the limit cone in `AlgebraCat R` is a limit cone.\n(Internal use only; use the limits API.)\n-/\ndef limitConeIsLimit (F : J ⥤ AlgebraCatMax.{v, w} R) : IsLimit (limitCone.{v, w} F) "}