l3lab/ntp-mathlib huggingface dataset:
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    

Proof state:
case w
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
⊢ { obj := fun x => limit (diagram ι F x), map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
        (f ≫ g) ≫
      limit.π (diagram ι F z) j =
    ({ obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          f ≫
        { obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          g) ≫
      limit.π (diagram ι F z) j

Next tactic:
haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
    

Proof state:
case w
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this✝ : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
this : HasLimit (StructuredArrow.map g ⋙ diagram ι F y)
⊢ { obj := fun x => limit (diagram ι F x), map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
        (f ≫ g) ≫
      limit.π (diagram ι F z) j =
    ({ obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          f ≫
        { obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          g) ≫
      limit.π (diagram ι F z) j

Next tactic:
haveI : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F _) := h _
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F _) := h _
    

Proof state:
case w
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this✝¹ : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
this✝ : HasLimit (StructuredArrow.map g ⋙ diagram ι F y)
this : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F x)
⊢ { obj := fun x => limit (diagram ι F x), map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
        (f ≫ g) ≫
      limit.π (diagram ι F z) j =
    ({ obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          f ≫
        { obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          g) ≫
      limit.π (diagram ι F z) j

Next tactic:
haveI : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F _) := h _
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F _) := h _
    

Proof state:
case w
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this✝² : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
this✝¹ : HasLimit (StructuredArrow.map g ⋙ diagram ι F y)
this✝ : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F x)
this : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F x)
⊢ { obj := fun x => limit (diagram ι F x), map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
        (f ≫ g) ≫
      limit.π (diagram ι F z) j =
    ({ obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          f ≫
        { obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          g) ≫
      limit.π (diagram ι F z) j

Next tactic:
haveI : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F _) := h _
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F _) := h _
    

Proof state:
case w
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this✝³ : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
this✝² : HasLimit (StructuredArrow.map g ⋙ diagram ι F y)
this✝¹ : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F x)
this✝ : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F x)
this : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F x)
⊢ { obj := fun x => limit (diagram ι F x), map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
        (f ≫ g) ≫
      limit.π (diagram ι F z) j =
    ({ obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          f ≫
        { obj := fun x => limit (diagram ι F x),
              map := fun {X Y} f => limit.pre (diagram ι F X) (StructuredArrow.map f) }.map
          g) ≫
      limit.π (diagram ι F z) j

Next tactic:
erw [limit.pre_pre, limit.pre_π, limit.pre_π]
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F _) := h _
    erw [limit.pre_pre, limit.pre_π, limit.pre_π]
    

Proof state:
case w
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this✝³ : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
this✝² : HasLimit (StructuredArrow.map g ⋙ diagram ι F y)
this✝¹ : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F x)
this✝ : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F x)
this : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F x)
⊢ limit.π (diagram ι F x) ((StructuredArrow.map (f ≫ g)).obj j) =
    limit.π (diagram ι F x) ((StructuredArrow.map g ⋙ StructuredArrow.map f).obj j)

Next tactic:
congr 1
/-- An auxiliary definition used to define `Ran`. -/
@[simps]
def loc (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] : L ⥤ D
    where
  obj x := limit (diagram ι F x)
  map {X Y} f :=
    haveI : HasLimit <| StructuredArrow.map f ⋙ diagram ι F X := h Y
    limit.pre (diagram ι F X) (StructuredArrow.map f)
  map_id := by
    intro l
    haveI : HasLimit (StructuredArrow.map (𝟙 _) ⋙ diagram ι F l) := h _
    dsimp
    ext j
    simp only [Category.id_comp, limit.pre_π]
    congr 1
    simp
  map_comp := by
    intro x y z f g
    apply limit.hom_ext
    intro j
    -- Porting note: The fact that we need to add these instances all over the place
    -- is certainly not ideal.
    haveI : HasLimit (StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F _) := h _
    haveI : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F _) := h _
    haveI : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F _) := h _
    erw [limit.pre_pre, limit.pre_π, limit.pre_π]
    congr 1
    

Proof state:
case w.h.e_7.h
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
x y z : L
f : x ⟶ y
g : y ⟶ z
j : StructuredArrow z ι
this✝³ : HasLimit (StructuredArrow.map f ⋙ diagram ι F x)
this✝² : HasLimit (StructuredArrow.map g ⋙ diagram ι F y)
this✝¹ : HasLimit (StructuredArrow.map (f ≫ g) ⋙ diagram ι F x)
this✝ : HasLimit (StructuredArrow.map g ⋙ StructuredArrow.map f ⋙ diagram ι F x)
this : HasLimit ((StructuredArrow.map g ⋙ StructuredArrow.map f) ⋙ diagram ι F x)
⊢ (StructuredArrow.map (f ≫ g)).obj j = (StructuredArrow.map g ⋙ StructuredArrow.map f).obj j

