File: Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean

full_name: CategoryTheory.Functor.IsCartesian
code: /-- The proposition that a morphism `φ : a ⟶ b` in `𝒳` lying over `f : R ⟶ S` in `𝒮` is a
cartesian morphism.

See SGA 1 VI 5.1. -/
class IsCartesian extends IsHomLift p f φ : Prop where
  universal_property {a' : 𝒳} (φ' : a' ⟶ b) [IsHomLift p f φ'] :
      ∃! χ : a' ⟶ a, IsHomLift p (𝟙 R) χ ∧ χ ≫ φ = φ'
goal: Prop

full_name: CategoryTheory.Functor.IsCartesian.universal_property
code: /-- The proposition that a morphism `φ : a ⟶ b` in `𝒳` lying over `f : R ⟶ S` in `𝒮` is a
cartesian morphism.

See SGA 1 VI 5.1. -/
class IsCartesian extends IsHomLift p f φ : Prop where
  universal_property {a' : 𝒳} (φ' : a' ⟶ b) [IsHomLift p f φ'] :
      ∃! χ : a' ⟶ a, IsHomLift p (𝟙 R) χ ∧ χ ≫ φ = φ'
goal: ∃! χ, p.IsHomLift (𝟙 R) χ ∧ χ ≫ φ = φ'

full_name: CategoryTheory.Functor.IsStronglyCartesian
code: /-- The proposition that a morphism `φ : a ⟶ b` in `𝒳` lying over `f : R ⟶ S` in `𝒮` is a
strongly cartesian morphism.

See <https://stacks.math.columbia.edu/tag/02XK> -/
class IsStronglyCartesian extends IsHomLift p f φ : Prop where
  universal_property' {a' : 𝒳} (g : p.obj a' ⟶ R) (φ' : a' ⟶ b) [IsHomLift p (g ≫ f) φ'] :
      ∃! χ : a' ⟶ a, IsHomLift p g χ ∧ χ ≫ φ = φ'
goal: Prop

full_name: CategoryTheory.Functor.IsStronglyCartesian.universal_property'
code: /-- The proposition that a morphism `φ : a ⟶ b` in `𝒳` lying over `f : R ⟶ S` in `𝒮` is a
strongly cartesian morphism.

See <https://stacks.math.columbia.edu/tag/02XK> -/
class IsStronglyCartesian extends IsHomLift p f φ : Prop where
  universal_property' {a' : 𝒳} (g : p.obj a' ⟶ R) (φ' : a' ⟶ b) [IsHomLift p (g ≫ f) φ'] :
      ∃! χ : a' ⟶ a, IsHomLift p g χ ∧ χ ≫ φ = φ'
goal: ∃! χ, p.IsHomLift g χ ∧ χ ≫ φ = φ'

full_name: CategoryTheory.Functor.IsCartesian.map
code: /-- Given a cartesian morphism `φ : a ⟶ b` lying over `f : R ⟶ S` in `𝒳`, and another morphism
`φ' : a' ⟶ b` which also lifts `f`, then `IsCartesian.map f φ φ'` is the morphism `a' ⟶ a` lifting
`𝟙 R` obtained from the universal property of `φ`. -/
protected noncomputable def map : a' ⟶ a 
goal: a' ⟶ a

