lib.graph-families.CycleGraph.md.

Version of Sunday, January 22, 2023, 10:42 PM

Powered by agda version 2.6.2.2-442c76b and pandoc 2.14.0.3


Investigations on graph-theoretical constructions in Homotopy type theory

Jonathan Prieto-Cubides j.w.w. Håkon Robbestad Gylterud

Department of Informatics

University of Bergen, Norway

{-# OPTIONS --without-K --exact-split #-}

open import foundations.Core using (Level)
module lib.graph-families.CycleGraph ( : Level)
  where
  open import foundations.Core
  open import lib.graph-definitions.Graph
  open Graph
  open import foundations.Fin 
       renaming (fin-pred to pred ; fin-suc to suc)

  open import lib.graph-classes.UnitGraph
  open import lib.graph-relations.Isomorphic


  Cycle :   Graph 
  Cycle zero = 𝟙-graph 
  Cycle (succ n) = graph  succ n 
                   x y  x  pred y)
                  (Fin-is-set)
                   _ _  set-is-groupoid Fin-is-set _ _)

  syntax Cycle n =  n

  module _ where

    open import lib.graph-classes.UnitGraph

    Cycle-is-inj : (n m : )  Cycle n  Cycle m  n  m
    Cycle-is-inj zero zero _ = idp
    Cycle-is-inj zero (succ m) Cn=Cm
      = ⊥-elim (π₂ (π₂ (v (pred (zero , unit) , (zero , unit) , idp))))
      where
      v : (∑[ x ] ∑[ y ] Edge (Cycle (succ m)) x y)
         (∑[ x ] ∑[ y ] Edge (𝟙-graph ) x y)
      v f = tr  G  ∑[ x ] ∑[ y ] Edge G x y) (! Cn=Cm) f

    Cycle-is-inj (succ n) zero Cn=Cm
      = ⊥-elim (π₂ (π₂ (v (pred (zero , unit) , (zero , unit) , idp))))
      where
      v : ∑[ x ] ∑[ y ] Edge (Cycle (succ n)) x y
         ∑[ x ] ∑[ y ] Edge (𝟙-graph ) x y
      v f = tr  G  ∑[ x ] ∑[ y ] Edge G x y) Cn=Cm f

    Cycle-is-inj (succ n) (succ m) Cn=Cm
      = Fin₁-is-inj-≃ (succ n) (succ m) (π₁ (apply (equiv-principle) Cn=Cm))
      where
      open import lib.graph-definitions.Graph.EquivalencePrinciple
      open EquivPrinciple (Cycle (succ n)) (Cycle (succ m))


  Edge-Cn-is-prop
    :  {n}{x y : Node ( n)}
     isProp (Edge ( n) x y)
  Edge-Cn-is-prop {n = succ n} {x}{y} = Fin-is-set _ _

  -- However, in the undirected version of a this graph,
  -- the above lemma only holds when n≥3.

  open import lib.graph-transformations.U
  open import foundations.Nat 

  Edge-Undirected-Cn-is-prop
    :  {n : }
     (x y : Node (Cycle (n +ℕ 3 )))
     isProp (Edge (U (Cycle (n +ℕ 3))) x y)
  Edge-Undirected-Cn-is-prop {zero} x y
    = +-prop (Edge-Cn-is-prop {n = 3} {y = y})
              (Edge-Cn-is-prop {n = 3}) λ {(p , q )  helper (p , q)}
              where
              helper : ¬ (Edge (Cycle 3) x y × Edge (Cycle 3) y x)
              helper (p , q)  rewrite p
                 = ⊥-from-fin-predx=y+x=fin-predy {k = 0} (ap pred p · ! q) p
  Edge-Undirected-Cn-is-prop {n@(succ _)} x y
    = +-prop (Edge-Cn-is-prop {succ _}) (Edge-Cn-is-prop {succ _}) helper
    where
      helper : ¬ (Edge (Cycle (n +ℕ 3)) x y × Edge (Cycle (n +ℕ 3)) y x)
      helper (p , q) rewrite p = ⊥-from-fin-predx=y+x=fin-predy {k = n} (ap pred p · ! q) p
  module
    _
    {n : }
    (x : Node ( succ n))
    where

    with-pred : Edge ( succ n) (pred x) x
    with-pred = refl (pred x)

    with-pred-is-prop : isProp (Edge ( succ n) (pred x)  x)
    with-pred-is-prop x = Fin-is-set _ _ _

    with-succ : Edge ( succ n) x (suc x)
    with-succ = ! fin-pred∘inverse-of-fin-pred x

    with-suc-is-prop : isProp (Edge ( succ n) x (suc x))
    with-suc-is-prop x = Fin-is-set _ _ _

Latest changes

(2022-12-28)(57c278b4) Last updated: 2021-09-16 15:00:00 by jonathan.cubides
(2022-07-06)(d3a4a8cf) minors by jonathan.cubides
(2022-01-26)(4aef326b) [ reports ] added some revisions by jonathan.cubides
(2021-12-20)(049db6a8) Added code of cubical experiments. by jonathan.cubides
(2021-12-20)(961730c9) [ html ] regular update by jonathan.cubides
(2021-12-20)(e0ef9faa) Fixed compilation and format, remove hidden parts by jonathan.cubides
(2021-12-20)(5120e5d1) Added cubical experiment to the master by jonathan.cubides
(2021-12-17)(828fdd0a) More revisions added for CPP by jonathan.cubides
(2021-12-15)(0d6a99d8) Fixed some broken links and descriptions by jonathan.cubides
(2021-12-15)(662a1f2d) [ .gitignore ] add by jonathan.cubides
(2021-12-15)(0630ce66) Minor fixes by jonathan.cubides
(2021-12-13)(04f10eba) Fixed a lot of details by jonathan.cubides
(2021-12-10)(24195c9f) [ .gitignore ] ignore .zip and arxiv related files by jonathan.cubides
(2021-12-09)(538d2859) minor fixes before dinner by jonathan.cubides
(2021-12-09)(36a1a69f) [ planar.pdf ] w.i.p revisions to share on arxiv first by jonathan.cubides