l3lab/ntp-mathlib huggingface dataset:
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `ℝ` and `ℂ` are strictly ordered rings.

Note this is only an instance with `open scoped ComplexOrder`. -/
def toStrictOrderedCommRing : StrictOrderedCommRing K where
  zero_le_one := by simp [@IsROrC.le_iff_re_im K]
  add_le_add_left _ _ := add_le_add_left
  mul_pos z w hz hw := by
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
z w : K
hz : 0 < z
hw : 0 < w
⊢ 0 < z * w

Next tactic:
rw [lt_iff_re_im, map_zero] at hz hw ⊢
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `ℝ` and `ℂ` are strictly ordered rings.

Note this is only an instance with `open scoped ComplexOrder`. -/
def toStrictOrderedCommRing : StrictOrderedCommRing K where
  zero_le_one := by simp [@IsROrC.le_iff_re_im K]
  add_le_add_left _ _ := add_le_add_left
  mul_pos z w hz hw := by
    rw [lt_iff_re_im, map_zero] at hz hw ⊢
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
z w : K
hz : 0 < re z ∧ im 0 = im z
hw : 0 < re w ∧ im 0 = im w
⊢ 0 < re (z * w) ∧ im 0 = im (z * w)

Next tactic:
simp [mul_re, mul_im, ← hz.2, ← hw.2, mul_pos hz.1 hw.1]
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `ℝ` and `ℂ` are strictly ordered rings.

Note this is only an instance with `open scoped ComplexOrder`. -/
def toStrictOrderedCommRing : StrictOrderedCommRing K where
  zero_le_one := by simp [@IsROrC.le_iff_re_im K]
  add_le_add_left _ _ := add_le_add_left
  mul_pos z w hz hw := by
    rw [lt_iff_re_im, map_zero] at hz hw ⊢
    simp [mul_re, mul_im, ← hz.2, ← hw.2, mul_pos hz.1 hw.1]
  mul_comm := by 

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
⊢ ∀ (a b : K), a * b = b * a

Next tactic:
intros
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `ℝ` and `ℂ` are strictly ordered rings.

Note this is only an instance with `open scoped ComplexOrder`. -/
def toStrictOrderedCommRing : StrictOrderedCommRing K where
  zero_le_one := by simp [@IsROrC.le_iff_re_im K]
  add_le_add_left _ _ := add_le_add_left
  mul_pos z w hz hw := by
    rw [lt_iff_re_im, map_zero] at hz hw ⊢
    simp [mul_re, mul_im, ← hz.2, ← hw.2, mul_pos hz.1 hw.1]
  mul_comm := by intros; 

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a✝ b✝ : K
⊢ a✝ * b✝ = b✝ * a✝

Next tactic:
apply ext
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `ℝ` and `ℂ` are strictly ordered rings.

Note this is only an instance with `open scoped ComplexOrder`. -/
def toStrictOrderedCommRing : StrictOrderedCommRing K where
  zero_le_one := by simp [@IsROrC.le_iff_re_im K]
  add_le_add_left _ _ := add_le_add_left
  mul_pos z w hz hw := by
    rw [lt_iff_re_im, map_zero] at hz hw ⊢
    simp [mul_re, mul_im, ← hz.2, ← hw.2, mul_pos hz.1 hw.1]
  mul_comm := by intros; apply ext <;> 

Proof state:
case hre
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a✝ b✝ : K
⊢ re (a✝ * b✝) = re (b✝ * a✝)

Next tactic:
ring_nf
/-- With `z ≤ w` iff `w - z` is real and nonnegative, `ℝ` and `ℂ` are strictly ordered rings.

Note this is only an instance with `open scoped ComplexOrder`. -/
def toStrictOrderedCommRing : StrictOrderedCommRing K where
  zero_le_one := by simp [@IsROrC.le_iff_re_im K]
  add_le_add_left _ _ := add_le_add_left
  mul_pos z w hz hw := by
    rw [lt_iff_re_im, map_zero] at hz hw ⊢
    simp [mul_re, mul_im, ← hz.2, ← hw.2, mul_pos hz.1 hw.1]
  mul_comm := by intros; apply ext <;> 

