fork download
  1. -- proof for a /\ b is a pair of proofs for a and b
  2. data _/\_ (a : Set) (b : Set) : Set where
  3. and : a -> b -> (a /\ b)
  4.  
  5. -- proof of equivalence is a pair of proofs for implications
  6. data _<->_ (a : Set) (b : Set) : Set where
  7. eq : ((a -> b) /\ (b -> a)) -> (a <-> b)
  8.  
  9. -- composition of proofs
  10. _._ : {a b c : Set} -> (b -> c) -> (a -> b) -> (a -> c)
  11. _._ f g x = f (g x)
  12.  
  13. -- proofs in both directions are generated as composition of implication proofs
  14. proof : {p q r : Set} -> ((p <-> q) /\ (q <-> r)) -> (p <-> r)
  15. proof (and (eq (and pq qp)) (eq (and qr rq))) = eq (and (qr . pq) (qp . rq))
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: stray '\' in program
 -- proof for a /\ b is a pair of proofs for a and b
 ^
prog.cpp:2:1: error: stray '\' in program
 data _/\_ (a : Set) (b : Set) : Set where
 ^
prog.cpp:3:2: error: stray '\' in program
  and : a -> b -> (a /\ b)
  ^
prog.cpp:7:2: error: stray '\' in program
  eq : ((a -> b) /\ (b -> a)) -> (a <-> b)
  ^
prog.cpp:14:1: error: stray '\' in program
 proof : ((p <-> q) /\ (q <-> r)) -> (p <-> r)
 ^
prog.cpp:1:1: error: expected unqualified-id before '--' token
 -- proof for a /\ b is a pair of proofs for a and b
 ^
prog.cpp:10:21: error: expected unqualified-id before '->' token
 _._ : {a b c : Set} -> (b -> c) -> (a -> b) -> (a -> c)
                     ^
stdout
Standard output is empty