Skip to content

Commit 9dfd1d9

Browse files
committed
add updated files
1 parent 90d60fc commit 9dfd1d9

File tree

4 files changed

+61
-122
lines changed

4 files changed

+61
-122
lines changed

Mathlib/CategoryTheory/Category/ULift.lean

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@ variable {C : Type u₁} [Category.{v₁} C]
5151

5252
/-- The functorial version of `ULift.up`. -/
5353
@[simps]
54-
def Ulift.upFunctor : C ⥤ ULift.{u₂} C where
54+
def ULift.upFunctor : C ⥤ ULift.{u₂} C where
5555
obj := ULift.up
5656
map f := f
57-
#align category_theory.ulift.up_functor CategoryTheory.Ulift.upFunctor
57+
#align category_theory.ulift.up_functor CategoryTheory.ULift.upFunctor
5858

5959
/-- The functorial version of `ULift.down`. -/
6060
@[simps]
61-
def Ulift.downFunctor : ULift.{u₂} C ⥤ C where
61+
def ULift.downFunctor : ULift.{u₂} C ⥤ C where
6262
obj := ULift.down
6363
map f := f
64-
#align category_theory.ulift.down_functor CategoryTheory.Ulift.downFunctor
64+
#align category_theory.ulift.down_functor CategoryTheory.ULift.downFunctor
6565

6666
/-- The categorical equivalence between `C` and `ULift C`. -/
6767
@[simps]
68-
def Ulift.equivalence : C ≌ ULift.{u₂} C where
69-
functor := Ulift.upFunctor
70-
inverse := Ulift.downFunctor
68+
def ULift.equivalence : C ≌ ULift.{u₂} C where
69+
functor := ULift.upFunctor
70+
inverse := ULift.downFunctor
7171
unitIso :=
7272
{ hom := 𝟙 _
7373
inv := 𝟙 _ }
@@ -93,70 +93,70 @@ def Ulift.equivalence : C ≌ ULift.{u₂} C where
9393
functor_unitIso_comp X := by
9494
change 𝟙 X ≫ 𝟙 X = 𝟙 X
9595
simp
96-
#align category_theory.ulift.equivalence CategoryTheory.Ulift.equivalence
96+
#align category_theory.ulift.equivalence CategoryTheory.ULift.equivalence
9797

98-
section UliftHom
98+
section ULiftHom
9999
/- Porting note: obviously we don't want code that looks like this long term
100100
the ability to turn off unused universe parameter error is desirable -/
101101
/-- `ULiftHom.{w} C` is an alias for `C`, which is endowed with a category instance
102102
whose morphisms are obtained by applying `ULift.{w}` to the morphisms from `C`.
103103
-/
104-
def UliftHom.{w,u} (C : Type u) : Type u :=
104+
def ULiftHom.{w,u} (C : Type u) : Type u :=
105105
let _ := ULift.{w} C
106106
C
107-
#align category_theory.ulift_hom CategoryTheory.UliftHom
107+
#align category_theory.ulift_hom CategoryTheory.ULiftHom
108108

109-
instance {C} [Inhabited C] : Inhabited (UliftHom C) :=
109+
instance {C} [Inhabited C] : Inhabited (ULiftHom C) :=
110110
⟨(default : C)⟩
111111

112112
/-- The obvious function `ULiftHom C → C`. -/
113-
def UliftHom.objDown {C} (A : UliftHom C) : C :=
113+
def ULiftHom.objDown {C} (A : ULiftHom C) : C :=
114114
A
115-
#align category_theory.ulift_hom.obj_down CategoryTheory.UliftHom.objDown
115+
#align category_theory.ulift_hom.obj_down CategoryTheory.ULiftHom.objDown
116116

117117
/-- The obvious function `C → ULiftHom C`. -/
118-
def UliftHom.objUp {C} (A : C) : UliftHom C :=
118+
def ULiftHom.objUp {C} (A : C) : ULiftHom C :=
119119
A
120-
#align category_theory.ulift_hom.obj_up CategoryTheory.UliftHom.objUp
120+
#align category_theory.ulift_hom.obj_up CategoryTheory.ULiftHom.objUp
121121

122122
@[simp]
123-
theorem objDown_objUp {C} (A : C) : (UliftHom.objUp A).objDown = A :=
123+
theorem objDown_objUp {C} (A : C) : (ULiftHom.objUp A).objDown = A :=
124124
rfl
125125
#align category_theory.obj_down_obj_up CategoryTheory.objDown_objUp
126126