Proof state:
case him
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a✝ b✝ : K
⊢ im (a✝ * b✝) = im (b✝ * a✝)

Next tactic:
ring_nf
theorem toOrderedSMul : OrderedSMul ℝ K :=
  OrderedSMul.mk' fun a b r hab hr => by
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a b : K
r : ℝ
hab : a < b
hr : 0 < r
⊢ r • a ≤ r • b

Next tactic:
replace hab := hab.le
theorem toOrderedSMul : OrderedSMul ℝ K :=
  OrderedSMul.mk' fun a b r hab hr => by
    replace hab := hab.le
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a b : K
r : ℝ
hr : 0 < r
hab : a ≤ b
⊢ r • a ≤ r • b

Next tactic:
rw [IsROrC.le_iff_re_im] at hab
theorem toOrderedSMul : OrderedSMul ℝ K :=
  OrderedSMul.mk' fun a b r hab hr => by
    replace hab := hab.le
    rw [IsROrC.le_iff_re_im] at hab
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a b : K
r : ℝ
hr : 0 < r
hab : re a ≤ re b ∧ im a = im b
⊢ r • a ≤ r • b

Next tactic:
rw [IsROrC.le_iff_re_im, smul_re, smul_re, smul_im, smul_im]
theorem toOrderedSMul : OrderedSMul ℝ K :=
  OrderedSMul.mk' fun a b r hab hr => by
    replace hab := hab.le
    rw [IsROrC.le_iff_re_im] at hab
    rw [IsROrC.le_iff_re_im, smul_re, smul_re, smul_im, smul_im]
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
a b : K
r : ℝ
hr : 0 < r
hab : re a ≤ re b ∧ im a = im b
⊢ r * re a ≤ r * re b ∧ r * im a = r * im b

Next tactic:
exact hab.imp (fun h => mul_le_mul_of_nonneg_left h hr.le) (congr_arg _)
@[simp, isROrC_simps]
theorem normSq_to_real {x : ℝ} : normSq x = x * x := by 

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
x : ℝ
⊢ normSq x = x * x

Next tactic:
simp [IsROrC.normSq]
/-- The real part in an `IsROrC` field, as a continuous linear map. -/
noncomputable def reClm : K →L[ℝ] ℝ :=
  reLm.mkContinuous 1 fun x => by
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
x : K
⊢ ‖reLm x‖ ≤ 1 * ‖x‖

Next tactic:
rw [one_mul]
/-- The real part in an `IsROrC` field, as a continuous linear map. -/
noncomputable def reClm : K →L[ℝ] ℝ :=
  reLm.mkContinuous 1 fun x => by
    rw [one_mul]
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
x : K
⊢ ‖reLm x‖ ≤ ‖x‖

Next tactic:
exact abs_re_le_norm x
/-- The imaginary part in an `IsROrC` field, as a continuous linear map. -/
noncomputable def imClm : K →L[ℝ] ℝ :=
  imLm.mkContinuous 1 fun x => by
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
x : K
⊢ ‖imLm x‖ ≤ 1 * ‖x‖

Next tactic:
rw [one_mul]
/-- The imaginary part in an `IsROrC` field, as a continuous linear map. -/
noncomputable def imClm : K →L[ℝ] ℝ :=
  imLm.mkContinuous 1 fun x => by
    rw [one_mul]
    

Proof state:
K : Type u_1
E : Type u_2
inst✝ : IsROrC K
x : K
⊢ ‖imLm x‖ ≤ ‖x‖

