@@ -51,7 +51,9 @@ namespace CategoryTheory.Quiv
5151open Opposite
5252universe w₂ w₁ w' w v₂ v₁ v u₂ u₁ u
5353
54+ /-- Convenience instance so we can write `0 : WalkingParallelPairᵒᵖ := op .zero. -/
5455scoped instance : Zero (WalkingParallelPairᵒᵖ) := ⟨.op .zero⟩
56+ /-- Convenience instance so we can write `1 : WalkingParallelPairᵒᵖ := op .one. -/
5557scoped instance : One (WalkingParallelPairᵒᵖ) := ⟨.op .one⟩
5658
5759@ [simp← ] lemma WalkingQuiver.zero_def : (0 : WalkingParallelPairᵒᵖ) = .op .zero := rfl
@@ -91,6 +93,7 @@ abbrev src (e : F.obj 1) := F.map (Quiver.Hom.op .left) e
9193corresponding quiver. -/
9294abbrev tgt (e : F.obj 1 ) := F.map (Quiver.Hom.op .right) e
9395
96+ /-- Hint to help lean recognize edge types. -/
9497unif_hint hom_eq_asFunctor1 (X : Quiv.{v, u}) where
9598 ⊢ (s t : ULift.{max w v} X) × (s.1 ⟶ t.1 ) ≟ (asFunctor.{w} X).obj 1
9699
@@ -99,9 +102,9 @@ unif_hint hom_eq_asFunctor1 (X : Quiv.{v, u}) where
99102@[simp] lemma asFunctor_tgt (e : (s t : ULift X) × (s.1 ⟶ t.1 )) :
100103 tgt e = e.2 .1 := rfl
101104
102- @[simp] lemma src_asFunctor {s t : ULift X} (e : (s.1 ⟶ t.1 )) :
105+ lemma src_asFunctor {s t : ULift X} (e : (s.1 ⟶ t.1 )) :
103106 src (⟨s, t, e⟩ : (asFunctor.{w} X).obj 1 ) = s := rfl
104- @[simp] lemma tgt_asFunctor {s t : ULift X} (e : (s.1 ⟶ t.1 )) :
107+ lemma tgt_asFunctor {s t : ULift X} (e : (s.1 ⟶ t.1 )) :
105108 tgt (⟨s, t, e⟩ : (asFunctor.{w} X).obj 1 ) = t := rfl
106109
107110@[ext]
@@ -114,8 +117,6 @@ lemma asFunctor.hom_ext (f g : (s t : ULift.{max w v} X) × (s.1 ⟶ t.1))
114117 congr
115118 exact heq_iff_eq.mp he
116119
117- attribute [simp high] asFunctor.hom_ext_iff
118-
119120/-- The type of vertices of a quiver in functor form. -/
120121abbrev Vertex (F : WalkingParallelPairᵒᵖ ⥤ Type w) := F.obj 0
121122/-- The type of all edges of a quiver in functor form. -/
@@ -181,14 +182,9 @@ lemma edge_disjoint {F : WalkingParallelPairᵒᵖ ⥤ Type w}
181182 (st₁ st₂ : Vertex F × Vertex F) (h : st₁ ≠ st₂) :
182183 Function.onFun Disjoint (fun st' ↦ {e.1 | e : Edge F st'.1 st'.2 }) st₁ st₂ := by
183184 intro es hst₁ hst₂ e he
184- specialize hst₁ he
185- specialize hst₂ he
186- simp only [Set.mem_setOf_eq] at hst₁ hst₂
187- rcases hst₁ with ⟨⟨e₁, hs₁, ht₁⟩, he₁⟩
188- rcases hst₂ with ⟨⟨e₂, hs₂, ht₂⟩, he₂⟩
189- simp only at he₁ he₂; subst he₁ he₂
190- have : st₁ = st₂ := by ext <;> simp_all
191- contradiction
185+ rcases hst₁ he with ⟨⟨e₁, hs₁, ht₁⟩, ⟨⟩⟩
186+ rcases hst₂ he with ⟨⟨e₂, hs₂, ht₂⟩, ⟨⟩⟩
187+ grind
192188
193189/-- We can cast an `Edge` along paired equalities of its source and target.
194190Unlike `Quiver.Hom` and `homOfEq`, the source and target are internally only tracked
@@ -256,6 +252,7 @@ instance {Q : Quiv.{v, u}} {s t : Vertex Q.asFunctor} :
256252 right_inv e := rfl
257253 }⟩⟩
258254
255+ /-- Recursor for assigning a more precise type to an edge of a quiver in functor form. -/
259256@[elab_as_elim]
260257def map_hom {motive : (F.obj 1 ) → Sort *}
261258 (f : {s t : Vertex F} → (e : Edge F s t) → motive e) (e : F.obj 1 ) : motive e :=
@@ -278,7 +275,7 @@ by hand. -/
278275lemma naturality_tgt (f : F.obj 1 ) : tgt (μ.app 1 f) = (μ.app 0 (tgt f)) := by
279276 simpa using congrFun (μ.naturality ⟨.right⟩).symm f
280277
281- /-- The image of an precisely-typed edge under a natural transformation. -/
278+ /-- The image of a precisely-typed edge under a natural transformation. -/
282279def natTransEdge (f : Edge F s t) : Edge G (μ.app 0 s) (μ.app 0 t) :=
283280 Subtype.map (μ.app 1 ) (fun e ⟨hs, ht⟩ ↦ by simp [hs, ht]) f
284281
@@ -327,17 +324,20 @@ lemma naturality_tgt_up {f : F.obj 1} :
327324lemma naturality_tgt_down {f : ULift (F.obj 1 )} :
328325 tgt f.down = ULift.down (@tgt (F ⋙ uliftFunctor.{w'}) f) := by rfl
329326
330- def natTransEdge_up {f : F.obj 1 } :
327+ /-- The image of an edge under composition with `uliftFunctor`. -/
328+ def natTransEdgeUp {f : F.obj 1 } :
331329 Edge (F ⋙ uliftFunctor.{w'}) (ULift.up (src f)) (ULift.up (tgt f)) :=
332330 ⟨ULift.up f, by simp⟩
333331
334- def natTransEdge_down (f : ULift (F.obj 1 )) :
332+ /-- The image of a `ULift`ed edge under `ULift.down`. -/
333+ def natTransEdgeDown (f : ULift (F.obj 1 )) :
335334 Edge F (ULift.down (@src (F ⋙ uliftFunctor.{w'}) f))
336335 (ULift.down (@tgt (F ⋙ uliftFunctor.{w'}) f)) :=
337336 ⟨ULift.down f, by simp [naturality_src_down, naturality_tgt_down]⟩
338337
339338namespace asFunctor
340339
340+ /-- The image of a precisely-typed edge between `asFunctor`s under a natural transformation. -/
341341def natTransEdge
342342 (μ : X.asFunctor ⟶ Y.asFunctor) {s t : X} (f : s ⟶ t) :
343343 Y.str.Hom (μ.app 0 ⟨s⟩).1 (μ.app 0 ⟨t⟩).1 :=
0 commit comments