Next tactic:
aesop_cat
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
⊢ ∀ ⦃X Y : S⦄ (f_1 : X ⟶ Y),
    (((whiskeringLeft S L D).obj ι).obj G).map f_1 ≫
        (fun x => f.app (ι.obj x) ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x)))) Y =
      (fun x => f.app (ι.obj x) ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x)))) X ≫ F.map f_1

Next tactic:
intro x y ff
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
⊢ (((whiskeringLeft S L D).obj ι).obj G).map ff ≫
      (fun x => f.app (ι.obj x) ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x)))) y =
    (fun x => f.app (ι.obj x) ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x)))) x ≫ F.map ff

Next tactic:
dsimp only [whiskeringLeft]
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
⊢ (ι ⋙ G).map ff ≫ f.app (ι.obj y) ≫ limit.π (diagram ι F (ι.obj y)) (StructuredArrow.mk (𝟙 (ι.obj y))) =
    (f.app (ι.obj x) ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x)))) ≫ F.map ff

Next tactic:
simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
        

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
⊢ f.app (ι.obj x) ≫
      limit.pre (diagram ι F (ι.obj x)) (StructuredArrow.map (ι.map ff)) ≫
        limit.π (diagram ι F (ι.obj y)) (StructuredArrow.mk (𝟙 (ι.obj y))) =
    f.app (ι.obj x) ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x))) ≫ F.map ff

Next tactic:
congr 1
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
        congr 1
        

Proof state:
case e_a
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
⊢ limit.pre (diagram ι F (ι.obj x)) (StructuredArrow.map (ι.map ff)) ≫
      limit.π (diagram ι F (ι.obj y)) (StructuredArrow.mk (𝟙 (ι.obj y))) =
    limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x))) ≫ F.map ff

Next tactic:
haveI : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x)) := h _
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
        congr 1
        haveI : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x)) := h _
        

Proof state:
case e_a
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
this : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x))
⊢ limit.pre (diagram ι F (ι.obj x)) (StructuredArrow.map (ι.map ff)) ≫
      limit.π (diagram ι F (ι.obj y)) (StructuredArrow.mk (𝟙 (ι.obj y))) =
    limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x))) ≫ F.map ff

Next tactic:
erw [limit.pre_π]
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
        congr 1
        haveI : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x)) := h _
        erw [limit.pre_π]
        

Proof state:
case e_a
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
this : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x))
⊢ limit.π (diagram ι F (ι.obj x)) ((StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y)))) =
    limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x))) ≫ F.map ff

Next tactic:
let t : StructuredArrow.mk (𝟙 (ι.obj x)) ⟶
          (StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y))) :=
          StructuredArrow.homMk ff ?_
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
        congr 1
        haveI : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x)) := h _
        erw [limit.pre_π]
        let t : StructuredArrow.mk (𝟙 (ι.obj x)) ⟶
          (StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y))) :=
          StructuredArrow.homMk ff ?_
        

Proof state:
case e_a.refine_2
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
this : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x))
t : StructuredArrow.mk (𝟙 (ι.obj x)) ⟶ (StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y))) :=
  StructuredArrow.homMk ff
⊢ limit.π (diagram ι F (ι.obj x)) ((StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y)))) =
    limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 (ι.obj x))) ≫ F.map ff
case e_a.refine_1
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
this : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x))
⊢ (StructuredArrow.mk (𝟙 (ι.obj x))).hom ≫ ι.map ff =
    ((StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y)))).hom

Next tactic:
convert (limit.w (diagram ι F (ι.obj x)) t).symm using 1
/-- An auxiliary definition used to define `Ran` and `Ran.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [h : ∀ x, HasLimit (diagram ι F x)] (G : L ⥤ D) :
    (G ⟶ loc ι F) ≃ (((whiskeringLeft _ _ _).obj ι).obj G ⟶ F)
    where
  toFun f :=
    { app := fun x => f.app _ ≫ limit.π (diagram ι F (ι.obj x)) (StructuredArrow.mk (𝟙 _))
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, NatTrans.naturality_assoc, loc_map, Category.assoc]
        congr 1
        haveI : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x)) := h _
        erw [limit.pre_π]
        let t : StructuredArrow.mk (𝟙 (ι.obj x)) ⟶
          (StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y))) :=
          StructuredArrow.homMk ff ?_
        convert (limit.w (diagram ι F (ι.obj x)) t).symm using 1
        

Proof state:
case e_a.refine_1
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
h : ∀ (x : L), HasLimit (diagram ι F x)
G : L ⥤ D
f : G ⟶ loc ι F
x y : S
ff : x ⟶ y
this : HasLimit (StructuredArrow.map (ι.map ff) ⋙ diagram ι F (ι.obj x))
⊢ (StructuredArrow.mk (𝟙 (ι.obj x))).hom ≫ ι.map ff =
    ((StructuredArrow.map (ι.map ff)).obj (StructuredArrow.mk (𝟙 (ι.obj y)))).hom

Next tactic:
simp