Created
February 27, 2025 21:43
-
-
Save clayrat/69fe096b4d5280ccf5113c1fdd055ec3 to your computer and use it in GitHub Desktop.
Cograph
This file contains hidden or 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
{-# OPTIONS --safe #-} | |
module Cograph where | |
open import Prelude | |
record Graph {A B : π°} (f : A β B) : π° where | |
field | |
x : A | |
y : B | |
sub : f x οΌ y | |
open Graph public | |
data Cograph {A B : π°} (f : A β B) : π° where | |
arg : A β Cograph f | |
res : B β Cograph f | |
quo : β {a b} β f a οΌ b β arg a οΌ res b | |
f : β β Maybe β | |
f n = just (2 + n) | |
foo : Graph f | |
foo .x = 2 | |
foo .y = just 4 | |
foo .sub = refl | |
bar : Cograph f | |
bar = arg 2 | |
baz : Cograph f | |
baz = res (just 4) | |
quux : bar οΌ baz | |
quux = quo refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment