File: Mathlib/Combinatorics/Quiver/Symmetric.lean

full_name: Quiver.Symmetrify
code: /-- A type synonym for the symmetrized quiver (with an arrow both ways for each original arrow).
    NB: this does not work for `Prop`-valued quivers. It requires `[Quiver.{v+1} V]`. -/
-- Porting note: no hasNonemptyInstance linter yet
def Symmetrify (V : Type*) 
goal: Type u_1

full_name: Quiver.symmetrifyQuiver
code: instance symmetrifyQuiver (V : Type u) [Quiver V] : Quiver (Symmetrify V) 
goal: Quiver (Quiver.Symmetrify V)

full_name: Quiver.HasReverse.reverse'
code: /-- A quiver `HasReverse` if we can reverse an arrow `p` from `a` to `b` to get an arrow
    `p.reverse` from `b` to `a`. -/
class HasReverse where
  /-- the map which sends an arrow to its reverse -/
  reverse' : ∀ {a b : V}, (a ⟶ b) → (b ⟶ a)
goal: (a ⟶ b) → (b ⟶ a)

full_name: Quiver.HasReverse
code: /-- A quiver `HasReverse` if we can reverse an arrow `p` from `a` to `b` to get an arrow
    `p.reverse` from `b` to `a`. -/
class HasReverse where
  /-- the map which sends an arrow to its reverse -/
  reverse' : ∀ {a b : V}, (a ⟶ b) → (b ⟶ a)
goal: Type (max u_2 v)

full_name: Quiver.reverse
code: /-- Reverse the direction of an arrow. -/
def reverse {V} [Quiver.{v + 1} V] [HasReverse V] {a b : V} : (a ⟶ b) → (b ⟶ a) 
goal: (a ⟶ b) → (b ⟶ a)

full_name: Quiver.HasInvolutiveReverse
code: /-- A quiver `HasInvolutiveReverse` if reversing twice is the identity. -/
class HasInvolutiveReverse extends HasReverse V where
  /-- `reverse` is involutive -/
  inv' : ∀ {a b : V} (f : a ⟶ b), reverse (reverse f) = f
goal: Type (max u_2 v)

full_name: Quiver.HasInvolutiveReverse.inv'
code: /-- A quiver `HasInvolutiveReverse` if reversing twice is the identity. -/
class HasInvolutiveReverse extends HasReverse V where
  /-- `reverse` is involutive -/
  inv' : ∀ {a b : V} (f : a ⟶ b), reverse (reverse f) = f
goal: Quiver.reverse (Quiver.reverse f) = f

full_name: Quiver.reverse_reverse
code: @[simp]
theorem reverse_reverse [h : HasInvolutiveReverse V] {a b : V} (f : a ⟶ b) :
    reverse (reverse f) = f 
goal: Quiver.reverse (Quiver.reverse f) = f

full_name: Quiver.reverse_inj
code: @[simp]
theorem reverse_inj [h : HasInvolutiveReverse V] {a b : V}
    (f g : a ⟶ b) : reverse f = reverse g ↔ f = g 
goal: Quiver.reverse f = Quiver.reverse g ↔ f = g

full_name: Quiver.eq_reverse_iff
code: theorem eq_reverse_iff [h : HasInvolutiveReverse V] {a b : V} (f : a ⟶ b)
    (g : b ⟶ a) : f = reverse g ↔ reverse f = g 
goal: f = Quiver.reverse g ↔ Quiver.reverse f = g

full_name: Prefunctor.MapReverse.map_reverse'
code: /-- A prefunctor preserving reversal of arrows -/
class _root_.Prefunctor.MapReverse (φ : U ⥤q V) : Prop where
  /-- The image of a reverse is the reverse of the image. -/
  map_reverse' : ∀ {u v : U} (e : u ⟶ v), φ.map (reverse e) = reverse (φ.map e)
goal: φ.map (Quiver.reverse e) = Quiver.reverse (φ.map e)

full_name: Prefunctor.MapReverse
code: /-- A prefunctor preserving reversal of arrows -/
class _root_.Prefunctor.MapReverse (φ : U ⥤q V) : Prop where
  /-- The image of a reverse is the reverse of the image. -/
  map_reverse' : ∀ {u v : U} (e : u ⟶ v), φ.map (reverse e) = reverse (φ.map e)
goal: Prop

full_name: Prefunctor.map_reverse
code: @[simp]
theorem _root_.Prefunctor.map_reverse (φ : U ⥤q V) [φ.MapReverse]
    {u v : U} (e : u ⟶ v) : φ.map (reverse e) = reverse (φ.map e) 
goal: φ.map (Quiver.reverse e) = Quiver.reverse (φ.map e)

full_name: Prefunctor.mapReverseComp
code: instance _root_.Prefunctor.mapReverseComp
    (φ : U ⥤q V) (ψ : V ⥤q W) [φ.MapReverse] [ψ.MapReverse] :
    (φ ⋙q ψ).MapReverse 
goal: (φ ⋙q ψ).MapReverse

full_name: Prefunctor.mapReverseId
code: instance _root_.Prefunctor.mapReverseId :
    (Prefunctor.id U).MapReverse 
goal: (𝟭q U).MapReverse

full_name: Quiver.instHasReverseSymmetrify
code: instance : HasReverse (Symmetrify V) 
goal: Quiver.HasReverse (Quiver.Symmetrify V)

full_name: Quiver.instHasInvolutiveReverseSymmetrify
code: instance :
    HasInvolutiveReverse
      (Symmetrify V) 
goal: Quiver.HasInvolutiveReverse (Quiver.Symmetrify V)

full_name: Quiver.symmetrify_reverse
code: @[simp]
theorem symmetrify_reverse {a b : Symmetrify V} (e : a ⟶ b) : reverse e = e.swap 
goal: Quiver.reverse e = Sum.swap e

full_name: Quiver.Hom.toPos
code: /-- Shorthand for the "forward" arrow corresponding to `f` in `symmetrify V` -/
abbrev Hom.toPos {X Y : V} (f : X ⟶ Y) : (Quiver.symmetrifyQuiver V).Hom X Y 
goal: X ⟶ Y

full_name: Quiver.Hom.toNeg
code: /-- Shorthand for the "backward" arrow corresponding to `f` in `symmetrify V` -/
abbrev Hom.toNeg {X Y : V} (f : X ⟶ Y) : (Quiver.symmetrifyQuiver V).Hom Y X 
goal: Y ⟶ X

full_name: Quiver.Path.reverse
code: /-- Reverse the direction of a path. -/
@[simp]
def Path.reverse [HasReverse V] {a : V} : ∀ {b}, Path a b → Path b a
  
goal: Quiver.Path a b → Quiver.Path b a

full_name: Quiver.Path.reverse_toPath
code: @[simp]
theorem Path.reverse_toPath [HasReverse V] {a b : V} (f : a ⟶ b) :
    f.toPath.reverse = (Quiver.reverse f).toPath 
goal: f.toPath.reverse = (Quiver.reverse f).toPath

full_name: Quiver.Path.reverse_comp
code: @[simp]
theorem Path.reverse_comp [HasReverse V] {a b c : V} (p : Path a b) (q : Path b c) :
    (p.comp q).reverse = q.reverse.comp p.reverse 
goal: (p.comp q).reverse = q.reverse.comp p.reverse

full_name: Quiver.Path.reverse_reverse
code: @[simp]
theorem Path.reverse_reverse [h : HasInvolutiveReverse V] {a b : V} (p : Path a b) :
    p.reverse.reverse = p 
goal: p.reverse.reverse = p

full_name: Quiver.Symmetrify.of
code: /-- The inclusion of a quiver in its symmetrification -/
def of : Prefunctor V (Symmetrify V) 
goal: V ⥤q Quiver.Symmetrify V

full_name: Quiver.Symmetrify.lift
code: /-- Given a quiver `V'` with reversible arrows, a prefunctor to `V'` can be lifted to one from
    `Symmetrify V` to `V'` -/
def lift [HasReverse V'] (φ : Prefunctor V V') :
    Prefunctor (Symmetrify V) V' 
goal: Quiver.Symmetrify V ⥤q V'

full_name: Quiver.Symmetrify.lift_spec
code: theorem lift_spec [HasReverse V'] (φ : Prefunctor V V') :
    Symmetrify.of.comp (Symmetrify.lift φ) = φ 