127127
@[simp]
128-
theorem objUp_objDown {C} (A : UliftHom C) : UliftHom.objUp A.objDown = A :=
128+
theorem objUp_objDown {C} (A : ULiftHom C) : ULiftHom.objUp A.objDown = A :=
129129
rfl
130130
#align category_theory.obj_up_obj_down CategoryTheory.objUp_objDown
131131

132-
instance : Category.{max v₂ v₁} (UliftHom.{v₂} C) where
132+
instance : Category.{max v₂ v₁} (ULiftHom.{v₂} C) where
133133
Hom A B := ULift.{v₂} <| A.objDown ⟶ B.objDown
134134
id A := ⟨𝟙 _⟩
135135
comp f g := ⟨f.down ≫ g.down⟩
136136

137137
/-- One half of the quivalence between `C` and `ULiftHom C`. -/
138138
@[simps]
139-
def UliftHom.up : C ⥤ UliftHom C where
140-
obj := UliftHom.objUp
139+
def ULiftHom.up : C ⥤ ULiftHom C where
140+
obj := ULiftHom.objUp
141141
map f := ⟨f⟩
142-
#align category_theory.ulift_hom.up CategoryTheory.UliftHom.up
142+
#align category_theory.ulift_hom.up CategoryTheory.ULiftHom.up
143143

144144
/-- One half of the quivalence between `C` and `ULiftHom C`. -/
145145
@[simps]
146-
def UliftHom.down : UliftHom C ⥤ C where
147-
obj := UliftHom.objDown
146+
def ULiftHom.down : ULiftHom C ⥤ C where
147+
obj := ULiftHom.objDown
148148
map f := f.down
149-
#align category_theory.ulift_hom.down CategoryTheory.UliftHom.down
149+
#align category_theory.ulift_hom.down CategoryTheory.ULiftHom.down
150150

151151
/-- The equivalence between `C` and `ULiftHom C`. -/
152-
def UliftHom.equiv : C ≌ UliftHom C where
153-
functor := UliftHom.up
154-
inverse := UliftHom.down
152+
def ULiftHom.equiv : C ≌ ULiftHom C where
153+
functor := ULiftHom.up
154+
inverse := ULiftHom.down
155155
unitIso := NatIso.ofComponents (fun A => eqToIso rfl) (by aesop_cat)
156156
counitIso := NatIso.ofComponents (fun A => eqToIso rfl) (by aesop_cat)
157-
#align category_theory.ulift_hom.equiv CategoryTheory.UliftHom.equiv
157+
#align category_theory.ulift_hom.equiv CategoryTheory.ULiftHom.equiv
158158

159-
end UliftHom
159+
end ULiftHom
160160
/- Porting note: we want to keep around the category instance on `D`
161161
so Lean can figure out things further down. So `AsSmall` has been
162162
nolinted. -/
@@ -211,11 +211,11 @@ def AsSmall.equiv : C ≌ AsSmall C where
211211
instance [Inhabited C] : Inhabited (AsSmall C) :=
212212
⟨⟨default⟩⟩
213213

214-
/-- The equivalence between `C` and `ULiftHom (Ulift C)`. -/
215-
def UliftHomUliftCategory.equiv.{v', u', v, u} (C : Type u) [Category.{v} C] :
216-
C ≌ UliftHom.{v'} (ULift.{u'} C) :=
217-
Ulift.equivalence.trans UliftHom.equiv
218-
#align category_theory.ulift_hom_ulift_category.equiv CategoryTheory.UliftHomUliftCategory.equiv
214+
/-- The equivalence between `C` and `ULiftHom (ULift C)`. -/
215+
def ULiftHomULiftCategory.equiv.{v', u', v, u} (C : Type u) [Category.{v} C] :
216+
C ≌ ULiftHom.{v'} (ULift.{u'} C) :=
217+
ULift.equivalence.trans ULiftHom.equiv
218+
#align category_theory.ulift_hom_ulift_category.equiv CategoryTheory.ULiftHomULiftCategory.equiv
219219

220220
end CategoryTheory
221221

Mathlib/CategoryTheory/CommSq.lean

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ structure LiftStruct (sq : CommSq f i p g) where
121121

122122
namespace LiftStruct
123123

