Base.agda 833 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module Logic.Base where
  2. infix 60 ¬_
  3. infix 30 _/\_
  4. infix 20 _\/_
  5. data True : Set where
  6. tt : True
  7. data False : Set where
  8. elim-False : {A : Set} -> False -> A
  9. elim-False ()
  10. data _/\_ (P Q : Set) : Set where
  11. /\-I : P -> Q -> P /\ Q
  12. data _\/_ (P Q : Set) : Set where
  13. \/-IL : P -> P \/ Q
  14. \/-IR : Q -> P \/ Q
  15. elimD-\/ : {P Q : Set}(C : P \/ Q -> Set) ->
  16. ((p : P) -> C (\/-IL p)) ->
  17. ((q : Q) -> C (\/-IR q)) ->
  18. (pq : P \/ Q) -> C pq
  19. elimD-\/ C left right (\/-IL p) = left p
  20. elimD-\/ C left right (\/-IR q) = right q
  21. elim-\/ : {P Q R : Set} -> (P -> R) -> (Q -> R) -> P \/ Q -> R
  22. elim-\/ = elimD-\/ (\_ -> _)
  23. ¬_ : Set -> Set
  24. ¬ P = P -> False
  25. data ∃ {A : Set}(P : A -> Set) : Set where
  26. ∃-I : (w : A) -> P w -> ∃ P
  27. ∏ : {A : Set}(P : A -> Set) -> Set
  28. ∏ {A} P = (x : A) -> P x