mirror of
https://github.com/Smaug123/agdaproofs
synced 2025-10-14 07:58:41 +00:00
Some graphs stuff (#98)
This commit is contained in:
26
Graphs/PathGraph.agda
Normal file
26
Graphs/PathGraph.agda
Normal file
@@ -0,0 +1,26 @@
|
||||
{-# OPTIONS --warning=error --safe --without-K #-}
|
||||
|
||||
open import LogicalFormulae
|
||||
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
|
||||
open import Functions
|
||||
open import Setoids.Setoids
|
||||
open import Setoids.Subset
|
||||
open import Graphs.Definition
|
||||
open import Sets.FinSet.Definition
|
||||
open import Sets.FinSet.Lemmas
|
||||
open import Numbers.Naturals.Semiring
|
||||
open import Sets.EquivalenceRelations
|
||||
|
||||
module Graphs.PathGraph where
|
||||
|
||||
nNotSucc : {n : ℕ} → (n ≡ succ n) → False
|
||||
nNotSucc {zero} ()
|
||||
nNotSucc {succ n} pr = nNotSucc (succInjective pr)
|
||||
|
||||
PathGraph : (n : ℕ) → Graph _ (reflSetoid (FinSet (succ n)))
|
||||
Graph._<->_ (PathGraph n) x y = (toNat x ≡ succ (toNat y)) || (toNat y ≡ succ (toNat x))
|
||||
Graph.noSelfRelation (PathGraph n) x (inl bad) = nNotSucc bad
|
||||
Graph.noSelfRelation (PathGraph n) x (inr bad) = nNotSucc bad
|
||||
Graph.symmetric (PathGraph n) (inl x) = inr x
|
||||
Graph.symmetric (PathGraph n) (inr x) = inl x
|
||||
Graph.wellDefined (PathGraph n) refl refl i = i
|
Reference in New Issue
Block a user