Skip to content

Commit d5b8374

Browse files
committed
chore(CategoryTheory): reduce Set α = α → Prop defeq abuse (leanprover-community#36115)
1 parent 177e455 commit d5b8374

File tree

9 files changed

+31
-35
lines changed

9 files changed

+31
-35
lines changed

Mathlib/AlgebraicGeometry/EllipticCurve/Affine/Point.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ variable (W') in
522522
and the set of pairs `⟨x, y⟩` satisfying `W.Nonsingular x y` with zero. -/
523523
def nonsingularPointEquiv : W'.Point ≃ WithZero {xy : R × R // W'.Nonsingular xy.fst xy.snd} :=
524524
(Equiv.Set.univ W'.Point).symm.trans <| (nonsingularPointEquivSubtype trivial).trans
525-
(Equiv.setCongr <| Set.ext fun _ => exists_iff_of_forall fun _ => trivial).optionCongr
525+
(Equiv.subtypeEquivProp <| by simp).optionCongr
526526

527527
@[simp]
528528
lemma nonsingularPointEquiv_zero : nonsingularPointEquiv W' .zero = none :=
@@ -555,7 +555,7 @@ predicate and the set of pairs `⟨x, y⟩` satisfying `W.Equation x y` with zer
555555
def pointEquivSubtype {p : W'.Point → Prop} (p0 : p .zero) :
556556
{P : W'.Point // p P} ≃ WithZero {xy : R × R // ∃ h : W'.Equation xy.fst xy.snd, p <| .mk h} :=
557557
(nonsingularPointEquivSubtype p0).trans
558-
(Equiv.setCongr <| by simp [equation_iff_nonsingular, Point.mk]).optionCongr
558+
(Equiv.subtypeEquivProp <| by ext; simp [equation_iff_nonsingular, Point.mk]).optionCongr
559559

560560
@[simp]
561561
lemma pointEquivSubtype_zero {p : W'.Point → Prop} (p0 : p .zero) :
@@ -583,7 +583,7 @@ variable (W') in
583583
`⟨x, y⟩` satisfying `E.Equation x y` with zero. -/
584584
def pointEquiv : W'.Point ≃ WithZero {xy : R × R // W'.Equation xy.fst xy.snd} :=
585585
(Equiv.Set.univ W'.Point).symm.trans <| (pointEquivSubtype trivial).trans
586-
(Equiv.setCongr <| Set.ext fun _ => exists_iff_of_forall fun _ => trivial).optionCongr
586+
(Equiv.subtypeEquivProp <| by simp).optionCongr
587587

588588
@[simp]
589589
lemma pointEquiv_zero : W'.pointEquiv .zero = none :=

Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ set_option backward.isDefEq.respectTransparency false in
564564
which is the largest ideal sheaf whose support is equal to it.
565565
The reduced induced scheme structure on the closed set is the quotient of this ideal. -/
566566
@[simps! ideal coe_support]
567-
nonrec def vanishingIdeal (Z : Closeds X) : IdealSheafData X :=
567+
noncomputable nonrec def vanishingIdeal (Z : Closeds X) : IdealSheafData X :=
568568
mkOfMemSupportIff
569569
(fun U ↦ vanishingIdeal (U.2.fromSpec ⁻¹' Z))
570570
(fun U f ↦ by

Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,11 @@ def fromSpec {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) :
552552
TopCat.ofHom
553553
{ toFun := FromSpec.toFun f_deg hm
554554
continuous_toFun := by
555-
rw [isTopologicalBasis_subtype (ProjectiveSpectrum.isTopologicalBasis_basic_opens 𝒜) (pbo f).1
556-
|>.continuous_iff]
555+
rw [isTopologicalBasis_subtype (ProjectiveSpectrum.isTopologicalBasis_basic_opens 𝒜)
556+
(· ∈ pbo f) |>.continuous_iff]
557557
rintro s ⟨_, ⟨a, rfl⟩, rfl⟩
558-
have h₁ : Subtype.val (p := (pbo f).1) ⁻¹' (pbo a) =
559-
⋃ i : ℕ, Subtype.val (p := (pbo f).1) ⁻¹' (pbo (decompose 𝒜 a i)) := by
558+
have h₁ : Subtype.val (p := (· ∈ pbo f)) ⁻¹' (pbo a) =
559+
⋃ i : ℕ, Subtype.val (p := (· ∈ pbo f)) ⁻¹' (pbo (decompose 𝒜 a i)) := by
560560
simp [ProjectiveSpectrum.basicOpen_eq_union_of_projection 𝒜 a]
561561
let e : _ ≃ _ :=
562562
⟨FromSpec.toFun f_deg hm, ToSpec.toFun f, toSpec_fromSpec _ _ _, fromSpec_toSpec _ _ _⟩

Mathlib/AlgebraicGeometry/Sites/Pretopology.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,16 @@ section
102102
/-- The jointly surjective topology on `Scheme` is defined by the same condition as the jointly
103103
surjective pretopology. -/
104104
def jointlySurjectiveTopology : GrothendieckTopology Scheme.{u} :=
105-
jointlySurjectivePretopology.toGrothendieck.copy (fun X s ↦ jointlySurjectivePretopology X ↑s) <|
105+
jointlySurjectivePretopology.toGrothendieck.copy
106+
(fun X ↦ {s | ↑s ∈ jointlySurjectivePretopology X}) <|
106107
funext fun _ ↦ Set.ext fun s ↦
107108
fun ⟨_, hp, hps⟩ x ↦ let ⟨Y, u, hu, hmem⟩ := hp x;
108109
⟨Y, u, Presieve.map_monotone hps _ _ hu, hmem⟩,
109110
fun hs ↦ ⟨s, hs, le_rfl⟩⟩
110111

111112
theorem mem_jointlySurjectiveTopology_iff_jointlySurjectivePretopology
112113
{X : Scheme.{u}} {s : Sieve X} :
113-
s ∈ jointlySurjectiveTopology X ↔ jointlySurjectivePretopology X ↑s :=
114+
s ∈ jointlySurjectiveTopology X ↔ ↑s ∈ jointlySurjectivePretopology X :=
114115
Iff.rfl
115116

116117
lemma jointlySurjectiveTopology_eq_toGrothendieck_jointlySurjectivePretopology :

Mathlib/AlgebraicGeometry/Sites/Small.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ set_option backward.isDefEq.respectTransparency false in
8383
/-- The pretopology on `Over S` induced by `P` where coverings are given by `P`-covers
8484
of `S`-schemes. -/
8585
def overPretopology : Pretopology (Over S) where
86-
coverings Y R := ∃ (𝒰 : Cover.{u} (precoverage P) Y.left) (_ : 𝒰.Over S), R = 𝒰.toPresieveOver
86+
coverings Y := {R | ∃ (𝒰 : Cover.{u} (precoverage P) Y.left) (_ : 𝒰.Over S), R = 𝒰.toPresieveOver}
8787
has_isos {X Y} f _ := ⟨coverOfIsIso f.left, inferInstance, (Presieve.ofArrows_pUnit _).symm⟩
8888
pullbacks := by
8989
rintro Y X f _ ⟨𝒰, h, rfl⟩
@@ -179,9 +179,9 @@ are given by `P`-coverings in `S`-schemes satisfying `Q`.
179179
The most common case is `P = Q`. In this case, this is simply surjective families
180180
in `S`-schemes with `P`. -/
181181
def smallPretopology : Pretopology (Q.Over ⊤ S) where
182-
coverings Y R :=
183-
∃ (𝒰 : Cover.{u} (precoverage P) Y.left) (_ : 𝒰.Over S) (h : ∀ j : 𝒰.I₀, Q (𝒰.X j ↘ S)),
184-
R = 𝒰.toPresieveOverProp h
182+
coverings Y :=
183+
{R | ∃ (𝒰 : Cover.{u} (precoverage P) Y.left) (_ : 𝒰.Over S) (h : ∀ j : 𝒰.I₀, Q (𝒰.X j ↘ S)),
184+
R = 𝒰.toPresieveOverProp h}
185185
has_isos {X Y} f := ⟨coverOfIsIso f.left, inferInstance, fun _ ↦ Y.prop,
186186
(Presieve.ofArrows_pUnit _).symm⟩
187187
pullbacks := by

Mathlib/CategoryTheory/CofilteredSystem.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ def toPreimages : J ⥤ Type v where
167167
map g := MapsTo.restrict (F.map g) _ _ fun x h => by
168168
rw [mem_iInter] at h ⊢
169169
intro f
170-
rw [← mem_preimage, preimage_preimage, mem_preimage]
171-
convert h (g ≫ f); rw [F.map_comp]; rfl
170+
simpa using h (g ≫ f)
172171
map_id j := by
173172
simp +unfoldPartialApp only [MapsTo.restrict, Subtype.map, F.map_id]
174173
ext
175-
rfl
174+
simp
176175
map_comp f g := by
177176
simp +unfoldPartialApp only [MapsTo.restrict, Subtype.map, F.map_comp]
178-
rfl
177+
ext
178+
simp
179179

180180
instance toPreimages_finite [∀ j, Finite (F.obj j)] : ∀ j, Finite ((F.toPreimages s).obj j) :=
181181
fun _ => Subtype.finite

Mathlib/CategoryTheory/Sites/DenseSubsite/InducedTopology.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class LocallyCoverDense : Prop where
5656
variable [G.LocallyCoverDense K]
5757

5858
theorem pushforward_cover_iff_cover_pullback [G.Full] [G.Faithful] {X : C} (S : Sieve X) :
59-
K _ (S.functorPushforward G) ↔ ∃ T : K (G.obj X), T.val.functorPullback G = S := by
59+
S.functorPushforward G ∈ K (G.obj X) ↔ ∃ T : K (G.obj X), T.val.functorPullback G = S := by
6060
constructor
6161
· intro hS
6262
exact ⟨⟨_, hS⟩, (Sieve.fullyFaithfulFunctorGaloisCoinsertion G X).u_l_eq S⟩
@@ -70,10 +70,9 @@ then the set `{ T ∩ mor(C) | T ∈ K }` is a Grothendieck topology of `C`.
7070
-/
7171
@[simps]
7272
def inducedTopology : GrothendieckTopology C where
73-
sieves _ S := K _ (S.functorPushforward G)
73+
sieves X := {S | S.functorPushforward G ∈ K (G.obj X)}
7474
top_mem' X := by
75-
change K _ _
76-
rw [Sieve.functorPushforward_top]
75+
rw [Set.mem_setOf, Sieve.functorPushforward_top]
7776
exact K.top_mem _
7877
pullback_stable' X Y S iYX hS := by
7978
apply K.transitive (LocallyCoverDense.functorPushforward_functorPullback_mem
@@ -104,7 +103,7 @@ def inducedTopology : GrothendieckTopology C where
104103

105104
@[simp]
106105
lemma mem_inducedTopology_sieves_iff {X : C} (S : Sieve X) :
107-
S ∈ (G.inducedTopology K) X ↔ (S.functorPushforward G) ∈ K (G.obj X) :=
106+
S ∈ G.inducedTopology K X ↔ S.functorPushforward G ∈ K (G.obj X) :=
108107
Iff.rfl
109108

110109
/-- `G` is cover-lifting w.r.t. the induced topology. -/

Mathlib/CategoryTheory/Sites/Over.lean

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,14 @@ namespace GrothendieckTopology
163163
/-- The Grothendieck topology on the category `Over X` for any `X : C` that is
164164
induced by a Grothendieck topology on `C`. -/
165165
def over (X : C) : GrothendieckTopology (Over X) where
166-
sieves Y S := Sieve.overEquiv Y S ∈ J Y.left
167-
top_mem' Y := by
168-
change _ ∈ J Y.left
169-
simp
166+
sieves Y := Sieve.overEquiv Y ⁻¹' J Y.left
167+
top_mem' Y := by simp
170168
pullback_stable' Y₁ Y₂ S₁ f h₁ := by
171-
change _ ∈ J _ at h₁ ⊢
172-
rw [Sieve.overEquiv_pullback]
169+
rw [Set.mem_preimage, Sieve.overEquiv_pullback]
173170
exact J.pullback_stable _ h₁
174-
transitive' Y S (hS : _ ∈ J _) R hR := J.transitive hS _ (fun Z f hf => by
175-
have hf' : _ ∈ J _ := hR ((Sieve.overEquiv_iff _ _).1 hf)
176-
rw [Sieve.overEquiv_pullback] at hf'
177-
exact hf')
171+
transitive' Y S hS R hR := J.transitive hS _ fun Z f hf => by
172+
specialize hR ((Sieve.overEquiv_iff _ _).1 hf)
173+
rwa [Set.mem_preimage, Sieve.overEquiv_pullback] at hR
178174

179175
lemma mem_over_iff {X : C} {Y : Over X} (S : Sieve Y) :
180176
S ∈ (J.over X) Y ↔ Sieve.overEquiv _ S ∈ J Y.left := by

Mathlib/CategoryTheory/Sites/Spaces.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ open CategoryTheory TopologicalSpace CategoryTheory.Limits
4646

4747
/-- The Grothendieck topology associated to a topological space. -/
4848
def grothendieckTopology : GrothendieckTopology (Opens T) where
49-
sieves X S := ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), S f ∧ x ∈ U
49+
sieves X := {S | ∀ x ∈ X, ∃ (U : Opens T) (f : U ⟶ X), S f ∧ x ∈ U}
5050
top_mem' _ _ hx := ⟨_, 𝟙 _, trivial, hx⟩
5151
pullback_stable' X Y S f hf y hy := by
5252
rcases hf y (f.le hy) with ⟨U, g, hg, hU⟩
@@ -60,7 +60,7 @@ def grothendieckTopology : GrothendieckTopology (Opens T) where
6060
set_option backward.isDefEq.respectTransparency false in
6161
/-- The Grothendieck pretopology associated to a topological space. -/
6262
def pretopology : Pretopology (Opens T) where
63-
coverings X R := ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), R f ∧ x ∈ U
63+
coverings X := {R | ∀ x ∈ X, ∃ (U : _) (f : U ⟶ X), R f ∧ x ∈ U}
6464
has_isos _ _ f _ _ hx := ⟨_, _, Presieve.singleton_self _, (inv f).le hx⟩
6565
pullbacks X Y f S hS x hx := by
6666
rcases hS _ (f.le hx) with ⟨U, g, hg, hU⟩

0 commit comments

Comments
 (0)