Skip to content

Commit 7a27a3a

Browse files
author
mathlib4-bot
committed
Merge remote-tracking branch 'upstream/master' into bump/v4.29.0
2 parents c3e58b4 + 8ca4eac commit 7a27a3a

File tree

8 files changed

+268
-4
lines changed

8 files changed

+268
-4
lines changed

Mathlib/Algebra/Group/Submonoid/Operations.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,11 @@ def submonoidCongr (h : S = T) : S ≃* T :=
10471047
-- this name is primed so that the version to `f.range` instead of `f.mrange` can be unprimed.
10481048
/-- A monoid homomorphism `f : M →* N` with a left-inverse `g : N → M` defines a multiplicative
10491049
equivalence between `M` and `f.mrange`.
1050-
This is a bidirectional version of `MonoidHom.mrange_restrict`. -/
1050+
This is a bidirectional version of `MonoidHom.mrangeRestrict`. -/
10511051
@[to_additive (attr := simps +simpRhs)
10521052
/-- An additive monoid homomorphism `f : M →+ N` with a left-inverse `g : N → M` defines an
10531053
additive equivalence between `M` and `f.mrange`. This is a bidirectional version of
1054-
`AddMonoidHom.mrange_restrict`. -/]
1054+
`AddMonoidHom.mrangeRestrict`. -/]
10551055
def ofLeftInverse' (f : M →* N) {g : N → M} (h : Function.LeftInverse g f) :
10561056
M ≃* MonoidHom.mrange f :=
10571057
{ f.mrangeRestrict with

Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,4 +1053,185 @@ lemma Scheme.exists_isOpenCover_and_isAffine [IsCofiltered I]
10531053

10541054
end IsAffine
10551055

1056+
section LocallyOfFinitePresentation
1057+
1058+
include hc in
1059+
/-- See `Scheme.exists_π_app_comp_eq_of_locallyOfFinitePresentation` for the general case. -/
1060+
private nonrec lemma Scheme.exists_π_app_comp_eq_of_locallyOfFinitePresentation_of_isAffine
1061+
[IsCofiltered I] [LocallyOfFinitePresentation f]
1062+
[IsAffine S] [IsAffine X] [∀ i, IsAffine (D.obj i)]
1063+
(a : c.pt ⟶ X) (ha : c.π ≫ t = (Functor.const _).map (a ≫ f)) :
1064+
∃ (i : I) (g : D.obj i ⟶ X), c.π.app i ≫ g = a ∧ g ≫ f = t.app i := by
1065+
-- Every scheme involved is affine, so the proof is merely translate to commutative algebra and
1066+
-- use `RingHom.EssFiniteType.exists_eq_comp_ι_app_of_isColimit`.
1067+
-- Unfortunately the translation takes 45 lines.
1068+
wlog hS : ∃ R, S = Spec R generalizing S
1069+
· obtain ⟨i, g, hg, hg'⟩ := this (t ≫ ((Functor.const I).mapIso S.isoSpec).hom)
1070+
(f ≫ S.isoSpec.hom) (by simp [reassoc_of% ha]) ⟨_, rfl⟩
1071+
exact ⟨i, g, hg, by simpa using congr($hg' ≫ S.isoSpec.inv)⟩
1072+
obtain ⟨R, rfl⟩ := hS
1073+
wlog hX : ∃ S, X = Spec S generalizing X
1074+
· obtain ⟨i, f, hf⟩ := this (a ≫ X.isoSpec.hom) (X.isoSpec.inv ≫ f)
1075+
(by simp [ha, - Functor.map_comp]) ⟨_, rfl⟩
1076+
exact ⟨i, f ≫ X.isoSpec.inv, by simpa [← Iso.comp_inv_eq] using hf⟩
1077+
obtain ⟨S, rfl⟩ := hX
1078+
obtain ⟨φ, rfl⟩ := Spec.map_surjective f
1079+
wlog hD : ∃ D' : I ⥤ CommRingCatᵒᵖ, D = D' ⋙ Scheme.Spec generalizing D
1080+
· let e : D ⟶ D ⋙ Scheme.Γ.rightOp ⋙ Scheme.Spec := D.whiskerLeft ΓSpec.adjunction.unit
1081+
have inst (i) : IsIso (e.app i) := by dsimp [e]; infer_instance
1082+
have inst : IsIso e := NatIso.isIso_of_isIso_app e
1083+
have inst (i) : IsAffine ((D ⋙ Scheme.Γ.rightOp ⋙ Scheme.Spec).obj i) := by
1084+
dsimp; infer_instance
1085+
obtain ⟨i, g, hg, hg'⟩ := this _ _ ((IsLimit.postcomposeHomEquiv (asIso e) c).symm hc)
1086+
(inv e ≫ t) a (by simpa using ha) ⟨D ⋙ Scheme.Γ.rightOp, rfl⟩
1087+
exact ⟨i, e.app i ≫ g, by rwa [← Category.assoc], by simp [hg']⟩
1088+
obtain ⟨D, rfl⟩ := hD
1089+
let e : ((Functor.const Iᵒᵖ).obj R).rightOp ⋙ Scheme.Spec ≅ (Functor.const I).obj (Spec R) :=
1090+
NatIso.ofComponents (fun _ ↦ Iso.refl _) (by simp)
1091+
obtain ⟨t, rfl⟩ : ∃ t' : (Functor.const Iᵒᵖ).obj R ⟶ D.leftOp,
1092+
t = Functor.whiskerRight (NatTrans.rightOp t') Scheme.Spec ≫ e.hom :=
1093+
⟨⟨fun i ↦ Spec.preimage (t.app i.unop), fun _ _ f ↦ Spec.map_injective
1094+
(by simpa using (t.naturality f.unop).symm)⟩, by ext : 2; simp [e]⟩
1095+
wlog hc' : ∃ c' : Cocone D.leftOp, c = Scheme.Spec.mapCone (coneOfCoconeLeftOp c') generalizing c
1096+
· have inst : IsAffine c.pt := isAffine_of_isLimit _ hc
1097+
let e' : (D ⋙ Scheme.Spec).op ⋙ Γ ≅ D.leftOp := D.leftOp.isoWhiskerLeft SpecΓIdentity
1098+
let c' := coneOfCoconeLeftOp ((Cocones.precompose e'.inv).obj (Γ.mapCocone c.op))
1099+
have inst : ∀ i, IsAffine ((D ⋙ Scheme.Spec).op.obj i).unop := by dsimp; infer_instance
1100+
obtain ⟨i, f, hf⟩ := this (Scheme.Spec.mapCone c') (isLimitOfPreserves _
1101+
(isLimitConeOfCoconeLeftOp _ ((IsColimit.precomposeHomEquiv e'.symm _).symm
1102+
(isColimitOfPreserves _ hc.op)))) (c.pt.isoSpec.inv ≫ a) (by
1103+
ext i
1104+
have : c.π.app i ≫ Spec.map (t.app (.op i)) = a ≫ Spec.map φ := by
1105+
simpa using congr((($ha).app i))
1106+
simp [c', e, e', ← this, Iso.eq_inv_comp, isoSpec_hom_naturality_assoc]) ⟨_, rfl⟩
1107+
refine ⟨i, f, ?_⟩
1108+
simpa [Iso.eq_inv_comp, c', isoSpec_hom_naturality_assoc, e'] using hf
1109+
obtain ⟨c', rfl⟩ := hc'
1110+
obtain ⟨ψ, rfl⟩ := Spec.map_surjective a
1111+
replace hc := isColimitOfConeOfCoconeLeftOp _ (isLimitOfReflects _ hc)
1112+
obtain ⟨i, g, hg, hg'⟩ :=
1113+
RingHom.EssFiniteType.exists_eq_comp_ι_app_of_isColimit _ D.leftOp t _ _ hc
1114+
(HasRingHomProperty.Spec_iff.mp ‹LocallyOfFinitePresentation (Spec.map φ)›) ψ fun i ↦ by
1115+
apply Spec.map_injective; simpa using congr(($ha).app i.unop).symm
1116+
exact ⟨i.unop, Spec.map g, by simpa using congr(Spec.map $hg').symm,
1117+
by simpa using congr(Spec.map $hg)⟩
1118+
1119+
open TopologicalSpace in
1120+
include hc in
1121+
/--
1122+
Given a cofiltered diagram of qcqs schemes `Dᵢ` over `S` with affine transition maps.
1123+
If `X` is locally of finite presentation over `S`, then any `S`-morphism `lim Dᵢ ⟶ X` factors
1124+
through some `lim Dᵢ ⟶ Dⱼ ⟶ X` for some `j`.
1125+
-/
1126+
lemma Scheme.exists_π_app_comp_eq_of_locallyOfFinitePresentation
1127+
[IsCofiltered I] [LocallyOfFinitePresentation f]
1128+
[∀ {i j} (f : i ⟶ j), IsAffineHom (D.map f)]
1129+
[∀ i, CompactSpace (D.obj i)] [∀ i, QuasiSeparatedSpace (D.obj i)]
1130+
(a : c.pt ⟶ X) (ha : c.π ≫ t = (Functor.const _).map (a ≫ f)) :
1131+
∃ (i : I) (g : D.obj i ⟶ X), c.π.app i ≫ g = a ∧ g ≫ f = t.app i := by
1132+
classical
1133+
-- The open cover of `c := lim Dᵢ` indexed by triplets of affine opens `(U, V, W)` with
1134+
-- `U ⊆ c`, `V ⊆ X`, `W ⊆ S` such that `U` maps to `V` maps to `W`.
1135+
have 𝒰 := (c.pt.isBasis_affineOpens).isOpenCover_mem_and_le
1136+
(((X.isBasis_affineOpens).isOpenCover_mem_and_le
1137+
((S.isBasis_affineOpens).isOpenCover.comap f.base.hom)).comap a.base.hom)
1138+
-- By qcqs, this cover descends to some finite affine open cover `𝒱` of `Dᵢ`.
1139+
obtain ⟨i, s, 𝒱, h𝒱, h𝒱𝒰⟩ := Scheme.exists_isOpenCover_and_isAffine D c hc _ 𝒰 fun U ↦ U.2.1
1140+
obtain ⟨i', fi'i, hi'⟩ : ∃ (i' : I) (fi'i : i' ⟶ i),
1141+
∀ j, D.map fi'i ⁻¹ᵁ 𝒱 j ≤ t.app i' ⁻¹ᵁ j.1.1.2.1.2.1 := by
1142+
choose k fk hk using fun j ↦ exists_map_preimage_le_map_preimage D c hc (h𝒱𝒰 j).1.isCompact
1143+
(V := t.app i ⁻¹ᵁ j.1.1.2.1.2.1) (by
1144+
rw [← Hom.comp_preimage, ← NatTrans.comp_app, ha]
1145+
exact (h𝒱𝒰 j).2.symm.trans_le (j.1.prop.2.trans (a.preimage_mono j.1.1.2.prop.2)))
1146+
obtain ⟨i', fi'i, fi', hfi'⟩ := IsCofiltered.wideCospan fk
1147+
refine ⟨i', fi'i, fun j ↦ ?_⟩
1148+
rw [← hfi', Functor.map_comp, Hom.comp_preimage]
1149+
refine (Hom.preimage_mono _ (hk _)).trans ?_
1150+
simp only [← Hom.comp_preimage, t.naturality, Functor.const_obj_obj,
1151+
Functor.const_obj_map, Category.comp_id, le_refl]
1152+
-- Using the affine version `exists_π_app_comp_eq_of_locallyOfFinitePresentation_of_isAffine`,
1153+
-- one can now factor `Dⱼ ⁻¹ 𝒱ⱼ ⟶ lim Dᵢ ⟶ X` through some `Dⱼₖ ⁻¹ 𝒱ⱼ` for each `𝒱ⱼ`,
1154+
-- and by finite-ness we may chose a fixed `k` that works for every `j`.
1155+
have : ∃ k, ∃ (fk : k ⟶ i), ∀ j, ∃ (ak : ↑(D.map fk ⁻¹ᵁ 𝒱 j) ⟶ X),
1156+
ak ≫ f = Opens.ι _ ≫ t.app k ∧ c.π.app _ ∣_ _ ≫ ak = Opens.ι _ ≫ a := by
1157+
let 𝒱' := (D.map fi'i ⁻¹ᵁ 𝒱 ·)
1158+
have h𝒱'𝒰 (j : s) : c.π.app i' ⁻¹ᵁ 𝒱' j = j.1.1.1 := by
1159+
rw [← Hom.comp_preimage, c.w fi'i]; exact (h𝒱𝒰 j).2.symm
1160+
have _ (j k) : IsAffine ((opensDiagram D i' (𝒱' j)).obj k) := ((h𝒱𝒰 _).1.preimage _).preimage _
1161+
let t𝒱 (j : _) : opensDiagram D i' (𝒱' j) ⟶ (Functor.const (Over i')).obj j.1.1.2.1.2 :=
1162+
{ app k := (t.app k.left).resLE _ _ <| by
1163+
refine (Hom.preimage_mono _ (hi' _)).trans ?_
1164+
simp only [Functor.id_obj, Functor.const_obj_obj, ← Hom.comp_preimage, t.naturality,
1165+
Functor.const_obj_map, Category.comp_id, le_refl]
1166+
naturality {k₁ k₂} f₁₂ := by simp [Hom.resLE_comp_resLE] }
1167+
have (j : s) : IsAffine j.1.1.2.1.1 := j.1.1.2.prop.1
1168+
choose k ak hk hk' using fun j ↦ exists_π_app_comp_eq_of_locallyOfFinitePresentation_of_isAffine
1169+
_ (t𝒱 j) (f.resLE _ _ j.1.1.2.prop.2) _ (isLimitOpensCone D c hc i' (𝒱' j))
1170+
(a.resLE _ _ ((h𝒱'𝒰 _).trans_le j.1.prop.2)) (by
1171+
ext k
1172+
simp [t𝒱, Hom.resLE_comp_resLE, show c.π.app k.left ≫ t.app k.left = a ≫ f from
1173+
congr(($ha).app k.left)])
1174+
obtain ⟨i'', fi''i', fi'', hi''⟩ := IsCofiltered.wideCospan fun j ↦ (k j).hom
1175+
refine ⟨i'', fi''i' ≫ fi'i, fun j ↦
1176+
⟨Scheme.homOfLE _ ?_ ≫ D.map (fi'' _) ∣_ _ ≫ ak j ≫ Opens.ι _, ?_, ?_⟩⟩
1177+
· simp only [← Hom.comp_preimage, ← Functor.map_comp, 𝒱', reassoc_of% hi'']; rfl
1178+
· have : ak j ≫ Opens.ι _ ≫ f = Opens.ι _ ≫ t.app (k j).left := by
1179+
simpa [t𝒱] using congr($(hk' j) ≫ Opens.ι _)
1180+
simp [this]
1181+
· have e : c.π.app i'' ⁻¹ᵁ D.map (fi''i' ≫ fi'i) ⁻¹ᵁ 𝒱 j ≤ c.π.app i' ⁻¹ᵁ 𝒱' j := by
1182+
simp only [← Hom.comp_preimage, Cone.w, 𝒱']; rfl
1183+
simpa [← AlgebraicGeometry.Scheme.Hom.resLE_eq_morphismRestrict,
1184+
Scheme.Hom.resLE_comp_resLE_assoc] using congr(Scheme.homOfLE _ e ≫ $(hk j) ≫ Opens.ι _)
1185+
choose k fki ak hak hak' using this
1186+
-- We may then find an `l` for each `j₁` and `j₂` such that the map `Dⱼ₁ₗ ⁻¹ 𝒱ⱼ₁ ⟶ X` and
1187+
-- `Dⱼ₂ₗ ⁻¹ 𝒱ⱼ₂ ⟶ X` agrees on the intersection in `Dₗ`.
1188+
-- And again by finiteness we may choose a global `l`.
1189+
obtain ⟨l, flk, hl⟩ : ∃ (l : I) (flk : l ⟶ k), ∀ j₁ j₂, Scheme.homOfLE _ inf_le_left ≫
1190+
D.map flk ∣_ _ ≫ ak j₁ = Scheme.homOfLE _ inf_le_right ≫ D.map flk ∣_ _ ≫ ak j₂ := by
1191+
let 𝒱' := (D.map fki ⁻¹ᵁ 𝒱 ·)
1192+
have (j₁ j₂ : s) : ∃ (l : I) (flk : l ⟶ k), Scheme.homOfLE _ inf_le_left ≫ D.map flk ∣_ _ ≫
1193+
ak j₁ = Scheme.homOfLE _ inf_le_right ≫ D.map flk ∣_ _ ≫ ak j₂ := by
1194+
have _ (x) : CompactSpace ↥((opensDiagram D k (𝒱' j₁ ⊓ 𝒱' j₂)).obj x) :=
1195+
isCompact_iff_compactSpace.mp (QuasiCompact.isCompact_preimage _ (𝒱' j₁ ⊓ 𝒱' j₂).isOpen
1196+
(((h𝒱𝒰 _).1.preimage _).isCompact.inter_of_isOpen ((h𝒱𝒰 _).1.preimage _).isCompact
1197+
(D.map fki ⁻¹ᵁ 𝒱 j₁).2 (D.map fki ⁻¹ᵁ 𝒱 j₂).2))
1198+
obtain ⟨⟨l, ⟨⟨⟩⟩, flk⟩, ⟨flk', ⟨⟨⟨⟩⟩⟩, h⟩, e⟩ :=
1199+
Scheme.exists_hom_comp_eq_comp_of_locallyOfFiniteType _
1200+
(opensDiagramι .. ≫ (Over.forget k).whiskerLeft t) f _
1201+
(isLimitOpensCone D c hc k (𝒱' j₁ ⊓ 𝒱' j₂)) (i := .mk (𝟙 k))
1202+
(Scheme.homOfLE _ (by simp [𝒱']) ≫ ak j₁) (Scheme.homOfLE _ (by simp [𝒱']) ≫ ak j₂)
1203+
(by simp [hak]) (by simp [hak]) (by simp; simp [Hom.resLE, hak'])
1204+
obtain rfl : flk = flk' := by simpa using h.symm
1205+
refine ⟨l, flk, by simpa [← Scheme.Hom.resLE_eq_morphismRestrict] using e⟩
1206+
choose l flk hflk using this
1207+
obtain ⟨l', fl'k, fl'l, hl'⟩ := IsCofiltered.wideCospan (I := s × s) fun x ↦ flk x.1 x.2
1208+
refine ⟨l', fl'k, fun j₁ j₂ ↦ ?_⟩
1209+
have H : (D.map fl'k ≫ D.map fki) ⁻¹ᵁ (𝒱 j₁ ⊓ 𝒱 j₂) ≤
1210+
(D.map (fl'l (j₁, j₂)) ≫ D.map (flk j₁ j₂) ≫ D.map fki) ⁻¹ᵁ (𝒱 j₁ ⊓ 𝒱 j₂) := by
1211+
simp only [← Functor.map_comp, reassoc_of% hl']; rfl
1212+
simpa [← Scheme.Hom.resLE_eq_morphismRestrict, Scheme.Hom.resLE_comp_resLE_assoc,
1213+
← Functor.map_comp, hl'] using congr((D.map (fl'l (j₁, j₂))).resLE _ _ H ≫ $(hflk j₁ j₂))
1214+
-- We may glue the morphisms into `Dₗ ⟶ X` and verify that it indeed satisfies the hypothesis.
1215+
let h𝒲 := (h𝒱.comap (D.map fki).base.hom).comap (D.map flk).base.hom
1216+
let 𝒲 := Scheme.openCoverOfIsOpenCover _ (D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 ·) h𝒲
1217+
let F := 𝒲.glueMorphisms (fun j ↦ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j ≫ ak j) (fun j₁ j₂ ↦ by
1218+
rw [← cancel_epi (isPullback_opens_inf _ _).isoPullback.hom]
1219+
simpa [𝒲] using hl j₁ j₂)
1220+
have hF (j : s) : (D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 j).ι ≫ F = D.map flk ∣_ _ ≫ ak j :=
1221+
Scheme.Cover.ι_glueMorphisms ..
1222+
refine ⟨l, F, ?_, ?_⟩
1223+
· refine Cover.hom_ext (𝒲.pullback₁ (c.π.app l)) _ _ fun j ↦ ?_
1224+
rw [← cancel_epi (isPullback_morphismRestrict _ _).flip.isoPullback.hom]
1225+
dsimp [𝒲]
1226+
simp only [pullback.condition_assoc, IsPullback.isoPullback_hom_snd_assoc,
1227+
IsPullback.isoPullback_hom_fst_assoc, hF]
1228+
have h : c.π.app l ⁻¹ᵁ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 j ≤ c.π.app k ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 j := by
1229+
simp only [← Hom.comp_preimage, c.w_assoc, c.w]; rfl
1230+
simpa [← Scheme.Hom.resLE_eq_morphismRestrict, Scheme.Hom.resLE_comp_resLE_assoc] using
1231+
congr(Scheme.homOfLE _ h ≫ $(hak' j))
1232+
· refine 𝒲.hom_ext _ _ fun j ↦ ?_
1233+
simp [F, Cover.ι_glueMorphisms_assoc, hak]; rfl
1234+
1235+
end LocallyOfFinitePresentation
1236+
10561237
end AlgebraicGeometry

Mathlib/CategoryTheory/Bicategory/Functor/Prelax.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def mkOfHomFunctors (F : B → C) (F' : (a : B) → (b : B) → (a ⟶ b) ⥤ (F
136136
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : PrelaxFunctor B B where
137137
toPrelaxFunctorStruct := PrelaxFunctorStruct.id B
138138

139-
instance : Inhabited (PrelaxFunctorStruct B B) :=
140-
PrelaxFunctorStruct.id B⟩
139+
instance : Inhabited (PrelaxFunctor B B) :=
140+
PrelaxFunctor.id B⟩
141141

142142
variable (F : PrelaxFunctor B C)
143143

Mathlib/CategoryTheory/Filtered/Basic.lean

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,15 @@ theorem tulip {j₁ j₂ j₃ k₁ k₂ l : C} (f₁ : j₁ ⟶ k₁) (f₂ : j
551551
refine ⟨s, k₁l ≫ l's, ls, k₂l ≫ l's, ?_, by simp only [← Category.assoc, hl], ?_⟩ <;>
552552
simp only [hs₁, hs₂, Category.assoc]
553553

554+
lemma wideSpan {I : Type*} [Finite I] {i : C} {j : I → C} (f : ∀ x, i ⟶ j x) :
555+
∃ k fik, ∃ g : ∀ x, j x ⟶ k, ∀ x, f x ≫ g x = fik := by
556+
have : IsFiltered C := { nonempty := ⟨i⟩ }
557+
classical
558+
cases nonempty_fintype I
559+
obtain ⟨k, fk, hk⟩ := sup_exists (insert i (Finset.univ.image j))
560+
(Finset.univ.image fun x ↦ ⟨i, j x, by simp, by simp, f x⟩)
561+
exact ⟨k, _, _, fun x ↦ hk _ _ (Finset.mem_image_of_mem _ (Finset.mem_univ _))⟩
562+
554563
end SpecialShapes
555564

556565
end IsFiltered
@@ -849,6 +858,17 @@ omit [IsCofiltered C] in
849858
lemma iff_of_equivalence (e : C ≌ D) : IsCofiltered C ↔ IsCofiltered D :=
850859
fun _ ↦ .of_equivalence e, fun _ ↦ .of_equivalence e.symm⟩
851860

861+
omit [IsCofiltered C] in
862+
lemma wideCospan [IsCofilteredOrEmpty C]
863+
{I : Type*} [Finite I] {i : C} {j : I → C} (f : ∀ x, j x ⟶ i) :
864+
∃ k fki, ∃ g : ∀ x, k ⟶ j x, ∀ x, g x ≫ f x = fki := by
865+
have : IsCofiltered C := { nonempty := ⟨i⟩ }
866+
classical
867+
cases nonempty_fintype I
868+
obtain ⟨k, fk, hk⟩ := IsCofiltered.inf_exists (insert i (Finset.univ.image j))
869+
(Finset.univ.image fun x ↦ ⟨j x, i, by simp, by simp, f x⟩)
870+
exact ⟨k, _, _, fun x ↦ hk _ _ (Finset.mem_image_of_mem _ (Finset.mem_univ _))⟩
871+
852872
end Nonempty
853873

854874

Mathlib/CategoryTheory/Monoidal/Cartesian/Grp_.lean

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,26 @@ lemma GrpObj.one_inv : η[G] ≫ ι = η := by simp [GrpObj.inv_eq_inv, GrpObj.c
184184

185185
@[deprecated (since := "2025-09-13")] alias Grp_Class.inv_eq_inv := GrpObj.inv_eq_inv
186186

187+
/-- The commutator of `G` as a morphism. This is the map `(x, y) ↦ x * y * x⁻¹ * y⁻¹`,
188+
see `CategoryTheory.GrpObj.lift_commutator_eq_mul_mul_inv_inv`.
189+
This morphism is constant with value `1` if and only if `G` is commutative
190+
(see `CategoryTheory.isCommMonObj_iff_commutator_eq_toUnit_η`). -/
191+
def GrpObj.commutator (G : C) [GrpObj G] : G ⊗ G ⟶ G :=
192+
fst _ _ * snd _ _ * (fst _ _) ⁻¹ * (snd _ _) ⁻¹
193+
194+
@[reassoc (attr := simp)]
195+
lemma GrpObj.lift_commutator_eq_mul_mul_inv_inv {X G : C} [GrpObj G] (f₁ f₂ : X ⟶ G) :
196+
lift f₁ f₂ ≫ commutator G = f₁ * f₂ * f₁⁻¹ * f₂⁻¹ := by
197+
simp [commutator, comp_mul, comp_inv]
198+
199+
@[reassoc (attr := simp)]
200+
lemma GrpObj.η_whiskerRight_commutator : η ▷ G ≫ commutator G = toUnit _ ≫ η := by
201+
simp [commutator, comp_mul, comp_inv, one_eq_one]
202+
203+
@[reassoc (attr := simp)]
204+
lemma GrpObj.whiskerLeft_η_commutator : G ◁ η ≫ commutator G = toUnit _ ≫ η := by
205+
simp [commutator, comp_mul, comp_inv, one_eq_one]
206+
187207
variable [BraidedCategory C]
188208

189209
instance [IsCommMonObj G] : IsMonHom ι[G] where
@@ -243,4 +263,17 @@ abbrev Hom.commGroup [IsCommMonObj G] : CommGroup (X ⟶ G) where
243263

244264
scoped[CategoryTheory.MonObj] attribute [instance] Hom.commGroup
245265

266+
section
267+
268+
/-- `G` is a commutative group object if and only if the commutator map `(x, y) ↦ x * y * x⁻¹ * y⁻¹`
269+
is constant. -/
270+
lemma isCommMonObj_iff_commutator_eq_toUnit_η :
271+
IsCommMonObj G ↔ GrpObj.commutator G = toUnit _ ≫ η := by
272+
rw [isCommMonObj_iff_isMulCommutative]
273+
refine ⟨fun h ↦ ?_, fun heq X ↦ ⟨⟨fun f g ↦ ?_⟩⟩⟩
274+
· simp [GrpObj.commutator, one_eq_one]
275+
· simpa [one_eq_one, mul_inv_eq_iff_eq_mul] using congr(lift f g ≫ $heq)
276+
277+
end
278+
246279
end CategoryTheory

Mathlib/CategoryTheory/Monoidal/Cartesian/Mon_.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,10 @@ def mulEquivCongrRight (e : M ≅ N) [IsMonHom e.hom] (X : C) : (X ⟶ M) ≃* (
385385
((yonedaMon.mapIso <| Mon.mkIso' e).app <| .op X).monCatIsoToMulEquiv
386386

387387
end Hom
388+
389+
/-- A monoid object `M` is commutative if and only if `X ⟶ M` is commutative for all `X`. -/
390+
lemma isCommMonObj_iff_isMulCommutative (M : C) [MonObj M] [BraidedCategory C] :
391+
IsCommMonObj M ↔ ∀ (X : C), IsMulCommutative (X ⟶ M) := by
392+
exact ⟨fun h X ↦ ⟨⟨by simp [mul_comm]⟩⟩, fun h ↦ ⟨by simp [mul_eq_mul, comp_mul, mul_comm]⟩⟩
393+
388394
end CategoryTheory

Mathlib/SetTheory/Cardinal/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ theorem mk_subtype_le_of_subset {α : Type u} {p q : α → Prop} (h : ∀ ⦃x
638638
theorem mk_le_mk_of_subset {α} {s t : Set α} (h : s ⊆ t) : #s ≤ #t :=
639639
⟨Set.embeddingOfSubset s t h⟩
640640

641+
theorem mk_monotone : Monotone (α := Set α) (mk ∘ (↑)) :=
642+
fun _ _ ↦ mk_le_mk_of_subset
643+
641644
@[deprecated mk_eq_zero (since := "2026-01-31")]
642645
theorem mk_emptyCollection (α : Type u) : #(∅ : Set α) = 0 :=
643646
mk_eq_zero _
@@ -854,6 +857,12 @@ lemma card_lt_card_of_left_finite {A B : Set α} (hfin : A.Finite) (hlt : A ⊂
854857
· exact card_lt_card_of_right_finite hfin hlt
855858
· exact (lt_aleph0_iff_subtype_finite.mpr hfin).trans_le <| Cardinal.aleph0_le_mk_iff.mpr hinf
856859

860+
theorem mk_strictMono [Finite α] : StrictMono (α := Set α) (mk ∘ (↑)) :=
861+
fun _ s ↦ card_lt_card_of_right_finite s.toFinite
862+
863+
theorem mk_strictMonoOn : StrictMonoOn (mk ∘ (↑)) {s : Set α | s.Finite} :=
864+
fun _ _ _ ↦ card_lt_card_of_right_finite
865+
857866
theorem le_mk_diff_add_mk (S T : Set α) : #S ≤ #(S \ T : Set α) + #T :=
858867
(mk_le_mk_of_subset <| subset_diff_union _ _).trans <| mk_union_le _ _
859868

Mathlib/Topology/Sets/OpenCover.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ lemma isTopologicalBasis (hu : IsOpenCover u)
6363

6464
end IsOpenCover
6565

66+
lemma Opens.IsBasis.isOpenCover {S : Set (Opens X)} (hS : Opens.IsBasis S) :
67+
IsOpenCover (fun U : S ↦ (U : Opens X)) :=
68+
top_le_iff.mp (subset_trans hS.2.superset (by simp))
69+
70+
/-- Given an open cover and a basis,
71+
the set of basis elements contained in any of the covers is still a cover. -/
72+
lemma Opens.IsBasis.isOpenCover_mem_and_le {S : Set (Opens X)} (hS : Opens.IsBasis S)
73+
{U : ι → Opens X} (hU : IsOpenCover U) :
74+
IsOpenCover (fun V : { x : Opens X × ι // x.1 ∈ S ∧ x.1 ≤ U x.2 } ↦ V.1.1) := by
75+
refine top_le_iff.mp fun x _ ↦ ?_
76+
obtain ⟨i, hxi⟩ := hU.exists_mem x
77+
obtain ⟨_, ⟨V, hV, rfl⟩, hxV, hVU⟩ := hS.exists_subset_of_mem_open hxi (U i).2
78+
simp only [Opens.iSup_mk, Opens.carrier_eq_coe, Opens.mem_mk, Set.mem_iUnion, SetLike.mem_coe]
79+
exact ⟨⟨(V, i), hV, hVU⟩, hxV⟩
80+
6681
end TopologicalSpace
6782

6883
section Irreducible

0 commit comments

Comments
 (0)