124-
/-- A `lift_struct` for a commutative square gives a `lift_struct` for the
124+
/-- A `LiftStruct` for a commutative square gives a `LiftStruct` for the
125125
corresponding square in the opposite category. -/
126126
@[simps]
127127
def op {sq : CommSq f i p g} (l : LiftStruct sq) : LiftStruct sq.op
@@ -131,8 +131,8 @@ def op {sq : CommSq f i p g} (l : LiftStruct sq) : LiftStruct sq.op
131131
fac_right := by rw [← op_comp, l.fac_left]
132132
#align category_theory.comm_sq.lift_struct.op CategoryTheory.CommSq.LiftStruct.op
133133

134-
/-- A `lift_struct` for a commutative square in the opposite category
135-
gives a `lift_struct` for the corresponding square in the original category. -/
134+
/-- A `LiftStruct` for a commutative square in the opposite category
135+
gives a `LiftStruct` for the corresponding square in the original category. -/
136136
@[simps]
137137
def unop {A B X Y : Cᵒᵖ} {f : A ⟶ X} {i : A ⟶ B} {p : X ⟶ Y} {g : B ⟶ Y} {sq : CommSq f i p g}
138138
(l : LiftStruct sq) : LiftStruct sq.unop
@@ -142,7 +142,7 @@ def unop {A B X Y : Cᵒᵖ} {f : A ⟶ X} {i : A ⟶ B} {p : X ⟶ Y} {g : B
142142
fac_right := by rw [← unop_comp, l.fac_left]
143143
#align category_theory.comm_sq.lift_struct.unop CategoryTheory.CommSq.LiftStruct.unop
144144

145-
/-- Equivalences of `lift_struct` for a square and the corresponding square
145+
/-- Equivalences of `LiftStruct` for a square and the corresponding square
146146
in the opposite category. -/
147147
@[simps]
148148
def opEquiv (sq : CommSq f i p g) : LiftStruct sq ≃ LiftStruct sq.op
@@ -153,7 +153,7 @@ def opEquiv (sq : CommSq f i p g) : LiftStruct sq ≃ LiftStruct sq.op
153153
right_inv := by aesop_cat
154154
#align category_theory.comm_sq.lift_struct.op_equiv CategoryTheory.CommSq.LiftStruct.opEquiv
155155

156-
/-- Equivalences of `lift_struct` for a square in the oppositive category and
156+
/-- Equivalences of `LiftStruct` for a square in the oppositive category and
157157
the corresponding square in the original category. -/
158158
def unopEquiv {A B X Y : Cᵒᵖ} {f : A ⟶ X} {i : A ⟶ B} {p : X ⟶ Y} {g : B ⟶ Y}
159159
(sq : CommSq f i p g) : LiftStruct sq ≃ LiftStruct sq.unop
@@ -171,8 +171,7 @@ instance subsingleton_liftStruct_of_epi (sq : CommSq f i p g) [Epi i] :
171171
fun l₁ l₂ => by
172172
ext
173173
rw [← cancel_epi i]
174-
simp only [LiftStruct.fac_left]
175-
174+
simp only [LiftStruct.fac_left]⟩
176175
#align category_theory.comm_sq.subsingleton_lift_struct_of_epi CategoryTheory.CommSq.subsingleton_liftStruct_of_epi
177176

178177
instance subsingleton_liftStruct_of_mono (sq : CommSq f i p g) [Mono p] :
@@ -186,9 +185,9 @@ instance subsingleton_liftStruct_of_mono (sq : CommSq f i p g) [Mono p] :
186185
variable (sq : CommSq f i p g)
187186

188187

189-
/-- The assertion that a square has a `lift_struct`. -/
188+
/-- The assertion that a square has a `LiftStruct`. -/
190189
class HasLift : Prop where
191-
/-- Square has a `lift_struct`. -/
190+
/-- Square has a `LiftStruct`. -/
192191
exists_lift : Nonempty sq.LiftStruct
193192
#align category_theory.comm_sq.has_lift CategoryTheory.CommSq.HasLift
194193

@@ -220,7 +219,7 @@ theorem iff_unop {A B X Y : Cᵒᵖ} {f : A ⟶ X} {i : A ⟶ B} {p : X ⟶ Y} {
220219

221220
end HasLift
222221

223-
/-- A choice of a diagonal morphism that is part of a `lift_struct` when
222+
/-- A choice of a diagonal morphism that is part of a `LiftStruct` when
224223
the square has a lift. -/
225224
noncomputable def lift [hsq : HasLift sq] : B ⟶ X :=
226225
hsq.exists_lift.some.l

Mathlib/CategoryTheory/DiscreteCategory.lean

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,15 @@ instance [Subsingleton α] : Subsingleton (Discrete α) :=
107107
ext
108108
apply Subsingleton.elim⟩
109109

110-
/- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
111-
/-- A simple tactic to run `cases` on any `discrete α` hypotheses. -/
112-
--unsafe def _root_.tactic.discrete_cases : tactic Unit :=
113-
-- sorry
114-
--#align tactic.discrete_cases tactic.discrete_cases
115-
116-
117-
--run_cmd
118-
-- add_interactive [`` tactic.discrete_cases]
110+
/-
111+
Porting note: It seems that `aesop` currently has no way to add lemmas locally.
119112
120-
--attribute [local tidy] tactic.discrete_cases
121-
--`[cases_matching* [discrete _, (_ : discrete _) ⟶ (_ : discrete _), plift _]]
113+
attribute [local tidy] tactic.discrete_cases
114+
`[cases_matching* [discrete _, (_ : discrete _) ⟶ (_ : discrete _), PLift _]]
115+
-/
122116

123-
--macro (name := discrete_cases) "discrete_cases" : tactic =>
124-
-- `(tactic|casesm* Discrete _, (_ : Discrete _) ⟶ (_ : Discrete _), PLift _)
125117
/- Porting note: rewrote `discrete_cases` tactic -/
118+
/-- A simple tactic to run `cases` on any `discrete α` hypotheses. -/
126119
macro "discrete_cases": tactic =>
127120
`(tactic|casesm* Discrete _, (_ : Discrete _) ⟶ (_ : Discrete _), PLift _)
128121

@@ -152,7 +145,7 @@ protected abbrev eqToIso {X Y : Discrete α} (h : X.as = Y.as) : X ≅ Y :=
152145
exact h)
153146
#align category_theory.discrete.eq_to_iso CategoryTheory.Discrete.eqToIso
154147

155-
/-- A variant of `eq_to_hom` that lifts terms to the discrete category. -/
148+
/-- A variant of `eqToHom` that lifts terms to the discrete category. -/
156149
abbrev eqToHom' {a b : α} (h : a = b) : Discrete.mk a ⟶ Discrete.mk b :=
157150
Discrete.eqToHom h
158151
#align category_theory.discrete.eq_to_hom' CategoryTheory.Discrete.eqToHom'
@@ -172,10 +165,7 @@ variable {C : Type u₂} [Category.{v₂} C]
172165
instance {I : Type u₁} {i j : Discrete I} (f : i ⟶ j) : IsIso f :=
173166
⟨⟨Discrete.eqToHom (eq_of_hom f).symm, by aesop_cat⟩⟩
174167

175-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
176-
\ tactic `discrete_cases #[] -/
177-
/-- Any function `I → C` gives a functor `Discrete I ⥤ C`.
178-
-/
168+
/-- Any function `I → C` gives a functor `Discrete I ⥤ C`.-/
179169
def functor {I : Type u₁} (F : I → C) : Discrete I ⥤ C
180170
where
181171
obj := F ∘ Discrete.as
@@ -208,8 +198,6 @@ def functorComp {I : Type u₁} {J : Type u₁'} (f : J → C) (g : I → J) :
208198
NatIso.ofComponents (fun X => Iso.refl _) (by aesop_cat)
209199
#align category_theory.discrete.functor_comp CategoryTheory.Discrete.functorComp
210200

211-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
212-
\ tactic `discrete_cases #[] -/
213201
/-- For functors out of a discrete category,
214202
a natural transformation is just a collection of maps,
215203
as the naturality squares are trivial.
@@ -218,24 +206,20 @@ as the naturality squares are trivial.
218206
def natTrans {I : Type u₁} {F G : Discrete I ⥤ C} (f : ∀ i : Discrete I, F.obj i ⟶ G.obj i) : F ⟶ G
219207
where
220208
app := f
221-
naturality {X Y} g := by
222-
rcases g with ⟨⟨g⟩⟩
209+
naturality := fun {X Y} ⟨⟨g⟩⟩ => by
223210
discrete_cases
224211
rcases g
225212
change F.map (𝟙 _) ≫ _ = _ ≫ G.map (𝟙 _)
226213
simp
227214
#align category_theory.discrete.nat_trans CategoryTheory.Discrete.natTrans
228215

229-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
230-
\ tactic `discrete_cases #[] -/
231216
/-- For functors out of a discrete category,
232217
a natural isomorphism is just a collection of isomorphisms,
233218
as the naturality squares are trivial.
234219
-/
235220
@[simps!]
236221
def natIso {I : Type u₁} {F G : Discrete I ⥤ C} (f : ∀ i : Discrete I, F.obj i ≅ G.obj i) : F ≅ G :=
237-
NatIso.ofComponents f fun g => by
238-
rcases g with ⟨⟨g⟩⟩
222+
NatIso.ofComponents f fun ⟨⟨g⟩⟩ => by
239223
discrete_cases
240224
rcases g
241225
change F.map (𝟙 _) ≫ _ = _ ≫ G.map (𝟙 _)
@@ -247,8 +231,6 @@ theorem natIso_app {I : Type u₁} {F G : Discrete I ⥤ C} (f : ∀ i : Discret
247231
(i : Discrete I) : (Discrete.natIso f).app i = f i := by aesop_cat
248232
#align category_theory.discrete.nat_iso_app CategoryTheory.Discrete.natIso_app
249233

250-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
251-
\ tactic `discrete_cases #[] -/
252234
/-- Every functor `F` from a discrete category is naturally isomorphic (actually, equal) to
253235
`discrete.functor (F.obj)`. -/
254236
@[simp]
@@ -263,11 +245,7 @@ def compNatIsoDiscrete {I : Type u₁} {D : Type u₃} [Category.{v₃} D] (F :
263245
natIso fun _ => Iso.refl _
264246
#align category_theory.discrete.comp_nat_iso_discrete CategoryTheory.Discrete.compNatIsoDiscrete
265247

266-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
267-
\ tactic `discrete_cases #[] -/
268-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
269-
\ tactic `discrete_cases #[] -/
270-
/-- We can promote a type-level `equiv` to
248+
/-- We can promote a type-level `Equiv` to
271249
an equivalence between the corresponding `discrete` categories.
272250
-/
273251
@[simps]
@@ -289,7 +267,7 @@ def equivalence {I : Type u₁} {J : Type u₂} (e : I ≃ J) : Discrete I ≌ D
289267
simp)
290268
#align category_theory.discrete.equivalence CategoryTheory.Discrete.equivalence
291269

292-
/-- We can convert an equivalence of `discrete` categories to a type-level `equiv`. -/
270+
/-- We can convert an equivalence of `discrete` categories to a type-level `Equiv`. -/
293271
@[simps]
294272
def equivOfEquivalence {α : Type u₁} {β : Type u₂} (h : Discrete α ≌ Discrete β) : α ≃ β
295273
where
@@ -307,27 +285,23 @@ variable {J : Type v₁}
307285

308286
open Opposite
309287

310-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
311-
\ tactic `discrete_cases #[] -/
312-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported
313-
\ non-interactive tactic tactic.op_induction' -/
314-
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported
315-
\ tactic `discrete_cases #[] -/
316288
/-- A discrete category is equivalent to its opposite category. -/
317289
@[simps! functor_obj_as inverse_obj]
318290
protected def opposite (α : Type u₁) : (Discrete α)ᵒᵖ ≌ Discrete α :=
319291
let F : Discrete α ⥤ (Discrete α)ᵒᵖ := Discrete.functor fun x => op (Discrete.mk x)
320292
Equivalence.mk F.leftOp F
321-
(NatIso.ofComponents (fun ⟨X⟩ => Iso.refl _)
322-
<| fun {X Y} f => by
293+
(NatIso.ofComponents (fun ⟨X⟩ => Iso.refl _) <| fun {X Y} ⟨⟨f⟩⟩ => by
323294
induction X using Opposite.rec
324295
induction Y using Opposite.rec
325-
rcases f with ⟨⟨f⟩⟩
326296
discrete_cases
327297
rcases f
328298
aesop_cat)
329299
(Discrete.natIso <| fun ⟨X⟩ => Iso.refl _)
300+
330301
/-
302+
Porting note:
303+
The following is what was generated by mathport:
304+
331305
refine'
332306
Equivalence.mk (F.leftOp) F _
333307
(Discrete.natIso fun X =>
@@ -361,4 +335,3 @@ theorem functor_map_id (F : Discrete J ⥤ C) {j : Discrete J} (f : j ⟶ j) : F
361335
end Discrete
362336

363337
end CategoryTheory
364-

0 commit comments

Comments
 (0)