algebraic_geometry.morphisms.quasi_compactMathlib.AlgebraicGeometry.Morphisms.QuasiCompact

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
@@ -298,7 +298,7 @@ end
 
 /-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
 `f ^ n * x = 0` for some `n`. -/
-lemma exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact (X : Scheme.{u})
+lemma exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact (X : Scheme)
   {U : opens X.carrier} (hU : is_compact U.1) (x f : X.presheaf.obj (op U))
   (H : x |_ X.basic_open f = 0) :
   ∃ n : ℕ, f ^ n * x = 0 :=
@@ -322,7 +322,7 @@ begin
   use finset.univ.sup n,
   suffices : ∀ (i : s), X.presheaf.map (hom_of_le (h₁ i)).op (f ^ (finset.univ.sup n) * x) = 0,
   { subst e,
-    apply Top.sheaf.eq_of_locally_eq.{(u+1) u} X.sheaf (λ (i : s), (i : opens X.carrier)),
+    apply X.sheaf.eq_of_locally_eq (λ (i : s), (i : opens X.carrier)),
     intro i,
     rw map_zero,
     apply this },

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -193,11 +193,11 @@ theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).
     change CompactSpace ((opens.map f.val.base).obj (Y.basic_open r))
     rw [Scheme.preimage_basic_open f r]
     erw [← isCompact_iff_compactSpace]
-    rw [← isCompact_univ_iff] at H 
+    rw [← isCompact_univ_iff] at H
     exact is_compact_basic_open X H _
   · rintro X Y H f S hS hS'
     skip
-    rw [← is_affine_open.basic_open_union_eq_self_iff] at hS 
+    rw [← is_affine_open.basic_open_union_eq_self_iff] at hS
     delta quasi_compact.affine_property
     rw [← isCompact_univ_iff]
     change IsCompact ((opens.map f.val.base).obj ⊤).1
@@ -354,7 +354,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
     {U : Opens X.carrier} (hU : IsAffineOpen U) (x f : X.Presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 :=
   by
-  rw [← map_zero (X.presheaf.map (hom_of_le <| X.basic_open_le f : X.basic_open f ⟶ U).op)] at H 
+  rw [← map_zero (X.presheaf.map (hom_of_le <| X.basic_open_le f : X.basic_open f ⟶ U).op)] at H
   have := (is_localization_basic_open hU f).3
   obtain ⟨⟨_, n, rfl⟩, e⟩ := this.mp H
   exact ⟨n, by simpa [mul_comm x] using e⟩
@@ -397,9 +397,9 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   replace hn :=
     congr_arg (fun x => X.presheaf.map (hom_of_le (h₁ i)).op (f ^ (finset.univ.sup n - n i)) * x)
       (hn i)
-  dsimp at hn 
-  simp only [← map_mul, ← map_pow] at hn 
-  rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn 
+  dsimp at hn
+  simp only [← map_mul, ← map_pow] at hn
+  rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn
   apply Finset.le_sup (Finset.mem_univ i)
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact
 -/
Diff
@@ -150,7 +150,35 @@ theorem quasiCompact_eq_affineProperty :
 
 #print AlgebraicGeometry.isCompact_basicOpen /-
 theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (U : Set X.carrier))
