@@ -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. -/
126119macro "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. -/
156149abbrev 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]
172165instance {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`.-/
179169def 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,
214202a natural transformation is just a collection of maps,
215203as the naturality squares are trivial.
@@ -218,24 +206,20 @@ as the naturality squares are trivial.
218206def 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,
232217a natural isomorphism is just a collection of isomorphisms,
233218as the naturality squares are trivial.
234219-/
235220@[simps!]
236221def 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
271249an 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]
294272def equivOfEquivalence {α : Type u₁} {β : Type u₂} (h : Discrete α ≌ Discrete β) : α ≃ β
295273 where
@@ -307,27 +285,23 @@ variable {J : Type v₁}
307285
308286open 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]
318290protected 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
361335end Discrete
362336
363337end CategoryTheory
364-
0 commit comments