topology.sheaves.sheaf_condition.unique_gluingMathlib.Topology.Sheaves.SheafCondition.UniqueGluing

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

chore(topology/sheaves): revert universe generalizations from #19153 (#19230)

This reverts commit 13361559.

These are just too difficult to forward port as is because of the max u v =?= max u ?v issue https://github.com/leanprover/lean4/issues/2297.

We have another candidate approach to this, using a new UnivLE typeclass, and I would prefer if we investigated that without the pressure of the port at the same time.

This will delay @hrmacbeth's plans to define meromorphic functions, perhaps.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -48,9 +48,9 @@ open topological_space
 open topological_space.opens
 open opposite
 
-universes u v w
+universes u v
 
-variables {C : Type u} [category.{max w v} C] [concrete_category.{max w v} C]
+variables {C : Type u} [category.{v} C] [concrete_category.{v} C]
 
 namespace Top
 
@@ -60,7 +60,7 @@ section
 
 local attribute [instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variables {X : Top.{w}} (F : presheaf C X) {ι : Type w} (U : ι → opens X)
+variables {X : Top.{v}} (F : presheaf C X) {ι : Type v} (U : ι → opens X)
 
 /--
 A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
@@ -85,14 +85,14 @@ We prove this to be equivalent to the usual one below in
 `is_sheaf_iff_is_sheaf_unique_gluing`
 -/
 def is_sheaf_unique_gluing : Prop :=
-∀ ⦃ι : Type w⦄ (U : ι → opens X) (sf : Π i : ι, F.obj (op (U i))),
+∀ ⦃ι : Type v⦄ (U : ι → opens X) (sf : Π i : ι, F.obj (op (U i))),
   is_compatible F U sf → ∃! s : F.obj (op (supr U)), is_gluing F U sf s
 
 end
 
 section type_valued
 
-variables {X : Top.{w}} (F : presheaf (Type max w v) X) {ι : Type w} (U : ι → opens X)
+variables {X : Top.{v}} (F : presheaf (Type v) X) {ι : Type v} (U : ι → opens X)
 
 /--
 For presheaves of types, terms of `pi_opens F U` are just families of sections.
@@ -100,7 +100,7 @@ For presheaves of types, terms of `pi_opens F U` are just families of sections.
 def pi_opens_iso_sections_family : pi_opens F U ≅ Π i : ι, F.obj (op (U i)) :=
 limits.is_limit.cone_point_unique_up_to_iso
   (limit.is_limit (discrete.functor (λ i : ι, F.obj (op (U i)))))
-  ((types.product_limit_cone.{w (max w v)} (λ i : ι, F.obj (op (U i)))).is_limit)
+  ((types.product_limit_cone.{v v} (λ i : ι, F.obj (op (U i)))).is_limit)
 
 /--
 Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
@@ -112,8 +112,8 @@ lemma compatible_iff_left_res_eq_right_res (sf : pi_opens F U) :
 begin
   split ; intros h,
   { ext ⟨i, j⟩,
-    rw [left_res, types.limit.lift_π_apply, fan.mk_π_app,
-        right_res, types.limit.lift_π_apply, fan.mk_π_app],
+    rw [left_res, types.limit.lift_π_apply', fan.mk_π_app,
+        right_res, types.limit.lift_π_apply', fan.mk_π_app],
     exact h i j, },
   { intros i j,
     convert congr_arg (limits.pi.π (λ p : ι × ι, F.obj (op (U p.1 ⊓ U p.2))) (i,j)) h,
@@ -132,7 +132,7 @@ lemma is_gluing_iff_eq_res (sf : pi_opens F U) (s : F.obj (op (supr U))):
 begin
   split ; intros h,
   { ext ⟨i⟩,
-    rw [res, types.limit.lift_π_apply, fan.mk_π_app],
+    rw [res, types.limit.lift_π_apply', fan.mk_π_app],
     exact h i, },
   { intro i,
     convert congr_arg (limits.pi.π (λ i : ι, F.obj (op (U i))) i) h,
@@ -209,9 +209,8 @@ section
 
 local attribute [instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variables [has_limits_of_size.{w w} C] [reflects_isomorphisms (forget C)]
-  [preserves_limits_of_size.{w w} (forget C)]
-variables {X : Top.{w}} (F : presheaf C X) {ι : Type w} (U : ι → opens X)
+variables [has_limits C] [reflects_isomorphisms (forget C)] [preserves_limits (forget C)]
+variables {X : Top.{v}} (F : presheaf C X) {ι : Type v} (U : ι → opens X)
 
 /--
 For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
@@ -236,10 +235,10 @@ section
 
 local attribute [instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variables [has_limits_of_size.{w w} C] [reflects_isomorphisms (concrete_category.forget C)]
-variables [preserves_limits_of_size.{w w} (concrete_category.forget C)]
+variables [has_limits C] [reflects_isomorphisms (concrete_category.forget C)]
+variables [preserves_limits (concrete_category.forget C)]
 
-variables {X : Top.{w}} (F : sheaf C X) {ι : Type w} (U : ι → opens X)
+variables {X : Top.{v}} (F : sheaf C X) {ι : Type v} (U : ι → opens X)
 
 /--
 A more convenient way of obtaining a unique gluing of sections for a sheaf.

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

chore(topology/sheaves/*): universe generalizations (#19153)

Necessary but sadly insufficient for the request at https://leanprover.zulipchat.com/#narrow/stream/144837-PR-reviews/topic/.2319146.20sheaves.20on.20manifolds

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -48,9 +48,9 @@ open topological_space
 open topological_space.opens
 open opposite
 
-universes u v
+universes u v w
 
-variables {C : Type u} [category.{v} C] [concrete_category.{v} C]
+variables {C : Type u} [category.{max w v} C] [concrete_category.{max w v} C]
 
 namespace Top
 
@@ -60,7 +60,7 @@ section
 
 local attribute [instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variables {X : Top.{v}} (F : presheaf C X) {ι : Type v} (U : ι → opens X)
+variables {X : Top.{w}} (F : presheaf C X) {ι : Type w} (U : ι → opens X)
 
 /--
 A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
@@ -85,14 +85,14 @@ We prove this to be equivalent to the usual one below in
 `is_sheaf_iff_is_sheaf_unique_gluing`
 -/
 def is_sheaf_unique_gluing : Prop :=
-∀ ⦃ι : Type v⦄ (U : ι → opens X) (sf : Π i : ι, F.obj (op (U i))),
+∀ ⦃ι : Type w⦄ (U : ι → opens X) (sf : Π i : ι, F.obj (op (U i))),
   is_compatible F U sf → ∃! s : F.obj (op (supr U)), is_gluing F U sf s
 
 end
 
 section type_valued
 
-variables {X : Top.{v}} (F : presheaf (Type v) X) {ι : Type v} (U : ι → opens X)
+variables {X : Top.{w}} (F : presheaf (Type max w v) X) {ι : Type w} (U : ι → opens X)
 
 /--
 For presheaves of types, terms of `pi_opens F U` are just families of sections.
@@ -100,7 +100,7 @@ For presheaves of types, terms of `pi_opens F U` are just families of sections.
 def pi_opens_iso_sections_family : pi_opens F U ≅ Π i : ι, F.obj (op (U i)) :=
 limits.is_limit.cone_point_unique_up_to_iso
   (limit.is_limit (discrete.functor (λ i : ι, F.obj (op (U i)))))
-  ((types.product_limit_cone.{v v} (λ i : ι, F.obj (op (U i)))).is_limit)
+  ((types.product_limit_cone.{w (max w v)} (λ i : ι, F.obj (op (U i)))).is_limit)
 
 /--
 Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
@@ -112,8 +112,8 @@ lemma compatible_iff_left_res_eq_right_res (sf : pi_opens F U) :
 begin
   split ; intros h,
   { ext ⟨i, j⟩,
-    rw [left_res, types.limit.lift_π_apply', fan.mk_π_app,
-        right_res, types.limit.lift_π_apply', fan.mk_π_app],
+    rw [left_res, types.limit.lift_π_apply, fan.mk_π_app,
+        right_res, types.limit.lift_π_apply, fan.mk_π_app],
     exact h i j, },
   { intros i j,
     convert congr_arg (limits.pi.π (λ p : ι × ι, F.obj (op (U p.1 ⊓ U p.2))) (i,j)) h,
@@ -132,7 +132,7 @@ lemma is_gluing_iff_eq_res (sf : pi_opens F U) (s : F.obj (op (supr U))):
 begin
   split ; intros h,
   { ext ⟨i⟩,
-    rw [res, types.limit.lift_π_apply', fan.mk_π_app],
+    rw [res, types.limit.lift_π_apply, fan.mk_π_app],
     exact h i, },
   { intro i,
     convert congr_arg (limits.pi.π (λ i : ι, F.obj (op (U i))) i) h,
@@ -209,8 +209,9 @@ section
 
 local attribute [instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variables [has_limits C] [reflects_isomorphisms (forget C)] [preserves_limits (forget C)]
-variables {X : Top.{v}} (F : presheaf C X) {ι : Type v} (U : ι → opens X)
+variables [has_limits_of_size.{w w} C] [reflects_isomorphisms (forget C)]
+  [preserves_limits_of_size.{w w} (forget C)]
+variables {X : Top.{w}} (F : presheaf C X) {ι : Type w} (U : ι → opens X)
 
 /--
 For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
@@ -235,10 +236,10 @@ section
 
 local attribute [instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variables [has_limits C] [reflects_isomorphisms (concrete_category.forget C)]
-variables [preserves_limits (concrete_category.forget C)]
+variables [has_limits_of_size.{w w} C] [reflects_isomorphisms (concrete_category.forget C)]
+variables [preserves_limits_of_size.{w w} (concrete_category.forget C)]
 
-variables {X : Top.{v}} (F : sheaf C X) {ι : Type v} (U : ι → opens X)
+variables {X : Top.{w}} (F : sheaf C X) {ι : Type w} (U : ι → opens X)
 
 /--
 A more convenient way of obtaining a unique gluing of sections for a sheaf.

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -222,7 +222,8 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
+variable [HasLimits C] [CategoryTheory.Functor.ReflectsIsomorphisms (forget C)]
+  [PreservesLimits (forget C)]
 
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
@@ -251,7 +252,7 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
+variable [HasLimits C] [CategoryTheory.Functor.ReflectsIsomorphisms (ConcreteCategory.forget C)]
 
 variable [PreservesLimits (ConcreteCategory.forget C)]
 
Diff
@@ -189,7 +189,7 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
 -/
 theorem isSheafUniqueGluingOfIsSheafTypes (Fsh : F.IsSheaf) : F.IsSheafUniqueGluing :=
   by
-  rw [is_sheaf_iff_is_sheaf_equalizer_products] at Fsh 
+  rw [is_sheaf_iff_is_sheaf_equalizer_products] at Fsh
   intro ι U sf hsf
   let sf' := (pi_opens_iso_sections_family F U).inv sf
   have hsf' : left_res F U sf' = right_res F U sf' := by
Diff
@@ -325,7 +325,14 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover :
 #print TopCat.Sheaf.eq_of_locally_eq₂ /-
 theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂)
     (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
-    (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by classical
+    (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by
+  classical
+  fapply F.eq_of_locally_eq' fun t : ULift Bool => if t.1 then U₁ else U₂
+  · exact fun i => if h : i.1 then eq_to_hom (if_pos h) ≫ i₁ else eq_to_hom (if_neg h) ≫ i₂
+  · refine' le_trans hcover _; rw [sup_le_iff]; constructor
+    · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
+    · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
+  · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
 #align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂
 -/
 
Diff
@@ -325,14 +325,7 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover :
 #print TopCat.Sheaf.eq_of_locally_eq₂ /-
 theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂)
     (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
-    (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by
-  classical
-  fapply F.eq_of_locally_eq' fun t : ULift Bool => if t.1 then U₁ else U₂
-  · exact fun i => if h : i.1 then eq_to_hom (if_pos h) ≫ i₁ else eq_to_hom (if_neg h) ≫ i₂
-  · refine' le_trans hcover _; rw [sup_le_iff]; constructor
-    · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
-    · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
-  · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
+    (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by classical
 #align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂
 -/
 
Diff
@@ -111,7 +111,6 @@ section TypeValued
 
 variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
 
-#print TopCat.Presheaf.piOpensIsoSectionsFamily /-
 /-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
 -/
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
@@ -119,9 +118,7 @@ def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
     (limit.isLimit (Discrete.functor fun i : ι => F.obj (op (U i))))
     (Types.productLimitCone.{v, v} fun i : ι => F.obj (op (U i))).IsLimit
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
--/
 
-#print TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes /-
 /-- Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
 as being equalized by the arrows `left_res` and `right_res` of the equalizer diagram.
 -/
@@ -138,9 +135,7 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     · rw [left_res, types.pi_lift_π_apply]; rfl
     · rw [right_res, types.pi_lift_π_apply]; rfl
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
--/
 
-#print TopCat.Presheaf.isGluing_iff_eq_res /-
 /-- Under the isomorphism `pi_opens_iso_sections_family`, being a gluing of a family of
 sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
 equalizer diagram).
@@ -158,7 +153,6 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
     rw [res, types.pi_lift_π_apply]
     rfl
 #align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
--/
 
 #print TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types /-
 /-- The "equalizer" sheaf condition can be obtained from the sheaf condition
@@ -190,11 +184,10 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
 #align Top.presheaf.is_sheaf_of_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types
 -/
 
-#print TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types /-
 /-- The sheaf condition in terms of unique gluings can be obtained from the usual
 "equalizer" sheaf condition.
 -/
-theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUniqueGluing :=
+theorem isSheafUniqueGluingOfIsSheafTypes (Fsh : F.IsSheaf) : F.IsSheafUniqueGluing :=
   by
   rw [is_sheaf_iff_is_sheaf_equalizer_products] at Fsh 
   intro ι U sf hsf
@@ -212,15 +205,14 @@ theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUnique
     rw [← is_gluing_iff_eq_res F U]
     convert hy
     rw [inv_hom_id_apply]
-#align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types
--/
+#align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluingOfIsSheafTypes
 
 #print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types /-
 /-- For type-valued presheaves, the sheaf condition in terms of unique gluings is equivalent to the
 usual sheaf condition in terms of equalizer diagrams.
 -/
 theorem isSheaf_iff_isSheafUniqueGluing_types : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
-  Iff.intro (isSheafUniqueGluing_of_isSheaf_types F) (isSheaf_of_isSheafUniqueGluing_types F)
+  Iff.intro (isSheafUniqueGluingOfIsSheafTypes F) (isSheaf_of_isSheafUniqueGluing_types F)
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types
 -/
 
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2021 Justus Springer. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
 -/
-import Mathbin.Topology.Sheaves.Forget
-import Mathbin.CategoryTheory.Limits.Shapes.Types
-import Mathbin.Topology.Sheaves.Sheaf
-import Mathbin.CategoryTheory.Types
+import Topology.Sheaves.Forget
+import CategoryTheory.Limits.Shapes.Types
+import Topology.Sheaves.Sheaf
+import CategoryTheory.Types
 
 #align_import topology.sheaves.sheaf_condition.unique_gluing from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2021 Justus Springer. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
-
-! This file was ported from Lean 3 source module topology.sheaves.sheaf_condition.unique_gluing
-! leanprover-community/mathlib commit 5dc6092d09e5e489106865241986f7f2ad28d4c8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Topology.Sheaves.Forget
 import Mathbin.CategoryTheory.Limits.Shapes.Types
 import Mathbin.Topology.Sheaves.Sheaf
 import Mathbin.CategoryTheory.Types
 
+#align_import topology.sheaves.sheaf_condition.unique_gluing from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
+
 /-!
 # The sheaf condition in terms of unique gluings
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
 
 ! This file was ported from Lean 3 source module topology.sheaves.sheaf_condition.unique_gluing
-! leanprover-community/mathlib commit 13361559d66b84f80b6d5a1c4a26aa5054766725
+! leanprover-community/mathlib commit 5dc6092d09e5e489106865241986f7f2ad28d4c8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -61,9 +61,9 @@ open TopologicalSpace.Opens
 
 open Opposite
 
-universe u v w
+universe u v
 
-variable {C : Type u} [Category.{max w v} C] [ConcreteCategory.{max w v} C]
+variable {C : Type u} [Category.{v} C] [ConcreteCategory.{v} C]
 
 namespace TopCat
 
@@ -73,7 +73,7 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable {X : TopCat.{w}} (F : Presheaf C X) {ι : Type w} (U : ι → Opens X)
+variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
 #print TopCat.Presheaf.IsCompatible /-
 /-- A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
@@ -103,7 +103,7 @@ We prove this to be equivalent to the usual one below in
 `is_sheaf_iff_is_sheaf_unique_gluing`
 -/
 def IsSheafUniqueGluing : Prop :=
-  ∀ ⦃ι : Type w⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
+  ∀ ⦃ι : Type v⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
     IsCompatible F U sf → ∃! s : F.obj (op (iSup U)), IsGluing F U sf s
 #align Top.presheaf.is_sheaf_unique_gluing TopCat.Presheaf.IsSheafUniqueGluing
 -/
@@ -112,7 +112,7 @@ end
 
 section TypeValued
 
-variable {X : TopCat.{w}} (F : Presheaf (Type max w v) X) {ι : Type w} (U : ι → Opens X)
+variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
 
 #print TopCat.Presheaf.piOpensIsoSectionsFamily /-
 /-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
@@ -120,7 +120,7 @@ variable {X : TopCat.{w}} (F : Presheaf (Type max w v) X) {ι : Type w} (U : ι
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
   Limits.IsLimit.conePointUniqueUpToIso
     (limit.isLimit (Discrete.functor fun i : ι => F.obj (op (U i))))
-    (Types.productLimitCone.{w, max w v} fun i : ι => F.obj (op (U i))).IsLimit
+    (Types.productLimitCone.{v, v} fun i : ι => F.obj (op (U i))).IsLimit
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
 -/
 
@@ -133,7 +133,7 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
   by
   constructor <;> intro h
   · ext ⟨i, j⟩
-    rw [left_res, types.limit.lift_π_apply, fan.mk_π_app, right_res, types.limit.lift_π_apply,
+    rw [left_res, types.limit.lift_π_apply', fan.mk_π_app, right_res, types.limit.lift_π_apply',
       fan.mk_π_app]
     exact h i j
   · intro i j
@@ -154,7 +154,7 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
   by
   constructor <;> intro h
   · ext ⟨i⟩
-    rw [res, types.limit.lift_π_apply, fan.mk_π_app]
+    rw [res, types.limit.lift_π_apply', fan.mk_π_app]
     exact h i
   · intro i
     convert congr_arg (limits.pi.π (fun i : ι => F.obj (op (U i))) i) h
@@ -233,10 +233,9 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimitsOfSize.{w, w} C] [ReflectsIsomorphisms (forget C)]
-  [PreservesLimitsOfSize.{w, w} (forget C)]
+variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
 
-variable {X : TopCat.{w}} (F : Presheaf C X) {ι : Type w} (U : ι → Opens X)
+variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
 #print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing /-
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
@@ -263,11 +262,11 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimitsOfSize.{w, w} C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
+variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
 
-variable [PreservesLimitsOfSize.{w, w} (ConcreteCategory.forget C)]
+variable [PreservesLimits (ConcreteCategory.forget C)]
 
-variable {X : TopCat.{w}} (F : Sheaf C X) {ι : Type w} (U : ι → Opens X)
+variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 
 #print TopCat.Sheaf.existsUnique_gluing /-
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
Diff
@@ -182,7 +182,7 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
   choose m m_spec m_uniq using fun x : s.X =>
     Fsh U ((pi_opens_iso_sections_family F U).Hom (s.ι x)) (h_compatible x)
   refine' ⟨m, _, _⟩
-  · ext (⟨i⟩x)
+  · ext ⟨i⟩ x
     simp [res]
     exact m_spec x i
   · intro l hl
Diff
@@ -75,20 +75,25 @@ attribute [local instance] concrete_category.has_coe_to_sort concrete_category.h
 
 variable {X : TopCat.{w}} (F : Presheaf C X) {ι : Type w} (U : ι → Opens X)
 
+#print TopCat.Presheaf.IsCompatible /-
 /-- A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
 agree, for all `i` and `j`
 -/
 def IsCompatible (sf : ∀ i : ι, F.obj (op (U i))) : Prop :=
   ∀ i j : ι, F.map (inf_le_left (U i) (U j)).op (sf i) = F.map (inf_le_right (U i) (U j)).op (sf j)
 #align Top.presheaf.is_compatible TopCat.Presheaf.IsCompatible
+-/
 
+#print TopCat.Presheaf.IsGluing /-
 /-- A section `s` is a gluing for a family of sections `sf` if it restricts to `sf i` on `U i`,
 for all `i`
 -/
 def IsGluing (sf : ∀ i : ι, F.obj (op (U i))) (s : F.obj (op (iSup U))) : Prop :=
   ∀ i : ι, F.map (Opens.leSupr U i).op s = sf i
 #align Top.presheaf.is_gluing TopCat.Presheaf.IsGluing
+-/
 
+#print TopCat.Presheaf.IsSheafUniqueGluing /-
 /--
 The sheaf condition in terms of unique gluings. A presheaf `F : presheaf C X` satisfies this sheaf
 condition if and only if, for every compatible family of sections `sf : Π i : ι, F.obj (op (U i))`,
@@ -101,6 +106,7 @@ def IsSheafUniqueGluing : Prop :=
   ∀ ⦃ι : Type w⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
     IsCompatible F U sf → ∃! s : F.obj (op (iSup U)), IsGluing F U sf s
 #align Top.presheaf.is_sheaf_unique_gluing TopCat.Presheaf.IsSheafUniqueGluing
+-/
 
 end
 
@@ -108,6 +114,7 @@ section TypeValued
 
 variable {X : TopCat.{w}} (F : Presheaf (Type max w v) X) {ι : Type w} (U : ι → Opens X)
 
+#print TopCat.Presheaf.piOpensIsoSectionsFamily /-
 /-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
 -/
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
@@ -115,7 +122,9 @@ def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
     (limit.isLimit (Discrete.functor fun i : ι => F.obj (op (U i))))
     (Types.productLimitCone.{w, max w v} fun i : ι => F.obj (op (U i))).IsLimit
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
+-/
 
+#print TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes /-
 /-- Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
 as being equalized by the arrows `left_res` and `right_res` of the equalizer diagram.
 -/
@@ -132,7 +141,9 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     · rw [left_res, types.pi_lift_π_apply]; rfl
     · rw [right_res, types.pi_lift_π_apply]; rfl
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
+-/
 
+#print TopCat.Presheaf.isGluing_iff_eq_res /-
 /-- Under the isomorphism `pi_opens_iso_sections_family`, being a gluing of a family of
 sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
 equalizer diagram).
@@ -150,7 +161,9 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
     rw [res, types.pi_lift_π_apply]
     rfl
 #align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
+-/
 
+#print TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types /-
 /-- The "equalizer" sheaf condition can be obtained from the sheaf condition
 in terms of unique gluings.
 -/
@@ -178,7 +191,9 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
     rw [is_gluing_iff_eq_res]
     exact congr_fun hl x
 #align Top.presheaf.is_sheaf_of_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types
+-/
 
+#print TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types /-
 /-- The sheaf condition in terms of unique gluings can be obtained from the usual
 "equalizer" sheaf condition.
 -/
@@ -201,13 +216,16 @@ theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUnique
     convert hy
     rw [inv_hom_id_apply]
 #align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types
+-/
 
+#print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types /-
 /-- For type-valued presheaves, the sheaf condition in terms of unique gluings is equivalent to the
 usual sheaf condition in terms of equalizer diagrams.
 -/
 theorem isSheaf_iff_isSheafUniqueGluing_types : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.intro (isSheafUniqueGluing_of_isSheaf_types F) (isSheaf_of_isSheafUniqueGluing_types F)
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types
+-/
 
 end TypeValued
 
@@ -220,6 +238,7 @@ variable [HasLimitsOfSize.{w, w} C] [ReflectsIsomorphisms (forget C)]
 
 variable {X : TopCat.{w}} (F : Presheaf C X) {ι : Type w} (U : ι → Opens X)
 
+#print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing /-
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
 preserves limits, the sheaf condition in terms of unique gluings is equivalent to the usual one
 in terms of equalizer diagrams.
@@ -228,6 +247,7 @@ theorem isSheaf_iff_isSheafUniqueGluing : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.trans (isSheaf_iff_isSheaf_comp (forget C) F)
     (isSheaf_iff_isSheafUniqueGluing_types (F ⋙ forget C))
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing
+-/
 
 end
 
@@ -249,13 +269,16 @@ variable [PreservesLimitsOfSize.{w, w} (ConcreteCategory.forget C)]
 
 variable {X : TopCat.{w}} (F : Sheaf C X) {ι : Type w} (U : ι → Opens X)
 
+#print TopCat.Sheaf.existsUnique_gluing /-
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
 -/
 theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
     ∃! s : F.1.obj (op (iSup U)), IsGluing F.1 U sf s :=
   (isSheaf_iff_isSheafUniqueGluing F.1).mp F.cond U sf h
 #align Top.sheaf.exists_unique_gluing TopCat.Sheaf.existsUnique_gluing
+-/
 
+#print TopCat.Sheaf.existsUnique_gluing' /-
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
@@ -275,7 +298,9 @@ theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover
     · rw [eq_to_hom_op, eq_to_hom_op, eq_to_hom_trans, eq_to_hom_refl, F.1.map_id, id_apply]
     · convert gl'_spec i
 #align Top.sheaf.exists_unique_gluing' TopCat.Sheaf.existsUnique_gluing'
+-/
 
+#print TopCat.Sheaf.eq_of_locally_eq /-
 @[ext]
 theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
     (h : ∀ i, F.1.map (Opens.leSupr U i).op s = F.1.map (Opens.leSupr U i).op t) : s = t :=
@@ -288,7 +313,9 @@ theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
   · apply gl_uniq; intro i; rfl
   · symm; apply gl_uniq; intro i; rw [← h]
 #align Top.sheaf.eq_of_locally_eq TopCat.Sheaf.eq_of_locally_eq
+-/
 
+#print TopCat.Sheaf.eq_of_locally_eq' /-
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
@@ -305,7 +332,9 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover :
   rw [← comp_apply, ← comp_apply, ← F.1.map_comp]
   convert h i
 #align Top.sheaf.eq_of_locally_eq' TopCat.Sheaf.eq_of_locally_eq'
+-/
 
+#print TopCat.Sheaf.eq_of_locally_eq₂ /-
 theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂)
     (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
     (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by
@@ -317,6 +346,7 @@ theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ :
     · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
   · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
 #align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂
+-/
 
 end
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
 
 ! This file was ported from Lean 3 source module topology.sheaves.sheaf_condition.unique_gluing
-! leanprover-community/mathlib commit f60c6087a7275b72d5db3c5a1d0e19e35a429c0a
+! leanprover-community/mathlib commit 13361559d66b84f80b6d5a1c4a26aa5054766725
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -61,9 +61,9 @@ open TopologicalSpace.Opens
 
 open Opposite
 
-universe u v
+universe u v w
 
-variable {C : Type u} [Category.{v} C] [ConcreteCategory.{v} C]
+variable {C : Type u} [Category.{max w v} C] [ConcreteCategory.{max w v} C]
 
 namespace TopCat
 
@@ -73,7 +73,7 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
+variable {X : TopCat.{w}} (F : Presheaf C X) {ι : Type w} (U : ι → Opens X)
 
 /-- A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
 agree, for all `i` and `j`
@@ -89,7 +89,6 @@ def IsGluing (sf : ∀ i : ι, F.obj (op (U i))) (s : F.obj (op (iSup U))) : Pro
   ∀ i : ι, F.map (Opens.leSupr U i).op s = sf i
 #align Top.presheaf.is_gluing TopCat.Presheaf.IsGluing
 
-#print TopCat.Presheaf.IsSheafUniqueGluing /-
 /--
 The sheaf condition in terms of unique gluings. A presheaf `F : presheaf C X` satisfies this sheaf
 condition if and only if, for every compatible family of sections `sf : Π i : ι, F.obj (op (U i))`,
@@ -99,26 +98,24 @@ We prove this to be equivalent to the usual one below in
 `is_sheaf_iff_is_sheaf_unique_gluing`
 -/
 def IsSheafUniqueGluing : Prop :=
-  ∀ ⦃ι : Type v⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
+  ∀ ⦃ι : Type w⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
     IsCompatible F U sf → ∃! s : F.obj (op (iSup U)), IsGluing F U sf s
 #align Top.presheaf.is_sheaf_unique_gluing TopCat.Presheaf.IsSheafUniqueGluing
--/
 
 end
 
 section TypeValued
 
-variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
+variable {X : TopCat.{w}} (F : Presheaf (Type max w v) X) {ι : Type w} (U : ι → Opens X)
 
 /-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
 -/
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
   Limits.IsLimit.conePointUniqueUpToIso
     (limit.isLimit (Discrete.functor fun i : ι => F.obj (op (U i))))
-    (Types.productLimitCone.{v, v} fun i : ι => F.obj (op (U i))).IsLimit
+    (Types.productLimitCone.{w, max w v} fun i : ι => F.obj (op (U i))).IsLimit
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
 
-#print TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes /-
 /-- Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
 as being equalized by the arrows `left_res` and `right_res` of the equalizer diagram.
 -/
@@ -127,7 +124,7 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
   by
   constructor <;> intro h
   · ext ⟨i, j⟩
-    rw [left_res, types.limit.lift_π_apply', fan.mk_π_app, right_res, types.limit.lift_π_apply',
+    rw [left_res, types.limit.lift_π_apply, fan.mk_π_app, right_res, types.limit.lift_π_apply,
       fan.mk_π_app]
     exact h i j
   · intro i j
@@ -135,7 +132,6 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     · rw [left_res, types.pi_lift_π_apply]; rfl
     · rw [right_res, types.pi_lift_π_apply]; rfl
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
--/
 
 /-- Under the isomorphism `pi_opens_iso_sections_family`, being a gluing of a family of
 sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
@@ -147,7 +143,7 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
   by
   constructor <;> intro h
   · ext ⟨i⟩
-    rw [res, types.limit.lift_π_apply', fan.mk_π_app]
+    rw [res, types.limit.lift_π_apply, fan.mk_π_app]
     exact h i
   · intro i
     convert congr_arg (limits.pi.π (fun i : ι => F.obj (op (U i))) i) h
@@ -155,7 +151,6 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
     rfl
 #align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
 
-#print TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types /-
 /-- The "equalizer" sheaf condition can be obtained from the sheaf condition
 in terms of unique gluings.
 -/
@@ -183,9 +178,7 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
     rw [is_gluing_iff_eq_res]
     exact congr_fun hl x
 #align Top.presheaf.is_sheaf_of_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types
--/
 
-#print TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types /-
 /-- The sheaf condition in terms of unique gluings can be obtained from the usual
 "equalizer" sheaf condition.
 -/
@@ -208,16 +201,13 @@ theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUnique
     convert hy
     rw [inv_hom_id_apply]
 #align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types
--/
 
-#print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types /-
 /-- For type-valued presheaves, the sheaf condition in terms of unique gluings is equivalent to the
 usual sheaf condition in terms of equalizer diagrams.
 -/
 theorem isSheaf_iff_isSheafUniqueGluing_types : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.intro (isSheafUniqueGluing_of_isSheaf_types F) (isSheaf_of_isSheafUniqueGluing_types F)
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types
--/
 
 end TypeValued
 
@@ -225,11 +215,11 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
+variable [HasLimitsOfSize.{w, w} C] [ReflectsIsomorphisms (forget C)]
+  [PreservesLimitsOfSize.{w, w} (forget C)]
 
-variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
+variable {X : TopCat.{w}} (F : Presheaf C X) {ι : Type w} (U : ι → Opens X)
 
-#print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing /-
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
 preserves limits, the sheaf condition in terms of unique gluings is equivalent to the usual one
 in terms of equalizer diagrams.
@@ -238,7 +228,6 @@ theorem isSheaf_iff_isSheafUniqueGluing : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.trans (isSheaf_iff_isSheaf_comp (forget C) F)
     (isSheaf_iff_isSheafUniqueGluing_types (F ⋙ forget C))
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing
--/
 
 end
 
@@ -254,11 +243,11 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
+variable [HasLimitsOfSize.{w, w} C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
 
-variable [PreservesLimits (ConcreteCategory.forget C)]
+variable [PreservesLimitsOfSize.{w, w} (ConcreteCategory.forget C)]
 
-variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
+variable {X : TopCat.{w}} (F : Sheaf C X) {ι : Type w} (U : ι → Opens X)
 
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
 -/
Diff
@@ -200,7 +200,7 @@ theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUnique
   use s
   dsimp
   constructor
-  · convert(is_gluing_iff_eq_res F U sf' _).mpr s_spec
+  · convert (is_gluing_iff_eq_res F U sf' _).mpr s_spec
     rw [inv_hom_id_apply]
   · intro y hy
     apply s_uniq
@@ -321,12 +321,12 @@ theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ :
     (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
     (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by
   classical
-    fapply F.eq_of_locally_eq' fun t : ULift Bool => if t.1 then U₁ else U₂
-    · exact fun i => if h : i.1 then eq_to_hom (if_pos h) ≫ i₁ else eq_to_hom (if_neg h) ≫ i₂
-    · refine' le_trans hcover _; rw [sup_le_iff]; constructor
-      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
-      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
-    · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
+  fapply F.eq_of_locally_eq' fun t : ULift Bool => if t.1 then U₁ else U₂
+  · exact fun i => if h : i.1 then eq_to_hom (if_pos h) ≫ i₁ else eq_to_hom (if_neg h) ≫ i₂
+  · refine' le_trans hcover _; rw [sup_le_iff]; constructor
+    · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
+    · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
+  · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
 #align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂
 
 end
Diff
@@ -191,7 +191,7 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
 -/
 theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUniqueGluing :=
   by
-  rw [is_sheaf_iff_is_sheaf_equalizer_products] at Fsh
+  rw [is_sheaf_iff_is_sheaf_equalizer_products] at Fsh 
   intro ι U sf hsf
   let sf' := (pi_opens_iso_sections_family F U).inv sf
   have hsf' : left_res F U sf' = right_res F U sf' := by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
 
 ! This file was ported from Lean 3 source module topology.sheaves.sheaf_condition.unique_gluing
-! leanprover-community/mathlib commit 618ea3d5c99240cd7000d8376924906a148bf9ff
+! leanprover-community/mathlib commit f60c6087a7275b72d5db3c5a1d0e19e35a429c0a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.CategoryTheory.Types
 /-!
 # The sheaf condition in terms of unique gluings
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We provide an alternative formulation of the sheaf condition in terms of unique gluings.
 
 We work with sheaves valued in a concrete category `C` admitting all limits, whose forgetful
Diff
@@ -72,12 +72,6 @@ attribute [local instance] concrete_category.has_coe_to_sort concrete_category.h
 
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
-/- warning: Top.presheaf.is_compatible -> TopCat.Presheaf.IsCompatible is a dubious translation:
-lean 3 declaration is
-  forall {C : Type.{u1}} [_inst_1 : CategoryTheory.Category.{u2, u1} C] [_inst_2 : CategoryTheory.ConcreteCategory.{u2, u2, u1} C _inst_1] {X : TopCat.{u2}} (F : TopCat.Presheaf.{u2, u2, u1} C _inst_1 X) {ι : Type.{u2}} (U : ι -> (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} (CategoryTheory.ConcreteCategory.hasCoeToSort.{succ u2, u2, u2} TopCat.{u2} TopCat.largeCategory.{u2} TopCat.concreteCategory.{u2}) X) (TopCat.topologicalSpace.{u2} X))), (forall (i : ι), coeSort.{succ u1, succ (succ u2)} C Type.{u2} (CategoryTheory.ConcreteCategory.hasCoeToSort.{u1, u2, u2} C _inst_1 _inst_2) (CategoryTheory.Functor.obj.{u2, u2, u2, u1} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X))) (CategoryTheory.Category.opposite.{u2, u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (Preorder.smallCategory.{u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (PartialOrder.toPreorder.{u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (SetLike.partialOrder.{u2, u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopologicalSpace.Opens.setLike.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)))))) C _inst_1 F (Opposite.op.{succ u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (U i)))) -> Prop
-but is expected to have type
-  forall {C : Type.{u1}} [_inst_1 : CategoryTheory.Category.{u2, u1} C] [_inst_2 : CategoryTheory.ConcreteCategory.{u2, u2, u1} C _inst_1] {X : TopCat.{u2}} (F : TopCat.Presheaf.{u2, u2, u1} C _inst_1 X) {ι : Type.{u2}} (U : ι -> (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))), (forall (i : ι), Prefunctor.obj.{succ u2, succ u2, u1, succ u2} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u1} C (CategoryTheory.Category.toCategoryStruct.{u2, u1} C _inst_1)) Type.{u2} (CategoryTheory.CategoryStruct.toQuiver.{u2, succ u2} Type.{u2} (CategoryTheory.Category.toCategoryStruct.{u2, succ u2} Type.{u2} CategoryTheory.types.{u2})) (CategoryTheory.Functor.toPrefunctor.{u2, u2, u1, succ u2} C _inst_1 Type.{u2} CategoryTheory.types.{u2} (CategoryTheory.forget.{u1, u2, u2} C _inst_1 _inst_2)) (Prefunctor.obj.{succ u2, succ u2, u2, u1} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.CategoryStruct.toQuiver.{u2, u2} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.Category.toCategoryStruct.{u2, u2} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.Category.opposite.{u2, u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (Preorder.smallCategory.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (PartialOrder.toPreorder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteSemilatticeInf.toPartialOrder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))))))))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u1} C (CategoryTheory.Category.toCategoryStruct.{u2, u1} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u2, u2, u1} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.Category.opposite.{u2, u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (Preorder.smallCategory.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (PartialOrder.toPreorder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteSemilatticeInf.toPartialOrder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))))))) C _inst_1 F) (Opposite.op.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (U i)))) -> Prop
-Case conversion may be inaccurate. Consider using '#align Top.presheaf.is_compatible TopCat.Presheaf.IsCompatibleₓ'. -/
 /-- A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
 agree, for all `i` and `j`
 -/
@@ -85,9 +79,6 @@ def IsCompatible (sf : ∀ i : ι, F.obj (op (U i))) : Prop :=
   ∀ i j : ι, F.map (inf_le_left (U i) (U j)).op (sf i) = F.map (inf_le_right (U i) (U j)).op (sf j)
 #align Top.presheaf.is_compatible TopCat.Presheaf.IsCompatible
 
-/- warning: Top.presheaf.is_gluing -> TopCat.Presheaf.IsGluing is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.presheaf.is_gluing TopCat.Presheaf.IsGluingₓ'. -/
 /-- A section `s` is a gluing for a family of sections `sf` if it restricts to `sf i` on `U i`,
 for all `i`
 -/
@@ -116,12 +107,6 @@ section TypeValued
 
 variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
 
-/- warning: Top.presheaf.pi_opens_iso_sections_family -> TopCat.Presheaf.piOpensIsoSectionsFamily is a dubious translation:
-lean 3 declaration is
-  forall {X : TopCat.{u1}} (F : TopCat.Presheaf.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} X) {ι : Type.{u1}} (U : ι -> (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X))), CategoryTheory.Iso.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} TopCat.Presheaf.piOpensIsoSectionsFamily._proof_1.{u1} X F ι U) (forall (i : ι), CategoryTheory.Functor.obj.{u1, u1, u1, succ u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X))) (CategoryTheory.Category.opposite.{u1, u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (Preorder.smallCategory.{u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (PartialOrder.toPreorder.{u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (SetLike.partialOrder.{u1, u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopologicalSpace.Opens.setLike.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)))))) Type.{u1} CategoryTheory.types.{u1} F (Opposite.op.{succ u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (U i)))
-but is expected to have type
-  forall {X : TopCat.{u1}} (F : TopCat.Presheaf.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} X) {ι : Type.{u1}} (U : ι -> (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))), CategoryTheory.Iso.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (fun (J : Type.{u1}) => CategoryTheory.Limits.hasLimitsOfShapeOfHasLimits.{u1, u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (CategoryTheory.Discrete.{u1} J) (CategoryTheory.discreteCategory.{u1} J) CategoryTheory.Limits.Types.instHasLimitsTypeTypes.{u1}) X F ι U) (forall (i : ι), Prefunctor.obj.{succ u1, succ u1, u1, succ u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.CategoryStruct.toQuiver.{u1, u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.Category.toCategoryStruct.{u1, u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.Category.opposite.{u1, u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (Preorder.smallCategory.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (PartialOrder.toPreorder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteSemilatticeInf.toPartialOrder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))))))))) Type.{u1} (CategoryTheory.CategoryStruct.toQuiver.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1})) (CategoryTheory.Functor.toPrefunctor.{u1, u1, u1, succ u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.Category.opposite.{u1, u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (Preorder.smallCategory.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (PartialOrder.toPreorder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteSemilatticeInf.toPartialOrder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))))))) Type.{u1} CategoryTheory.types.{u1} F) (Opposite.op.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (U i)))
-Case conversion may be inaccurate. Consider using '#align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamilyₓ'. -/
 /-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
 -/
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
@@ -149,9 +134,6 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
 -/
 
-/- warning: Top.presheaf.is_gluing_iff_eq_res -> TopCat.Presheaf.isGluing_iff_eq_res is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_resₓ'. -/
 /-- Under the isomorphism `pi_opens_iso_sections_family`, being a gluing of a family of
 sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
 equalizer diagram).
@@ -275,9 +257,6 @@ variable [PreservesLimits (ConcreteCategory.forget C)]
 
 variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 
-/- warning: Top.sheaf.exists_unique_gluing -> TopCat.Sheaf.existsUnique_gluing is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.sheaf.exists_unique_gluing TopCat.Sheaf.existsUnique_gluingₓ'. -/
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
 -/
 theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
@@ -285,9 +264,6 @@ theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompati
   (isSheaf_iff_isSheafUniqueGluing F.1).mp F.cond U sf h
 #align Top.sheaf.exists_unique_gluing TopCat.Sheaf.existsUnique_gluing
 
-/- warning: Top.sheaf.exists_unique_gluing' -> TopCat.Sheaf.existsUnique_gluing' is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.sheaf.exists_unique_gluing' TopCat.Sheaf.existsUnique_gluing'ₓ'. -/
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
@@ -308,9 +284,6 @@ theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover
     · convert gl'_spec i
 #align Top.sheaf.exists_unique_gluing' TopCat.Sheaf.existsUnique_gluing'
 
-/- warning: Top.sheaf.eq_of_locally_eq -> TopCat.Sheaf.eq_of_locally_eq is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.sheaf.eq_of_locally_eq TopCat.Sheaf.eq_of_locally_eqₓ'. -/
 @[ext]
 theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
     (h : ∀ i, F.1.map (Opens.leSupr U i).op s = F.1.map (Opens.leSupr U i).op t) : s = t :=
@@ -324,9 +297,6 @@ theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
   · symm; apply gl_uniq; intro i; rw [← h]
 #align Top.sheaf.eq_of_locally_eq TopCat.Sheaf.eq_of_locally_eq
 
-/- warning: Top.sheaf.eq_of_locally_eq' -> TopCat.Sheaf.eq_of_locally_eq' is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.sheaf.eq_of_locally_eq' TopCat.Sheaf.eq_of_locally_eq'ₓ'. -/
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
@@ -344,9 +314,6 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover :
   convert h i
 #align Top.sheaf.eq_of_locally_eq' TopCat.Sheaf.eq_of_locally_eq'
 
-/- warning: Top.sheaf.eq_of_locally_eq₂ -> TopCat.Sheaf.eq_of_locally_eq₂ is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂ₓ'. -/
 theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂)
     (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
     (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by
Diff
@@ -144,10 +144,8 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     exact h i j
   · intro i j
     convert congr_arg (limits.pi.π (fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2))) (i, j)) h
-    · rw [left_res, types.pi_lift_π_apply]
-      rfl
-    · rw [right_res, types.pi_lift_π_apply]
-      rfl
+    · rw [left_res, types.pi_lift_π_apply]; rfl
+    · rw [right_res, types.pi_lift_π_apply]; rfl
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
 -/
 
@@ -318,20 +316,12 @@ theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
     (h : ∀ i, F.1.map (Opens.leSupr U i).op s = F.1.map (Opens.leSupr U i).op t) : s = t :=
   by
   let sf : ∀ i : ι, F.1.obj (op (U i)) := fun i => F.1.map (opens.le_supr U i).op s
-  have sf_compatible : is_compatible _ U sf :=
-    by
-    intro i j
-    simp_rw [← comp_apply, ← F.1.map_comp]
+  have sf_compatible : is_compatible _ U sf := by intro i j; simp_rw [← comp_apply, ← F.1.map_comp];
     rfl
   obtain ⟨gl, -, gl_uniq⟩ := F.exists_unique_gluing U sf sf_compatible
   trans gl
-  · apply gl_uniq
-    intro i
-    rfl
-  · symm
-    apply gl_uniq
-    intro i
-    rw [← h]
+  · apply gl_uniq; intro i; rfl
+  · symm; apply gl_uniq; intro i; rw [← h]
 #align Top.sheaf.eq_of_locally_eq TopCat.Sheaf.eq_of_locally_eq
 
 /- warning: Top.sheaf.eq_of_locally_eq' -> TopCat.Sheaf.eq_of_locally_eq' is a dubious translation:
@@ -363,9 +353,7 @@ theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ :
   classical
     fapply F.eq_of_locally_eq' fun t : ULift Bool => if t.1 then U₁ else U₂
     · exact fun i => if h : i.1 then eq_to_hom (if_pos h) ≫ i₁ else eq_to_hom (if_neg h) ≫ i₂
-    · refine' le_trans hcover _
-      rw [sup_le_iff]
-      constructor
+    · refine' le_trans hcover _; rw [sup_le_iff]; constructor
       · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
       · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
     · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
Diff
@@ -72,6 +72,12 @@ attribute [local instance] concrete_category.has_coe_to_sort concrete_category.h
 
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
+/- warning: Top.presheaf.is_compatible -> TopCat.Presheaf.IsCompatible is a dubious translation:
+lean 3 declaration is
+  forall {C : Type.{u1}} [_inst_1 : CategoryTheory.Category.{u2, u1} C] [_inst_2 : CategoryTheory.ConcreteCategory.{u2, u2, u1} C _inst_1] {X : TopCat.{u2}} (F : TopCat.Presheaf.{u2, u2, u1} C _inst_1 X) {ι : Type.{u2}} (U : ι -> (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} (CategoryTheory.ConcreteCategory.hasCoeToSort.{succ u2, u2, u2} TopCat.{u2} TopCat.largeCategory.{u2} TopCat.concreteCategory.{u2}) X) (TopCat.topologicalSpace.{u2} X))), (forall (i : ι), coeSort.{succ u1, succ (succ u2)} C Type.{u2} (CategoryTheory.ConcreteCategory.hasCoeToSort.{u1, u2, u2} C _inst_1 _inst_2) (CategoryTheory.Functor.obj.{u2, u2, u2, u1} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X))) (CategoryTheory.Category.opposite.{u2, u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (Preorder.smallCategory.{u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (PartialOrder.toPreorder.{u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (SetLike.partialOrder.{u2, u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopologicalSpace.Opens.setLike.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)))))) C _inst_1 F (Opposite.op.{succ u2} (TopologicalSpace.Opens.{u2} (coeSort.{succ (succ u2), succ (succ u2)} TopCat.{u2} Type.{u2} TopCat.hasCoeToSort.{u2} X) (TopCat.topologicalSpace.{u2} X)) (U i)))) -> Prop
+but is expected to have type
+  forall {C : Type.{u1}} [_inst_1 : CategoryTheory.Category.{u2, u1} C] [_inst_2 : CategoryTheory.ConcreteCategory.{u2, u2, u1} C _inst_1] {X : TopCat.{u2}} (F : TopCat.Presheaf.{u2, u2, u1} C _inst_1 X) {ι : Type.{u2}} (U : ι -> (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))), (forall (i : ι), Prefunctor.obj.{succ u2, succ u2, u1, succ u2} C (CategoryTheory.CategoryStruct.toQuiver.{u2, u1} C (CategoryTheory.Category.toCategoryStruct.{u2, u1} C _inst_1)) Type.{u2} (CategoryTheory.CategoryStruct.toQuiver.{u2, succ u2} Type.{u2} (CategoryTheory.Category.toCategoryStruct.{u2, succ u2} Type.{u2} CategoryTheory.types.{u2})) (CategoryTheory.Functor.toPrefunctor.{u2, u2, u1, succ u2} C _inst_1 Type.{u2} CategoryTheory.types.{u2} (CategoryTheory.forget.{u1, u2, u2} C _inst_1 _inst_2)) (Prefunctor.obj.{succ u2, succ u2, u2, u1} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.CategoryStruct.toQuiver.{u2, u2} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.Category.toCategoryStruct.{u2, u2} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.Category.opposite.{u2, u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (Preorder.smallCategory.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (PartialOrder.toPreorder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteSemilatticeInf.toPartialOrder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))))))))) C (CategoryTheory.CategoryStruct.toQuiver.{u2, u1} C (CategoryTheory.Category.toCategoryStruct.{u2, u1} C _inst_1)) (CategoryTheory.Functor.toPrefunctor.{u2, u2, u2, u1} (Opposite.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))) (CategoryTheory.Category.opposite.{u2, u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (Preorder.smallCategory.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (PartialOrder.toPreorder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteSemilatticeInf.toPartialOrder.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (CompleteLattice.toCompleteSemilatticeInf.{u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X))))))) C _inst_1 F) (Opposite.op.{succ u2} (TopologicalSpace.Opens.{u2} (CategoryTheory.Bundled.α.{u2, u2} TopologicalSpace.{u2} X) (TopCat.topologicalSpace_coe.{u2} X)) (U i)))) -> Prop
+Case conversion may be inaccurate. Consider using '#align Top.presheaf.is_compatible TopCat.Presheaf.IsCompatibleₓ'. -/
 /-- A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
 agree, for all `i` and `j`
 -/
@@ -79,6 +85,9 @@ def IsCompatible (sf : ∀ i : ι, F.obj (op (U i))) : Prop :=
   ∀ i j : ι, F.map (inf_le_left (U i) (U j)).op (sf i) = F.map (inf_le_right (U i) (U j)).op (sf j)
 #align Top.presheaf.is_compatible TopCat.Presheaf.IsCompatible
 
+/- warning: Top.presheaf.is_gluing -> TopCat.Presheaf.IsGluing is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.presheaf.is_gluing TopCat.Presheaf.IsGluingₓ'. -/
 /-- A section `s` is a gluing for a family of sections `sf` if it restricts to `sf i` on `U i`,
 for all `i`
 -/
@@ -86,6 +95,7 @@ def IsGluing (sf : ∀ i : ι, F.obj (op (U i))) (s : F.obj (op (iSup U))) : Pro
   ∀ i : ι, F.map (Opens.leSupr U i).op s = sf i
 #align Top.presheaf.is_gluing TopCat.Presheaf.IsGluing
 
+#print TopCat.Presheaf.IsSheafUniqueGluing /-
 /--
 The sheaf condition in terms of unique gluings. A presheaf `F : presheaf C X` satisfies this sheaf
 condition if and only if, for every compatible family of sections `sf : Π i : ι, F.obj (op (U i))`,
@@ -98,6 +108,7 @@ def IsSheafUniqueGluing : Prop :=
   ∀ ⦃ι : Type v⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
     IsCompatible F U sf → ∃! s : F.obj (op (iSup U)), IsGluing F U sf s
 #align Top.presheaf.is_sheaf_unique_gluing TopCat.Presheaf.IsSheafUniqueGluing
+-/
 
 end
 
@@ -105,6 +116,12 @@ section TypeValued
 
 variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
 
+/- warning: Top.presheaf.pi_opens_iso_sections_family -> TopCat.Presheaf.piOpensIsoSectionsFamily is a dubious translation:
+lean 3 declaration is
+  forall {X : TopCat.{u1}} (F : TopCat.Presheaf.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} X) {ι : Type.{u1}} (U : ι -> (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X))), CategoryTheory.Iso.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} TopCat.Presheaf.piOpensIsoSectionsFamily._proof_1.{u1} X F ι U) (forall (i : ι), CategoryTheory.Functor.obj.{u1, u1, u1, succ u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X))) (CategoryTheory.Category.opposite.{u1, u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (Preorder.smallCategory.{u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (PartialOrder.toPreorder.{u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (SetLike.partialOrder.{u1, u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopologicalSpace.Opens.setLike.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)))))) Type.{u1} CategoryTheory.types.{u1} F (Opposite.op.{succ u1} (TopologicalSpace.Opens.{u1} (coeSort.{succ (succ u1), succ (succ u1)} TopCat.{u1} Type.{u1} TopCat.hasCoeToSort.{u1} X) (TopCat.topologicalSpace.{u1} X)) (U i)))
+but is expected to have type
+  forall {X : TopCat.{u1}} (F : TopCat.Presheaf.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} X) {ι : Type.{u1}} (U : ι -> (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))), CategoryTheory.Iso.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (TopCat.Presheaf.SheafConditionEqualizerProducts.piOpens.{u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (fun (J : Type.{u1}) => CategoryTheory.Limits.hasLimitsOfShapeOfHasLimits.{u1, u1, u1, succ u1} Type.{u1} CategoryTheory.types.{u1} (CategoryTheory.Discrete.{u1} J) (CategoryTheory.discreteCategory.{u1} J) CategoryTheory.Limits.Types.instHasLimitsTypeTypes.{u1}) X F ι U) (forall (i : ι), Prefunctor.obj.{succ u1, succ u1, u1, succ u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.CategoryStruct.toQuiver.{u1, u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.Category.toCategoryStruct.{u1, u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.Category.opposite.{u1, u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (Preorder.smallCategory.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (PartialOrder.toPreorder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteSemilatticeInf.toPartialOrder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))))))))) Type.{u1} (CategoryTheory.CategoryStruct.toQuiver.{u1, succ u1} Type.{u1} (CategoryTheory.Category.toCategoryStruct.{u1, succ u1} Type.{u1} CategoryTheory.types.{u1})) (CategoryTheory.Functor.toPrefunctor.{u1, u1, u1, succ u1} (Opposite.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))) (CategoryTheory.Category.opposite.{u1, u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (Preorder.smallCategory.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (PartialOrder.toPreorder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteSemilatticeInf.toPartialOrder.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (CompleteLattice.toCompleteSemilatticeInf.{u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (TopologicalSpace.Opens.instCompleteLatticeOpens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X))))))) Type.{u1} CategoryTheory.types.{u1} F) (Opposite.op.{succ u1} (TopologicalSpace.Opens.{u1} (CategoryTheory.Bundled.α.{u1, u1} TopologicalSpace.{u1} X) (TopCat.topologicalSpace_coe.{u1} X)) (U i)))
+Case conversion may be inaccurate. Consider using '#align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamilyₓ'. -/
 /-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
 -/
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
@@ -113,6 +130,7 @@ def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
     (Types.productLimitCone.{v, v} fun i : ι => F.obj (op (U i))).IsLimit
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
 
+#print TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes /-
 /-- Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
 as being equalized by the arrows `left_res` and `right_res` of the equalizer diagram.
 -/
@@ -131,7 +149,11 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     · rw [right_res, types.pi_lift_π_apply]
       rfl
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
+-/
 
+/- warning: Top.presheaf.is_gluing_iff_eq_res -> TopCat.Presheaf.isGluing_iff_eq_res is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_resₓ'. -/
 /-- Under the isomorphism `pi_opens_iso_sections_family`, being a gluing of a family of
 sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
 equalizer diagram).
@@ -150,6 +172,7 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
     rfl
 #align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
 
+#print TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types /-
 /-- The "equalizer" sheaf condition can be obtained from the sheaf condition
 in terms of unique gluings.
 -/
@@ -177,7 +200,9 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
     rw [is_gluing_iff_eq_res]
     exact congr_fun hl x
 #align Top.presheaf.is_sheaf_of_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types
+-/
 
+#print TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types /-
 /-- The sheaf condition in terms of unique gluings can be obtained from the usual
 "equalizer" sheaf condition.
 -/
@@ -200,13 +225,16 @@ theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUnique
     convert hy
     rw [inv_hom_id_apply]
 #align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types
+-/
 
+#print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types /-
 /-- For type-valued presheaves, the sheaf condition in terms of unique gluings is equivalent to the
 usual sheaf condition in terms of equalizer diagrams.
 -/
 theorem isSheaf_iff_isSheafUniqueGluing_types : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.intro (isSheafUniqueGluing_of_isSheaf_types F) (isSheaf_of_isSheafUniqueGluing_types F)
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types
+-/
 
 end TypeValued
 
@@ -218,6 +246,7 @@ variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forge
 
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
+#print TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing /-
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
 preserves limits, the sheaf condition in terms of unique gluings is equivalent to the usual one
 in terms of equalizer diagrams.
@@ -226,6 +255,7 @@ theorem isSheaf_iff_isSheafUniqueGluing : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.trans (isSheaf_iff_isSheaf_comp (forget C) F)
     (isSheaf_iff_isSheafUniqueGluing_types (F ⋙ forget C))
 #align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing
+-/
 
 end
 
@@ -247,6 +277,9 @@ variable [PreservesLimits (ConcreteCategory.forget C)]
 
 variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 
+/- warning: Top.sheaf.exists_unique_gluing -> TopCat.Sheaf.existsUnique_gluing is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.sheaf.exists_unique_gluing TopCat.Sheaf.existsUnique_gluingₓ'. -/
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
 -/
 theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
@@ -254,6 +287,9 @@ theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompati
   (isSheaf_iff_isSheafUniqueGluing F.1).mp F.cond U sf h
 #align Top.sheaf.exists_unique_gluing TopCat.Sheaf.existsUnique_gluing
 
+/- warning: Top.sheaf.exists_unique_gluing' -> TopCat.Sheaf.existsUnique_gluing' is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.sheaf.exists_unique_gluing' TopCat.Sheaf.existsUnique_gluing'ₓ'. -/
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
@@ -274,6 +310,9 @@ theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover
     · convert gl'_spec i
 #align Top.sheaf.exists_unique_gluing' TopCat.Sheaf.existsUnique_gluing'
 
+/- warning: Top.sheaf.eq_of_locally_eq -> TopCat.Sheaf.eq_of_locally_eq is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.sheaf.eq_of_locally_eq TopCat.Sheaf.eq_of_locally_eqₓ'. -/
 @[ext]
 theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
     (h : ∀ i, F.1.map (Opens.leSupr U i).op s = F.1.map (Opens.leSupr U i).op t) : s = t :=
@@ -295,6 +334,9 @@ theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
     rw [← h]
 #align Top.sheaf.eq_of_locally_eq TopCat.Sheaf.eq_of_locally_eq
 
+/- warning: Top.sheaf.eq_of_locally_eq' -> TopCat.Sheaf.eq_of_locally_eq' is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.sheaf.eq_of_locally_eq' TopCat.Sheaf.eq_of_locally_eq'ₓ'. -/
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
@@ -312,6 +354,9 @@ theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover :
   convert h i
 #align Top.sheaf.eq_of_locally_eq' TopCat.Sheaf.eq_of_locally_eq'
 
+/- warning: Top.sheaf.eq_of_locally_eq₂ -> TopCat.Sheaf.eq_of_locally_eq₂ is a dubious translation:
+<too large>
+Case conversion may be inaccurate. Consider using '#align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂ₓ'. -/
 theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂)
     (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
     (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t := by
Diff
@@ -82,7 +82,7 @@ def IsCompatible (sf : ∀ i : ι, F.obj (op (U i))) : Prop :=
 /-- A section `s` is a gluing for a family of sections `sf` if it restricts to `sf i` on `U i`,
 for all `i`
 -/
-def IsGluing (sf : ∀ i : ι, F.obj (op (U i))) (s : F.obj (op (supᵢ U))) : Prop :=
+def IsGluing (sf : ∀ i : ι, F.obj (op (U i))) (s : F.obj (op (iSup U))) : Prop :=
   ∀ i : ι, F.map (Opens.leSupr U i).op s = sf i
 #align Top.presheaf.is_gluing TopCat.Presheaf.IsGluing
 
@@ -96,7 +96,7 @@ We prove this to be equivalent to the usual one below in
 -/
 def IsSheafUniqueGluing : Prop :=
   ∀ ⦃ι : Type v⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
-    IsCompatible F U sf → ∃! s : F.obj (op (supᵢ U)), IsGluing F U sf s
+    IsCompatible F U sf → ∃! s : F.obj (op (iSup U)), IsGluing F U sf s
 #align Top.presheaf.is_sheaf_unique_gluing TopCat.Presheaf.IsSheafUniqueGluing
 
 end
@@ -137,7 +137,7 @@ sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow
 equalizer diagram).
 -/
 @[simp]
-theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (supᵢ U))) :
+theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
     IsGluing F U ((piOpensIsoSectionsFamily F U).Hom sf) s ↔ res F U s = sf :=
   by
   constructor <;> intro h
@@ -250,18 +250,18 @@ variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
 -/
 theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
-    ∃! s : F.1.obj (op (supᵢ U)), IsGluing F.1 U sf s :=
+    ∃! s : F.1.obj (op (iSup U)), IsGluing F.1 U sf s :=
   (isSheaf_iff_isSheafUniqueGluing F.1).mp F.cond U sf h
 #align Top.sheaf.exists_unique_gluing TopCat.Sheaf.existsUnique_gluing
 
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
-theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : V ≤ supᵢ U)
+theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : V ≤ iSup U)
     (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
     ∃! s : F.1.obj (op V), ∀ i : ι, F.1.map (iUV i).op s = sf i :=
   by
-  have V_eq_supr_U : V = supᵢ U := le_antisymm hcover (supᵢ_le fun i => (iUV i).le)
+  have V_eq_supr_U : V = iSup U := le_antisymm hcover (iSup_le fun i => (iUV i).le)
   obtain ⟨gl, gl_spec, gl_uniq⟩ := F.exists_unique_gluing U sf h
   refine' ⟨F.1.map (eq_to_hom V_eq_supr_U).op gl, _, _⟩
   · intro i
@@ -275,7 +275,7 @@ theorem existsUnique_gluing' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover
 #align Top.sheaf.exists_unique_gluing' TopCat.Sheaf.existsUnique_gluing'
 
 @[ext]
-theorem eq_of_locally_eq (s t : F.1.obj (op (supᵢ U)))
+theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
     (h : ∀ i, F.1.map (Opens.leSupr U i).op s = F.1.map (Opens.leSupr U i).op t) : s = t :=
   by
   let sf : ∀ i : ι, F.1.obj (op (U i)) := fun i => F.1.map (opens.le_supr U i).op s
@@ -298,10 +298,10 @@ theorem eq_of_locally_eq (s t : F.1.obj (op (supᵢ U)))
 /-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
 which can be more convenient in practice.
 -/
-theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : V ≤ supᵢ U)
+theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : V ≤ iSup U)
     (s t : F.1.obj (op V)) (h : ∀ i, F.1.map (iUV i).op s = F.1.map (iUV i).op t) : s = t :=
   by
-  have V_eq_supr_U : V = supᵢ U := le_antisymm hcover (supᵢ_le fun i => (iUV i).le)
+  have V_eq_supr_U : V = iSup U := le_antisymm hcover (iSup_le fun i => (iUV i).le)
   suffices F.1.map (eq_to_hom V_eq_supr_U.symm).op s = F.1.map (eq_to_hom V_eq_supr_U.symm).op t by
     convert congr_arg (F.1.map (eq_to_hom V_eq_supr_U).op) this <;>
       rw [← comp_apply, ← F.1.map_comp, eq_to_hom_op, eq_to_hom_op, eq_to_hom_trans, eq_to_hom_refl,
@@ -321,8 +321,8 @@ theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ :
     · refine' le_trans hcover _
       rw [sup_le_iff]
       constructor
-      · convert le_supᵢ (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
-      · convert le_supᵢ (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
+      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
+      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
     · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
 #align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂
 
Diff
@@ -241,9 +241,9 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.Forget C)]
+variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
 
-variable [PreservesLimits (ConcreteCategory.Forget C)]
+variable [PreservesLimits (ConcreteCategory.forget C)]
 
 variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 
Diff
@@ -192,7 +192,7 @@ theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUnique
   use s
   dsimp
   constructor
-  · convert (is_gluing_iff_eq_res F U sf' _).mpr s_spec
+  · convert(is_gluing_iff_eq_res F U sf' _).mpr s_spec
     rw [inv_hom_id_apply]
   · intro y hy
     apply s_uniq
Diff
@@ -241,9 +241,9 @@ section
 
 attribute [local instance] concrete_category.has_coe_to_sort concrete_category.has_coe_to_fun
 
-variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget C)]
+variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.Forget C)]
 
-variable [PreservesLimits (ConcreteCategory.forget C)]
+variable [PreservesLimits (ConcreteCategory.Forget C)]
 
 variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 

Changes in mathlib4

mathlib3
mathlib4
chore(CategoryTheory): move Full, Faithful, EssSurj, IsEquivalence and ReflectsIsomorphisms to the Functor namespace (#11985)

These notions on functors are now Functor.Full, Functor.Faithful, Functor.EssSurj, Functor.IsEquivalence, Functor.ReflectsIsomorphisms. Deprecated aliases are introduced for the previous names.

Diff
@@ -154,7 +154,7 @@ section
 
 attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
-variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
+variable [HasLimits C] [(forget C).ReflectsIsomorphisms] [PreservesLimits (forget C)]
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
@@ -180,7 +180,7 @@ section
 
 attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
-variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget (C := C))]
+variable [HasLimits C] [(ConcreteCategory.forget (C := C)).ReflectsIsomorphisms]
 variable [PreservesLimits (ConcreteCategory.forget (C := C))]
 variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -155,7 +155,6 @@ section
 attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
-
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
@@ -182,9 +181,7 @@ section
 attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget (C := C))]
-
 variable [PreservesLimits (ConcreteCategory.forget (C := C))]
-
 variable {X : TopCat.{v}} (F : Sheaf C X) {ι : Type v} (U : ι → Opens X)
 
 /-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -221,7 +221,7 @@ theorem eq_of_locally_eq (s t : F.1.obj (op (iSup U)))
   let sf : ∀ i : ι, F.1.obj (op (U i)) := fun i => F.1.map (Opens.leSupr U i).op s
   have sf_compatible : IsCompatible _ U sf := by
     intro i j
-    simp_rw [← comp_apply, ← F.1.map_comp]
+    simp_rw [sf, ← comp_apply, ← F.1.map_comp]
     rfl
   obtain ⟨gl, -, gl_uniq⟩ := F.existsUnique_gluing U sf sf_compatible
   trans gl
refactor(Data/FunLike): use unbundled inheritance from FunLike (#8386)

The FunLike hierarchy is very big and gets scanned through each time we need a coercion (via the CoeFun instance). It looks like unbundled inheritance suits Lean 4 better here. The only class that still extends FunLike is EquivLike, since that has a custom coe_injective' field that is easier to implement. All other classes should take FunLike or EquivLike as a parameter.

Zulip thread

Important changes

Previously, morphism classes would be Type-valued and extend FunLike:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  extends FunLike F A B :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

After this PR, they should be Prop-valued and take FunLike as a parameter:

/-- `MyHomClass F A B` states that `F` is a type of `MyClass.op`-preserving morphisms.
You should extend this class when you extend `MyHom`. -/
class MyHomClass (F : Type*) (A B : outParam <| Type*) [MyClass A] [MyClass B]
  [FunLike F A B] : Prop :=
(map_op : ∀ (f : F) (x y : A), f (MyClass.op x y) = MyClass.op (f x) (f y))

(Note that A B stay marked as outParam even though they are not purely required to be so due to the FunLike parameter already filling them in. This is required to see through type synonyms, which is important in the category theory library. Also, I think keeping them as outParam is slightly faster.)

Similarly, MyEquivClass should take EquivLike as a parameter.

As a result, every mention of [MyHomClass F A B] should become [FunLike F A B] [MyHomClass F A B].

Remaining issues

Slower (failing) search

While overall this gives some great speedups, there are some cases that are noticeably slower. In particular, a failing application of a lemma such as map_mul is more expensive. This is due to suboptimal processing of arguments. For example:

variable [FunLike F M N] [Mul M] [Mul N] (f : F) (x : M) (y : M)

theorem map_mul [MulHomClass F M N] : f (x * y) = f x * f y

example [AddHomClass F A B] : f (x * y) = f x * f y := map_mul f _ _

Before this PR, applying map_mul f gives the goals [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Since M and N are out_params, [MulHomClass F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found.

After this PR, the goals become [FunLike F ?M ?N] [Mul ?M] [Mul ?N] [MulHomClass F ?M ?N]. Now [FunLike F ?M ?N] is synthesized first, supplies values for ?M and ?N and then the Mul M and Mul N instances can be found, before trying MulHomClass F M N which fails. Since the Mul hierarchy is very big, this can be slow to fail, especially when there is no such Mul instance.

A long-term but harder to achieve solution would be to specify the order in which instance goals get solved. For example, we'd like to change the arguments to map_mul to look like [FunLike F M N] [Mul M] [Mul N] [highPriority <| MulHomClass F M N] because MulHomClass fails or succeeds much faster than the others.

As a consequence, the simpNF linter is much slower since by design it tries and fails to apply many map_ lemmas. The same issue occurs a few times in existing calls to simp [map_mul], where map_mul is tried "too soon" and fails. Thanks to the speedup of leanprover/lean4#2478 the impact is very limited, only in files that already were close to the timeout.

simp not firing sometimes

This affects map_smulₛₗ and related definitions. For simp lemmas Lean apparently uses a slightly different mechanism to find instances, so that rw can find every argument to map_smulₛₗ successfully but simp can't: leanprover/lean4#3701.

Missing instances due to unification failing

Especially in the category theory library, we might sometimes have a type A which is also accessible as a synonym (Bundled A hA).1. Instance synthesis doesn't always work if we have f : A →* B but x * y : (Bundled A hA).1 or vice versa. This seems to be mostly fixed by keeping A B as outParams in MulHomClass F A B. (Presumably because Lean will do a definitional check A =?= (Bundled A hA).1 instead of using the syntax in the discrimination tree.)

Workaround for issues

The timeouts can be worked around for now by specifying which map_mul we mean, either as map_mul f for some explicit f, or as e.g. MonoidHomClass.map_mul.

map_smulₛₗ not firing as simp lemma can be worked around by going back to the pre-FunLike situation and making LinearMap.map_smulₛₗ a simp lemma instead of the generic map_smulₛₗ. Writing simp [map_smulₛₗ _] also works.

Co-authored-by: Matthew Ballard <matt@mrb.email> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott@tqft.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -283,16 +283,22 @@ theorem objSupIsoProdEqLocus_inv_eq_iff {X : TopCat.{u}} (F : X.Sheaf CommRingCa
   constructor
   · rintro rfl
     rw [← TopCat.Sheaf.objSupIsoProdEqLocus_inv_fst, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_snd]
-    simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp, and_self]
+    -- `simp` doesn't see through the type equality of objects in `CommRingCat`, so use `rw` #8386
+    repeat rw [← comp_apply]
+    simp only [← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp, and_self]
   · rintro ⟨e₁, e₂⟩
     refine' F.eq_of_locally_eq₂
       (homOfLE (inf_le_right : U ⊓ W ≤ W)) (homOfLE (inf_le_right : V ⊓ W ≤ W)) _ _ _ _ _
     · rw [← inf_sup_right]
       exact le_inf e le_rfl
     · rw [← e₁, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_fst]
-      simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
+      -- `simp` doesn't see through the type equality of objects in `CommRingCat`, so use `rw` #8386
+      repeat rw [← comp_apply]
+      simp only [← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
     · rw [← e₂, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_snd]
-      simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
+      -- `simp` doesn't see through the type equality of objects in `CommRingCat`, so use `rw` #8386
+      repeat rw [← comp_apply]
+      simp only [← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
 
 end Sheaf
 
refactor(*): abbreviation for non-dependent FunLike (#9833)

This follows up from #9785, which renamed FunLike to DFunLike, by introducing a new abbreviation FunLike F α β := DFunLike F α (fun _ => β), to make the non-dependent use of FunLike easier.

I searched for the pattern DFunLike.*fun and DFunLike.*λ in all files to replace expressions of the form DFunLike F α (fun _ => β) with FunLike F α β. I did this everywhere except for extends clauses for two reasons: it would conflict with #8386, and more importantly extends must directly refer to a structure with no unfolding of defs or abbrevs.

Diff
@@ -50,7 +50,7 @@ namespace Presheaf
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instDFunLike
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
 variable {X : TopCat.{x}} (F : Presheaf C X) {ι : Type x} (U : ι → Opens X)
 
@@ -152,7 +152,7 @@ end TypeValued
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instDFunLike
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
 
@@ -179,7 +179,7 @@ open CategoryTheory
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instDFunLike
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instFunLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget (C := C))]
 
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -50,7 +50,7 @@ namespace Presheaf
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instDFunLike
 
 variable {X : TopCat.{x}} (F : Presheaf C X) {ι : Type x} (U : ι → Opens X)
 
@@ -152,7 +152,7 @@ end TypeValued
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instDFunLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
 
@@ -179,7 +179,7 @@ open CategoryTheory
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.instDFunLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget (C := C))]
 
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -283,7 +283,7 @@ theorem objSupIsoProdEqLocus_inv_eq_iff {X : TopCat.{u}} (F : X.Sheaf CommRingCa
   constructor
   · rintro rfl
     rw [← TopCat.Sheaf.objSupIsoProdEqLocus_inv_fst, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_snd]
-    simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
+    simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp, and_self]
   · rintro ⟨e₁, e₂⟩
     refine' F.eq_of_locally_eq₂
       (homOfLE (inf_le_right : U ⊓ W ≤ W)) (homOfLE (inf_le_right : V ⊓ W ≤ W)) _ _ _ _ _
perf(AlgebraicGeometry): Fix slow and bad proofs (#7747)

Fixed AlgebraicGeometry/AffineSchemes.lean, AlgebraicGeometry/Morphisms/QuasiSeparated.lean and AlgebraicGeometry/Morphisms/RingHomProperties.lean.

Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Andrew Yang <36414270+erdOne@users.noreply.github.com> Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -271,6 +271,29 @@ set_option linter.uppercaseLean3 false in
 
 end
 
+theorem objSupIsoProdEqLocus_inv_eq_iff {X : TopCat.{u}} (F : X.Sheaf CommRingCat.{u})
+    {U V W UW VW : Opens X} (e : W ≤ U ⊔ V) (x) (y : F.1.obj (op W))
+    (h₁ : UW = U ⊓ W) (h₂ : VW = V ⊓ W) :
+    F.1.map (homOfLE e).op ((F.objSupIsoProdEqLocus U V).inv x) = y ↔
+    F.1.map (homOfLE (h₁ ▸ inf_le_left : UW ≤ U)).op x.1.1 =
+      F.1.map (homOfLE <| h₁ ▸ inf_le_right).op y ∧
+    F.1.map (homOfLE (h₂ ▸ inf_le_left : VW ≤ V)).op x.1.2 =
+      F.1.map (homOfLE <| h₂ ▸ inf_le_right).op y := by
+  subst h₁ h₂
+  constructor
+  · rintro rfl
+    rw [← TopCat.Sheaf.objSupIsoProdEqLocus_inv_fst, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_snd]
+    simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
+  · rintro ⟨e₁, e₂⟩
+    refine' F.eq_of_locally_eq₂
+      (homOfLE (inf_le_right : U ⊓ W ≤ W)) (homOfLE (inf_le_right : V ⊓ W ≤ W)) _ _ _ _ _
+    · rw [← inf_sup_right]
+      exact le_inf e le_rfl
+    · rw [← e₁, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_fst]
+      simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
+    · rw [← e₂, ← TopCat.Sheaf.objSupIsoProdEqLocus_inv_snd]
+      simp only [← comp_apply, ← Functor.map_comp, ← op_comp, Category.assoc, homOfLE_comp]
+
 end Sheaf
 
 end TopCat
feat: universe generalizations in UniqueGluing and Forget (#7654)
  • Add a criterion isLimit_iff for a cone to be a limit in Limits/Types.lean.

  • Use the criterion to show the equivalence between the UniqueGluing and PairwiseIntersection sheaf conditions without going through EqualizerProducts, thereby generalize the universes.

  • Remove theorems/def that are now unnecessary. (cc @justus-springer)

  • Generalize isSheaf_iff_isSheaf_forget for sheaves on sites using isSheaf_iff_isLimit; use it to prove and generalize the result on topological spaces, removing a large chunk of code.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -4,9 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
 -/
 import Mathlib.Topology.Sheaves.Forget
+import Mathlib.Topology.Sheaves.SheafCondition.PairwiseIntersections
 import Mathlib.CategoryTheory.Limits.Shapes.Types
-import Mathlib.Topology.Sheaves.Sheaf
-import Mathlib.CategoryTheory.Types
 
 #align_import topology.sheaves.sheaf_condition.unique_gluing from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
 
@@ -29,8 +28,8 @@ and `sf j` to `U i ⊓ U j` agree. A section `s : F.obj (op (supr U))` is a glui
 family `sf`, if `s` restricts to `sf i` on `U i` for all `i : ι`
 
 We show that the sheaf condition in terms of unique gluings is equivalent to the definition
-in terms of equalizers. Our approach is as follows: First, we show them to be equivalent for
-`Type`-valued presheaves. Then we use that composing a presheaf with a limit-preserving and
+in terms of pairwise intersections. Our approach is as follows: First, we show them to be equivalent
+for `Type`-valued presheaves. Then we use that composing a presheaf with a limit-preserving and
 isomorphism-reflecting functor leaves the sheaf condition invariant, as shown in
 `Mathlib/Topology/Sheaves/Forget.lean`.
 
@@ -38,8 +37,8 @@ isomorphism-reflecting functor leaves the sheaf condition invariant, as shown in
 
 noncomputable section
 
-open TopCat TopCat.Presheaf TopCat.Presheaf.SheafConditionEqualizerProducts CategoryTheory
-  CategoryTheory.Limits TopologicalSpace TopologicalSpace.Opens Opposite
+open TopCat TopCat.Presheaf CategoryTheory CategoryTheory.Limits
+  TopologicalSpace TopologicalSpace.Opens Opposite
 
 universe v u x
 
@@ -89,123 +88,66 @@ end
 
 section TypeValued
 
-variable {X : TopCat.{x}} (F : Presheaf (Type u) X) {ι : Type x} (U : ι → Opens X) [UnivLE.{x, u}]
+variable {X : TopCat.{x}} {F : Presheaf (Type u) X} {ι : Type x} {U : ι → Opens X}
+
+/-- Given sections over a family of open sets, extend it to include
+  sections over pairwise intersections of the open sets. -/
+def objPairwiseOfFamily (sf : ∀ i, F.obj (op (U i))) :
+    ∀ i, ((Pairwise.diagram U).op ⋙ F).obj i
+  | ⟨Pairwise.single i⟩ => sf i
+  | ⟨Pairwise.pair i j⟩ => F.map (infLELeft (U i) (U j)).op (sf i)
+
+/-- Given a compatible family of sections over open sets, extend it to a
+  section of the functor `(Pairwise.diagram U).op ⋙ F`. -/
+def IsCompatible.sectionPairwise {sf} (h : IsCompatible F U sf) :
+    ((Pairwise.diagram U).op ⋙ F).sections := by
+  refine ⟨objPairwiseOfFamily sf, ?_⟩
+  let G := (Pairwise.diagram U).op ⋙ F
+  rintro (i|⟨i,j⟩) (i'|⟨i',j'⟩) (_|_|_|_)
+  · exact congr_fun (G.map_id <| op <| Pairwise.single i) _
+  · rfl
+  · exact (h i' i).symm
+  · exact congr_fun (G.map_id <| op <| Pairwise.pair i j) _
+
+theorem isGluing_iff_pairwise {sf s} : IsGluing F U sf s ↔
+    ∀ i, (F.mapCone (Pairwise.cocone U).op).π.app i s = objPairwiseOfFamily sf i := by
+  refine ⟨fun h ↦ ?_, fun h i ↦ h (op <| Pairwise.single i)⟩
+  rintro (i|⟨i,j⟩)
+  · exact h i
+  · rw [← (F.mapCone (Pairwise.cocone U).op).w (op <| Pairwise.Hom.left i j)]
+    exact congr_arg _ (h i)
+
+variable (F)
 
-/-- For presheaves of types, terms of `piOpens F U` are just families of sections.
--/
-def piOpensIsoSectionsFamily : piOpens F U ≃ ∀ i : ι, F.obj (op (U i)) :=
-  (Types.UnivLE.productIso _).toEquiv.trans (equivShrink _).symm
-set_option linter.uppercaseLean3 false in
-#align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
-
-@[simp]
-theorem piOpensIsoSectionsFamily_apply (sf : piOpens F U) (i : ι) :
-    piOpensIsoSectionsFamily F U sf i = Pi.π (fun i => F.obj (op (U i))) i sf := by
-  simp [piOpensIsoSectionsFamily]
-
-/-- Under the isomorphism `piOpensIsoSectionsFamily`, compatibility of sections is the same
-as being equalized by the arrows `leftRes` and `rightRes` of the equalizer diagram.
--/
-theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
-    IsCompatible F U (piOpensIsoSectionsFamily F U sf) ↔
-    leftRes F U sf = rightRes F U sf := by
-  constructor <;> intro h
-  · -- Porting note : Lean can't use `Types.limit_ext'` as an `ext` lemma
-    refine Types.limit_ext _ _ _ fun ⟨i, j⟩ => ?_
-    rw [leftRes, Types.Limit.lift_π_apply, Fan.mk_π_app, rightRes, Types.Limit.lift_π_apply,
-      Fan.mk_π_app]
-    simpa using h i j
-  · intro i j
-    convert congr_arg (Limits.Pi.π (fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2))) (i, j)) h
-    · rw [leftRes, Types.pi_lift_π_apply, piOpensIsoSectionsFamily_apply]
-      rfl
-    · rw [rightRes, Types.pi_lift_π_apply]
-      simp only [piOpensIsoSectionsFamily_apply]
-      rfl
-set_option linter.uppercaseLean3 false in
-#align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
-
-/-- Under the isomorphism `piOpensIsoSectionsFamily`, being a gluing of a family of
-sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
-equalizer diagram).
+/-- For type-valued presheaves, the sheaf condition in terms of unique gluings is equivalent to the
+usual sheaf condition.
 -/
-@[simp]
-theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
-    IsGluing F U (piOpensIsoSectionsFamily F U sf) s ↔ res F U s = sf := by
-  constructor <;> intro h
-  · -- Porting note : Lean can't use `Types.limit_ext'` as an `ext` lemma
-    refine Types.limit_ext _ _ _ fun ⟨i⟩ => ?_
-    rw [res, Types.Limit.lift_π_apply, Fan.mk_π_app]
-    simpa using h i
-  · intro i
-    convert congr_arg (Limits.Pi.π (fun i : ι => F.obj (op (U i))) i) h
-    rw [res, Types.pi_lift_π_apply]
+theorem isSheaf_iff_isSheafUniqueGluing_types : F.IsSheaf ↔ F.IsSheafUniqueGluing := by
+  simp_rw [isSheaf_iff_isSheafPairwiseIntersections, IsSheafPairwiseIntersections,
+    Types.isLimit_iff, IsSheafUniqueGluing, isGluing_iff_pairwise]
+  refine forall₂_congr fun ι U ↦ ⟨fun h sf cpt ↦ ?_, fun h s hs ↦ ?_⟩
+  · exact h _ cpt.sectionPairwise.prop
+  · specialize h (fun i ↦ s <| op <| Pairwise.single i) fun i j ↦
+      (hs <| op <| Pairwise.Hom.left i j).trans (hs <| op <| Pairwise.Hom.right i j).symm
+    convert h; ext (i|⟨i,j⟩)
     · rfl
-    · simp
+    · exact (hs <| op <| Pairwise.Hom.left i j).symm
 set_option linter.uppercaseLean3 false in
-#align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
+#align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types
 
-/-- The "equalizer" sheaf condition can be obtained from the sheaf condition
+#noalign Top.presheaf.pi_opens_iso_sections_family
+#noalign Top.presheaf.compatible_iff_left_res_eq_right_res
+#noalign Top.presheaf.is_gluing_iff_eq_res
+#noalign Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types
+
+/-- The usual sheaf condition can be obtained from the sheaf condition
 in terms of unique gluings.
 -/
-theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.IsSheaf := by
-  rw [isSheaf_iff_isSheafEqualizerProducts]
-  intro ι U
-  refine' ⟨Fork.IsLimit.mk' _ _⟩
-  intro s
-  have h_compatible :
-    ∀ x : s.pt, F.IsCompatible U (piOpensIsoSectionsFamily F U (s.ι x)) := by
-    intro x
-    rw [compatible_iff_leftRes_eq_rightRes]
-    convert congr_fun s.condition x
-  choose m m_spec m_uniq using fun x : s.pt =>
-    Fsh U (piOpensIsoSectionsFamily F U (s.ι x)) (h_compatible x)
-  refine' ⟨m, _, _⟩
-  · -- Porting note : `ext` can't see `limit.hom_ext` applies here:
-    -- See https://github.com/leanprover-community/mathlib4/issues/5229
-    refine limit.hom_ext fun ⟨i⟩ => funext fun x => ?_
-    simp only [Discrete.functor_obj, Functor.const_obj_obj, fork_pt, parallelPair_obj_zero, fork_ι,
-      res._eq_1, types_comp_apply, Types.pi_lift_π_apply]
-    simpa using m_spec x i
-  · intro l hl
-    ext x
-    apply m_uniq
-    rw [isGluing_iff_eq_res]
-    exact congr_fun hl x
+theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.IsSheaf :=
+  (isSheaf_iff_isSheafUniqueGluing_types F).mpr Fsh
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.is_sheaf_of_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_of_isSheafUniqueGluing_types
 
-/-- The sheaf condition in terms of unique gluings can be obtained from the usual
-"equalizer" sheaf condition.
--/
-theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUniqueGluing := by
-  rw [isSheaf_iff_isSheafEqualizerProducts] at Fsh
-  intro ι U sf hsf
-  let sf' := (piOpensIsoSectionsFamily F U).symm sf
-  have hsf' : leftRes F U sf' = rightRes F U sf' := by
-    rwa [← compatible_iff_leftRes_eq_rightRes F U sf', Equiv.apply_symm_apply]
-  choose s s_spec s_uniq using Types.unique_of_type_equalizer _ _ (Fsh U).some sf' hsf'
-  use s
-  dsimp
-  constructor
-  · convert (isGluing_iff_eq_res F U sf' _).mpr s_spec
-    simp only [Equiv.apply_symm_apply]
-  · intro y hy
-    apply s_uniq
-    rw [← isGluing_iff_eq_res F U]
-    convert hy
-    simp only [Equiv.apply_symm_apply]
-set_option linter.uppercaseLean3 false in
-#align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types
-
-/-- For type-valued presheaves, the sheaf condition in terms of unique gluings is equivalent to the
-usual sheaf condition in terms of equalizer diagrams.
--/
-theorem isSheaf_iff_isSheafUniqueGluing_types : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
-  Iff.intro (isSheafUniqueGluing_of_isSheaf_types F) (isSheaf_of_isSheafUniqueGluing_types F)
-set_option linter.uppercaseLean3 false in
-#align Top.presheaf.is_sheaf_iff_is_sheaf_unique_gluing_types TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing_types
-
 end TypeValued
 
 section
@@ -217,8 +159,7 @@ variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forge
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
 /-- For presheaves valued in a concrete category, whose forgetful functor reflects isomorphisms and
-preserves limits, the sheaf condition in terms of unique gluings is equivalent to the usual one
-in terms of equalizer diagrams.
+preserves limits, the sheaf condition in terms of unique gluings is equivalent to the usual one.
 -/
 theorem isSheaf_iff_isSheafUniqueGluing : F.IsSheaf ↔ F.IsSheafUniqueGluing :=
   Iff.trans (isSheaf_iff_isSheaf_comp (forget C) F)
chore: remove nonterminal simp (#7580)

Removes nonterminal simps on lines looking like simp [...]

Diff
@@ -164,7 +164,8 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
   · -- Porting note : `ext` can't see `limit.hom_ext` applies here:
     -- See https://github.com/leanprover-community/mathlib4/issues/5229
     refine limit.hom_ext fun ⟨i⟩ => funext fun x => ?_
-    simp [res]
+    simp only [Discrete.functor_obj, Functor.const_obj_obj, fork_pt, parallelPair_obj_zero, fork_ι,
+      res._eq_1, types_comp_apply, Types.pi_lift_π_apply]
     simpa using m_spec x i
   · intro l hl
     ext x
fix: don't use False as a bool, use false (#7059)
Diff
@@ -319,8 +319,8 @@ theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ :
     · refine' le_trans hcover _
       rw [sup_le_iff]
       constructor
-      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
-      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
+      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up true)
+      · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up false)
     · rintro ⟨_ | _⟩
       any_goals exact h₁
       any_goals exact h₂
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2021 Justus Springer. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
-
-! This file was ported from Lean 3 source module topology.sheaves.sheaf_condition.unique_gluing
-! leanprover-community/mathlib commit 5dc6092d09e5e489106865241986f7f2ad28d4c8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Topology.Sheaves.Forget
 import Mathlib.CategoryTheory.Limits.Shapes.Types
 import Mathlib.Topology.Sheaves.Sheaf
 import Mathlib.CategoryTheory.Types
 
+#align_import topology.sheaves.sheaf_condition.unique_gluing from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
+
 /-!
 # The sheaf condition in terms of unique gluings
 
feat: using UnivLE to generalize universes in UniqueGluing (#5726)

This is a test of the UnivLE proposal. The UniqueGluing file was one place where we couldn't forward port the universe generalisations made in mathlib3 in https://github.com/leanprover-community/mathlib/pull/19153.

Diff relative to #5724 is https://github.com/leanprover-community/mathlib4/compare/UnivLE_types...UnivLE_UniqueGluing.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Matthew Robert Ballard <matt@mrb.email> Co-authored-by: Bulhwi Cha <chabulhwi@semmalgil.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Oliver Nash <github@olivernash.org> Co-authored-by: Anatole Dedecker <anatolededecker@gmail.com> Co-authored-by: Tobias Grosser <tobias@grosser.es> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Moritz Firsching <moritz.firsching@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Christopher Hoskin <christopher.hoskin@gmail.com>

Diff
@@ -39,13 +39,12 @@ isomorphism-reflecting functor leaves the sheaf condition invariant, as shown in
 
 -/
 
-
 noncomputable section
 
 open TopCat TopCat.Presheaf TopCat.Presheaf.SheafConditionEqualizerProducts CategoryTheory
   CategoryTheory.Limits TopologicalSpace TopologicalSpace.Opens Opposite
 
-universe u v
+universe v u x
 
 variable {C : Type u} [Category.{v} C] [ConcreteCategory.{v} C]
 
@@ -57,7 +56,7 @@ section
 
 attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
 
-variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
+variable {X : TopCat.{x}} (F : Presheaf C X) {ι : Type x} (U : ι → Opens X)
 
 /-- A family of sections `sf` is compatible, if the restrictions of `sf i` and `sf j` to `U i ⊓ U j`
 agree, for all `i` and `j`
@@ -84,7 +83,7 @@ We prove this to be equivalent to the usual one below in
 `TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing`
 -/
 def IsSheafUniqueGluing : Prop :=
-  ∀ ⦃ι : Type v⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
+  ∀ ⦃ι : Type x⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
     IsCompatible F U sf → ∃! s : F.obj (op (iSup U)), IsGluing F U sf s
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.is_sheaf_unique_gluing TopCat.Presheaf.IsSheafUniqueGluing
@@ -93,34 +92,38 @@ end
 
 section TypeValued
 
-variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
+variable {X : TopCat.{x}} (F : Presheaf (Type u) X) {ι : Type x} (U : ι → Opens X) [UnivLE.{x, u}]
 
 /-- For presheaves of types, terms of `piOpens F U` are just families of sections.
 -/
-def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
-  Limits.IsLimit.conePointUniqueUpToIso
-    (limit.isLimit (Discrete.functor fun i : ι => F.obj (op (U i))))
-    (Types.productLimitCone.{v, v} fun i : ι => F.obj (op (U i))).isLimit
+def piOpensIsoSectionsFamily : piOpens F U ≃ ∀ i : ι, F.obj (op (U i)) :=
+  (Types.UnivLE.productIso _).toEquiv.trans (equivShrink _).symm
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
 
+@[simp]
+theorem piOpensIsoSectionsFamily_apply (sf : piOpens F U) (i : ι) :
+    piOpensIsoSectionsFamily F U sf i = Pi.π (fun i => F.obj (op (U i))) i sf := by
+  simp [piOpensIsoSectionsFamily]
+
 /-- Under the isomorphism `piOpensIsoSectionsFamily`, compatibility of sections is the same
 as being equalized by the arrows `leftRes` and `rightRes` of the equalizer diagram.
 -/
 theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
-    IsCompatible F U ((piOpensIsoSectionsFamily F U).hom sf) ↔
+    IsCompatible F U (piOpensIsoSectionsFamily F U sf) ↔
     leftRes F U sf = rightRes F U sf := by
   constructor <;> intro h
   · -- Porting note : Lean can't use `Types.limit_ext'` as an `ext` lemma
-    refine Types.limit_ext' _ _ _ fun ⟨i, j⟩ => ?_
-    rw [leftRes, Types.Limit.lift_π_apply', Fan.mk_π_app, rightRes, Types.Limit.lift_π_apply',
+    refine Types.limit_ext _ _ _ fun ⟨i, j⟩ => ?_
+    rw [leftRes, Types.Limit.lift_π_apply, Fan.mk_π_app, rightRes, Types.Limit.lift_π_apply,
       Fan.mk_π_app]
-    exact h i j
+    simpa using h i j
   · intro i j
     convert congr_arg (Limits.Pi.π (fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2))) (i, j)) h
-    · rw [leftRes, Types.pi_lift_π_apply']
+    · rw [leftRes, Types.pi_lift_π_apply, piOpensIsoSectionsFamily_apply]
       rfl
-    · rw [rightRes, Types.pi_lift_π_apply']
+    · rw [rightRes, Types.pi_lift_π_apply]
+      simp only [piOpensIsoSectionsFamily_apply]
       rfl
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
@@ -131,16 +134,17 @@ equalizer diagram).
 -/
 @[simp]
 theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
-    IsGluing F U ((piOpensIsoSectionsFamily F U).hom sf) s ↔ res F U s = sf := by
+    IsGluing F U (piOpensIsoSectionsFamily F U sf) s ↔ res F U s = sf := by
   constructor <;> intro h
   · -- Porting note : Lean can't use `Types.limit_ext'` as an `ext` lemma
-    refine Types.limit_ext' _ _ _ fun ⟨i⟩ => ?_
-    rw [res, Types.Limit.lift_π_apply', Fan.mk_π_app]
-    exact h i
+    refine Types.limit_ext _ _ _ fun ⟨i⟩ => ?_
+    rw [res, Types.Limit.lift_π_apply, Fan.mk_π_app]
+    simpa using h i
   · intro i
     convert congr_arg (Limits.Pi.π (fun i : ι => F.obj (op (U i))) i) h
-    rw [res, Types.pi_lift_π_apply']
-    rfl
+    rw [res, Types.pi_lift_π_apply]
+    · rfl
+    · simp
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
 
@@ -153,18 +157,18 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
   refine' ⟨Fork.IsLimit.mk' _ _⟩
   intro s
   have h_compatible :
-    ∀ x : s.pt, F.IsCompatible U ((F.piOpensIsoSectionsFamily U).hom (s.ι x)) := by
+    ∀ x : s.pt, F.IsCompatible U (piOpensIsoSectionsFamily F U (s.ι x)) := by
     intro x
     rw [compatible_iff_leftRes_eq_rightRes]
     convert congr_fun s.condition x
   choose m m_spec m_uniq using fun x : s.pt =>
-    Fsh U ((piOpensIsoSectionsFamily F U).hom (s.ι x)) (h_compatible x)
+    Fsh U (piOpensIsoSectionsFamily F U (s.ι x)) (h_compatible x)
   refine' ⟨m, _, _⟩
   · -- Porting note : `ext` can't see `limit.hom_ext` applies here:
     -- See https://github.com/leanprover-community/mathlib4/issues/5229
     refine limit.hom_ext fun ⟨i⟩ => funext fun x => ?_
     simp [res]
-    exact m_spec x i
+    simpa using m_spec x i
   · intro l hl
     ext x
     apply m_uniq
@@ -179,20 +183,20 @@ set_option linter.uppercaseLean3 false in
 theorem isSheafUniqueGluing_of_isSheaf_types (Fsh : F.IsSheaf) : F.IsSheafUniqueGluing := by
   rw [isSheaf_iff_isSheafEqualizerProducts] at Fsh
   intro ι U sf hsf
-  let sf' := (piOpensIsoSectionsFamily F U).inv sf
+  let sf' := (piOpensIsoSectionsFamily F U).symm sf
   have hsf' : leftRes F U sf' = rightRes F U sf' := by
-    rwa [← compatible_iff_leftRes_eq_rightRes F U sf', inv_hom_id_apply]
+    rwa [← compatible_iff_leftRes_eq_rightRes F U sf', Equiv.apply_symm_apply]
   choose s s_spec s_uniq using Types.unique_of_type_equalizer _ _ (Fsh U).some sf' hsf'
   use s
   dsimp
   constructor
-  · convert(isGluing_iff_eq_res F U sf' _).mpr s_spec
-    rw [inv_hom_id_apply]
+  · convert (isGluing_iff_eq_res F U sf' _).mpr s_spec
+    simp only [Equiv.apply_symm_apply]
   · intro y hy
     apply s_uniq
     rw [← isGluing_iff_eq_res F U]
     convert hy
-    rw [inv_hom_id_apply]
+    simp only [Equiv.apply_symm_apply]
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.is_sheaf_unique_gluing_of_is_sheaf_types TopCat.Presheaf.isSheafUniqueGluing_of_isSheaf_types
 
chore: update SHAs after #19153 was reverted (#5712)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Justus Springer
 
 ! This file was ported from Lean 3 source module topology.sheaves.sheaf_condition.unique_gluing
-! leanprover-community/mathlib commit 618ea3d5c99240cd7000d8376924906a148bf9ff
+! leanprover-community/mathlib commit 5dc6092d09e5e489106865241986f7f2ad28d4c8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
chore: better TypeMax instances for limits in Type (#5535)

Preliminary to the full forward port of https://github.com/leanprover-community/mathlib/pull/19153, this is a slight generalization along with explanation of the problem with the instances.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -118,9 +118,9 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     exact h i j
   · intro i j
     convert congr_arg (Limits.Pi.π (fun p : ι × ι => F.obj (op (U p.1 ⊓ U p.2))) (i, j)) h
-    · rw [leftRes, Types.pi_lift_π_apply]
+    · rw [leftRes, Types.pi_lift_π_apply']
       rfl
-    · rw [rightRes, Types.pi_lift_π_apply]
+    · rw [rightRes, Types.pi_lift_π_apply']
       rfl
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
@@ -139,7 +139,7 @@ theorem isGluing_iff_eq_res (sf : piOpens F U) (s : F.obj (op (iSup U))) :
     exact h i
   · intro i
     convert congr_arg (Limits.Pi.π (fun i : ι => F.obj (op (U i))) i) h
-    rw [res, Types.pi_lift_π_apply]
+    rw [res, Types.pi_lift_π_apply']
     rfl
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.is_gluing_iff_eq_res TopCat.Presheaf.isGluing_iff_eq_res
feat: more consistent use of ext, and updating porting notes. (#5242)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -160,7 +160,8 @@ theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.I
   choose m m_spec m_uniq using fun x : s.pt =>
     Fsh U ((piOpensIsoSectionsFamily F U).hom (s.ι x)) (h_compatible x)
   refine' ⟨m, _, _⟩
-  · -- Porting note : Lean can't use `limit.hom_ext` as an `ext` lemma
+  · -- Porting note : `ext` can't see `limit.hom_ext` applies here:
+    -- See https://github.com/leanprover-community/mathlib4/issues/5229
     refine limit.hom_ext fun ⟨i⟩ => funext fun x => ?_
     simp [res]
     exact m_spec x i
feat: change ConcreteCategory.hasCoeToFun to FunLike (#4693)
Diff
@@ -55,7 +55,7 @@ namespace Presheaf
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.hasCoeToFun
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
 
 variable {X : TopCat.{v}} (F : Presheaf C X) {ι : Type v} (U : ι → Opens X)
 
@@ -207,7 +207,7 @@ end TypeValued
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.hasCoeToFun
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (forget C)] [PreservesLimits (forget C)]
 
@@ -235,7 +235,7 @@ open CategoryTheory
 
 section
 
-attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.hasCoeToFun
+attribute [local instance] ConcreteCategory.hasCoeToSort ConcreteCategory.funLike
 
 variable [HasLimits C] [ReflectsIsomorphisms (ConcreteCategory.forget (C := C))]
 
@@ -319,7 +319,9 @@ theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ :
       constructor
       · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up True)
       · convert le_iSup (fun t : ULift Bool => if t.1 then U₁ else U₂) (ULift.up False)
-    · rintro ⟨_ | _⟩ <;> simp [h₁, h₂]
+    · rintro ⟨_ | _⟩
+      any_goals exact h₁
+      any_goals exact h₂
 set_option linter.uppercaseLean3 false in
 #align Top.sheaf.eq_of_locally_eq₂ TopCat.Sheaf.eq_of_locally_eq₂
 
chore: tidy various files (#4854)
Diff
@@ -20,8 +20,8 @@ We provide an alternative formulation of the sheaf condition in terms of unique
 
 We work with sheaves valued in a concrete category `C` admitting all limits, whose forgetful
 functor `C ⥤ Type` preserves limits and reflects isomorphisms. The usual categories of algebraic
-structures, such as `Mon`, `AddCommGroup`, `Ring`, `CommRing` etc. are all examples of this kind of
-category.
+structures, such as `MonCat`, `AddCommGroupCat`, `RingCat`, `CommRingCat` etc. are all examples of
+this kind of category.
 
 A presheaf `F : presheaf C X` satisfies the sheaf condition if and only if, for every
 compatible family of sections `sf : Π i : ι, F.obj (op (U i))`, there exists a unique gluing
@@ -35,28 +35,15 @@ We show that the sheaf condition in terms of unique gluings is equivalent to the
 in terms of equalizers. Our approach is as follows: First, we show them to be equivalent for
 `Type`-valued presheaves. Then we use that composing a presheaf with a limit-preserving and
 isomorphism-reflecting functor leaves the sheaf condition invariant, as shown in
-`topology/sheaves/forget.lean`.
+`Mathlib/Topology/Sheaves/Forget.lean`.
 
 -/
 
 
 noncomputable section
 
-open TopCat
-
-open TopCat.Presheaf
-
-open TopCat.Presheaf.SheafConditionEqualizerProducts
-
-open CategoryTheory
-
-open CategoryTheory.Limits
-
-open TopologicalSpace
-
-open TopologicalSpace.Opens
-
-open Opposite
+open TopCat TopCat.Presheaf TopCat.Presheaf.SheafConditionEqualizerProducts CategoryTheory
+  CategoryTheory.Limits TopologicalSpace TopologicalSpace.Opens Opposite
 
 universe u v
 
@@ -94,7 +81,7 @@ condition if and only if, for every compatible family of sections `sf : Π i : 
 there exists a unique gluing `s : F.obj (op (supr U))`.
 
 We prove this to be equivalent to the usual one below in
-`is_sheaf_iff_is_sheaf_unique_gluing`
+`TopCat.Presheaf.isSheaf_iff_isSheafUniqueGluing`
 -/
 def IsSheafUniqueGluing : Prop :=
   ∀ ⦃ι : Type v⦄ (U : ι → Opens X) (sf : ∀ i : ι, F.obj (op (U i))),
@@ -108,7 +95,7 @@ section TypeValued
 
 variable {X : TopCat.{v}} (F : Presheaf (Type v) X) {ι : Type v} (U : ι → Opens X)
 
-/-- For presheaves of types, terms of `pi_opens F U` are just families of sections.
+/-- For presheaves of types, terms of `piOpens F U` are just families of sections.
 -/
 def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
   Limits.IsLimit.conePointUniqueUpToIso
@@ -117,8 +104,8 @@ def piOpensIsoSectionsFamily : piOpens F U ≅ ∀ i : ι, F.obj (op (U i)) :=
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.pi_opens_iso_sections_family TopCat.Presheaf.piOpensIsoSectionsFamily
 
-/-- Under the isomorphism `pi_opens_iso_sections_family`, compatibility of sections is the same
-as being equalized by the arrows `left_res` and `right_res` of the equalizer diagram.
+/-- Under the isomorphism `piOpensIsoSectionsFamily`, compatibility of sections is the same
+as being equalized by the arrows `leftRes` and `rightRes` of the equalizer diagram.
 -/
 theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
     IsCompatible F U ((piOpensIsoSectionsFamily F U).hom sf) ↔
@@ -138,7 +125,7 @@ theorem compatible_iff_leftRes_eq_rightRes (sf : piOpens F U) :
 set_option linter.uppercaseLean3 false in
 #align Top.presheaf.compatible_iff_left_res_eq_right_res TopCat.Presheaf.compatible_iff_leftRes_eq_rightRes
 
-/-- Under the isomorphism `pi_opens_iso_sections_family`, being a gluing of a family of
+/-- Under the isomorphism `piOpensIsoSectionsFamily`, being a gluing of a family of
 sections `sf` is the same as lying in the preimage of `res` (the leftmost arrow of the
 equalizer diagram).
 -/
feat: port Topology.Sheaves.SheafCondition.UniqueGluing (#4424)

Dependencies 11 + 767

768 files ported (98.6%)
314147 lines ported (98.3%)
Show graph

The unported dependencies are