Next tactic:
exact abs_im_le_norm x
/-- The colimit cocone over `coyoneda.obj X`, with cocone point `PUnit`.
-/
@[simps]
def colimitCocone (X : Cᵒᵖ) : Cocone (coyoneda.obj X) where
  pt := PUnit
  ι := { app := by 

Proof state:
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
⊢ (X_1 : C) → (coyoneda.obj X).obj X_1 ⟶ ((Functor.const C).obj PUnit.{v + 1}).obj X_1

Next tactic:
aesop_cat
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    

Proof state:
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
Y : C
⊢ (colimitCocone X).ι.app Y ≫ (fun s x => s.ι.app X.unop (𝟙 X.unop)) s = s.ι.app Y

Next tactic:
funext f
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    

Proof state:
case h
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
Y : C
f : (coyoneda.obj X).obj Y
⊢ ((colimitCocone X).ι.app Y ≫ (fun s x => s.ι.app X.unop (𝟙 X.unop)) s) f = s.ι.app Y f

Next tactic:
convert congr_fun (s.w f).symm (𝟙 (unop X))
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    convert congr_fun (s.w f).symm (𝟙 (unop X))
    

Proof state:
case h.e'_3.h
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
Y : C
f : (coyoneda.obj X).obj Y
e_1✝ : s.pt = ((Functor.const C).obj s.pt).obj X.unop
⊢ s.ι.app Y f = ((coyoneda.obj X).map f ≫ s.ι.app Y) (𝟙 X.unop)

Next tactic:
simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
      coyoneda_obj_map, Category.id_comp]
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    convert congr_fun (s.w f).symm (𝟙 (unop X))
    simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
      coyoneda_obj_map, Category.id_comp]
  uniq s m w := by
    

Proof state:
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
m : (colimitCocone X).pt ⟶ s.pt
w : ∀ (j : C), (colimitCocone X).ι.app j ≫ m = s.ι.app j
⊢ m = (fun s x => s.ι.app X.unop (𝟙 X.unop)) s

Next tactic:
apply funext
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    convert congr_fun (s.w f).symm (𝟙 (unop X))
    simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
      coyoneda_obj_map, Category.id_comp]
  uniq s m w := by
    apply funext; 

Proof state:
case h
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
m : (colimitCocone X).pt ⟶ s.pt
w : ∀ (j : C), (colimitCocone X).ι.app j ≫ m = s.ι.app j
⊢ ∀ (x : (colimitCocone X).pt), m x = (fun s x => s.ι.app X.unop (𝟙 X.unop)) s x

Next tactic:
rintro ⟨⟩
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    convert congr_fun (s.w f).symm (𝟙 (unop X))
    simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
      coyoneda_obj_map, Category.id_comp]
  uniq s m w := by
    apply funext; rintro ⟨⟩
    

Proof state:
case h.unit
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
m : (colimitCocone X).pt ⟶ s.pt
w : ∀ (j : C), (colimitCocone X).ι.app j ≫ m = s.ι.app j
⊢ m PUnit.unit = (fun s x => s.ι.app X.unop (𝟙 X.unop)) s PUnit.unit

Next tactic:
dsimp
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    convert congr_fun (s.w f).symm (𝟙 (unop X))
    simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
      coyoneda_obj_map, Category.id_comp]
  uniq s m w := by
    apply funext; rintro ⟨⟩
    dsimp
    

Proof state:
case h.unit
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
m : (colimitCocone X).pt ⟶ s.pt
w : ∀ (j : C), (colimitCocone X).ι.app j ≫ m = s.ι.app j
⊢ m PUnit.unit = s.ι.app X.unop (𝟙 X.unop)

Next tactic:
rw [← w]
/-- The proposed colimit cocone over `coyoneda.obj X` is a colimit cocone.
-/
@[simps]
def colimitCoconeIsColimit (X : Cᵒᵖ) : IsColimit (colimitCocone X)
    where
  desc s _ := s.ι.app (unop X) (𝟙 _)
  fac s Y := by
    funext f
    convert congr_fun (s.w f).symm (𝟙 (unop X))
    simp only [coyoneda_obj_obj, Functor.const_obj_obj, types_comp_apply,
      coyoneda_obj_map, Category.id_comp]
  uniq s m w := by
    apply funext; rintro ⟨⟩
    dsimp
    rw [← w]
    

Proof state:
case h.unit
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
s : Cocone (coyoneda.obj X)
m : (colimitCocone X).pt ⟶ s.pt
w : ∀ (j : C), (colimitCocone X).ι.app j ≫ m = s.ι.app j
⊢ m PUnit.unit = ((colimitCocone X).ι.app X.unop ≫ m) (𝟙 X.unop)

Next tactic:
simp
/-- The colimit of `coyoneda.obj X` is isomorphic to `PUnit`.
-/
noncomputable def colimitCoyonedaIso (X : Cᵒᵖ) : colimit (coyoneda.obj X) ≅ PUnit := by
  

