Created
July 5, 2017 21:07
-
-
Save rntz/c0da26c83d028b8f677a430b31d92d40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open import Data.Product | |
open import Data.Unit | |
open import Level | |
record Graph i j : Set (suc (i ⊔ j)) where | |
field node : Set i | |
field edge : (a b : node) -> Set j | |
open Graph public | |
record Functor {i j k l} (A : Graph i j) (B : Graph k l) : Set (i ⊔ j ⊔ k ⊔ l) where | |
field ap : node A -> node B | |
field cov : ∀{a b} -> edge A a b -> edge B (ap a) (ap b) | |
open Functor public | |
-- the graph with one edge with a self-edge | |
unit : Graph _ _ | |
node unit = ⊤ | |
edge unit a b = ⊤ | |
-- the graph where nodes are Sets and edges are functions | |
sets : Graph _ _ | |
node sets = Set | |
edge sets a b = a -> b | |
connected : ∀{i j} -> Graph i j -> Set _ | |
connected G = ∀ (P : Functor G sets) (a b : node G) -> ap P a -> ap P b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment