File: Mathlib/CategoryTheory/MorphismProperty/Factorization.lean

full_name: CategoryTheory.MorphismProperty.MapFactorizationData.hp
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: W₂ self.p

full_name: CategoryTheory.MorphismProperty.MapFactorizationData.p
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: self.Z ⟶ Y

full_name: CategoryTheory.MorphismProperty.MapFactorizationData.hi
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: W₁ self.i

full_name: CategoryTheory.MorphismProperty.MapFactorizationData.Z
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: C

full_name: CategoryTheory.MorphismProperty.MapFactorizationData
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: Type (max u_1 u_2)

full_name: CategoryTheory.MorphismProperty.MapFactorizationData.fac
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: CategoryTheory.CategoryStruct.comp self.i self.p = f

full_name: CategoryTheory.MorphismProperty.MapFactorizationData.i
code: /-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p
goal: X ⟶ self.Z

full_name: CategoryTheory.MorphismProperty.FactorizationData
code: /-- The data of a term in `MapFactorizationData W₁ W₂ f` for any morphism `f`. -/
abbrev FactorizationData 
goal: Type (max u_1 u_2)

full_name: CategoryTheory.MorphismProperty.HasFactorization.nonempty_mapFactorizationData
code: /-- The factorization axiom for two classes of morphisms `W₁` and `W₂` in a category `C`. It
asserts that any morphism can be factored as a morphism in `W₁` followed by a morphism
in `W₂`. -/
class HasFactorization : Prop where
  nonempty_mapFactorizationData {X Y : C} (f : X ⟶ Y) : Nonempty (MapFactorizationData W₁ W₂ f)
goal: Nonempty (W₁.MapFactorizationData W₂ f)

full_name: CategoryTheory.MorphismProperty.HasFactorization
code: /-- The factorization axiom for two classes of morphisms `W₁` and `W₂` in a category `C`. It
asserts that any morphism can be factored as a morphism in `W₁` followed by a morphism
in `W₂`. -/
class HasFactorization : Prop where
  nonempty_mapFactorizationData {X Y : C} (f : X ⟶ Y) : Nonempty (MapFactorizationData W₁ W₂ f)
goal: Prop

full_name: CategoryTheory.MorphismProperty.factorizationData
code: /-- A chosen term in `FactorizationData W₁ W₂` when `HasFactorization W₁ W₂` holds. -/
noncomputable def factorizationData [HasFactorization W₁ W₂] : FactorizationData W₁ W₂ 
goal: W₁.FactorizationData W₂

full_name: CategoryTheory.MorphismProperty.comp
code: /-- The class of morphisms that are of the form `i ≫ p` with `W₁ i` and `W₂ p`. -/
def comp : MorphismProperty C 
goal: CategoryTheory.MorphismProperty C

full_name: CategoryTheory.MorphismProperty.comp_eq_top_iff
code: lemma comp_eq_top_iff : W₁.comp W₂ = ⊤ ↔ HasFactorization W₁ W₂ 
goal: W₁.comp W₂ = ⊤ ↔ W₁.HasFactorization W₂

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.p
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: self.Z ⟶ CategoryTheory.Arrow.rightFunc

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: Type (max u_1 u_2)

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.hi
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: W₁ (self.i.app f)

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.i
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: CategoryTheory.Arrow.leftFunc ⟶ self.Z

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.Z
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: CategoryTheory.Functor (CategoryTheory.Arrow C) C

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.fac
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: CategoryTheory.CategoryStruct.comp self.i self.p = CategoryTheory.Arrow.leftToRight

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.hp
code: /-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)
goal: W₂ (self.p.app f)

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.fac_app
code: @[reassoc (attr := simp)]
lemma fac_app {f : Arrow C} : data.i.app f ≫ data.p.app f = f.hom 
goal: CategoryTheory.CategoryStruct.comp (data.i.app f) (data.p.app f) = f.hom

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.ofLE
code: /-- If `W₁ ≤ W₁'` and `W₂ ≤ W₂'`, then a functorial factorization for `W₁` and `W₂` induces
a functorial factorization for `W₁'` and `W₂'`. -/
def ofLE {W₁' W₂' : MorphismProperty C} (le₁ : W₁ ≤ W₁') (le₂ : W₂ ≤ W₂') :
    FunctorialFactorizationData W₁' W₂' 
goal: W₁'.FunctorialFactorizationData W₂'

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.factorizationData
code: /-- The term in `FactorizationData W₁ W₂` that is deduced from a functorial factorization. -/
def factorizationData : FactorizationData W₁ W₂ 
goal: W₁.FactorizationData W₂

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.mapZ
code: /-- When `data : FunctorialFactorizationData W₁ W₂`, this is the
morphism `(data.factorizationData f).Z ⟶ (data.factorizationData g).Z` expressing the
functoriality of the intermediate objects of the factorizations
for `φ : Arrow.mk f ⟶ Arrow.mk g`. -/
def mapZ : (data.factorizationData f).Z ⟶ (data.factorizationData g).Z 
goal: (data.factorizationData f).Z ⟶ (data.factorizationData g).Z

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.i_mapZ
code: @[reassoc (attr := simp)]
lemma i_mapZ :
    (data.factorizationData f).i ≫ data.mapZ φ = φ.left ≫ (data.factorizationData g).i 
goal: CategoryTheory.CategoryStruct.comp (data.factorizationData f).i (data.mapZ φ) =
  CategoryTheory.CategoryStruct.comp φ.left (data.factorizationData g).i

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.mapZ_p
code: @[reassoc (attr := simp)]
lemma mapZ_p :
    data.mapZ φ ≫ (data.factorizationData g).p = (data.factorizationData f).p ≫ φ.right 
goal: CategoryTheory.CategoryStruct.comp (data.mapZ φ) (data.factorizationData g).p =
  CategoryTheory.CategoryStruct.comp (data.factorizationData f).p φ.right

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.mapZ_id
code: @[simp]
lemma mapZ_id : data.mapZ (𝟙 (Arrow.mk f)) = 𝟙 _ 
goal: data.mapZ (CategoryTheory.CategoryStruct.id (CategoryTheory.Arrow.mk f)) =
  CategoryTheory.CategoryStruct.id (data.factorizationData f).Z

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.mapZ_comp
code: @[reassoc, simp]
lemma mapZ_comp {X'' Y'' : C} {h : X'' ⟶ Y''} (ψ : Arrow.mk g ⟶ Arrow.mk h) :
    data.mapZ (φ ≫ ψ) = data.mapZ φ ≫ data.mapZ ψ 
goal: data.mapZ (CategoryTheory.CategoryStruct.comp φ ψ) = CategoryTheory.CategoryStruct.comp (data.mapZ φ) (data.mapZ ψ)

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z_map_app
code: /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/
@[simps]
def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C 
goal: ∀ {X Y : CategoryTheory.Arrow (CategoryTheory.Functor J C)} (τ : X ⟶ Y) (j : J),
  ((CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z data J).map τ).app j =
    data.mapZ { left := τ.left.app j, right := τ.right.app j, w := ⋯ }

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z_obj_obj
code: /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/
@[simps]
def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C 
goal: ((CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z data J).obj f).obj j =
  (data.factorizationData (f.hom.app j)).Z

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z_obj_map
code: /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/
@[simps]
def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C 
goal: ∀ {X Y : J} (φ : X ⟶ Y),
  ((CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z data J).obj f).map φ =
    data.mapZ { left := f.left.map φ, right := f.right.map φ, w := ⋯ }

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory.Z
code: /-- Auxiliary definition for `FunctorialFactorizationData.functorCategory`. -/
@[simps]
def functorCategory.Z : Arrow (J ⥤ C) ⥤ J ⥤ C 
goal: CategoryTheory.Functor (CategoryTheory.Arrow (CategoryTheory.Functor J C)) (CategoryTheory.Functor J C)

full_name: CategoryTheory.MorphismProperty.FunctorialFactorizationData.functorCategory
code: /-- A functorial factorization in the category `C` extends to the functor category `J ⥤ C`. -/
def functorCategory :
    FunctorialFactorizationData (W₁.functorCategory J) (W₂.functorCategory J) 
goal: (W₁.functorCategory J).FunctorialFactorizationData (W₂.functorCategory J)

full_name: CategoryTheory.MorphismProperty.HasFunctorialFactorization
code: /-- The functorial factorization axiom for two classes of morphisms `W₁` and `W₂` in a
category `C`. It asserts that any morphism can be factored in a functorial manner
as a morphism in `W₁` followed by a morphism in `W₂`. -/
class HasFunctorialFactorization : Prop where
  nonempty_functorialFactorizationData : Nonempty (FunctorialFactorizationData W₁ W₂)
goal: Prop

full_name: CategoryTheory.MorphismProperty.HasFunctorialFactorization.nonempty_functorialFactorizationData
code: /-- The functorial factorization axiom for two classes of morphisms `W₁` and `W₂` in a
category `C`. It asserts that any morphism can be factored in a functorial manner
as a morphism in `W₁` followed by a morphism in `W₂`. -/
class HasFunctorialFactorization : Prop where
  nonempty_functorialFactorizationData : Nonempty (FunctorialFactorizationData W₁ W₂)
goal: Nonempty (W₁.FunctorialFactorizationData W₂)

full_name: CategoryTheory.MorphismProperty.functorialFactorizationData
code: /-- A chosen term in `FunctorialFactorizationData W₁ W₂` when the functorial factorization
axiom `HasFunctorialFactorization W₁ W₂` holds. -/
noncomputable def functorialFactorizationData [HasFunctorialFactorization W₁ W₂] :
    FunctorialFactorizationData W₁ W₂ 
goal: W₁.FunctorialFactorizationData W₂

full_name: CategoryTheory.MorphismProperty.instHasFactorizationOfHasFunctorialFactorization
code: instance [HasFunctorialFactorization W₁ W₂] : HasFactorization W₁ W₂ 
goal: W₁.HasFactorization W₂

full_name: CategoryTheory.MorphismProperty.instHasFunctorialFactorizationFunctorFunctorCategory
code: instance [HasFunctorialFactorization W₁ W₂] (J : Type*) [Category J] :
    HasFunctorialFactorization (W₁.functorCategory J) (W₂.functorCategory J) 
goal: (W₁.functorCategory J).HasFunctorialFactorization (W₂.functorCategory J)