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
Definition relation (A: Type) := A -> A -> Prop. | |
(* Definition: Equivalence relation *) | |
Reserved Notation "x == y" (at level 80, no associativity). | |
Class Equivalence {A: Type}(eq: relation A) := | |
{ | |
equiv_eq := eq | |
where "x == y" := (equiv_eq x y); |
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
(* Monad with Coercion *) | |
Definition relation (A: Type) := A -> A -> Prop. | |
Hint Unfold relation. | |
Reserved Notation "x == y" (at level 85, no associativity). | |
Class Equivalence (A: Type) := | |
{ | |
equiv_eq: relation A where "x == y" := (equiv_eq x y); | |
equiv_refl: |
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
(* Monad with Coercion *) | |
Require Import ssreflect. | |
Definition relation (A: Type) := A -> A -> Prop. | |
Hint Unfold relation. | |
Definition refl {A: Type}(R: relation A) | |
:= forall a, R a a. | |
Definition sym {A: Type}(R: relation A) |
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
Class Category := | |
{ objects:> Setoid; | |
arrows:> Setoid; | |
domain: Map arrows objects; | |
codomain: Map arrows objects; | |
identity: Map objects arrows; | |
compose: forall (f g: arrows)(composable: codomain f == domain g), arrows; |
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
(* Cat_on_Coq の Setoid を使ってるよ *) | |
Inductive function_eq {X Y: Set}(f: X -> Y): forall (X' Y': Set)(g: X' -> Y'), Prop := | |
| feq_def: forall f': X -> Y, (forall x: X, f x = f' x) -> function_eq f f'. | |
Lemma function_eq_refl: | |
forall (Xf Yf: Set)(f: Xf -> Yf), | |
function_eq f f. | |
Proof. | |
move => Xf Yf f. |
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
Class is_Typoid (carrier: Type): Type := | |
{ equal: relation carrier; | |
prf_equiv :> Equivalence equal }. | |
Class Typoid: Type := | |
{ typoid_carrier: Type; | |
is_typoid:> is_Typoid typoid_carrier }. | |
Coercion typoid_carrier: Typoid >-> Sortclass. | |
Definition eq_Typoid (S T: Typoid) := |
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
Require Import | |
Ssreflect.ssreflect Ssreflect.ssrbool Ssreflect.ssrfun | |
Ssreflect.ssrnat Ssreflect.prime Ssreflect.seq | |
Ssreflect.div Ssreflect.binomial Ssreflect.bigop. | |
Lemma coprime_plus a b: | |
coprime a (b+a) -> coprime b (b+a). | |
Proof. | |
by rewrite /coprime gcdnDl gcdnDr gcdnC. | |
Qed. |
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
(* HORS? *) | |
Set Implicit Arguments. | |
Require Import List. | |
CoInductive List (A: Set): Set := | |
| Nil | Cons (head: A)(tail: List A). | |
Arguments Nil {A}. | |
Arguments Cons {A}(head)(tail). |
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
Check (1: nat: Set: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Type: Ty |
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
(* Directed finite graph *) | |
Require Import | |
Ssreflect.ssreflect Ssreflect.ssrbool | |
Ssreflect.ssrfun Ssreflect.eqtype | |
Ssreflect.ssrnat Ssreflect.seq | |
Ssreflect.path Ssreflect.fintype | |
Ssreflect.fingraph. |
OlderNewer