-    (f : X.Presheaf.obj (op U)) : IsCompact (X.basicOpen f : Set X.carrier) := by classical
+    (f : X.Presheaf.obj (op U)) : IsCompact (X.basicOpen f : Set X.carrier) := by
+  classical
+  refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1
+  obtain ⟨s, hs, e⟩ := (is_compact_open_iff_eq_finset_affine_union _).mp ⟨hU, U.is_open⟩
+  let g : s → X.affine_opens := by
+    intro V
+    use V.1 ⊓ X.basic_open f
+    have : V.1.1 ⟶ U := by
+      apply hom_of_le; change _ ⊆ (U : Set X.carrier); rw [e]
+      convert @Set.subset_iUnion₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
+        1
+      rfl
+    erw [← X.to_LocallyRingedSpace.to_RingedSpace.basic_open_res this.op]
+    exact is_affine_open.basic_open_is_affine V.1.Prop _
+  haveI : Finite s := hs.to_subtype
+  refine' ⟨Set.range g, Set.finite_range g, _⟩
+  refine'
+    (set.inter_eq_right_iff_subset.mpr
+            (SetLike.coe_subset_coe.2 <| RingedSpace.basic_open_le _ _)).symm.trans
+      _
+  rw [e, Set.iUnion₂_inter]
+  apply le_antisymm <;> apply Set.iUnion₂_subset
+  · intro i hi
+    refine' Set.Subset.trans _ (Set.subset_iUnion₂ _ (Set.mem_range_self ⟨i, hi⟩))
+    exact Set.Subset.rfl
+  · rintro ⟨i, hi⟩ ⟨⟨j, hj⟩, hj'⟩
+    rw [← hj']
+    refine' Set.Subset.trans _ (Set.subset_iUnion₂ j hj)
+    exact Set.Subset.rfl
 #align algebraic_geometry.is_compact_basic_open AlgebraicGeometry.isCompact_basicOpen
 -/
 
@@ -303,7 +331,21 @@ instance (f : X ⟶ Z) (g : Y ⟶ Z) [QuasiCompact f] :
 theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
     (hS : IsCompact S.1) (h₁ : P ⊥)
     (h₂ : ∀ (S : Opens X.carrier) (hS : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
-    P S := by classical
+    P S := by
+  classical
+  obtain ⟨s, hs, hs'⟩ := (is_compact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
+  replace hs' : S = iSup fun i : s => (i : opens X.carrier) := by ext1; simpa using hs'
+  subst hs'
+  apply hs.induction_on
+  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
+  · intro x s h₃ hs h₄
+    have : IsCompact (⨆ i : s, (i : opens X.carrier)).1 := by
+      refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
+    convert h₂ _ this x h₄
+    simp only [coe_coe]
+    rw [iSup_subtype, sup_comm]
+    conv_rhs => rw [iSup_subtype]
+    exact iSup_insert
 #align algebraic_geometry.compact_open_induction_on AlgebraicGeometry.compact_open_induction_on
 -/
 
Diff
@@ -150,35 +150,7 @@ theorem quasiCompact_eq_affineProperty :
 
 #print AlgebraicGeometry.isCompact_basicOpen /-
 theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (U : Set X.carrier))
-    (f : X.Presheaf.obj (op U)) : IsCompact (X.basicOpen f : Set X.carrier) := by
-  classical
-  refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1
-  obtain ⟨s, hs, e⟩ := (is_compact_open_iff_eq_finset_affine_union _).mp ⟨hU, U.is_open⟩
-  let g : s → X.affine_opens := by
-    intro V
-    use V.1 ⊓ X.basic_open f
-    have : V.1.1 ⟶ U := by
-      apply hom_of_le; change _ ⊆ (U : Set X.carrier); rw [e]
-      convert @Set.subset_iUnion₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
-        1
-      rfl
-    erw [← X.to_LocallyRingedSpace.to_RingedSpace.basic_open_res this.op]
-    exact is_affine_open.basic_open_is_affine V.1.Prop _
-  haveI : Finite s := hs.to_subtype
-  refine' ⟨Set.range g, Set.finite_range g, _⟩
-  refine'
-    (set.inter_eq_right_iff_subset.mpr
-            (SetLike.coe_subset_coe.2 <| RingedSpace.basic_open_le _ _)).symm.trans
-      _
-  rw [e, Set.iUnion₂_inter]
-  apply le_antisymm <;> apply Set.iUnion₂_subset
-  · intro i hi
-    refine' Set.Subset.trans _ (Set.subset_iUnion₂ _ (Set.mem_range_self ⟨i, hi⟩))
-    exact Set.Subset.rfl
-  · rintro ⟨i, hi⟩ ⟨⟨j, hj⟩, hj'⟩
-    rw [← hj']
-    refine' Set.Subset.trans _ (Set.subset_iUnion₂ j hj)
-    exact Set.Subset.rfl
+    (f : X.Presheaf.obj (op U)) : IsCompact (X.basicOpen f : Set X.carrier) := by classical
 #align algebraic_geometry.is_compact_basic_open AlgebraicGeometry.isCompact_basicOpen
 -/
 
@@ -331,21 +303,7 @@ instance (f : X ⟶ Z) (g : Y ⟶ Z) [QuasiCompact f] :
 theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
     (hS : IsCompact S.1) (h₁ : P ⊥)
     (h₂ : ∀ (S : Opens X.carrier) (hS : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
-    P S := by
-  classical
-  obtain ⟨s, hs, hs'⟩ := (is_compact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
-  replace hs' : S = iSup fun i : s => (i : opens X.carrier) := by ext1; simpa using hs'
-  subst hs'
-  apply hs.induction_on
-  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
-  · intro x s h₃ hs h₄
-    have : IsCompact (⨆ i : s, (i : opens X.carrier)).1 := by
-      refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
-    convert h₂ _ this x h₄
-    simp only [coe_coe]
-    rw [iSup_subtype, sup_comm]
-    conv_rhs => rw [iSup_subtype]
-    exact iSup_insert
+    P S := by classical
 #align algebraic_geometry.compact_open_induction_on AlgebraicGeometry.compact_open_induction_on
 -/
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 Andrew Yang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 -/
-import Mathbin.AlgebraicGeometry.Morphisms.Basic
-import Mathbin.Topology.Spectral.Hom
-import Mathbin.AlgebraicGeometry.Limits
+import AlgebraicGeometry.Morphisms.Basic
+import Topology.Spectral.Hom
+import AlgebraicGeometry.Limits
 
 #align_import algebraic_geometry.morphisms.quasi_compact from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
 
Diff
@@ -209,8 +209,8 @@ theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).
 #align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affineProperty_isLocal
 -/
 
-#print AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE /-
-theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
+#print AlgebraicGeometry.QuasiCompact.affine_openCover_tfae /-
+theorem QuasiCompact.affine_openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
       [QuasiCompact f,
         ∃ (𝒰 : Scheme.OpenCover.{u} Y) (_ : ∀ i, IsAffine (𝒰.obj i)),
@@ -222,7 +222,7 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤) (hU' : ∀ i, IsAffineOpen (U i)),
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_TFAE f
-#align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
+#align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tfae
 -/
 
 #print AlgebraicGeometry.QuasiCompact.is_local_at_target /-
@@ -232,8 +232,8 @@ theorem QuasiCompact.is_local_at_target : PropertyIsLocalAtTarget @QuasiCompact
 #align algebraic_geometry.quasi_compact.is_local_at_target AlgebraicGeometry.QuasiCompact.is_local_at_target
 -/
 
-#print AlgebraicGeometry.QuasiCompact.openCover_tFAE /-
-theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
+#print AlgebraicGeometry.QuasiCompact.openCover_tfae /-
+theorem QuasiCompact.openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
       [QuasiCompact f,
         ∃ 𝒰 : Scheme.OpenCover.{u} Y,
@@ -246,7 +246,7 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_TFAE f
-#align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
+#align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tfae
 -/
 
 #print AlgebraicGeometry.quasiCompact_over_affine_iff /-
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Andrew Yang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
-
-! This file was ported from Lean 3 source module algebraic_geometry.morphisms.quasi_compact
-! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.AlgebraicGeometry.Morphisms.Basic
 import Mathbin.Topology.Spectral.Hom
 import Mathbin.AlgebraicGeometry.Limits
 
+#align_import algebraic_geometry.morphisms.quasi_compact from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
+
 /-!
 # Quasi-compact morphisms
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 
 ! This file was ported from Lean 3 source module algebraic_geometry.morphisms.quasi_compact
-! leanprover-community/mathlib commit 5dc6092d09e5e489106865241986f7f2ad28d4c8
+! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.AlgebraicGeometry.Limits
 /-!
 # Quasi-compact morphisms
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 A morphism of schemes is quasi-compact if the preimages of quasi-compact open sets are
 quasi-compact.
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 
 ! This file was ported from Lean 3 source module algebraic_geometry.morphisms.quasi_compact
-! 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.
 -/
@@ -364,7 +364,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
 #print AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact /-
 /-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
 `f ^ n * x = 0` for some `n`. -/
-theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
+theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme)
     {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.Presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 :=
   by
@@ -389,7 +389,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   suffices ∀ i : s, X.presheaf.map (hom_of_le (h₁ i)).op (f ^ finset.univ.sup n * x) = 0
     by
     subst e
-    apply TopCat.Sheaf.eq_of_locally_eq.{u + 1, u} X.sheaf fun i : s => (i : opens X.carrier)
+    apply X.sheaf.eq_of_locally_eq fun i : s => (i : opens X.carrier)
     intro i
     rw [map_zero]
     apply this
Diff
@@ -36,6 +36,7 @@ namespace AlgebraicGeometry
 
 variable {X Y : Scheme.{u}} (f : X ⟶ Y)
 
+#print AlgebraicGeometry.QuasiCompact /-
 /--
 A morphism is `quasi-compact` if the underlying map of topological spaces is, i.e. if the preimages
 of quasi-compact open sets are quasi-compact.
@@ -44,17 +45,23 @@ of quasi-compact open sets are quasi-compact.
 class QuasiCompact (f : X ⟶ Y) : Prop where
   isCompact_preimage : ∀ U : Set Y.carrier, IsOpen U → IsCompact U → IsCompact (f.1.base ⁻¹' U)
 #align algebraic_geometry.quasi_compact AlgebraicGeometry.QuasiCompact
+-/
 
+#print AlgebraicGeometry.quasiCompact_iff_spectral /-
 theorem quasiCompact_iff_spectral : QuasiCompact f ↔ IsSpectralMap f.1.base :=
   ⟨fun ⟨h⟩ => ⟨by continuity, h⟩, fun h => ⟨h.2⟩⟩
 #align algebraic_geometry.quasi_compact_iff_spectral AlgebraicGeometry.quasiCompact_iff_spectral
+-/
 
+#print AlgebraicGeometry.QuasiCompact.affineProperty /-
 /-- The `affine_target_morphism_property` corresponding to `quasi_compact`, asserting that the
 domain is a quasi-compact scheme. -/
 def QuasiCompact.affineProperty : AffineTargetMorphismProperty := fun X Y f hf =>
   CompactSpace X.carrier
 #align algebraic_geometry.quasi_compact.affine_property AlgebraicGeometry.QuasiCompact.affineProperty
+-/
 
+#print AlgebraicGeometry.quasiCompactOfIsIso /-
 instance (priority := 900) quasiCompactOfIsIso {X Y : Scheme} (f : X ⟶ Y) [IsIso f] :
     QuasiCompact f := by
   constructor
@@ -64,7 +71,9 @@ instance (priority := 900) quasiCompactOfIsIso {X Y : Scheme} (f : X ⟶ Y) [IsI
   delta Function.LeftInverse
   exacts [is_iso.inv_hom_id_apply f.1.base, is_iso.hom_inv_id_apply f.1.base]
 #align algebraic_geometry.quasi_compact_of_is_iso AlgebraicGeometry.quasiCompactOfIsIso
+-/
 
+#print AlgebraicGeometry.quasiCompactComp /-
 instance quasiCompactComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCompact f]
     [QuasiCompact g] : QuasiCompact (f ≫ g) :=
   by
@@ -75,7 +84,9 @@ instance quasiCompactComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCom
   · exact Continuous.isOpen_preimage (by continuity) _ hU
   apply quasi_compact.is_compact_preimage <;> assumption
 #align algebraic_geometry.quasi_compact_comp AlgebraicGeometry.quasiCompactComp
+-/
 
+#print AlgebraicGeometry.isCompact_open_iff_eq_finset_affine_union /-
 theorem isCompact_open_iff_eq_finset_affine_union {X : Scheme} (U : Set X.carrier) :
     IsCompact U ∧ IsOpen U ↔
       ∃ s : Set X.affineOpens, s.Finite ∧ U = ⋃ (i : X.affineOpens) (h : i ∈ s), i :=
@@ -84,7 +95,9 @@ theorem isCompact_open_iff_eq_finset_affine_union {X : Scheme} (U : Set X.carrie
   · rw [Subtype.range_coe]; exact is_basis_affine_open X
   · exact fun i => i.2.IsCompact
 #align algebraic_geometry.is_compact_open_iff_eq_finset_affine_union AlgebraicGeometry.isCompact_open_iff_eq_finset_affine_union
+-/
 
+#print AlgebraicGeometry.isCompact_open_iff_eq_basicOpen_union /-
 theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set X.carrier) :
     IsCompact U ∧ IsOpen U ↔
       ∃ s : Set (X.Presheaf.obj (op ⊤)),
@@ -92,7 +105,9 @@ theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set
   (isBasis_basicOpen X).isCompact_open_iff_eq_finite_iUnion _
     (fun i => ((topIsAffineOpen _).basicOpenIsAffine _).IsCompact) _
 #align algebraic_geometry.is_compact_open_iff_eq_basic_open_union AlgebraicGeometry.isCompact_open_iff_eq_basicOpen_union
+-/
 
+#print AlgebraicGeometry.quasiCompact_iff_forall_affine /-
 theorem quasiCompact_iff_forall_affine :
     QuasiCompact f ↔
       ∀ U : Opens Y.carrier, IsAffineOpen U → IsCompact (f.1.base ⁻¹' (U : Set Y.carrier)) :=
@@ -104,13 +119,17 @@ theorem quasiCompact_iff_forall_affine :
   simp only [Set.preimage_iUnion, Subtype.val_eq_coe]
   exact hS.is_compact_bUnion fun i _ => H i i.Prop
 #align algebraic_geometry.quasi_compact_iff_forall_affine AlgebraicGeometry.quasiCompact_iff_forall_affine
+-/
 
+#print AlgebraicGeometry.QuasiCompact.affineProperty_toProperty /-
 @[simp]
 theorem QuasiCompact.affineProperty_toProperty {X Y : Scheme} (f : X ⟶ Y) :
     (QuasiCompact.affineProperty : _).toProperty f ↔ IsAffine Y ∧ CompactSpace X.carrier := by
   delta affine_target_morphism_property.to_property quasi_compact.affine_property; simp
 #align algebraic_geometry.quasi_compact.affine_property_to_property AlgebraicGeometry.QuasiCompact.affineProperty_toProperty
+-/
 
+#print AlgebraicGeometry.quasiCompact_iff_affineProperty /-
 theorem quasiCompact_iff_affineProperty :
     QuasiCompact f ↔ targetAffineLocally QuasiCompact.affineProperty f :=
   by
@@ -120,12 +139,16 @@ theorem quasiCompact_iff_affineProperty :
   apply forall_congr'
   exact fun _ => isCompact_iff_compactSpace
 #align algebraic_geometry.quasi_compact_iff_affine_property AlgebraicGeometry.quasiCompact_iff_affineProperty
+-/
 
+#print AlgebraicGeometry.quasiCompact_eq_affineProperty /-
 theorem quasiCompact_eq_affineProperty :
     @QuasiCompact = targetAffineLocally QuasiCompact.affineProperty := by ext;
   exact quasi_compact_iff_affine_property _
 #align algebraic_geometry.quasi_compact_eq_affine_property AlgebraicGeometry.quasiCompact_eq_affineProperty
+-/
 
+#print AlgebraicGeometry.isCompact_basicOpen /-
 theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (U : Set X.carrier))
     (f : X.Presheaf.obj (op U)) : IsCompact (X.basicOpen f : Set X.carrier) := by
   classical
@@ -157,7 +180,9 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
     refine' Set.Subset.trans _ (Set.subset_iUnion₂ j hj)
     exact Set.Subset.rfl
 #align algebraic_geometry.is_compact_basic_open AlgebraicGeometry.isCompact_basicOpen
+-/
 
+#print AlgebraicGeometry.QuasiCompact.affineProperty_isLocal /-
 theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).IsLocal :=
   by
   constructor
@@ -182,7 +207,9 @@ theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).
     exacts [isCompact_iUnion fun i => is_compact_iff_compact_space.mpr (hS' i),
       top_is_affine_open _]
 #align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affineProperty_isLocal
+-/
 
+#print AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE /-
 theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
       [QuasiCompact f,
@@ -196,12 +223,16 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_TFAE f
 #align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
+-/
 
+#print AlgebraicGeometry.QuasiCompact.is_local_at_target /-
 theorem QuasiCompact.is_local_at_target : PropertyIsLocalAtTarget @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal
 #align algebraic_geometry.quasi_compact.is_local_at_target AlgebraicGeometry.QuasiCompact.is_local_at_target
+-/
 
+#print AlgebraicGeometry.QuasiCompact.openCover_tFAE /-
 theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
       [QuasiCompact f,
@@ -216,40 +247,54 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_TFAE f
 #align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
+-/
 
+#print AlgebraicGeometry.quasiCompact_over_affine_iff /-
 theorem quasiCompact_over_affine_iff {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] :
     QuasiCompact f ↔ CompactSpace X.carrier :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_target_iff f
 #align algebraic_geometry.quasi_compact_over_affine_iff AlgebraicGeometry.quasiCompact_over_affine_iff
+-/
 
+#print AlgebraicGeometry.compactSpace_iff_quasiCompact /-
 theorem compactSpace_iff_quasiCompact (X : Scheme) :
     CompactSpace X.carrier ↔ QuasiCompact (terminal.from X) :=
   (quasiCompact_over_affine_iff _).symm
 #align algebraic_geometry.compact_space_iff_quasi_compact AlgebraicGeometry.compactSpace_iff_quasiCompact
+-/
 
+#print AlgebraicGeometry.QuasiCompact.affine_openCover_iff /-
 theorem QuasiCompact.affine_openCover_iff {X Y : Scheme.{u}} (𝒰 : Scheme.OpenCover.{u} Y)
     [∀ i, IsAffine (𝒰.obj i)] (f : X ⟶ Y) :
     QuasiCompact f ↔ ∀ i, CompactSpace (pullback f (𝒰.map i)).carrier :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_iff f 𝒰
 #align algebraic_geometry.quasi_compact.affine_open_cover_iff AlgebraicGeometry.QuasiCompact.affine_openCover_iff
+-/
 
+#print AlgebraicGeometry.QuasiCompact.openCover_iff /-
 theorem QuasiCompact.openCover_iff {X Y : Scheme.{u}} (𝒰 : Scheme.OpenCover.{u} Y) (f : X ⟶ Y) :
     QuasiCompact f ↔ ∀ i, QuasiCompact (pullback.snd : pullback f (𝒰.map i) ⟶ _) :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_iff f 𝒰
 #align algebraic_geometry.quasi_compact.open_cover_iff AlgebraicGeometry.QuasiCompact.openCover_iff
+-/
 
+#print AlgebraicGeometry.quasiCompact_respectsIso /-
 theorem quasiCompact_respectsIso : MorphismProperty.RespectsIso @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
     targetAffineLocally_respectsIso QuasiCompact.affineProperty_isLocal.1
 #align algebraic_geometry.quasi_compact_respects_iso AlgebraicGeometry.quasiCompact_respectsIso
+-/
 
+#print AlgebraicGeometry.quasiCompact_stableUnderComposition /-
 theorem quasiCompact_stableUnderComposition :
     MorphismProperty.StableUnderComposition @QuasiCompact := fun _ _ _ _ _ _ _ => inferInstance
 #align algebraic_geometry.quasi_compact_stable_under_composition AlgebraicGeometry.quasiCompact_stableUnderComposition
+-/
 
 attribute [-simp] PresheafedSpace.as_coe SheafedSpace.as_coe
 
+#print AlgebraicGeometry.QuasiCompact.affineProperty_stableUnderBaseChange /-
 theorem QuasiCompact.affineProperty_stableUnderBaseChange :
     QuasiCompact.affineProperty.StableUnderBaseChange :=
   by
@@ -261,12 +306,15 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
   have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
   exact 𝒰.compact_space
 #align algebraic_geometry.quasi_compact.affine_property_stable_under_base_change AlgebraicGeometry.QuasiCompact.affineProperty_stableUnderBaseChange
+-/
 
+#print AlgebraicGeometry.quasiCompact_stableUnderBaseChange /-
 theorem quasiCompact_stableUnderBaseChange : MorphismProperty.StableUnderBaseChange @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.StableUnderBaseChange
       QuasiCompact.affineProperty_stableUnderBaseChange
 #align algebraic_geometry.quasi_compact_stable_under_base_change AlgebraicGeometry.quasiCompact_stableUnderBaseChange
+-/
 
 variable {Z : Scheme.{u}}
 
@@ -278,6 +326,7 @@ instance (f : X ⟶ Z) (g : Y ⟶ Z) [QuasiCompact f] :
     QuasiCompact (pullback.snd : pullback f g ⟶ Y) :=
   quasiCompact_stableUnderBaseChange.snd f g inferInstance
 
+#print AlgebraicGeometry.compact_open_induction_on /-
 @[elab_as_elim]
 theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.carrier)
     (hS : IsCompact S.1) (h₁ : P ⊥)
@@ -298,7 +347,9 @@ theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.ca
     conv_rhs => rw [iSup_subtype]
     exact iSup_insert
 #align algebraic_geometry.compact_open_induction_on AlgebraicGeometry.compact_open_induction_on
+-/
 
+#print AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen /-
 theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
     {U : Opens X.carrier} (hU : IsAffineOpen U) (x f : X.Presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 :=
@@ -308,7 +359,9 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
   obtain ⟨⟨_, n, rfl⟩, e⟩ := this.mp H
   exact ⟨n, by simpa [mul_comm x] using e⟩
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_affine_open AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen
+-/
 
+#print AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact /-
 /-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
 `f ^ n * x = 0` for some `n`. -/
 theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
@@ -349,6 +402,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn 
   apply Finset.le_sup (Finset.mem_univ i)
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact
+-/
 
 end AlgebraicGeometry
 
Diff
@@ -158,7 +158,7 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
     exact Set.Subset.rfl
 #align algebraic_geometry.is_compact_basic_open AlgebraicGeometry.isCompact_basicOpen
 
-theorem QuasiCompact.affinePropertyIsLocal : (QuasiCompact.affineProperty : _).IsLocal :=
+theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).IsLocal :=
   by
   constructor
   · apply affine_target_morphism_property.respects_iso_mk <;> rintro X Y Z _ _ _ H
@@ -181,7 +181,7 @@ theorem QuasiCompact.affinePropertyIsLocal : (QuasiCompact.affineProperty : _).I
     simp only [opens.coe_supr, Set.preimage_iUnion, Subtype.val_eq_coe]
     exacts [isCompact_iUnion fun i => is_compact_iff_compact_space.mpr (hS' i),
       top_is_affine_open _]
-#align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affinePropertyIsLocal
+#align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affineProperty_isLocal
 
 theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
@@ -194,13 +194,13 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
           CompactSpace (pullback f g).carrier,
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤) (hU' : ∀ i, IsAffineOpen (U i)),
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
-  quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affinePropertyIsLocal.affine_openCover_tFAE f
+  quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_TFAE f
 #align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
 
-theorem QuasiCompact.isLocalAtTarget : PropertyIsLocalAtTarget @QuasiCompact :=
+theorem QuasiCompact.is_local_at_target : PropertyIsLocalAtTarget @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
-    QuasiCompact.affinePropertyIsLocal.targetAffineLocallyIsLocal
-#align algebraic_geometry.quasi_compact.is_local_at_target AlgebraicGeometry.QuasiCompact.isLocalAtTarget
+    QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal
+#align algebraic_geometry.quasi_compact.is_local_at_target AlgebraicGeometry.QuasiCompact.is_local_at_target
 
 theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
@@ -214,12 +214,12 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
           QuasiCompact (pullback.snd : pullback f g ⟶ _),
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
   quasiCompact_eq_affineProperty.symm ▸
-    QuasiCompact.affinePropertyIsLocal.targetAffineLocallyIsLocal.openCover_tFAE f
+    QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_TFAE f
 #align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
 
 theorem quasiCompact_over_affine_iff {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] :
     QuasiCompact f ↔ CompactSpace X.carrier :=
-  quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affinePropertyIsLocal.affine_target_iff f
+  quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_target_iff f
 #align algebraic_geometry.quasi_compact_over_affine_iff AlgebraicGeometry.quasiCompact_over_affine_iff
 
 theorem compactSpace_iff_quasiCompact (X : Scheme) :
@@ -230,18 +230,18 @@ theorem compactSpace_iff_quasiCompact (X : Scheme) :
 theorem QuasiCompact.affine_openCover_iff {X Y : Scheme.{u}} (𝒰 : Scheme.OpenCover.{u} Y)
     [∀ i, IsAffine (𝒰.obj i)] (f : X ⟶ Y) :
     QuasiCompact f ↔ ∀ i, CompactSpace (pullback f (𝒰.map i)).carrier :=
-  quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affinePropertyIsLocal.affine_openCover_iff f 𝒰
+  quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_iff f 𝒰
 #align algebraic_geometry.quasi_compact.affine_open_cover_iff AlgebraicGeometry.QuasiCompact.affine_openCover_iff
 
 theorem QuasiCompact.openCover_iff {X Y : Scheme.{u}} (𝒰 : Scheme.OpenCover.{u} Y) (f : X ⟶ Y) :
     QuasiCompact f ↔ ∀ i, QuasiCompact (pullback.snd : pullback f (𝒰.map i) ⟶ _) :=
   quasiCompact_eq_affineProperty.symm ▸
-    QuasiCompact.affinePropertyIsLocal.targetAffineLocallyIsLocal.openCover_iff f 𝒰
+    QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_iff f 𝒰
 #align algebraic_geometry.quasi_compact.open_cover_iff AlgebraicGeometry.QuasiCompact.openCover_iff
 
 theorem quasiCompact_respectsIso : MorphismProperty.RespectsIso @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
-    targetAffineLocally_respectsIso QuasiCompact.affinePropertyIsLocal.1
+    targetAffineLocally_respectsIso QuasiCompact.affineProperty_isLocal.1
 #align algebraic_geometry.quasi_compact_respects_iso AlgebraicGeometry.quasiCompact_respectsIso
 
 theorem quasiCompact_stableUnderComposition :
@@ -264,7 +264,7 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
 
 theorem quasiCompact_stableUnderBaseChange : MorphismProperty.StableUnderBaseChange @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
-    QuasiCompact.affinePropertyIsLocal.StableUnderBaseChange
+    QuasiCompact.affineProperty_isLocal.StableUnderBaseChange
       QuasiCompact.affineProperty_stableUnderBaseChange
 #align algebraic_geometry.quasi_compact_stable_under_base_change AlgebraicGeometry.quasiCompact_stableUnderBaseChange
 
Diff
@@ -190,7 +190,7 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
           ∀ i : 𝒰.J, CompactSpace (pullback f (𝒰.map i)).carrier,
         ∀ (𝒰 : Scheme.OpenCover.{u} Y) [∀ i, IsAffine (𝒰.obj i)] (i : 𝒰.J),
           CompactSpace (pullback f (𝒰.map i)).carrier,
-        ∀ {U : Scheme} (g : U ⟶ Y) [IsAffine U] [IsOpenImmersion g],
+        ∀ {U : Scheme} (g : U ⟶ Y) [IsAffine U] [IsOpenImmersionCat g],
           CompactSpace (pullback f g).carrier,
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤) (hU' : ∀ i, IsAffineOpen (U i)),
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
@@ -210,7 +210,7 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∀ (𝒰 : Scheme.OpenCover.{u} Y) (i : 𝒰.J),
           QuasiCompact (pullback.snd : (𝒰.pullbackCover f).obj i ⟶ 𝒰.obj i),
         ∀ U : Opens Y.carrier, QuasiCompact (f ∣_ U),
-        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g],
+        ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersionCat g],
           QuasiCompact (pullback.snd : pullback f g ⟶ _),
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
   quasiCompact_eq_affineProperty.symm ▸
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 
 ! This file was ported from Lean 3 source module algebraic_geometry.morphisms.quasi_compact
-! leanprover-community/mathlib commit d39590fc8728fbf6743249802486f8c91ffe07bc
+! leanprover-community/mathlib commit 13361559d66b84f80b6d5a1c4a26aa5054766725
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -311,7 +311,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
 
 /-- If `x : Γ(X, U)` is zero on `D(f)` for some `f : Γ(X, U)`, and `U` is quasi-compact, then
 `f ^ n * x = 0` for some `n`. -/
-theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme)
+theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme.{u})
     {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.Presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 :=
   by
@@ -336,7 +336,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   suffices ∀ i : s, X.presheaf.map (hom_of_le (h₁ i)).op (f ^ finset.univ.sup n * x) = 0
     by
     subst e
-    apply X.sheaf.eq_of_locally_eq fun i : s => (i : opens X.carrier)
+    apply TopCat.Sheaf.eq_of_locally_eq.{u + 1, u} X.sheaf fun i : s => (i : opens X.carrier)
     intro i
     rw [map_zero]
     apply this
Diff
@@ -129,33 +129,33 @@ theorem quasiCompact_eq_affineProperty :
 theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (U : Set X.carrier))
     (f : X.Presheaf.obj (op U)) : IsCompact (X.basicOpen f : Set X.carrier) := by
   classical
-    refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1
-    obtain ⟨s, hs, e⟩ := (is_compact_open_iff_eq_finset_affine_union _).mp ⟨hU, U.is_open⟩
-    let g : s → X.affine_opens := by
-      intro V
-      use V.1 ⊓ X.basic_open f
-      have : V.1.1 ⟶ U := by
-        apply hom_of_le; change _ ⊆ (U : Set X.carrier); rw [e]
-        convert@Set.subset_iUnion₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
-          1
-        rfl
-      erw [← X.to_LocallyRingedSpace.to_RingedSpace.basic_open_res this.op]
-      exact is_affine_open.basic_open_is_affine V.1.Prop _
-    haveI : Finite s := hs.to_subtype
-    refine' ⟨Set.range g, Set.finite_range g, _⟩
-    refine'
-      (set.inter_eq_right_iff_subset.mpr
-              (SetLike.coe_subset_coe.2 <| RingedSpace.basic_open_le _ _)).symm.trans
-        _
-    rw [e, Set.iUnion₂_inter]
-    apply le_antisymm <;> apply Set.iUnion₂_subset
-    · intro i hi
-      refine' Set.Subset.trans _ (Set.subset_iUnion₂ _ (Set.mem_range_self ⟨i, hi⟩))
-      exact Set.Subset.rfl
-    · rintro ⟨i, hi⟩ ⟨⟨j, hj⟩, hj'⟩
-      rw [← hj']
-      refine' Set.Subset.trans _ (Set.subset_iUnion₂ j hj)
-      exact Set.Subset.rfl
+  refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1
+  obtain ⟨s, hs, e⟩ := (is_compact_open_iff_eq_finset_affine_union _).mp ⟨hU, U.is_open⟩
+  let g : s → X.affine_opens := by
+    intro V
+    use V.1 ⊓ X.basic_open f
+    have : V.1.1 ⟶ U := by
+      apply hom_of_le; change _ ⊆ (U : Set X.carrier); rw [e]
+      convert @Set.subset_iUnion₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
+        1
+      rfl
+    erw [← X.to_LocallyRingedSpace.to_RingedSpace.basic_open_res this.op]
+    exact is_affine_open.basic_open_is_affine V.1.Prop _
+  haveI : Finite s := hs.to_subtype
+  refine' ⟨Set.range g, Set.finite_range g, _⟩
+  refine'
+    (set.inter_eq_right_iff_subset.mpr
+            (SetLike.coe_subset_coe.2 <| RingedSpace.basic_open_le _ _)).symm.trans
+      _
+  rw [e, Set.iUnion₂_inter]
+  apply le_antisymm <;> apply Set.iUnion₂_subset
+  · intro i hi
+    refine' Set.Subset.trans _ (Set.subset_iUnion₂ _ (Set.mem_range_self ⟨i, hi⟩))
+    exact Set.Subset.rfl
+  · rintro ⟨i, hi⟩ ⟨⟨j, hj⟩, hj'⟩
+    rw [← hj']
+    refine' Set.Subset.trans _ (Set.subset_iUnion₂ j hj)
+    exact Set.Subset.rfl
 #align algebraic_geometry.is_compact_basic_open AlgebraicGeometry.isCompact_basicOpen
 
 theorem QuasiCompact.affinePropertyIsLocal : (QuasiCompact.affineProperty : _).IsLocal :=
@@ -284,19 +284,19 @@ theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.ca
     (h₂ : ∀ (S : Opens X.carrier) (hS : IsCompact S.1) (U : X.affineOpens), P S → P (S ⊔ U)) :
     P S := by
   classical
-    obtain ⟨s, hs, hs'⟩ := (is_compact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
-    replace hs' : S = iSup fun i : s => (i : opens X.carrier) := by ext1; simpa using hs'
-    subst hs'
-    apply hs.induction_on
-    · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
-    · intro x s h₃ hs h₄
-      have : IsCompact (⨆ i : s, (i : opens X.carrier)).1 := by
-        refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
-      convert h₂ _ this x h₄
-      simp only [coe_coe]
-      rw [iSup_subtype, sup_comm]
-      conv_rhs => rw [iSup_subtype]
-      exact iSup_insert
+  obtain ⟨s, hs, hs'⟩ := (is_compact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
+  replace hs' : S = iSup fun i : s => (i : opens X.carrier) := by ext1; simpa using hs'
+  subst hs'
+  apply hs.induction_on
+  · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
+  · intro x s h₃ hs h₄
+    have : IsCompact (⨆ i : s, (i : opens X.carrier)).1 := by
+      refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
+    convert h₂ _ this x h₄
+    simp only [coe_coe]
+    rw [iSup_subtype, sup_comm]
+    conv_rhs => rw [iSup_subtype]
+    exact iSup_insert
 #align algebraic_geometry.compact_open_induction_on AlgebraicGeometry.compact_open_induction_on
 
 theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
Diff
@@ -62,7 +62,7 @@ instance (priority := 900) quasiCompactOfIsIso {X Y : Scheme} (f : X ⟶ Y) [IsI
   convert hU'.image (inv f.1.base).continuous_toFun using 1
   rw [Set.image_eq_preimage_of_inverse]
   delta Function.LeftInverse
-  exacts[is_iso.inv_hom_id_apply f.1.base, is_iso.hom_inv_id_apply f.1.base]
+  exacts [is_iso.inv_hom_id_apply f.1.base, is_iso.hom_inv_id_apply f.1.base]
 #align algebraic_geometry.quasi_compact_of_is_iso AlgebraicGeometry.quasiCompactOfIsIso
 
 instance quasiCompactComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCompact f]
@@ -162,36 +162,37 @@ theorem QuasiCompact.affinePropertyIsLocal : (QuasiCompact.affineProperty : _).I
   by
   constructor
   · apply affine_target_morphism_property.respects_iso_mk <;> rintro X Y Z _ _ _ H
-    exacts[@Homeomorph.compactSpace _ _ H (TopCat.homeoOfIso (as_iso e.inv.1.base)), H]
+    exacts [@Homeomorph.compactSpace _ _ H (TopCat.homeoOfIso (as_iso e.inv.1.base)), H]
   · introv H
-    delta quasi_compact.affine_property at H⊢
+    delta quasi_compact.affine_property at H ⊢
     change CompactSpace ((opens.map f.val.base).obj (Y.basic_open r))
     rw [Scheme.preimage_basic_open f r]
     erw [← isCompact_iff_compactSpace]
-    rw [← isCompact_univ_iff] at H
+    rw [← isCompact_univ_iff] at H 
     exact is_compact_basic_open X H _
   · rintro X Y H f S hS hS'
     skip
-    rw [← is_affine_open.basic_open_union_eq_self_iff] at hS
+    rw [← is_affine_open.basic_open_union_eq_self_iff] at hS 
     delta quasi_compact.affine_property
     rw [← isCompact_univ_iff]
     change IsCompact ((opens.map f.val.base).obj ⊤).1
     rw [← hS]
     dsimp [opens.map]
     simp only [opens.coe_supr, Set.preimage_iUnion, Subtype.val_eq_coe]
-    exacts[isCompact_iUnion fun i => is_compact_iff_compact_space.mpr (hS' i), top_is_affine_open _]
+    exacts [isCompact_iUnion fun i => is_compact_iff_compact_space.mpr (hS' i),
+      top_is_affine_open _]
 #align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affinePropertyIsLocal
 
 theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
     TFAE
       [QuasiCompact f,
-        ∃ (𝒰 : Scheme.OpenCover.{u} Y)(_ : ∀ i, IsAffine (𝒰.obj i)),
+        ∃ (𝒰 : Scheme.OpenCover.{u} Y) (_ : ∀ i, IsAffine (𝒰.obj i)),
           ∀ i : 𝒰.J, CompactSpace (pullback f (𝒰.map i)).carrier,
         ∀ (𝒰 : Scheme.OpenCover.{u} Y) [∀ i, IsAffine (𝒰.obj i)] (i : 𝒰.J),
           CompactSpace (pullback f (𝒰.map i)).carrier,
         ∀ {U : Scheme} (g : U ⟶ Y) [IsAffine U] [IsOpenImmersion g],
           CompactSpace (pullback f g).carrier,
-        ∃ (ι : Type u)(U : ι → Opens Y.carrier)(hU : iSup U = ⊤)(hU' : ∀ i, IsAffineOpen (U i)),
+        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤) (hU' : ∀ i, IsAffineOpen (U i)),
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affinePropertyIsLocal.affine_openCover_tFAE f
 #align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
@@ -211,7 +212,7 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∀ U : Opens Y.carrier, QuasiCompact (f ∣_ U),
         ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g],
           QuasiCompact (pullback.snd : pullback f g ⟶ _),
-        ∃ (ι : Type u)(U : ι → Opens Y.carrier)(hU : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
+        ∃ (ι : Type u) (U : ι → Opens Y.carrier) (hU : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affinePropertyIsLocal.targetAffineLocallyIsLocal.openCover_tFAE f
 #align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
@@ -253,7 +254,7 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
     QuasiCompact.affineProperty.StableUnderBaseChange :=
   by
   intro X Y S _ _ f g h
-  rw [quasi_compact.affine_property] at h⊢
+  rw [quasi_compact.affine_property] at h ⊢
   skip
   let 𝒰 := Scheme.pullback.open_cover_of_right Y.affine_cover.finite_subcover f g
   have : Finite 𝒰.J := by dsimp [𝒰]; infer_instance
@@ -302,7 +303,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
     {U : Opens X.carrier} (hU : IsAffineOpen U) (x f : X.Presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 :=
   by
-  rw [← map_zero (X.presheaf.map (hom_of_le <| X.basic_open_le f : X.basic_open f ⟶ U).op)] at H
+  rw [← map_zero (X.presheaf.map (hom_of_le <| X.basic_open_le f : X.basic_open f ⟶ U).op)] at H 
   have := (is_localization_basic_open hU f).3
   obtain ⟨⟨_, n, rfl⟩, e⟩ := this.mp H
   exact ⟨n, by simpa [mul_comm x] using e⟩
@@ -323,7 +324,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
     exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_affine_open X i.1.2
       (X.presheaf.map (hom_of_le (h₁ i)).op x) (X.presheaf.map (hom_of_le (h₁ i)).op f) _
   swap
-  · delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict at H⊢
+  · delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict at H ⊢
     convert congr_arg (X.presheaf.map (hom_of_le _).op) H
     · simp only [← comp_apply, ← functor.map_comp]; congr
     · rw [map_zero]
@@ -343,9 +344,9 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   replace hn :=
     congr_arg (fun x => X.presheaf.map (hom_of_le (h₁ i)).op (f ^ (finset.univ.sup n - n i)) * x)
       (hn i)
-  dsimp at hn
-  simp only [← map_mul, ← map_pow] at hn
-  rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn
+  dsimp at hn 
+  simp only [← map_mul, ← map_pow] at hn 
+  rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn 
   apply Finset.le_sup (Finset.mem_univ i)
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact
 
Diff
@@ -30,7 +30,7 @@ open CategoryTheory CategoryTheory.Limits Opposite TopologicalSpace
 
 universe u
 
-open AlgebraicGeometry
+open scoped AlgebraicGeometry
 
 namespace AlgebraicGeometry
 
Diff
@@ -81,8 +81,7 @@ theorem isCompact_open_iff_eq_finset_affine_union {X : Scheme} (U : Set X.carrie
       ∃ s : Set X.affineOpens, s.Finite ∧ U = ⋃ (i : X.affineOpens) (h : i ∈ s), i :=
   by
   apply opens.is_basis.is_compact_open_iff_eq_finite_Union (coe : X.affine_opens → opens X.carrier)
-  · rw [Subtype.range_coe]
-    exact is_basis_affine_open X
+  · rw [Subtype.range_coe]; exact is_basis_affine_open X
   · exact fun i => i.2.IsCompact
 #align algebraic_geometry.is_compact_open_iff_eq_finset_affine_union AlgebraicGeometry.isCompact_open_iff_eq_finset_affine_union
 
@@ -108,10 +107,8 @@ theorem quasiCompact_iff_forall_affine :
 
 @[simp]
 theorem QuasiCompact.affineProperty_toProperty {X Y : Scheme} (f : X ⟶ Y) :
-    (QuasiCompact.affineProperty : _).toProperty f ↔ IsAffine Y ∧ CompactSpace X.carrier :=
-  by
-  delta affine_target_morphism_property.to_property quasi_compact.affine_property
-  simp
+    (QuasiCompact.affineProperty : _).toProperty f ↔ IsAffine Y ∧ CompactSpace X.carrier := by
+  delta affine_target_morphism_property.to_property quasi_compact.affine_property; simp
 #align algebraic_geometry.quasi_compact.affine_property_to_property AlgebraicGeometry.QuasiCompact.affineProperty_toProperty
 
 theorem quasiCompact_iff_affineProperty :
@@ -125,9 +122,7 @@ theorem quasiCompact_iff_affineProperty :
 #align algebraic_geometry.quasi_compact_iff_affine_property AlgebraicGeometry.quasiCompact_iff_affineProperty
 
 theorem quasiCompact_eq_affineProperty :
-    @QuasiCompact = targetAffineLocally QuasiCompact.affineProperty :=
-  by
-  ext
+    @QuasiCompact = targetAffineLocally QuasiCompact.affineProperty := by ext;
   exact quasi_compact_iff_affine_property _
 #align algebraic_geometry.quasi_compact_eq_affine_property AlgebraicGeometry.quasiCompact_eq_affineProperty
 
@@ -140,9 +135,7 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
       intro V
       use V.1 ⊓ X.basic_open f
       have : V.1.1 ⟶ U := by
-        apply hom_of_le
-        change _ ⊆ (U : Set X.carrier)
-        rw [e]
+        apply hom_of_le; change _ ⊆ (U : Set X.carrier); rw [e]
         convert@Set.subset_iUnion₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
           1
         rfl
@@ -263,14 +256,8 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
   rw [quasi_compact.affine_property] at h⊢
   skip
   let 𝒰 := Scheme.pullback.open_cover_of_right Y.affine_cover.finite_subcover f g
-  have : Finite 𝒰.J := by
-    dsimp [𝒰]
-    infer_instance
-  have : ∀ i, CompactSpace (𝒰.obj i).carrier :=
-    by
-    intro i
-    dsimp
-    infer_instance
+  have : Finite 𝒰.J := by dsimp [𝒰]; infer_instance
+  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
   exact 𝒰.compact_space
 #align algebraic_geometry.quasi_compact.affine_property_stable_under_base_change AlgebraicGeometry.QuasiCompact.affineProperty_stableUnderBaseChange
 
@@ -297,21 +284,13 @@ theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.ca
     P S := by
   classical
     obtain ⟨s, hs, hs'⟩ := (is_compact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
-    replace hs' : S = iSup fun i : s => (i : opens X.carrier) :=
-      by
-      ext1
-      simpa using hs'
+    replace hs' : S = iSup fun i : s => (i : opens X.carrier) := by ext1; simpa using hs'
     subst hs'
     apply hs.induction_on
-    · convert h₁
-      rw [iSup_eq_bot]
-      rintro ⟨_, h⟩
-      exact h.elim
+    · convert h₁; rw [iSup_eq_bot]; rintro ⟨_, h⟩; exact h.elim
     · intro x s h₃ hs h₄
-      have : IsCompact (⨆ i : s, (i : opens X.carrier)).1 :=
-        by
-        refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1
-        exact ⟨s, hs, by simp⟩
+      have : IsCompact (⨆ i : s, (i : opens X.carrier)).1 := by
+        refine' ((is_compact_open_iff_eq_finset_affine_union _).mpr _).1; exact ⟨s, hs, by simp⟩
       convert h₂ _ this x h₄
       simp only [coe_coe]
       rw [iSup_subtype, sup_comm]
@@ -337,12 +316,8 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   by
   obtain ⟨s, hs, e⟩ := (is_compact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
   replace e : U = iSup fun i : s => (i : opens X.carrier)
-  · ext1
-    simpa using e
-  have h₁ : ∀ i : s, i.1.1 ≤ U := by
-    intro i
-    change (i : opens X.carrier) ≤ U
-    rw [e]
+  · ext1; simpa using e
+  have h₁ : ∀ i : s, i.1.1 ≤ U := by intro i; change (i : opens X.carrier) ≤ U; rw [e];
     exact le_iSup _ _
   have H' := fun i : s =>
     exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_affine_open X i.1.2
@@ -350,11 +325,9 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   swap
   · delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict at H⊢
     convert congr_arg (X.presheaf.map (hom_of_le _).op) H
-    · simp only [← comp_apply, ← functor.map_comp]
-      congr
+    · simp only [← comp_apply, ← functor.map_comp]; congr
     · rw [map_zero]
-    · rw [X.basic_open_res]
-      exact Set.inter_subset_right _ _
+    · rw [X.basic_open_res]; exact Set.inter_subset_right _ _
   choose n hn using H'
   haveI := hs.to_subtype
   cases nonempty_fintype s
Diff
@@ -91,7 +91,7 @@ theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set
       ∃ s : Set (X.Presheaf.obj (op ⊤)),
         s.Finite ∧ U = ⋃ (i : X.Presheaf.obj (op ⊤)) (h : i ∈ s), X.basicOpen i :=
   (isBasis_basicOpen X).isCompact_open_iff_eq_finite_iUnion _
-    (fun i => ((top_isAffineOpen _).basicOpen_is_affine _).IsCompact) _
+    (fun i => ((topIsAffineOpen _).basicOpenIsAffine _).IsCompact) _
 #align algebraic_geometry.is_compact_open_iff_eq_basic_open_union AlgebraicGeometry.isCompact_open_iff_eq_basicOpen_union
 
 theorem quasiCompact_iff_forall_affine :
Diff
@@ -90,7 +90,7 @@ theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set
     IsCompact U ∧ IsOpen U ↔
       ∃ s : Set (X.Presheaf.obj (op ⊤)),
         s.Finite ∧ U = ⋃ (i : X.Presheaf.obj (op ⊤)) (h : i ∈ s), X.basicOpen i :=
-  (isBasis_basicOpen X).isCompact_open_iff_eq_finite_unionᵢ _
+  (isBasis_basicOpen X).isCompact_open_iff_eq_finite_iUnion _
     (fun i => ((top_isAffineOpen _).basicOpen_is_affine _).IsCompact) _
 #align algebraic_geometry.is_compact_open_iff_eq_basic_open_union AlgebraicGeometry.isCompact_open_iff_eq_basicOpen_union
 
@@ -102,7 +102,7 @@ theorem quasiCompact_iff_forall_affine :
   refine' ⟨fun H U hU => H U U.IsOpen hU.IsCompact, _⟩
   intro H U hU hU'
   obtain ⟨S, hS, rfl⟩ := (is_compact_open_iff_eq_finset_affine_union U).mp ⟨hU', hU⟩
-  simp only [Set.preimage_unionᵢ, Subtype.val_eq_coe]
+  simp only [Set.preimage_iUnion, Subtype.val_eq_coe]
   exact hS.is_compact_bUnion fun i _ => H i i.Prop
 #align algebraic_geometry.quasi_compact_iff_forall_affine AlgebraicGeometry.quasiCompact_iff_forall_affine
 
@@ -143,7 +143,7 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
         apply hom_of_le
         change _ ⊆ (U : Set X.carrier)
         rw [e]
-        convert@Set.subset_unionᵢ₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
+        convert@Set.subset_iUnion₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
           1
         rfl
       erw [← X.to_LocallyRingedSpace.to_RingedSpace.basic_open_res this.op]
@@ -154,14 +154,14 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
       (set.inter_eq_right_iff_subset.mpr
               (SetLike.coe_subset_coe.2 <| RingedSpace.basic_open_le _ _)).symm.trans
         _
-    rw [e, Set.unionᵢ₂_inter]
-    apply le_antisymm <;> apply Set.unionᵢ₂_subset
+    rw [e, Set.iUnion₂_inter]
+    apply le_antisymm <;> apply Set.iUnion₂_subset
     · intro i hi
-      refine' Set.Subset.trans _ (Set.subset_unionᵢ₂ _ (Set.mem_range_self ⟨i, hi⟩))
+      refine' Set.Subset.trans _ (Set.subset_iUnion₂ _ (Set.mem_range_self ⟨i, hi⟩))
       exact Set.Subset.rfl
     · rintro ⟨i, hi⟩ ⟨⟨j, hj⟩, hj'⟩
       rw [← hj']
-      refine' Set.Subset.trans _ (Set.subset_unionᵢ₂ j hj)
+      refine' Set.Subset.trans _ (Set.subset_iUnion₂ j hj)
       exact Set.Subset.rfl
 #align algebraic_geometry.is_compact_basic_open AlgebraicGeometry.isCompact_basicOpen
 
@@ -185,8 +185,8 @@ theorem QuasiCompact.affinePropertyIsLocal : (QuasiCompact.affineProperty : _).I
     change IsCompact ((opens.map f.val.base).obj ⊤).1
     rw [← hS]
     dsimp [opens.map]
-    simp only [opens.coe_supr, Set.preimage_unionᵢ, Subtype.val_eq_coe]
-    exacts[isCompact_unionᵢ fun i => is_compact_iff_compact_space.mpr (hS' i), top_is_affine_open _]
+    simp only [opens.coe_supr, Set.preimage_iUnion, Subtype.val_eq_coe]
+    exacts[isCompact_iUnion fun i => is_compact_iff_compact_space.mpr (hS' i), top_is_affine_open _]
 #align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affinePropertyIsLocal
 
 theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
@@ -198,7 +198,7 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
           CompactSpace (pullback f (𝒰.map i)).carrier,
         ∀ {U : Scheme} (g : U ⟶ Y) [IsAffine U] [IsOpenImmersion g],
           CompactSpace (pullback f g).carrier,
-        ∃ (ι : Type u)(U : ι → Opens Y.carrier)(hU : supᵢ U = ⊤)(hU' : ∀ i, IsAffineOpen (U i)),
+        ∃ (ι : Type u)(U : ι → Opens Y.carrier)(hU : iSup U = ⊤)(hU' : ∀ i, IsAffineOpen (U i)),
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affinePropertyIsLocal.affine_openCover_tFAE f
 #align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
@@ -218,7 +218,7 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∀ U : Opens Y.carrier, QuasiCompact (f ∣_ U),
         ∀ {U : Scheme} (g : U ⟶ Y) [IsOpenImmersion g],
           QuasiCompact (pullback.snd : pullback f g ⟶ _),
-        ∃ (ι : Type u)(U : ι → Opens Y.carrier)(hU : supᵢ U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
+        ∃ (ι : Type u)(U : ι → Opens Y.carrier)(hU : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affinePropertyIsLocal.targetAffineLocallyIsLocal.openCover_tFAE f
 #align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
@@ -297,14 +297,14 @@ theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.ca
     P S := by
   classical
     obtain ⟨s, hs, hs'⟩ := (is_compact_open_iff_eq_finset_affine_union S.1).mp ⟨hS, S.2⟩
-    replace hs' : S = supᵢ fun i : s => (i : opens X.carrier) :=
+    replace hs' : S = iSup fun i : s => (i : opens X.carrier) :=
       by
       ext1
       simpa using hs'
     subst hs'
     apply hs.induction_on
     · convert h₁
-      rw [supᵢ_eq_bot]
+      rw [iSup_eq_bot]
       rintro ⟨_, h⟩
       exact h.elim
     · intro x s h₃ hs h₄
@@ -314,9 +314,9 @@ theorem compact_open_induction_on {P : Opens X.carrier → Prop} (S : Opens X.ca
         exact ⟨s, hs, by simp⟩
       convert h₂ _ this x h₄
       simp only [coe_coe]
-      rw [supᵢ_subtype, sup_comm]
-      conv_rhs => rw [supᵢ_subtype]
-      exact supᵢ_insert
+      rw [iSup_subtype, sup_comm]
+      conv_rhs => rw [iSup_subtype]
+      exact iSup_insert
 #align algebraic_geometry.compact_open_induction_on AlgebraicGeometry.compact_open_induction_on
 
 theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Scheme)
@@ -336,14 +336,14 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 :=
   by
   obtain ⟨s, hs, e⟩ := (is_compact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
-  replace e : U = supᵢ fun i : s => (i : opens X.carrier)
+  replace e : U = iSup fun i : s => (i : opens X.carrier)
   · ext1
     simpa using e
   have h₁ : ∀ i : s, i.1.1 ≤ U := by
     intro i
     change (i : opens X.carrier) ≤ U
     rw [e]
-    exact le_supᵢ _ _
+    exact le_iSup _ _
   have H' := fun i : s =>
     exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_affine_open X i.1.2
       (X.presheaf.map (hom_of_le (h₁ i)).op x) (X.presheaf.map (hom_of_le (h₁ i)).op f) _
Diff
@@ -143,8 +143,8 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
         apply hom_of_le
         change _ ⊆ (U : Set X.carrier)
         rw [e]
-        convert
-          @Set.subset_unionᵢ₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using 1
+        convert@Set.subset_unionᵢ₂ _ _ _ (fun (U : X.affine_opens) (h : U ∈ s) => ↑U) V V.prop using
+          1
         rfl
       erw [← X.to_LocallyRingedSpace.to_RingedSpace.basic_open_res this.op]
       exact is_affine_open.basic_open_is_affine V.1.Prop _
Diff
@@ -372,7 +372,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
       (hn i)
   dsimp at hn
   simp only [← map_mul, ← map_pow] at hn
-  rwa [mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn
+  rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn
   apply Finset.le_sup (Finset.mem_univ i)
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact
 

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -59,8 +59,9 @@ instance (priority := 900) quasiCompactOfIsIso {X Y : Scheme} (f : X ⟶ Y) [IsI
   intro U _ hU'
   convert hU'.image (inv f.1.base).continuous_toFun using 1
   rw [Set.image_eq_preimage_of_inverse]
-  delta Function.LeftInverse
-  exacts [IsIso.inv_hom_id_apply f.1.base, IsIso.hom_inv_id_apply f.1.base]
+  · delta Function.LeftInverse
+    exact IsIso.inv_hom_id_apply f.1.base
+  · exact IsIso.hom_inv_id_apply f.1.base
 #align algebraic_geometry.quasi_compact_of_is_iso AlgebraicGeometry.quasiCompactOfIsIso
 
 instance quasiCompactComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCompact f]
@@ -171,14 +172,14 @@ theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).
     exact H
   · rintro X Y H f S hS hS'
     rw [← IsAffineOpen.basicOpen_union_eq_self_iff] at hS
-    delta QuasiCompact.affineProperty
-    rw [← isCompact_univ_iff]
-    change IsCompact ((Opens.map f.val.base).obj ⊤).1
-    rw [← hS]
-    dsimp [Opens.map]
-    simp only [Opens.iSup_mk, Opens.carrier_eq_coe, Opens.coe_mk, Set.preimage_iUnion]
-    exacts [isCompact_iUnion fun i => isCompact_iff_compactSpace.mpr (hS' i),
-      topIsAffineOpen _]
+    · delta QuasiCompact.affineProperty
+      rw [← isCompact_univ_iff]
+      change IsCompact ((Opens.map f.val.base).obj ⊤).1
+      rw [← hS]
+      dsimp [Opens.map]
+      simp only [Opens.iSup_mk, Opens.carrier_eq_coe, Opens.coe_mk, Set.preimage_iUnion]
+      exact isCompact_iUnion fun i => isCompact_iff_compactSpace.mpr (hS' i)
+    · exact topIsAffineOpen _
 #align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affineProperty_isLocal
 
 theorem QuasiCompact.affine_openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
@@ -323,8 +324,8 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
     convert congr_arg (X.presheaf.map (homOfLE _).op) H
     -- Note: the below was `simp only [← comp_apply]`
     · rw [← comp_apply, ← comp_apply]
-      simp only [← Functor.map_comp]
-      rfl
+      · simp only [← Functor.map_comp]
+        rfl
       · simp only [Scheme.basicOpen_res, ge_iff_le, inf_le_right]
     · rw [map_zero]
   choose n hn using H'
feat(CategoryTheory): morphism properties that have the two-out-of-three property (#12460)

The type class MorphismProperty.HasTwoOutOfThreeProperty is introduced. The structure StableUnderComposition is also changed into a type class IsStableUnderComposition.

Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>

Diff
@@ -242,9 +242,10 @@ theorem quasiCompact_respectsIso : MorphismProperty.RespectsIso @QuasiCompact :=
     targetAffineLocally_respectsIso QuasiCompact.affineProperty_isLocal.1
 #align algebraic_geometry.quasi_compact_respects_iso AlgebraicGeometry.quasiCompact_respectsIso
 
-theorem quasiCompact_stableUnderComposition :
-    MorphismProperty.StableUnderComposition @QuasiCompact := fun _ _ _ _ _ _ _ => inferInstance
-#align algebraic_geometry.quasi_compact_stable_under_composition AlgebraicGeometry.quasiCompact_stableUnderComposition
+instance quasiCompact_isStableUnderComposition :
+    MorphismProperty.IsStableUnderComposition @QuasiCompact where
+  comp_mem _ _ _ _ := inferInstance
+#align algebraic_geometry.quasi_compact_stable_under_composition AlgebraicGeometry.quasiCompact_isStableUnderComposition
 
 theorem QuasiCompact.affineProperty_stableUnderBaseChange :
     QuasiCompact.affineProperty.StableUnderBaseChange := by
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -70,7 +70,7 @@ instance quasiCompactComp {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [QuasiCom
   rw [Scheme.comp_val_base, coe_comp, Set.preimage_comp]
   apply QuasiCompact.isCompact_preimage
   · exact Continuous.isOpen_preimage (by
-    -- porting note: `continuity` failed
+    -- Porting note: `continuity` failed
     -- see https://github.com/leanprover-community/mathlib4/issues/5030
       exact Scheme.Hom.continuous g) _ hU
   apply QuasiCompact.isCompact_preimage <;> assumption
@@ -146,7 +146,7 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
   rw [e, Set.iUnion₂_inter]
   apply le_antisymm <;> apply Set.iUnion₂_subset
   · intro i hi
-    -- porting note: had to make explicit the first given parameter to `Set.subset_iUnion₂`
+    -- Porting note: had to make explicit the first given parameter to `Set.subset_iUnion₂`
     exact Set.Subset.trans (Set.Subset.rfl : _ ≤ g ⟨i, hi⟩)
       (@Set.subset_iUnion₂ _ _ _
         (fun (i : Scheme.affineOpens X) (_ : i ∈ Set.range g) => (i : Set X.toPresheafedSpace)) _
@@ -312,7 +312,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
     intro i
     change (i : Opens X.carrier) ≤ U
     rw [e]
-    -- porting note: `exact le_iSup _ _` no longer works
+    -- Porting note: `exact le_iSup _ _` no longer works
     exact le_iSup (fun (i : s) => (i : Opens (X.toPresheafedSpace))) _
   have H' := fun i : s =>
     exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen X i.1.2
chore: prepare Lean version bump with explicit simp (#10999)

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

Diff
@@ -251,8 +251,8 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
   intro X Y S _ _ f g h
   rw [QuasiCompact.affineProperty] at h ⊢
   let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
-  have : Finite 𝒰.J := by dsimp; infer_instance
-  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
+  have : Finite 𝒰.J := by dsimp [𝒰]; infer_instance
+  have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp [𝒰]; infer_instance
   exact 𝒰.compactSpace
 #align algebraic_geometry.quasi_compact.affine_property_stable_under_base_change AlgebraicGeometry.QuasiCompact.affineProperty_stableUnderBaseChange
 
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -306,8 +306,8 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
     {U : Opens X.carrier} (hU : IsCompact U.1) (x f : X.presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
   obtain ⟨s, hs, e⟩ := (isCompact_open_iff_eq_finset_affine_union U.1).mp ⟨hU, U.2⟩
-  replace e : U = iSup fun i : s => (i : Opens X.carrier)
-  · ext1; simpa using e
+  replace e : U = iSup fun i : s => (i : Opens X.carrier) := by
+    ext1; simpa using e
   have h₁ : ∀ i : s, i.1.1 ≤ U := by
     intro i
     change (i : Opens X.carrier) ≤ U
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
@@ -320,10 +320,12 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   swap
   · delta TopCat.Presheaf.restrictOpen TopCat.Presheaf.restrict at H ⊢
     convert congr_arg (X.presheaf.map (homOfLE _).op) H
-    · simp only [← comp_apply, ← Functor.map_comp]
+    -- Note: the below was `simp only [← comp_apply]`
+    · rw [← comp_apply, ← comp_apply]
+      simp only [← Functor.map_comp]
       rfl
+      · simp only [Scheme.basicOpen_res, ge_iff_le, inf_le_right]
     · rw [map_zero]
-      simp only [Scheme.basicOpen_res, ge_iff_le, inf_le_right]
   choose n hn using H'
   haveI := hs.to_subtype
   cases nonempty_fintype s
refactor: decapitalize names in @[mk_iff] (#9378)
  • @[mk_iff] class MyPred now generates myPred_iff, not MyPred_iff
  • add Lean.Name.decapitalize
  • fix indentation and a few typos in the docs/comments.

Partially addresses issue #9129

Diff
@@ -96,7 +96,7 @@ theorem isCompact_open_iff_eq_basicOpen_union {X : Scheme} [IsAffine X] (U : Set
 theorem quasiCompact_iff_forall_affine :
     QuasiCompact f ↔
       ∀ U : Opens Y.carrier, IsAffineOpen U → IsCompact (f.1.base ⁻¹' (U : Set Y.carrier)) := by
-  rw [QuasiCompact_iff]
+  rw [quasiCompact_iff]
   refine' ⟨fun H U hU => H U U.isOpen hU.isCompact, _⟩
   intro H U hU hU'
   obtain ⟨S, hS, rfl⟩ := (isCompact_open_iff_eq_finset_affine_union U).mp ⟨hU', hU⟩
chore: replace IsLocalization.eq_iff_exists' by exists_of_eq (#8335)

The other direction is a consequence of IsLocalization.map_units.

Also do the same for LocalizationMap and IsLocalizedModule.

This means we have one less fact to prove when constructing an IsLocalization (etc.) instance (thus many proofs are golfed), but once we construct it we still have access to the eq_iff_exists lemmas (without the prime) so the API doesn't get less powerful.

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

Diff
@@ -296,7 +296,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
     {U : Opens X} (hU : IsAffineOpen U) (x f : X.presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
   rw [← map_zero (X.presheaf.map (homOfLE <| X.basicOpen_le f : X.basicOpen f ⟶ U).op)] at H
-  obtain ⟨⟨_, n, rfl⟩, e⟩ := (hU.isLocalization_basicOpen f).eq_iff_exists'.mp H
+  obtain ⟨⟨_, n, rfl⟩, e⟩ := (hU.isLocalization_basicOpen f).exists_of_eq H
   exact ⟨n, by simpa [mul_comm x] using e⟩
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_affine_open AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen
 
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
@@ -296,7 +296,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen (X : Sch
     {U : Opens X} (hU : IsAffineOpen U) (x f : X.presheaf.obj (op U))
     (H : x |_ X.basicOpen f = 0) : ∃ n : ℕ, f ^ n * x = 0 := by
   rw [← map_zero (X.presheaf.map (homOfLE <| X.basicOpen_le f : X.basicOpen f ⟶ U).op)] at H
-  obtain ⟨⟨_, n, rfl⟩, e⟩ := (isLocalization_basicOpen hU f).eq_iff_exists'.mp H
+  obtain ⟨⟨_, n, rfl⟩, e⟩ := (hU.isLocalization_basicOpen f).eq_iff_exists'.mp H
   exact ⟨n, by simpa [mul_comm x] using e⟩
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_affine_open AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isAffineOpen
 
chore: Make Set/Finset lemmas match lattice lemma names (#7378)

Rename union_eq_left_iff_subset to union_eq_left to match sup_eq_left. Similarly for the right and inter versions.

Diff
@@ -141,7 +141,7 @@ theorem isCompact_basicOpen (X : Scheme) {U : Opens X.carrier} (hU : IsCompact (
     exact IsAffineOpen.basicOpenIsAffine V.1.prop _
   haveI : Finite s := hs.to_subtype
   refine' ⟨Set.range g, Set.finite_range g, _⟩
-  refine' (Set.inter_eq_right_iff_subset.mpr
+  refine' (Set.inter_eq_right.mpr
             (SetLike.coe_subset_coe.2 <| RingedSpace.basicOpen_le _ _)).symm.trans _
   rw [e, Set.iUnion₂_inter]
   apply le_antisymm <;> apply Set.iUnion₂_subset
chore: tidy various files (#7132)
Diff
@@ -34,7 +34,7 @@ namespace AlgebraicGeometry
 variable {X Y : Scheme.{u}} (f : X ⟶ Y)
 
 /--
-A morphism is `quasi-compact` if the underlying map of topological spaces is, i.e. if the preimages
+A morphism is "quasi-compact" if the underlying map of topological spaces is, i.e. if the preimages
 of quasi-compact open sets are quasi-compact.
 -/
 @[mk_iff]
@@ -47,7 +47,7 @@ theorem quasiCompact_iff_spectral : QuasiCompact f ↔ IsSpectralMap f.1.base :=
   ⟨fun ⟨h⟩ => ⟨by continuity, h⟩, fun h => ⟨h.2⟩⟩
 #align algebraic_geometry.quasi_compact_iff_spectral AlgebraicGeometry.quasiCompact_iff_spectral
 
-/-- The `affine_target_morphism_property` corresponding to `quasi_compact`, asserting that the
+/-- The `AffineTargetMorphismProperty` corresponding to `QuasiCompact`, asserting that the
 domain is a quasi-compact scheme. -/
 def QuasiCompact.affineProperty : AffineTargetMorphismProperty := fun X _ _ _ =>
   CompactSpace X.carrier
@@ -181,7 +181,7 @@ theorem QuasiCompact.affineProperty_isLocal : (QuasiCompact.affineProperty : _).
       topIsAffineOpen _]
 #align algebraic_geometry.quasi_compact.affine_property_is_local AlgebraicGeometry.QuasiCompact.affineProperty_isLocal
 
-theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
+theorem QuasiCompact.affine_openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
     List.TFAE
       [QuasiCompact f,
         ∃ (𝒰 : Scheme.OpenCover.{u} Y) (_ : ∀ i, IsAffine (𝒰.obj i)),
@@ -193,14 +193,14 @@ theorem QuasiCompact.affine_openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤) (_ : ∀ i, IsAffineOpen (U i)),
           ∀ i, CompactSpace (f.1.base ⁻¹' (U i).1)] :=
   quasiCompact_eq_affineProperty.symm ▸ QuasiCompact.affineProperty_isLocal.affine_openCover_TFAE f
-#align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tFAE
+#align algebraic_geometry.quasi_compact.affine_open_cover_tfae AlgebraicGeometry.QuasiCompact.affine_openCover_tfae
 
 theorem QuasiCompact.is_local_at_target : PropertyIsLocalAtTarget @QuasiCompact :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal
 #align algebraic_geometry.quasi_compact.is_local_at_target AlgebraicGeometry.QuasiCompact.is_local_at_target
 
-theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
+theorem QuasiCompact.openCover_tfae {X Y : Scheme.{u}} (f : X ⟶ Y) :
     List.TFAE
       [QuasiCompact f,
         ∃ 𝒰 : Scheme.OpenCover.{u} Y,
@@ -213,7 +213,7 @@ theorem QuasiCompact.openCover_tFAE {X Y : Scheme.{u}} (f : X ⟶ Y) :
         ∃ (ι : Type u) (U : ι → Opens Y.carrier) (_ : iSup U = ⊤), ∀ i, QuasiCompact (f ∣_ U i)] :=
   quasiCompact_eq_affineProperty.symm ▸
     QuasiCompact.affineProperty_isLocal.targetAffineLocallyIsLocal.openCover_TFAE f
-#align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tFAE
+#align algebraic_geometry.quasi_compact.open_cover_tfae AlgebraicGeometry.QuasiCompact.openCover_tfae
 
 theorem quasiCompact_over_affine_iff {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] :
     QuasiCompact f ↔ CompactSpace X.carrier :=
@@ -250,7 +250,6 @@ theorem QuasiCompact.affineProperty_stableUnderBaseChange :
     QuasiCompact.affineProperty.StableUnderBaseChange := by
   intro X Y S _ _ f g h
   rw [QuasiCompact.affineProperty] at h ⊢
-  skip
   let 𝒰 := Scheme.Pullback.openCoverOfRight Y.affineCover.finiteSubcover f g
   have : Finite 𝒰.J := by dsimp; infer_instance
   have : ∀ i, CompactSpace (𝒰.obj i).carrier := by intro i; dsimp; infer_instance
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -341,7 +341,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
       (hn i)
   dsimp at hn
   simp only [← map_mul, ← map_pow] at hn
-  rwa [MulZeroClass.mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn
+  rwa [mul_zero, ← mul_assoc, ← pow_add, tsub_add_cancel_of_le] at hn
   apply Finset.le_sup (Finset.mem_univ i)
 #align algebraic_geometry.exists_pow_mul_eq_zero_of_res_basic_open_eq_zero_of_is_compact AlgebraicGeometry.exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact
 
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,16 +2,13 @@
 Copyright (c) 2022 Andrew Yang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
-
-! This file was ported from Lean 3 source module algebraic_geometry.morphisms.quasi_compact
-! 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.AlgebraicGeometry.Morphisms.Basic
 import Mathlib.Topology.Spectral.Hom
 import Mathlib.AlgebraicGeometry.Limits
 
+#align_import algebraic_geometry.morphisms.quasi_compact from "leanprover-community/mathlib"@"5dc6092d09e5e489106865241986f7f2ad28d4c8"
+
 /-!
 # Quasi-compact morphisms
 
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
@@ -334,7 +334,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
   use Finset.univ.sup n
   suffices ∀ i : s, X.presheaf.map (homOfLE (h₁ i)).op (f ^ Finset.univ.sup n * x) = 0 by
     subst e
-    apply TopCat.Sheaf.eq_of_locally_eq.{u + 1, u} X.sheaf fun i : s => (i : Opens X.carrier)
+    apply TopCat.Sheaf.eq_of_locally_eq X.sheaf fun i : s => (i : Opens X.carrier)
     intro i
     rw [map_zero]
     apply this
chore: fix focusing dots (#5708)

This PR is the result of running

find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;

which firstly replaces . focusing dots with · and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.

Diff
@@ -326,7 +326,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme
     convert congr_arg (X.presheaf.map (homOfLE _).op) H
     · simp only [← comp_apply, ← Functor.map_comp]
       rfl
-    . rw [map_zero]
+    · rw [map_zero]
       simp only [Scheme.basicOpen_res, ge_iff_le, inf_le_right]
   choose n hn using H'
   haveI := hs.to_subtype
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: Andrew Yang
 
 ! This file was ported from Lean 3 source module algebraic_geometry.morphisms.quasi_compact
-! 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.
 -/
feat: port AlgebraicGeometry.Morphisms.QuasiCompact (#5642)

Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com>

Dependencies 11 + 936

937 files ported (98.8%)
387614 lines ported (98.6%)
Show graph

The unported dependencies are