goal: Quiver.Symmetrify.of ⋙q Quiver.Symmetrify.lift φ = φ

full_name: Quiver.Symmetrify.lift_reverse
code: theorem lift_reverse [h : HasInvolutiveReverse V']
    (φ : Prefunctor V V') {X Y : Symmetrify V} (f : X ⟶ Y) :
    (Symmetrify.lift φ).map (Quiver.reverse f) = Quiver.reverse ((Symmetrify.lift φ).map f) 
goal: (Quiver.Symmetrify.lift φ).map (Quiver.reverse f) = Quiver.reverse ((Quiver.Symmetrify.lift φ).map f)

full_name: Quiver.Symmetrify.lift_unique
code: /-- `lift φ` is the only prefunctor extending `φ` and preserving reverses. -/
theorem lift_unique [HasReverse V'] (φ : V ⥤q V') (Φ : Symmetrify V ⥤q V') (hΦ : (of ⋙q Φ) = φ)
    (hΦinv : ∀ {X Y : Symmetrify V} (f : X ⟶ Y),
      Φ.map (Quiver.reverse f) = Quiver.reverse (Φ.map f)) :
    Φ = Symmetrify.lift φ 
goal: Φ = Quiver.Symmetrify.lift φ

full_name: Prefunctor.symmetrify
code: /-- A prefunctor canonically defines a prefunctor of the symmetrifications. -/
@[simps]
def _root_.Prefunctor.symmetrify (φ : U ⥤q V) : Symmetrify U ⥤q Symmetrify V 
goal: Quiver.Symmetrify U ⥤q Quiver.Symmetrify V

full_name: Prefunctor.symmetrify_map
code: /-- A prefunctor canonically defines a prefunctor of the symmetrifications. -/
@[simps]
def _root_.Prefunctor.symmetrify (φ : U ⥤q V) : Symmetrify U ⥤q Symmetrify V 
goal: ∀ {X Y : Quiver.Symmetrify U} (a : (X ⟶ Y) ⊕ (Y ⟶ X)), φ.symmetrify.map a = Sum.map φ.map φ.map a

full_name: Prefunctor.symmetrify_obj
code: /-- A prefunctor canonically defines a prefunctor of the symmetrifications. -/
@[simps]
def _root_.Prefunctor.symmetrify (φ : U ⥤q V) : Symmetrify U ⥤q Symmetrify V 
goal: ∀ (a : U), φ.symmetrify.obj a = φ.obj a

full_name: Prefunctor.symmetrify_mapReverse
code: instance _root_.Prefunctor.symmetrify_mapReverse (φ : U ⥤q V) :
    Prefunctor.MapReverse φ.symmetrify 
goal: φ.symmetrify.MapReverse

full_name: Quiver.Push.instHasReverse
code: instance [HasReverse V] : HasReverse (Quiver.Push σ) 
goal: Quiver.HasReverse (Quiver.Push σ)

full_name: Quiver.Push.instHasInvolutiveReverse
code: instance [h : HasInvolutiveReverse V] :
    HasInvolutiveReverse (Push σ) 
goal: Quiver.HasInvolutiveReverse (Quiver.Push σ)

full_name: Quiver.Push.of_reverse
code: theorem of_reverse [HasInvolutiveReverse V] (X Y : V) (f : X ⟶ Y) :
    (reverse <| (Push.of σ).map f) = (Push.of σ).map (reverse f) 
goal: Quiver.reverse ((Quiver.Push.of σ).map f) = (Quiver.Push.of σ).map (Quiver.reverse f)

full_name: Quiver.Push.ofMapReverse
code: instance ofMapReverse [h : HasInvolutiveReverse V] : (Push.of σ).MapReverse 
goal: (Quiver.Push.of σ).MapReverse

full_name: Quiver.IsPreconnected
code: /-- A quiver is preconnected iff there exists a path between any pair of
vertices.
Note that if `V` doesn't `HasReverse`, then the definition is stronger than
simply having a preconnected underlying `SimpleGraph`, since a path in one
direction doesn't induce one in the other.
-/
def IsPreconnected (V) [Quiver.{u + 1} V] 
goal: Prop