full_name: CategoryTheory.Functor.IsCartesian.map_isHomLift
code: instance map_isHomLift : IsHomLift p (𝟙 R) (IsCartesian.map p f φ φ') 
goal: p.IsHomLift (𝟙 R) (CategoryTheory.Functor.IsCartesian.map p f φ φ')

full_name: CategoryTheory.Functor.IsCartesian.fac
code: @[reassoc (attr := simp)]
lemma fac : IsCartesian.map p f φ φ' ≫ φ = φ' 
goal: CategoryTheory.Functor.IsCartesian.map p f φ φ' ≫ φ = φ'

full_name: CategoryTheory.Functor.IsCartesian.map_uniq
code: /-- Given a cartesian morphism `φ : a ⟶ b` lying over `f : R ⟶ S` in `𝒳`, and another morphism
`φ' : a' ⟶ b` which also lifts `f`. Then any morphism `ψ : a' ⟶ a` lifting `𝟙 R` such that
`g ≫ ψ = φ'` must equal the map induced from the universal property of `φ`. -/
lemma map_uniq (ψ : a' ⟶ a) [IsHomLift p (𝟙 R) ψ] (hψ : ψ ≫ φ = φ') :
    ψ = IsCartesian.map p f φ φ' 
goal: ψ = CategoryTheory.Functor.IsCartesian.map p f φ φ'

full_name: CategoryTheory.Functor.IsCartesian.ext
code: /-- Given a cartesian morphism `φ : a ⟶ b` lying over `f : R ⟶ S` in `𝒳`, and two morphisms
`ψ ψ' : a' ⟶ a` such that `ψ ≫ φ = ψ' ≫ φ`. Then we must have `ψ = ψ'`. -/
protected lemma ext (φ : a ⟶ b) [IsCartesian p f φ] {a' : 𝒳} (ψ ψ' : a' ⟶ a)
    [IsHomLift p (𝟙 R) ψ] [IsHomLift p (𝟙 R) ψ'] (h : ψ ≫ φ = ψ' ≫ φ) : ψ = ψ' 
goal: ψ = ψ'

full_name: CategoryTheory.Functor.IsCartesian.map_self
code: @[simp]
lemma map_self : IsCartesian.map p f φ φ = 𝟙 a 
goal: CategoryTheory.Functor.IsCartesian.map p f φ φ = 𝟙 a

full_name: CategoryTheory.Functor.IsCartesian.domainUniqueUpToIso
code: /-- The canonical isomorphism between the domains of two cartesian morphisms
lying over the same object. -/
noncomputable def domainUniqueUpToIso {a' : 𝒳} (φ' : a' ⟶ b) [IsCartesian p f φ'] : a' ≅ a 
goal: a' ≅ a

full_name: CategoryTheory.Functor.IsCartesian.of_iso_comp
code: /-- Precomposing a cartesian morphism with an isomorphism lifting the identity is cartesian. -/
instance of_iso_comp {a' : 𝒳} (φ' : a' ≅ a) [IsHomLift p (𝟙 R) φ'.hom] :
    IsCartesian p f (φ'.hom ≫ φ) 
goal: p.IsCartesian f (φ'.hom ≫ φ)

full_name: CategoryTheory.Functor.IsCartesian.of_comp_iso
code: /-- Postcomposing a cartesian morphism with an isomorphism lifting the identity is cartesian. -/
instance of_comp_iso {b' : 𝒳} (φ' : b ≅ b') [IsHomLift p (𝟙 S) φ'.hom] :
    IsCartesian p f (φ ≫ φ'.hom) 
goal: p.IsCartesian f (φ ≫ φ'.hom)

full_name: CategoryTheory.Functor.IsStronglyCartesian.universal_property
code: /-- The universal property of a strongly cartesian morphism.

This lemma is more flexible with respect to non-definitional equalities than the field
`universal_property'` of `IsStronglyCartesian`. -/
lemma universal_property {R' : 𝒮} {a' : 𝒳} (g : R' ⟶ R) (f' : R' ⟶ S) (hf' : f' = g ≫ f)
    (φ' : a' ⟶ b) [IsHomLift p f' φ'] : ∃! χ : a' ⟶ a, IsHomLift p g χ ∧ χ ≫ φ = φ' 
goal: ∃! χ, p.IsHomLift g χ ∧ χ ≫ φ = φ'

full_name: CategoryTheory.Functor.IsStronglyCartesian.isCartesian_of_isStronglyCartesian
code: instance isCartesian_of_isStronglyCartesian [p.IsStronglyCartesian f φ] : p.IsCartesian f φ 
goal: p.IsCartesian f φ

full_name: CategoryTheory.Functor.IsStronglyCartesian.map
code: /-- Given a diagram
```
a'        a --φ--> b
|         |        |
v         v        v
R' --g--> R --f--> S
```
such that `φ` is strongly cartesian, and a morphism `φ' : a' ⟶ b`. Then `map` is the map `a' ⟶ a`
lying over `g` obtained from the universal property of `φ`. -/
noncomputable def map : a' ⟶ a 
goal: a' ⟶ a

full_name: CategoryTheory.Functor.IsStronglyCartesian.map_isHomLift
code: instance map_isHomLift : IsHomLift p g (map p f φ hf' φ') 
goal: p.IsHomLift g (CategoryTheory.Functor.IsStronglyCartesian.map p f φ hf' φ')

full_name: CategoryTheory.Functor.IsStronglyCartesian.fac
code: @[reassoc (attr := simp)]
lemma fac : (map p f φ hf' φ') ≫ φ = φ' 
goal: CategoryTheory.Functor.IsStronglyCartesian.map p f φ hf' φ' ≫ φ = φ'

full_name: CategoryTheory.Functor.IsStronglyCartesian.map_uniq
code: /-- Given a diagram
```
a'        a --φ--> b
|         |        |
v         v        v
R' --g--> R --f--> S
```
such that `φ` is strongly cartesian, and morphisms `φ' : a' ⟶ b`, `ψ : a' ⟶ a` such that
`ψ ≫ φ = φ'`. Then `ψ` is the map induced by the universal property. -/
lemma map_uniq (ψ : a' ⟶ a) [IsHomLift p g ψ] (hψ : ψ ≫ φ = φ') : ψ = map p f φ hf' φ' 
goal: ψ = CategoryTheory.Functor.IsStronglyCartesian.map p f φ hf' φ'

full_name: CategoryTheory.Functor.IsStronglyCartesian.ext
code: /-- Given a diagram
```
a'        a --φ--> b
|         |        |
v         v        v
R' --g--> R --f--> S
```
such that `φ` is strongly cartesian, and morphisms `ψ ψ' : a' ⟶ a` such that
`g ≫ ψ = φ' = g ≫ ψ'`. Then we have that `ψ = ψ'`. -/
protected lemma ext (φ : a ⟶ b) [IsStronglyCartesian p f φ] {R' : 𝒮} {a' : 𝒳} (g : R' ⟶ R)
    {ψ ψ' : a' ⟶ a} [IsHomLift p g ψ] [IsHomLift p g ψ'] (h : ψ ≫ φ = ψ' ≫ φ) : ψ = ψ' 
goal: ψ = ψ'

full_name: CategoryTheory.Functor.IsStronglyCartesian.map_self
code: @[simp]
lemma map_self : map p f φ (id_comp f).symm φ = 𝟙 a 
goal: CategoryTheory.Functor.IsStronglyCartesian.map p f φ ⋯ φ = 𝟙 a

full_name: CategoryTheory.Functor.IsStronglyCartesian.map_comp_map
code: /-- When its possible to compare the two, the composition of two `IsCocartesian.map` will also be
given by a `IsCocartesian.map`. In other words, given diagrams
```
a''         a'        a --φ--> b          a' --φ'--> b          a'' --φ''--> b
|           |         |        |    and   |          |    and   |            |
v           v         v        v          v          v          v            v
R'' --g'--> R' --g--> R --f--> S          R' --f'--> S          R'' --f''--> S
```
such that `φ` and `φ'` are strongly cartesian morphisms. Then composing the induced map from
`a'' ⟶ a'` with the induced map from `a' ⟶ a` gives the induced map from `a'' ⟶ a`. -/
@[reassoc (attr := simp)]
lemma map_comp_map {R' R'' : 𝒮} {a' a'' : 𝒳} {f' : R' ⟶ S} {f'' : R'' ⟶ S} {g : R' ⟶ R}
    {g' : R'' ⟶ R'} (H : f' = g ≫ f) (H' : f'' = g' ≫ f') (φ' : a' ⟶ b) (φ'' : a'' ⟶ b)
    [IsStronglyCartesian p f' φ'] [IsHomLift p f'' φ''] :
    map p f' φ' H' φ'' ≫ map p f φ H φ' =
      map p f φ (show f'' = (g' ≫ g) ≫ f by rwa [assoc, ← H]) φ'' 
goal: CategoryTheory.Functor.IsStronglyCartesian.map p f' φ' H' φ'' ≫
    CategoryTheory.Functor.IsStronglyCartesian.map p f φ H φ' =
  CategoryTheory.Functor.IsStronglyCartesian.map p f φ ⋯ φ''

full_name: CategoryTheory.Functor.IsStronglyCartesian.comp
code: /-- Given two strongly cartesian morphisms `φ`, `ψ` as follows
```
a --φ--> b --ψ--> c
|        |        |
v        v        v
R --f--> S --g--> T
```
Then the composite `φ ≫ ψ` is also strongly cartesian. -/
instance comp [IsStronglyCartesian p f φ] [IsStronglyCartesian p g ψ] :
    IsStronglyCartesian p (f ≫ g) (φ ≫ ψ) 
goal: p.IsStronglyCartesian (f ≫ g) (φ ≫ ψ)

full_name: CategoryTheory.Functor.IsStronglyCartesian.of_comp
code: /-- Given two commutative squares
```
a --φ--> b --ψ--> c
|        |        |
v        v        v
R --f--> S --g--> T
```
such that `φ ≫ ψ` and `ψ` are strongly cartesian, then so is `φ`. -/
protected lemma of_comp [IsStronglyCartesian p g ψ] [IsStronglyCartesian p (f ≫ g) (φ ≫ ψ)]
    [IsHomLift p f φ] : IsStronglyCartesian p f φ 
goal: p.IsStronglyCartesian f φ

full_name: CategoryTheory.Functor.IsStronglyCartesian.of_iso
code: instance of_iso (φ : a ≅ b) [IsHomLift p f φ.hom] : IsStronglyCartesian p f φ.hom 
goal: p.IsStronglyCartesian f φ.hom

full_name: CategoryTheory.Functor.IsStronglyCartesian.of_isIso
code: instance of_isIso (φ : a ⟶ b) [IsHomLift p f φ] [IsIso φ] : IsStronglyCartesian p f φ 
goal: p.IsStronglyCartesian f φ

full_name: CategoryTheory.Functor.IsStronglyCartesian.isIso_of_base_isIso
code: /-- A strongly cartesian morphism lying over an isomorphism is an isomorphism. -/
lemma isIso_of_base_isIso (φ : a ⟶ b) [IsStronglyCartesian p f φ] [IsIso f] : IsIso φ 
goal: CategoryTheory.IsIso φ

full_name: CategoryTheory.Functor.IsStronglyCartesian.domainIsoOfBaseIso
code: /-- The canonical isomorphism between the domains of two strongly cartesian morphisms lying over
isomorphic objects. -/
noncomputable def domainIsoOfBaseIso {R R' S : 𝒮} {a a' b : 𝒳} {f : R ⟶ S} {f' : R' ⟶ S}
  {g : R' ≅ R} (h : f' = g.hom ≫ f) (φ : a ⟶ b) (φ' : a' ⟶ b) [IsStronglyCartesian p f φ]
    [IsStronglyCartesian p f' φ'] : a' ≅ a 
goal: a' ≅ a