l3lab/ntp-mathlib huggingface dataset:
/--
The equivalence between `K.sections` and `(K ⋙ uliftFunctor.{v, u}).sections`. This is used to show
that `uliftFunctor` preserves limits that are too possibly too large to exist in the source
category.
-/
def sectionsEquiv' {J : Type*} [Category J] (K : J ⥤ Type u) :
    K.sections ≃ (K ⋙ uliftFunctor.{v, u}).sections where
  toFun := fun ⟨u, hu⟩ => ⟨fun j => ⟨u j⟩, fun f => by simp [hu f]⟩
  invFun := fun ⟨u, hu⟩ => ⟨fun j => (u j).down, @fun j j' f => by simp [← hu f]⟩
  left_inv _ := by ext; rfl
  right_inv _ := by 

Proof state:
J : Type u_1
inst✝ : Category.{?u.4639, u_1} J
K : J ⥤ Type u
x✝ : ↑(Functor.sections (K ⋙ uliftFunctor.{v, u}))
⊢ (fun x =>
        match x with
        | { val := u, property := hu } =>
          { val := fun j => { down := u j },
            property := (_ : ∀ {j j' : J} (f : j ⟶ j'), { down := K.map f (u j) } = { down := u j' }) })
      ((fun x =>
          match x with
          | { val := u, property := hu } =>
            { val := fun j => (u j).down,
              property := (_ : ∀ (j j' : J) (f : j ⟶ j'), K.map f (u j).down = (u j').down) })
        x✝) =
    x✝

Next tactic:
ext
/--
The equivalence between `K.sections` and `(K ⋙ uliftFunctor.{v, u}).sections`. This is used to show
that `uliftFunctor` preserves limits that are too possibly too large to exist in the source
category.
-/
def sectionsEquiv' {J : Type*} [Category J] (K : J ⥤ Type u) :
    K.sections ≃ (K ⋙ uliftFunctor.{v, u}).sections where
  toFun := fun ⟨u, hu⟩ => ⟨fun j => ⟨u j⟩, fun f => by simp [hu f]⟩
  invFun := fun ⟨u, hu⟩ => ⟨fun j => (u j).down, @fun j j' f => by simp [← hu f]⟩
  left_inv _ := by ext; rfl
  right_inv _ := by ext; 

Proof state:
case a.h
J : Type u_1
inst✝ : Category.{?u.4639, u_1} J
K : J ⥤ Type u
x✝¹ : ↑(Functor.sections (K ⋙ uliftFunctor.{v, u}))
x✝ : J
⊢ ↑((fun x =>
            match x with
            | { val := u, property := hu } =>
              { val := fun j => { down := u j },
                property := (_ : ∀ {j j' : J} (f : j ⟶ j'), { down := K.map f (u j) } = { down := u j' }) })
          ((fun x =>
              match x with
              | { val := u, property := hu } =>
                { val := fun j => (u j).down,
                  property := (_ : ∀ (j j' : J) (f : j ⟶ j'), K.map f (u j).down = (u j').down) })
            x✝¹))
      x✝ =
    ↑x✝¹ x✝

Next tactic:
rfl
/--
The functor `uliftFunctor : Type u ⥤ Type (max u v)` preserves limits.
-/
noncomputable
instance : PreservesLimits uliftFunctor.{v, u} where
  preservesLimitsOfShape {J} := {
    preservesLimit := fun {K} => {
      preserves := fun {c} hc => by
        

Proof state:
J : Type (max u v)
inst✝ : Category.{max u v, max u v} J
K : J ⥤ Type u
c : Cone K
hc : IsLimit c
⊢ IsLimit (uliftFunctor.{v, u}.mapCone c)

Next tactic:
apply Nonempty.some
/--
The functor `uliftFunctor : Type u ⥤ Type (max u v)` preserves limits.
-/
noncomputable
instance : PreservesLimits uliftFunctor.{v, u} where
  preservesLimitsOfShape {J} := {
    preservesLimit := fun {K} => {
      preserves := fun {c} hc => by
        apply Nonempty.some
        

Proof state:
case h
J : Type (max u v)
inst✝ : Category.{max u v, max u v} J
K : J ⥤ Type u
c : Cone K
hc : IsLimit c
⊢ Nonempty (IsLimit (uliftFunctor.{v, u}.mapCone c))

Next tactic:
rw [Types.isLimit_iff ((uliftFunctor.{v, u}).mapCone c)]
/--
The functor `uliftFunctor : Type u ⥤ Type (max u v)` preserves limits.
-/
noncomputable
instance : PreservesLimits uliftFunctor.{v, u} where
  preservesLimitsOfShape {J} := {
    preservesLimit := fun {K} => {
      preserves := fun {c} hc => by
        apply Nonempty.some
        rw [Types.isLimit_iff ((uliftFunctor.{v, u}).mapCone c)]
        

Proof state:
case h
J : Type (max u v)
inst✝ : Category.{max u v, max u v} J
K : J ⥤ Type u
c : Cone K
hc : IsLimit c
⊢ ∀ s ∈ Functor.sections (K ⋙ uliftFunctor.{v, u}), ∃! x, ∀ (i : J), (uliftFunctor.{v, u}.mapCone c).π.app i x = s i

Next tactic:
intro s hs
/--
The functor `uliftFunctor : Type u ⥤ Type (max u v)` preserves limits.
-/
noncomputable
instance : PreservesLimits uliftFunctor.{v, u} where
  preservesLimitsOfShape {J} := {
    preservesLimit := fun {K} => {
      preserves := fun {c} hc => by
        apply Nonempty.some
        rw [Types.isLimit_iff ((uliftFunctor.{v, u}).mapCone c)]
        intro s hs
        

Proof state:
case h
J : Type (max u v)
inst✝ : Category.{max u v, max u v} J
K : J ⥤ Type u
c : Cone K
hc : IsLimit c
s : (j : J) → (K ⋙ uliftFunctor.{v, u}).obj j
hs : s ∈ Functor.sections (K ⋙ uliftFunctor.{v, u})
⊢ ∃! x, ∀ (i : J), (uliftFunctor.{v, u}.mapCone c).π.app i x = s i

Next tactic:
obtain ⟨x, hx₁, hx₂⟩ := (Types.isLimit_iff c).mp ⟨hc⟩ _ ((sectionsEquiv' K).symm ⟨s, hs⟩).2
/--
The functor `uliftFunctor : Type u ⥤ Type (max u v)` preserves limits.
-/
noncomputable
instance : PreservesLimits uliftFunctor.{v, u} where
  preservesLimitsOfShape {J} := {
    preservesLimit := fun {K} => {
      preserves := fun {c} hc => by
        apply Nonempty.some
        rw [Types.isLimit_iff ((uliftFunctor.{v, u}).mapCone c)]
        intro s hs
        obtain ⟨x, hx₁, hx₂⟩ := (Types.isLimit_iff c).mp ⟨hc⟩ _ ((sectionsEquiv' K).symm ⟨s, hs⟩).2
        

Proof state:
case h.intro.intro
J : Type (max u v)
inst✝ : Category.{max u v, max u v} J
K : J ⥤ Type u
c : Cone K
hc : IsLimit c
s : (j : J) → (K ⋙ uliftFunctor.{v, u}).obj j
hs : s ∈ Functor.sections (K ⋙ uliftFunctor.{v, u})
x : c.pt
hx₁ :
  ∀ (i : J),
    c.π.app i x =
      ↑((sectionsEquiv' K).symm
            { val := s, property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (K ⋙ uliftFunctor.{v, u}).map f (s j) = s j') })
        i
hx₂ :
  ∀ (y : c.pt),
    (fun x =>
          ∀ (i : J),
            c.π.app i x =
              ↑((sectionsEquiv' K).symm
                    { val := s,
                      property := (_ : ∀ {j j' : J} (f : j ⟶ j'), (K ⋙ uliftFunctor.{v, u}).map f (s j) = s j') })
                i)
        y →
      y = x
⊢ ∃! x, ∀ (i : J), (uliftFunctor.{v, u}.mapCone c).π.app i x = s i

Next tactic:
exact ⟨⟨x⟩, fun i => ULift.ext _ _ (hx₁ i),
          fun y hy => ULift.ext _ _ (hx₂ y.down fun i ↦ (ULift.ext_iff _ _).mp (hy i))⟩
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    

Proof state:
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
⊢ Function.LeftInverse
    (fun u =>
      {
        down :=
          Quot.map
            (fun x =>
              match x with
              | { fst := j, snd := x } => { fst := j, snd := x.down })
            (_ :
              ∀ (x x_1 : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
                Quot.Rel (K ⋙ uliftFunctor.{v, u}) x x_1 →
                  Quot.Rel K
                    ((fun x =>
                        match x with
                        | { fst := j, snd := x } => { fst := j, snd := x.down })
                      x)
                    ((fun x =>
                        match x with
                        | { fst := j, snd := x } => { fst := j, snd := x.down })
                      x_1))
            u })
    fun x =>
    match x with
    | { down := u } =>
      Quot.map
        (fun x =>
          match x with
          | { fst := j, snd := x } => { fst := j, snd := { down := x } })
        (_ :
          ∀ (x x_1 : (j : J) × K.obj j),
            Quot.Rel K x x_1 →
              Quot.Rel (K ⋙ uliftFunctor.{v, u})
                ((fun x =>
                    match x with
                    | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                  x)
                ((fun x =>
                    match x with
                    | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                  x_1))
        u

Next tactic:
intro ⟨x⟩
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    

Proof state:
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
x : Quot K
⊢ (fun u =>
        {
          down :=
            Quot.map
              (fun x =>
                match x with
                | { fst := j, snd := x } => { fst := j, snd := x.down })
              (_ :
                ∀ (x x_1 : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
                  Quot.Rel (K ⋙ uliftFunctor.{v, u}) x x_1 →
                    Quot.Rel K
                      ((fun x =>
                          match x with
                          | { fst := j, snd := x } => { fst := j, snd := x.down })
                        x)
                      ((fun x =>
                          match x with
                          | { fst := j, snd := x } => { fst := j, snd := x.down })
                        x_1))
              u })
      ((fun x =>
          match x with
          | { down := u } =>
            Quot.map
              (fun x =>
                match x with
                | { fst := j, snd := x } => { fst := j, snd := { down := x } })
              (_ :
                ∀ (x x_1 : (j : J) × K.obj j),
                  Quot.Rel K x x_1 →
                    Quot.Rel (K ⋙ uliftFunctor.{v, u})
                      ((fun x =>
                          match x with
                          | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                        x)
                      ((fun x =>
                          match x with
                          | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                        x_1))
              u)
        { down := x }) =
    { down := x }

Next tactic:
apply ULift.ext
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    apply ULift.ext
    

Proof state:
case h
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
x : Quot K
⊢ ((fun u =>
          {
            down :=
              Quot.map
                (fun x =>
                  match x with
                  | { fst := j, snd := x } => { fst := j, snd := x.down })
                (_ :
                  ∀ (x x_1 : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
                    Quot.Rel (K ⋙ uliftFunctor.{v, u}) x x_1 →
                      Quot.Rel K
                        ((fun x =>
                            match x with
                            | { fst := j, snd := x } => { fst := j, snd := x.down })
                          x)
                        ((fun x =>
                            match x with
                            | { fst := j, snd := x } => { fst := j, snd := x.down })
                          x_1))
                u })
        ((fun x =>
            match x with
            | { down := u } =>
              Quot.map
                (fun x =>
                  match x with
                  | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                (_ :
                  ∀ (x x_1 : (j : J) × K.obj j),
                    Quot.Rel K x x_1 →
                      Quot.Rel (K ⋙ uliftFunctor.{v, u})
                        ((fun x =>
                            match x with
                            | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                          x)
                        ((fun x =>
                            match x with
                            | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                          x_1))
                u)
          { down := x })).down =
    { down := x }.down

Next tactic:
simp only [Functor.comp_obj, Quot.map]
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    apply ULift.ext
    simp only [Functor.comp_obj, Quot.map]
    

Proof state:
case h
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
x : Quot K
⊢ Quot.lift (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down })
      (_ :
        ∀ (a b : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
          Quot.Rel (K ⋙ uliftFunctor.{v, u}) a b →
            (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down }) a =
              (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down }) b)
      (Quot.lift (fun x => Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u})) { fst := x.fst, snd := { down := x.snd } })
        (_ :
          ∀ (x y : (j : J) × K.obj j),
            Quot.Rel K x y →
              Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u}))
                  (match x with
                  | { fst := j, snd := x } => { fst := j, snd := { down := x } }) =
                Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u}))
                  (match y with
                  | { fst := j, snd := x } => { fst := j, snd := { down := x } }))
        x) =
    x

Next tactic:
rw [← Quot.out_eq x]
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    apply ULift.ext
    simp only [Functor.comp_obj, Quot.map]
    rw [← Quot.out_eq x]
  right_inv := by
    

Proof state:
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
⊢ Function.RightInverse
    (fun u =>
      {
        down :=
          Quot.map
            (fun x =>
              match x with
              | { fst := j, snd := x } => { fst := j, snd := x.down })
            (_ :
              ∀ (x x_1 : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
                Quot.Rel (K ⋙ uliftFunctor.{v, u}) x x_1 →
                  Quot.Rel K
                    ((fun x =>
                        match x with
                        | { fst := j, snd := x } => { fst := j, snd := x.down })
                      x)
                    ((fun x =>
                        match x with
                        | { fst := j, snd := x } => { fst := j, snd := x.down })
                      x_1))
            u })
    fun x =>
    match x with
    | { down := u } =>
      Quot.map
        (fun x =>
          match x with
          | { fst := j, snd := x } => { fst := j, snd := { down := x } })
        (_ :
          ∀ (x x_1 : (j : J) × K.obj j),
            Quot.Rel K x x_1 →
              Quot.Rel (K ⋙ uliftFunctor.{v, u})
                ((fun x =>
                    match x with
                    | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                  x)
                ((fun x =>
                    match x with
                    | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                  x_1))
        u

Next tactic:
intro x
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    apply ULift.ext
    simp only [Functor.comp_obj, Quot.map]
    rw [← Quot.out_eq x]
  right_inv := by
    intro x
    

Proof state:
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
x : Quot (K ⋙ uliftFunctor.{v, u})
⊢ (fun x =>
        match x with
        | { down := u } =>
          Quot.map
            (fun x =>
              match x with
              | { fst := j, snd := x } => { fst := j, snd := { down := x } })
            (_ :
              ∀ (x x_1 : (j : J) × K.obj j),
                Quot.Rel K x x_1 →
                  Quot.Rel (K ⋙ uliftFunctor.{v, u})
                    ((fun x =>
                        match x with
                        | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                      x)
                    ((fun x =>
                        match x with
                        | { fst := j, snd := x } => { fst := j, snd := { down := x } })
                      x_1))
            u)
      ((fun u =>
          {
            down :=
              Quot.map
                (fun x =>
                  match x with
                  | { fst := j, snd := x } => { fst := j, snd := x.down })
                (_ :
                  ∀ (x x_1 : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
                    Quot.Rel (K ⋙ uliftFunctor.{v, u}) x x_1 →
                      Quot.Rel K
                        ((fun x =>
                            match x with
                            | { fst := j, snd := x } => { fst := j, snd := x.down })
                          x)
                        ((fun x =>
                            match x with
                            | { fst := j, snd := x } => { fst := j, snd := x.down })
                          x_1))
                u })
        x) =
    x

Next tactic:
simp only [Functor.comp_obj, Quot.map]
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    apply ULift.ext
    simp only [Functor.comp_obj, Quot.map]
    rw [← Quot.out_eq x]
  right_inv := by
    intro x
    simp only [Functor.comp_obj, Quot.map]
    

Proof state:
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
x : Quot (K ⋙ uliftFunctor.{v, u})
⊢ Quot.lift (fun x => Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u})) { fst := x.fst, snd := { down := x.snd } })
      (_ :
        ∀ (x y : (j : J) × K.obj j),
          Quot.Rel K x y →
            Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u}))
                (match x with
                | { fst := j, snd := x } => { fst := j, snd := { down := x } }) =
              Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u}))
                (match y with
                | { fst := j, snd := x } => { fst := j, snd := { down := x } }))
      (Quot.lift (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down })
        (_ :
          ∀ (a b : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
            Quot.Rel (K ⋙ uliftFunctor.{v, u}) a b →
              (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down }) a =
                (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down }) b)
        x) =
    x

Next tactic:
rw [← Quot.out_eq x]
/--
The equivalence between the ulift of the explicit colimit cocone of a functor `K` and the explicit
colimit cocone of `K ⋙ uliftFunctor`.
-/
def quotEquiv {J : Type u} [Category.{u, u} J] (K : J ⥤ Type u) :
    uliftFunctor.{v, u}.obj (Types.Quot.{u, u} K) ≃
      (Types.Quot.{u, v} (K ⋙ uliftFunctor.{v, u})) where
  toFun := fun ⟨u⟩ => Quot.map (fun ⟨j, x⟩ ↦ ⟨j, ⟨x⟩⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, ULift.ext _ _ h⟩) u
  invFun := fun u => ⟨Quot.map (fun ⟨j, x⟩ ↦ ⟨j, x.down⟩)
    (fun _ _ ⟨f, h⟩ => ⟨f, (ULift.ext_iff.{v, u} _ _).mp h⟩) u⟩
  left_inv := by
    intro ⟨x⟩
    apply ULift.ext
    simp only [Functor.comp_obj, Quot.map]
    rw [← Quot.out_eq x]
  right_inv := by
    intro x
    simp only [Functor.comp_obj, Quot.map]
    rw [← Quot.out_eq x]
    

Proof state:
J : Type u
inst✝ : Category.{u, u} J
K : J ⥤ Type u
x : Quot (K ⋙ uliftFunctor.{v, u})
⊢ Quot.lift (fun x => Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u})) { fst := x.fst, snd := { down := x.snd } })
      (_ :
        ∀ (x y : (j : J) × K.obj j),
          Quot.Rel K x y →
            Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u}))
                (match x with
                | { fst := j, snd := x } => { fst := j, snd := { down := x } }) =
              Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u}))
                (match y with
                | { fst := j, snd := x } => { fst := j, snd := { down := x } }))
      (Quot.lift (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down })
        (_ :
          ∀ (a b : (j : J) × (K ⋙ uliftFunctor.{v, u}).obj j),
            Quot.Rel (K ⋙ uliftFunctor.{v, u}) a b →
              (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down }) a =
                (fun x => Quot.mk (Quot.Rel K) { fst := x.fst, snd := x.snd.down }) b)
        (Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u})) (Quot.out x))) =
    Quot.mk (Quot.Rel (K ⋙ uliftFunctor.{v, u})) (Quot.out x)

Next tactic:
rfl
/-- `f` is Lipschitz iff it is Lipschitz on the entire space. -/
@[simp]
theorem lipschitzOn_univ [PseudoEMetricSpace α] [PseudoEMetricSpace β] {K : ℝ≥0} {f : α → β} :
    LipschitzOnWith K f univ ↔ LipschitzWith K f := by 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Type x
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
K : ℝ≥0
f : α → β
⊢ LipschitzOnWith K f univ ↔ LipschitzWith K f

Next tactic:
simp [LipschitzOnWith, LipschitzWith]
theorem lipschitzOnWith_iff_restrict [PseudoEMetricSpace α] [PseudoEMetricSpace β] {K : ℝ≥0}
    {f : α → β} {s : Set α} : LipschitzOnWith K f s ↔ LipschitzWith K (s.restrict f) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Type x
inst✝¹ : PseudoEMetricSpace α
inst✝ : PseudoEMetricSpace β
K : ℝ≥0
f : α → β
s : Set α
⊢ LipschitzOnWith K f s ↔ LipschitzWith K (restrict s f)

Next tactic:
simp only [LipschitzOnWith, LipschitzWith, SetCoe.forall', restrict, Subtype.edist_eq]
theorem mul_edist_le (h : LipschitzWith K f) (x y : α) :
    (K⁻¹ : ℝ≥0∞) * edist (f x) (f y) ≤ edist x y := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Type x
inst✝² : PseudoEMetricSpace α
inst✝¹ : PseudoEMetricSpace β
inst✝ : PseudoEMetricSpace γ
K : ℝ≥0
f : α → β
x✝ y✝ : α
r : ℝ≥0∞
h : LipschitzWith K f
x y : α
⊢ (↑K)⁻¹ * edist (f x) (f y) ≤ edist x y

Next tactic:
rw [mul_comm, ← div_eq_mul_inv]