Proof state:
C : Type v
inst✝ : SmallCategory C
X : Cᵒᵖ
⊢ colimit (coyoneda.obj X) ≅ PUnit.{v + 1}

Next tactic:
apply colimit.isoColimitCocone
    { cocone := _
      isColimit := colimitCoconeIsColimit X }
/-- The yoneda embedding `yoneda.obj X : Cᵒᵖ ⥤ Type v` for `X : C` preserves limits. -/
instance yonedaPreservesLimits (X : C) : PreservesLimits (yoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                Quiver.Hom.unop (t.lift ⟨op X, fun j => (s.π.app j x).op, fun j₁ j₂ α => by
                  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : C
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ Cᵒᵖ
c : Cone K
t : IsLimit c
s : Cone (K ⋙ yoneda.obj X)
x : s.pt
j₁ j₂ : J
α : j₁ ⟶ j₂
⊢ ((Functor.const J).obj (op X)).map α ≫ (fun j => (s.π.app j x).op) j₂ = (fun j => (s.π.app j x).op) j₁ ≫ K.map α

Next tactic:
simp [← s.w α]
/-- The yoneda embedding `yoneda.obj X : Cᵒᵖ ⥤ Type v` for `X : C` preserves limits. -/
instance yonedaPreservesLimits (X : C) : PreservesLimits (yoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                Quiver.Hom.unop (t.lift ⟨op X, fun j => (s.π.app j x).op, fun j₁ j₂ α => by
                  simp [← s.w α]⟩)
              fac := fun s j => funext fun x => Quiver.Hom.op_inj (t.fac _ _)
              uniq := fun s m w =>
                funext fun x => by
                  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : C
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ Cᵒᵖ
c : Cone K
t : IsLimit c
s : Cone (K ⋙ yoneda.obj X)
m : s.pt ⟶ ((yoneda.obj X).mapCone c).pt
w : ∀ (j : J), m ≫ ((yoneda.obj X).mapCone c).π.app j = s.π.app j
x : s.pt
⊢ m x = (fun s x => (IsLimit.lift t { pt := op X, π := NatTrans.mk fun j => (s.π.app j x).op }).unop) s x

Next tactic:
refine Quiver.Hom.op_inj (t.uniq ⟨op X, _, _⟩ _ fun j => ?_)
/-- The yoneda embedding `yoneda.obj X : Cᵒᵖ ⥤ Type v` for `X : C` preserves limits. -/
instance yonedaPreservesLimits (X : C) : PreservesLimits (yoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                Quiver.Hom.unop (t.lift ⟨op X, fun j => (s.π.app j x).op, fun j₁ j₂ α => by
                  simp [← s.w α]⟩)
              fac := fun s j => funext fun x => Quiver.Hom.op_inj (t.fac _ _)
              uniq := fun s m w =>
                funext fun x => by
                  refine Quiver.Hom.op_inj (t.uniq ⟨op X, _, _⟩ _ fun j => ?_)
                  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : C
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ Cᵒᵖ
c : Cone K
t : IsLimit c
s : Cone (K ⋙ yoneda.obj X)
m : s.pt ⟶ ((yoneda.obj X).mapCone c).pt
w : ∀ (j : J), m ≫ ((yoneda.obj X).mapCone c).π.app j = s.π.app j
x : s.pt
j : J
⊢ (m x).op ≫ c.π.app j = { pt := op X, π := NatTrans.mk fun j => (s.π.app j x).op }.π.app j

Next tactic:
exact Quiver.Hom.unop_inj (congrFun (w j) x)
/-- The coyoneda embedding `coyoneda.obj X : C ⥤ Type v` for `X : Cᵒᵖ` preserves limits. -/
instance coyonedaPreservesLimits (X : Cᵒᵖ) : PreservesLimits (coyoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                t.lift
                  ⟨unop X, fun j => s.π.app j x, fun j₁ j₂ α => by
                    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : Cᵒᵖ
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ C
c : Cone K
t : IsLimit c
s : Cone (K ⋙ coyoneda.obj X)
x : s.pt
j₁ j₂ : J
α : j₁ ⟶ j₂
⊢ ((Functor.const J).obj X.unop).map α ≫ (fun j => s.π.app j x) j₂ = (fun j => s.π.app j x) j₁ ≫ K.map α

Next tactic:
dsimp
/-- The coyoneda embedding `coyoneda.obj X : C ⥤ Type v` for `X : Cᵒᵖ` preserves limits. -/
instance coyonedaPreservesLimits (X : Cᵒᵖ) : PreservesLimits (coyoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                t.lift
                  ⟨unop X, fun j => s.π.app j x, fun j₁ j₂ α => by
                    dsimp
                    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : Cᵒᵖ
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ C
c : Cone K
t : IsLimit c
s : Cone (K ⋙ coyoneda.obj X)
x : s.pt
j₁ j₂ : J
α : j₁ ⟶ j₂
⊢ 𝟙 X.unop ≫ s.π.app j₂ x = s.π.app j₁ x ≫ K.map α

Next tactic:
simp [← s.w α]
/-- The coyoneda embedding `coyoneda.obj X : C ⥤ Type v` for `X : Cᵒᵖ` preserves limits. -/
instance coyonedaPreservesLimits (X : Cᵒᵖ) : PreservesLimits (coyoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                t.lift
                  ⟨unop X, fun j => s.π.app j x, fun j₁ j₂ α => by
                    dsimp
                    simp [← s.w α]⟩
              -- See library note [dsimp, simp]
              fac := fun s j => funext fun x => t.fac _ _
              uniq := fun s m w =>
                funext fun x => by
                  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : Cᵒᵖ
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ C
c : Cone K
t : IsLimit c
s : Cone (K ⋙ coyoneda.obj X)
m : s.pt ⟶ ((coyoneda.obj X).mapCone c).pt
w : ∀ (j : J), m ≫ ((coyoneda.obj X).mapCone c).π.app j = s.π.app j
x : s.pt
⊢ m x = (fun s x => IsLimit.lift t { pt := X.unop, π := NatTrans.mk fun j => s.π.app j x }) s x

Next tactic:
refine' t.uniq ⟨unop X, _⟩ _ fun j => _
/-- The coyoneda embedding `coyoneda.obj X : C ⥤ Type v` for `X : Cᵒᵖ` preserves limits. -/
instance coyonedaPreservesLimits (X : Cᵒᵖ) : PreservesLimits (coyoneda.obj X) where
  preservesLimitsOfShape {J} 𝒥 :=
    { preservesLimit := fun {K} =>
        { preserves := fun {c} t =>
            { lift := fun s x =>
                t.lift
                  ⟨unop X, fun j => s.π.app j x, fun j₁ j₂ α => by
                    dsimp
                    simp [← s.w α]⟩
              -- See library note [dsimp, simp]
              fac := fun s j => funext fun x => t.fac _ _
              uniq := fun s m w =>
                funext fun x => by
                  refine' t.uniq ⟨unop X, _⟩ _ fun j => _
                  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : Cᵒᵖ
J : Type v
𝒥 : Category.{v, v} J
K : J ⥤ C
c : Cone K
t : IsLimit c
s : Cone (K ⋙ coyoneda.obj X)
m : s.pt ⟶ ((coyoneda.obj X).mapCone c).pt
w : ∀ (j : J), m ≫ ((coyoneda.obj X).mapCone c).π.app j = s.π.app j
x : s.pt
j : J
⊢ m x ≫ c.π.app j = { pt := X.unop, π := NatTrans.mk fun j => s.π.app j x }.π.app j

Next tactic:
exact congrFun (w j) x
/-- The yoneda embeddings jointly reflect limits. -/
def yonedaJointlyReflectsLimits (J : Type w) [SmallCategory J] (K : J ⥤ Cᵒᵖ) (c : Cone K)
    (t : ∀ X : C, IsLimit ((yoneda.obj X).mapCone c)) : IsLimit c :=
  let s' : ∀ s : Cone K, Cone (K ⋙ yoneda.obj s.pt.unop) := fun s =>
    ⟨PUnit, fun j _ => (s.π.app j).unop, fun j₁ j₂ α =>
      funext fun _ => Quiver.Hom.op_inj (s.w α).symm⟩
  { lift := fun s => ((t s.pt.unop).lift (s' s) PUnit.unit).op
    fac := fun s j => Quiver.Hom.unop_inj (congr_fun ((t s.pt.unop).fac (s' s) j) PUnit.unit)
    uniq := fun s m w => by
      

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type w
inst✝ : SmallCategory J
K : J ⥤ Cᵒᵖ
c : Cone K
t : (X : C) → IsLimit ((yoneda.obj X).mapCone c)
s' : (s : Cone K) → Cone (K ⋙ yoneda.obj s.pt.unop) :=
  fun s => { pt := PUnit.{v + 1}, π := NatTrans.mk fun j x => (s.π.app j).unop }
s : Cone K
m : s.pt ⟶ c.pt
w : ∀ (j : J), m ≫ c.π.app j = s.π.app j
⊢ m = (fun s => (IsLimit.lift (t s.pt.unop) (s' s) PUnit.unit).op) s

Next tactic:
apply Quiver.Hom.unop_inj
/-- The yoneda embeddings jointly reflect limits. -/
def yonedaJointlyReflectsLimits (J : Type w) [SmallCategory J] (K : J ⥤ Cᵒᵖ) (c : Cone K)
    (t : ∀ X : C, IsLimit ((yoneda.obj X).mapCone c)) : IsLimit c :=
  let s' : ∀ s : Cone K, Cone (K ⋙ yoneda.obj s.pt.unop) := fun s =>
    ⟨PUnit, fun j _ => (s.π.app j).unop, fun j₁ j₂ α =>
      funext fun _ => Quiver.Hom.op_inj (s.w α).symm⟩
  { lift := fun s => ((t s.pt.unop).lift (s' s) PUnit.unit).op
    fac := fun s j => Quiver.Hom.unop_inj (congr_fun ((t s.pt.unop).fac (s' s) j) PUnit.unit)
    uniq := fun s m w => by
      apply Quiver.Hom.unop_inj
      

Proof state:
case a
C : Type u
inst✝¹ : Category.{v, u} C
J : Type w
inst✝ : SmallCategory J
K : J ⥤ Cᵒᵖ
c : Cone K
t : (X : C) → IsLimit ((yoneda.obj X).mapCone c)
s' : (s : Cone K) → Cone (K ⋙ yoneda.obj s.pt.unop) :=
  fun s => { pt := PUnit.{v + 1}, π := NatTrans.mk fun j x => (s.π.app j).unop }
s : Cone K
m : s.pt ⟶ c.pt
w : ∀ (j : J), m ≫ c.π.app j = s.π.app j
⊢ m.unop = ((fun s => (IsLimit.lift (t s.pt.unop) (s' s) PUnit.unit).op) s).unop

Next tactic:
suffices (fun _ : PUnit => m.unop) = (t s.pt.unop).lift (s' s) by
        apply congr_fun this PUnit.unit
/-- The yoneda embeddings jointly reflect limits. -/
def yonedaJointlyReflectsLimits (J : Type w) [SmallCategory J] (K : J ⥤ Cᵒᵖ) (c : Cone K)
    (t : ∀ X : C, IsLimit ((yoneda.obj X).mapCone c)) : IsLimit c :=
  let s' : ∀ s : Cone K, Cone (K ⋙ yoneda.obj s.pt.unop) := fun s =>
    ⟨PUnit, fun j _ => (s.π.app j).unop, fun j₁ j₂ α =>
      funext fun _ => Quiver.Hom.op_inj (s.w α).symm⟩
  { lift := fun s => ((t s.pt.unop).lift (s' s) PUnit.unit).op
    fac := fun s j => Quiver.Hom.unop_inj (congr_fun ((t s.pt.unop).fac (s' s) j) PUnit.unit)
    uniq := fun s m w => by
      apply Quiver.Hom.unop_inj
      suffices (fun _ : PUnit => m.unop) = (t s.pt.unop).lift (s' s) by
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type w
inst✝ : SmallCategory J
K : J ⥤ Cᵒᵖ
c : Cone K
t : (X : C) → IsLimit ((yoneda.obj X).mapCone c)
s' : (s : Cone K) → Cone (K ⋙ yoneda.obj s.pt.unop) :=
  fun s => { pt := PUnit.{v + 1}, π := NatTrans.mk fun j x => (s.π.app j).unop }
s : Cone K
m : s.pt ⟶ c.pt
w : ∀ (j : J), m ≫ c.π.app j = s.π.app j
this : (fun x => m.unop) = IsLimit.lift (t s.pt.unop) (s' s)
⊢ m.unop = ((fun s => (IsLimit.lift (t s.pt.unop) (s' s) PUnit.unit).op) s).unop

Next tactic:
apply congr_fun this PUnit.unit
/-- The yoneda embeddings jointly reflect limits. -/
def yonedaJointlyReflectsLimits (J : Type w) [SmallCategory J] (K : J ⥤ Cᵒᵖ) (c : Cone K)
    (t : ∀ X : C, IsLimit ((yoneda.obj X).mapCone c)) : IsLimit c :=
  let s' : ∀ s : Cone K, Cone (K ⋙ yoneda.obj s.pt.unop) := fun s =>
    ⟨PUnit, fun j _ => (s.π.app j).unop, fun j₁ j₂ α =>
      funext fun _ => Quiver.Hom.op_inj (s.w α).symm⟩
  { lift := fun s => ((t s.pt.unop).lift (s' s) PUnit.unit).op
    fac := fun s j => Quiver.Hom.unop_inj (congr_fun ((t s.pt.unop).fac (s' s) j) PUnit.unit)
    uniq := fun s m w => by
      apply Quiver.Hom.unop_inj
      suffices (fun _ : PUnit => m.unop) = (t s.pt.unop).lift (s' s) by
        apply congr_fun this PUnit.unit
      

Proof state:
case a
C : Type u
inst✝¹ : Category.{v, u} C
J : Type w
inst✝ : SmallCategory J
K : J ⥤ Cᵒᵖ
c : Cone K
t : (X : C) → IsLimit ((yoneda.obj X).mapCone c)
s' : (s : Cone K) → Cone (K ⋙ yoneda.obj s.pt.unop) :=
  fun s => { pt := PUnit.{v + 1}, π := NatTrans.mk fun j x => (s.π.app j).unop }
s : Cone K
m : s.pt ⟶ c.pt
w : ∀ (j : J), m ≫ c.π.app j = s.π.app j
⊢ (fun x => m.unop) = IsLimit.lift (t s.pt.unop) (s' s)

Next tactic:
apply (t _).uniq (s' s) _ fun j => _
/-- The yoneda embeddings jointly reflect limits. -/
def yonedaJointlyReflectsLimits (J : Type w) [SmallCategory J] (K : J ⥤ Cᵒᵖ) (c : Cone K)
    (t : ∀ X : C, IsLimit ((yoneda.obj X).mapCone c)) : IsLimit c :=
  let s' : ∀ s : Cone K, Cone (K ⋙ yoneda.obj s.pt.unop) := fun s =>
    ⟨PUnit, fun j _ => (s.π.app j).unop, fun j₁ j₂ α =>
      funext fun _ => Quiver.Hom.op_inj (s.w α).symm⟩
  { lift := fun s => ((t s.pt.unop).lift (s' s) PUnit.unit).op
    fac := fun s j => Quiver.Hom.unop_inj (congr_fun ((t s.pt.unop).fac (s' s) j) PUnit.unit)
    uniq := fun s m w => by
      apply Quiver.Hom.unop_inj
      suffices (fun _ : PUnit => m.unop) = (t s.pt.unop).lift (s' s) by
        apply congr_fun this PUnit.unit
      apply (t _).uniq (s' s) _ fun j => _
      

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
J : Type w
inst✝ : SmallCategory J
K : J ⥤ Cᵒᵖ
c : Cone K
t : (X : C) → IsLimit ((yoneda.obj X).mapCone c)
s' : (s : Cone K) → Cone (K ⋙ yoneda.obj s.pt.unop) :=
  fun s => { pt := PUnit.{v + 1}, π := NatTrans.mk fun j x => (s.π.app j).unop }
s : Cone K
m : s.pt ⟶ c.pt
w : ∀ (j : J), m ≫ c.π.app j = s.π.app j
⊢ ∀ (j : J), (fun x => m.unop) ≫ ((yoneda.obj s.pt.unop).mapCone c).π.app j = (s' s).π.app j

Next tactic:
intro j