Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus.
On Mac, use
Cmd instead of
Ctrl .
/-
Copyright (c) 2023 Antoine Labelle. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Antoine Labelle
! This file was ported from Lean 3 source module combinatorics.quiver.single_obj
! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Combinatorics.Quiver.Cast
import Mathlib.Combinatorics.Quiver.Symmetric
/-!
# Single-object quiver
Single object quiver with a given arrows type.
## Main definitions
Given a type `α`, `SingleObj α` is the `Unit` type, whose single object is called `star α`, with
`Quiver` structure such that `star α ⟶ star α` is the type `α`.
An element `x : α` can be reinterpreted as an element of `star α ⟶ star α` using
`toHom`.
More generally, a list of elements of `a` can be reinterpreted as a path from `star α` to
itself using `pathEquivList`.
-/
namespace Quiver
/-- Type tag on `Unit` used to define single-object quivers. -/
-- Porting note: Removed `deriving Unique`.
@[ nolint unusedArguments ]
def SingleObj ( _ : Type _ ) : Type :=
Unit
#align quiver.single_obj Quiver.SingleObj
-- Porting note: `deriving` from above has been moved to below.
instance : Unique ( SingleObj α ) where
default := ⟨⟩
uniq := fun _ => rfl : ∀ {α : Sort ?u.30} {a : α }, a = a rfl
namespace SingleObj
variable ( α β γ : Type _ )
instance : Quiver : Type ?u.103 → Type (max?u.103?u.104) Quiver ( SingleObj α ) :=
⟨ fun _ _ => α ⟩
/-- The single object in `SingleObj α`. -/
def star : SingleObj α :=
Unit.unit
#align quiver.single_obj.star Quiver.SingleObj.star
instance : Inhabited : Sort ?u.205 → Sort (max1?u.205) Inhabited ( SingleObj α ) :=
⟨ star α ⟩
variable { α β γ }
lemma ext { x y : SingleObj α } : x = y := Unit.ext : ∀ (x y : Unit ), x = y Unit.ext x y
-- See note [reducible non-instances]
/-- Equip `SingleObj α` with a reverse operation. -/
@[reducible]
def hasReverse ( rev : α → α ) : HasReverse : (V : Type ?u.302) → [inst : Quiver V ] → Type (max?u.302?u.303) HasReverse ( SingleObj α ) := ⟨ rev ⟩
#align quiver.single_obj.has_reverse Quiver.SingleObj.hasReverse
-- See note [reducible non-instances]
/-- Equip `SingleObj α` with an involutive reverse operation. -/
@[reducible]
def hasInvolutiveReverse ( rev : α → α ) ( h : Function.Involutive : {α : Sort ?u.459} → (α → α ) → Prop Function.Involutive rev ) :
HasInvolutiveReverse : (V : Type ?u.466) → [inst : Quiver V ] → Type (max?u.466?u.467) HasInvolutiveReverse ( SingleObj α ) where
toHasReverse := hasReverse rev
inv' := h
#align quiver.single_obj.has_involutive_reverse Quiver.SingleObj.hasInvolutiveReverse
/-- The type of arrows from `star α` to itself is equivalent to the original type `α`. -/
@[ simps! ]
def toHom : α ≃ ( star α ⟶ star α ) :=
Equiv.refl : (α : Sort ?u.650) → α ≃ α Equiv.refl _
#align quiver.single_obj.to_hom Quiver.SingleObj.toHom
#align quiver.single_obj.to_hom_apply Quiver.SingleObj.toHom_apply : ∀ {α : Type u_1} (a : α ), ↑toHom a = a Quiver.SingleObj.toHom_apply
#align quiver.single_obj.to_hom_symm_apply Quiver.SingleObj.toHom_symm_apply : ∀ {α : Type u_1} (a : α ), ↑toHom .symm a = a Quiver.SingleObj.toHom_symm_apply
/-- Prefunctors between two `SingleObj` quivers correspond to functions between the corresponding
arrows types.
-/
@[ simps : ∀ {α : Type u_1} {β : Type u_2} (f : α → β ) {X Y : SingleObj α } (a : α ), (↑toPrefunctor f ).map a = f a simps ]
def toPrefunctor : ( α → β ) ≃ SingleObj α ⥤q SingleObj β where
toFun f := ⟨ id : {α : Sort ?u.846} → α → α id, f ⟩
invFun f a := f . map : {V : Type ?u.880} →
[inst : Quiver V ] →
{W : Type ?u.879} → [inst_1 : Quiver W ] → (self : V ⥤q W ) → {X Y : V } → (X ⟶ Y ) → (self .obj X ⟶ self .obj Y ) map ( toHom a )
left_inv _ := rfl : ∀ {α : Sort ?u.966} {a : α }, a = a rfl
right_inv _ := rfl : ∀ {α : Sort ?u.989} {a : α }, a = a rfl
#align quiver.single_obj.to_prefunctor_symm_apply Quiver.SingleObj.toPrefunctor_symm_apply : ∀ {α : Type u_1} {β : Type u_2} (f : SingleObj α ⥤q SingleObj β ) (a : α ), ↑toPrefunctor .symm f a = f .map (↑toHom a ) Quiver.SingleObj.toPrefunctor_symm_apply
#align quiver.single_obj.to_prefunctor_apply_map Quiver.SingleObj.toPrefunctor_apply_map : ∀ {α : Type u_1} {β : Type u_2} (f : α → β ) {X Y : SingleObj α } (a : α ), (↑toPrefunctor f ).map a = f a Quiver.SingleObj.toPrefunctor_apply_map
#align quiver.single_obj.to_prefunctor_apply_obj Quiver.SingleObj.toPrefunctor_apply_obj : ∀ {α : Type u_1} {β : Type u_2} (f : α → β ) (a : SingleObj α ), (↑toPrefunctor f ).obj a = id a Quiver.SingleObj.toPrefunctor_apply_obj
#align quiver.single_obj.to_prefunctor Quiver.SingleObj.toPrefunctor
theorem toPrefunctor_id : toPrefunctor id : {α : Sort ?u.1594} → α → α id = 𝟭q ( SingleObj α ) :=
rfl : ∀ {α : Sort ?u.1669} {a : α }, a = a rfl
#align quiver.single_obj.to_prefunctor_id Quiver.SingleObj.toPrefunctor_id : ∀ {α : Type u_1}, ↑toPrefunctor id = 𝟭q (SingleObj α ) Quiver.SingleObj.toPrefunctor_id
@[ simp ]
theorem toPrefunctor_symm_id : ∀ {α : Type u_1}, ↑toPrefunctor .symm (𝟭q (SingleObj α ) ) = id toPrefunctor_symm_id : toPrefunctor . symm : {α : Sort ?u.1719} → {β : Sort ?u.1718} → α ≃ β → β ≃ α symm ( 𝟭q ( SingleObj α )) = id : {α : Sort ?u.1830} → α → α id :=
rfl : ∀ {α : Sort ?u.1880} {a : α }, a = a rfl
#align quiver.single_obj.to_prefunctor_symm_id Quiver.SingleObj.toPrefunctor_symm_id : ∀ {α : Type u_1}, ↑toPrefunctor .symm (𝟭q (SingleObj α ) ) = id Quiver.SingleObj.toPrefunctor_symm_id
theorem toPrefunctor_comp : ∀ {α : Type u_1} {β : Type u_3} {γ : Type u_2} (f : α → β ) (g : β → γ ),
↑toPrefunctor (g ∘ f ) = ↑toPrefunctor f ⋙q ↑toPrefunctor g toPrefunctor_comp ( f : α → β ) ( g : β → γ ) :
toPrefunctor ( g ∘ f ) = toPrefunctor f ⋙q toPrefunctor g :=
rfl : ∀ {α : Sort ?u.2275} {a : α }, a = a rfl
#align quiver.single_obj.to_prefunctor_comp Quiver.SingleObj.toPrefunctor_comp : ∀ {α : Type u_1} {β : Type u_3} {γ : Type u_2} (f : α → β ) (g : β → γ ),
↑toPrefunctor (g ∘ f ) = ↑toPrefunctor f ⋙q ↑toPrefunctor g Quiver.SingleObj.toPrefunctor_comp
@[ simp ]
theorem toPrefunctor_symm_comp ( f : SingleObj α ⥤q SingleObj β ) ( g : SingleObj β ⥤q SingleObj γ ) :
toPrefunctor . symm : {α : Sort ?u.2377} → {β : Sort ?u.2376} → α ≃ β → β ≃ α symm ( f ⋙q g ) = toPrefunctor . symm : {α : Sort ?u.2575} → {β : Sort ?u.2574} → α ≃ β → β ≃ α symm g ∘ toPrefunctor . symm : {α : Sort ?u.2678} → {β : Sort ?u.2677} → α ≃ β → β ≃ α symm f := by
↑toPrefunctor .symm (f ⋙q g ) = ↑toPrefunctor .symm g ∘ ↑toPrefunctor .symm f simp only [ Equiv.symm_apply_eq : ∀ {α : Sort ?u.2800} {β : Sort ?u.2801} (e : α ≃ β ) {x : β } {y : (fun x => α ) x }, ↑e .symm x = y ↔ x = ↑e y Equiv.symm_apply_eq, toPrefunctor_comp : ∀ {α : Type ?u.2836} {β : Type ?u.2838} {γ : Type ?u.2837} (f : α → β ) (g : β → γ ),
↑toPrefunctor (g ∘ f ) = ↑toPrefunctor f ⋙q ↑toPrefunctor g toPrefunctor_comp, Equiv.apply_symm_apply : ∀ {α : Sort ?u.2876} {β : Sort ?u.2875} (e : α ≃ β ) (x : β ), ↑e (↑e .symm x ) = x Equiv.apply_symm_apply]
#align quiver.single_obj.to_prefunctor_symm_comp Quiver.SingleObj.toPrefunctor_symm_comp
/-- Auxiliary definition for `quiver.SingleObj.pathEquivList`.
Converts a path in the quiver `single_obj α` into a list of elements of type `a`.
-/
def pathToList : ∀ { x : SingleObj α }, Path : {V : Type ?u.3401} → [inst : Quiver V ] → V → V → Sort (max(?u.3401+1)?u.3402) Path ( star α ) x → List α
| _, Path.nil => []
| _, Path.cons : {V : Type ?u.3487} → [inst : Quiver V ] → {a b c : V } → Path a b → (b ⟶ c ) → Path a c Path.cons p a => a :: pathToList p
#align quiver.single_obj.path_to_list Quiver.SingleObj.pathToList
/-- Auxiliary definition for `quiver.SingleObj.pathEquivList`.
Converts a list of elements of type `α` into a path in the quiver `SingleObj α`.
-/
@[ simp ]
def listToPath : List α → Path : {V : Type ?u.4170} → [inst : Quiver V ] → V → V → Sort (max(?u.4170+1)?u.4171) Path ( star α ) ( star α )
| [] => Path.nil
| a :: l => ( listToPath l ). cons a
#align quiver.single_obj.list_to_path Quiver.SingleObj.listToPath
theorem listToPath_pathToList { x : SingleObj α } ( p : Path : {V : Type ?u.4814} → [inst : Quiver V ] → V → V → Sort (max(?u.4814+1)?u.4815) Path ( star α ) x ) :
listToPath ( pathToList p ) = p . cast : {U : Type ?u.4862} → [inst : Quiver U ] → {u v u' v' : U } → u = u' → v = v' → Path u v → Path u' v' cast rfl : ∀ {α : Sort ?u.4879} {a : α }, a = a rfl ext := by
induction' p with y z p a ih
· rfl
· dsimp at * ; rw [ ih ]
#align quiver.single_obj.path_to_list_to_path Quiver.SingleObj.listToPath_pathToList
theorem pathToList_listToPath ( l : List α ) : pathToList ( listToPath l ) = l := by
induction' l with a l ih
· rfl
· change a :: pathToList ( listToPath l ) = a :: l ; rw [ ih ]
#align quiver.single_obj.list_to_path_to_list Quiver.SingleObj.pathToList_listToPath
/-- Paths in `SingleObj α` quiver correspond to lists of elements of type `α`. -/
def pathEquivList : Path : {V : Type ?u.5284} → [inst : Quiver V ] → V → V → Sort (max(?u.5284+1)?u.5285) Path ( star α ) ( star α ) ≃ List α :=
⟨ pathToList , listToPath , fun p => listToPath_pathToList p , pathToList_listToPath ⟩
#align quiver.single_obj.path_equiv_list Quiver.SingleObj.pathEquivList
@[ simp ]
theorem pathEquivList_nil : ∀ {α : Type u_1}, ↑pathEquivList Path.nil = [] pathEquivList_nil : pathEquivList Path.nil = ( [] : List α ) :=
rfl : ∀ {α : Sort ?u.5550} {a : α }, a = a rfl
#align quiver.single_obj.path_equiv_list_nil Quiver.SingleObj.pathEquivList_nil : ∀ {α : Type u_1}, ↑pathEquivList Path.nil = [] Quiver.SingleObj.pathEquivList_nil
@[ simp ]
theorem pathEquivList_cons ( p : Path : {V : Type ?u.5604} → [inst : Quiver V ] → V → V → Sort (max(?u.5604+1)?u.5605) Path ( star α ) ( star α )) ( a : star α ⟶ star α ) :
pathEquivList ( Path.cons : {V : Type ?u.5727} → [inst : Quiver V ] → {a b c : V } → Path a b → (b ⟶ c ) → Path a c Path.cons p a ) = a :: pathToList p :=
rfl : ∀ {α : Sort ?u.5776} {a : α }, a = a rfl
#align quiver.single_obj.path_equiv_list_cons Quiver.SingleObj.pathEquivList_cons
@[ simp ]
theorem pathEquivList_symm_nil : ∀ {α : Type u_1}, ↑pathEquivList .symm [] = Path.nil pathEquivList_symm_nil : pathEquivList . symm : {α : Sort ?u.5850} → {β : Sort ?u.5849} → α ≃ β → β ≃ α symm ( [] : List α ) = Path.nil :=
rfl : ∀ {α : Sort ?u.6010} {a : α }, a = a rfl
#align quiver.single_obj.path_equiv_list_symm_nil Quiver.SingleObj.pathEquivList_symm_nil : ∀ {α : Type u_1}, ↑pathEquivList .symm [] = Path.nil Quiver.SingleObj.pathEquivList_symm_nil
@[ simp ]
theorem pathEquivList_symm_cons : ∀ {α : Type u_1} (l : List α ) (a : α ), ↑pathEquivList .symm (a :: l ) = Path.cons (↑pathEquivList .symm l ) a pathEquivList_symm_cons ( l : List α ) ( a : α ) :
pathEquivList . symm : {α : Sort ?u.6072} → {β : Sort ?u.6071} → α ≃ β → β ≃ α symm ( a :: l ) = Path.cons : {V : Type ?u.6145} → [inst : Quiver V ] → {a b c : V } → Path a b → (b ⟶ c ) → Path a c Path.cons ( pathEquivList . symm : {α : Sort ?u.6155} → {β : Sort ?u.6154} → α ≃ β → β ≃ α symm l ) a :=
rfl : ∀ {α : Sort ?u.6272} {a : α }, a = a rfl
#align quiver.single_obj.path_equiv_list_symm_cons Quiver.SingleObj.pathEquivList_symm_cons : ∀ {α : Type u_1} (l : List α ) (a : α ), ↑pathEquivList .symm (a :: l ) = Path.cons (↑pathEquivList .symm l ) a Quiver.SingleObj.pathEquivList_symm_cons
end SingleObj
end Quiver