Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
statement stringlengths 1 250 | proof stringlengths 0 2.1k | type stringclasses 16
values | symbolic_name stringlengths 1 35 | library stringclasses 14
values | filename stringclasses 41
values | imports listlengths 2 10 | deps listlengths 0 17 | docstring stringclasses 34
values | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
option_mul {T : Mul.type} (o1 o2 : option T) : option T | :=
match o1, o2 with
| Some n, Some m => Some (mul n m)
| _, _ => None
end. | Definition | option_mul | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"type"
] | We need a functorial construction (a container)
which preserves both structures. The simplest one is the option type. | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
option_square {T : Sq.type} (o : option T) : option T | :=
match o with
| Some n => Some (sq n)
| None => None
end. | Definition | option_square | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
sq_mul (V : Mul.type) (v : V) : sq v = mul v v. | Proof. by reflexivity. Qed. | Lemma | sq_mul | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"type"
] | As we expect we can proved this (by reflexivity) | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
problem (W : Mul.type) (w : option W) : sq w = mul w w. | Proof.
Fail reflexivity. (* What? It used to work! *)
Fail rewrite sq_mul. (* Lemmas don't cross the container either! *)
(* Let's investigate *)
rewrite /mul/= /sq/=.
(* As we expect, we are on the option type. In the LHS it is the Sq built using
the NFI instance
option_square w = option_mul w w
*)
rewrite /... | Lemma | problem | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"option_mul",
"option_square",
"sq_mul",
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
option_sq_mul {T : Sq.type} (o : option T) : option_square o = mul o o. | Proof. by rewrite /option_square; case: o => [x|//]; rewrite sq_mul. Qed. | Lemma | option_sq_mul | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"option_square",
"sq_mul",
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
problem (W : Sq.type) (w : option W) : sq w = mul w w. | Proof. by rewrite sq_mul. Qed. | Lemma | problem | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"sq_mul",
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
link {xT T : Type} {f : xT -> T} {g : T -> xT}
(canfg : forall x, f (g x) = x) | :=
T. | Definition | link | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"canfg"
] | This is the type which is used as a feather factory.
- xT plays the role of a rich type,
- T is a new type linked to xT by some lemma. In this case a very strong
cancellation lemma canfg | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
link_eqtest (x y : T) : bool | := eqtest (g x) (g y). | Definition | link_eqtest | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
link_eqOK (x y : T) : reflect (x = y) (link_eqtest x y). | Proof.
rewrite /link_eqtest; case: (eqOK (g x) (g y)) => [E|abs].
by constructor; rewrite -[x]canfg -[y]canfg E canfg.
by constructor=> /(f_equal g)/abs.
Qed. | Lemma | link_eqOK | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"canfg",
"link_eqtest"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
link_def : link canfg | := f def. | Definition | link_def | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"canfg",
"link"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
link_all_def x : eqtest x link_def = true. | Proof.
rewrite /link_def; have /eqOK <- := all_def (g x).
by rewrite canfg; case: (eqOK x x).
Qed. | Lemma | link_all_def | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"canfg",
"link_def"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
B : Type. | Axiom | B | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | We assume a known type B which is both an Equality and a Singleton | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
testB : B -> B -> bool. | Axiom | testB | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
testOKB : forall x y, reflect (x = y) (testB x y). | Axiom | testOKB | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"testB"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
defB : B. | Axiom | defB | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
all_defB : forall x, eqtest x defB = true. | Axiom | all_defB | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"defB"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
A : Type. | Axiom | A | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | Now we copy all instances from B to A via link | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
f : B -> A. | Axiom | f | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
g : A -> B. | Axiom | g | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
canfg : forall x, f (g x) = x. | Axiom | canfg | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
"n ^ m" | := (Nat.pow n m) : nat_scope. | Notation | n ^ m | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | ******************************************************************* | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
new_concept | := 999999. | Definition | new_concept | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [] | not a very clever construction, but a large one. Bare with us. | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
test x : new_concept ^ x ^ new_concept = x ^ new_concept ^ new_concept. | Proof.
(* this goal is not trivial, and maybe even false, but you may call
some automation on it anyway *)
Time Fail reflexivity. (* takes 7s, note that both by and // call reflexivity *)
Abort. | Lemma | test | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"new_concept"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
test x : new_concept ^ x ^ new_concept = x ^ new_concept ^ new_concept. | Time Fail reflexivity. (* takes 0s *)
rewrite new_concept.unlock.
Time Fail reflexivity. (* takes 7s, the original body is restored *)
Abort. | Lemma | test | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"new_concept"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
unlock_new_concept | := Unlockable new_concept.unlock. | Canonical | unlock_new_concept | examples | examples/hulk.v | [
"HB",
"structures",
"ssreflect",
"ssrfun",
"ssrbool"
] | [
"new_concept"
] | Notation new_concept := new_concept.body | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
"0" | := zero. | Notation | 0 | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"zero"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"- x" | := (opp x). | Notation | - x | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"opp"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
example (G : AbelianGrp.type) (x : G) : x + (- x) = - 0. | Proof. by rewrite addrC addNr -[LHS](addNr zero) addrC add0r. Qed. | Lemma | example | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"add0r",
"addNr",
"addrC",
"type",
"zero"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
Z_add_assoc : forall x y z, Z.add x (Z.add y z) = Z.add (Z.add x y) z. | Axiom | Z_add_assoc | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"add"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
Z_add_comm : forall x y, Z.add x y = Z.add y x. | Axiom | Z_add_comm | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"add"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
Z_add_0_l : forall x, Z.add Z0 x = x. | Axiom | Z_add_0_l | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"add"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
Z_add_opp_diag_l : forall x, Z.add (Z.opp x) x = Z0. | Axiom | Z_add_opp_diag_l | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"add",
"opp"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
example2 (x : Z) : x + (- x) = - 0. | Proof. by rewrite example. Qed. | Lemma | example2 | examples | examples/readme.v | [
"HB",
"structures",
"Corelib",
"ssreflect",
"BinNums",
"IntDef"
] | [
"example"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
funext : forall {T : Type} {U : T -> Type} [f g : forall t, U t],
(forall t, f t = g t) -> f = g. | Axiom | funext | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | we assume a few axioms to make life easier | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
propext : forall P Q : Prop, P <-> Q -> P = Q. | Axiom | propext | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
Prop_irrelevance : forall (P : Prop) (x y : P), x = y. | Axiom | Prop_irrelevance | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
U | := Type. | Notation | U | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | Shortcut | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
homs T | := (@hom T _ _). | Notation | homs | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"a ~> b" | := (hom a b)
(at level 99, b at level 200, format "a ~> b") : cat_scope. | Notation | a ~> b | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"a ~>_ C b" | := (@hom C a b)
(at level 99, C at level 0, only parsing) : cat_scope. | Notation | a ~>_ C b | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"f \o g" | := (comp g f) : cat_scope. | Notation | f \o g | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"f \; g :> T" | := (@comp T _ _ _ f g)
(at level 60, g, T at level 60, format "f \; g :> T", only parsing) : cat_scope. | Notation | f \; g :> T | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"f \; g" | := (comp f g) : cat_scope. | Notation | f \; g | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"\idmap_ a" | := (@idmap _ a) (only parsing, at level 0) : cat_scope. | Notation | \idmap_ a | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
discrete (T : U) | := T. | Definition | discrete | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | the discrete category on a type cannot be the default, we make an alias | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
etransA T (a b c d : discrete T) (f : a ~> b) (g : b ~> c) (h : c ~> d) :
f \; (g \; h) = (f \; g) \; h. | Proof. by rewrite /idmap/comp/=; case: _ / h; case: _ / g. Qed. | Lemma | etransA | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"discrete"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
Ucomp (X Y Z : U) (f : X ~> Y) (g : Y ~> Z) : f \; g = (g \o f)%function. | Proof. by []. Qed. | Lemma | Ucomp | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
Ucompx (X Y Z : U) (f : X ~> Y) (g : Y ~> Z) x : (f \; g) x = g (f x). | Proof. by []. Qed. | Lemma | Ucompx | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
U1 (X : U) : \idmap_X = idfun. | Proof. by []. Qed. | Lemma | U1 | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
U1x (X : U) x : \idmap_X x = x. | Proof. by []. Qed. | Lemma | U1x | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"F ^$" | := (@Fhom _ _ F _ _)
(at level 1, format "F ^$") : cat_scope. | Notation | F ^$ | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"F <$> f" | := (@Fhom _ _ F _ _ f)
(at level 58, format "F <$> f", right associativity) : cat_scope. | Notation | F <$> f | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
prefunctorP (C D : quiver) (F G : C ~> D) (eqFG : F =1 G) :
let homF a b F := F a ~> F b in
(forall a b f, eq_rect _ (homF a b) (F <$> f) _ (funext eqFG) = G <$> f) ->
F = G. | Proof.
move: F G => [F [[/= Fhom]]] [G [[/= Ghom]]] in eqFG *.
case: _ / (funext eqFG) => /= in Ghom * => eqFGhom.
congr PreFunctor.Pack; congr PreFunctor.Class; congr IsPreFunctor.Axioms_.
by do 3!apply: funext=> ?.
Qed. | Lemma | prefunctorP | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"funext",
"homF"
] | prefunctors are equal if their object and hom part are respectively equal | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
functorP (C D : precat) (F G : C ~> D) (eqFG : F =1 G) :
let homF a b F := F a ~> F b in
(forall a b f, eq_rect _ (homF a b) (F^$ f) _ (funext eqFG) = G^$ f) ->
F = G. | Proof.
move=> /= /prefunctorP {eqFG}.
case: F G => [F [/= Fm Fm']] [G [/= Gm Gm']]//=.
move=> [_] eqFG; have /= := eq_sigT_rect_existT _ _ eqFG; apply => {}eqFG.
case: _ / eqFG => /= in Gm Gm' * => eqFG.
case: _ / eqFG in Gm' *.
congr Functor.Pack; congr Functor.Class.
case: Fm' Gm' => [F1 Fc] [G1 Gc].
by congr PreFunc... | Lemma | functorP | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"Prop_irrelevance",
"funext",
"homF",
"prefunctorP"
] | functor equality is the same as prefunctor because of PI | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
comp_Fun (a b : C) (f : a ~> b) : (G \o F)%function <$> f = G <$> (F <$> f). | Proof. by []. Qed. | Lemma | comp_Fun | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
comp_F1 (a : C) : (G \o F)%function <$> \idmap_a = idmap. | Proof. by rewrite !comp_Fun !F1. Qed. | Lemma | comp_F1 | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"comp_Fun"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
comp_Fcomp (a b c : C) (f : a ~> b) (g : b ~> c) :
(G \o F)%function <$> (f \; g) = (G \o F)%function <$> f \; (G \o F)%function <$> g. | Proof. by rewrite !comp_Fun !Fcomp. Qed. | Lemma | comp_Fcomp | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"comp_Fun"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
funext_frefl A B (f : A -> B) : funext (frefl f) = erefl. | Proof. exact: Prop_irrelevance. Qed. | Lemma | funext_frefl | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"Prop_irrelevance",
"funext"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
precat_cat : PreCat_IsCat precat. | Proof.
by split=> [C D F|C D F|C D C' D' F G H];
apply/functorP => a b f /=; rewrite funext_frefl.
Qed. | Definition | precat_cat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"functorP",
"funext_frefl"
] | precategories and categories form a category | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
cat_cat : PreCat_IsCat cat. | Proof.
by split=> [C D F|C D F|C D C' D' F G H];
apply/functorP => a b f /=; rewrite funext_frefl.
Qed. | Definition | cat_cat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"functorP",
"funext_frefl"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
concrete : PreConcreteQuiver.sort >-> Sortclass. | Coercion | concrete | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"sort"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | ||
quiver_concrete_subproof : PreConcrete_IsConcrete quiver. | Proof.
constructor=> C D F G FG; apply: prefunctorP.
by move=> x; congr (_ x); apply: FG.
by move=> *; admit.
Admitted. | Lemma | quiver_concrete_subproof | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"prefunctorP"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
precat_concrete_subproof : PreConcrete_IsConcrete precat. | Proof.
constructor=> C D F G FG; apply: functorP.
by move=> x; congr (_ x); apply: FG.
by move=> *; admit.
Admitted. | Lemma | precat_concrete_subproof | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"functorP"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
cat_concrete_subproof : PreConcrete_IsConcrete cat. | Proof.
constructor=> C D F G FG; apply: functorP.
by move=> x; congr (_ x); apply: FG.
by move=> *; admit.
Admitted. | Lemma | cat_concrete_subproof | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"functorP"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
cst (C D : quiver) (c : C) | := fun & D => c. | Definition | cst | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | constant functor | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
catop (C : U) : U | := C. | Definition | catop | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | opposite category | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
"C ^op" | := (catop C)
(at level 2, format "C ^op") : cat_scope. | Notation | C ^op | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"catop"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
hom_Fhom_subproof (C : cat) (x : C) :
PreFunctor_IsFunctor _ _ (hom x). | Proof. by split=> *; apply/funext => h; [apply: compo1 | apply: compoA]. Qed. | Lemma | hom_Fhom_subproof | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"funext"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
hom_op {C : quiver} (c : C^op) : hom c = (@hom C)^~ c. | Proof. reflexivity. Qed. | Lemma | hom_op | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
homFhomx {C : precat} (a b c : C) (f : a ~> b) (g : c ~> a) :
(hom c <$> f) g = g \; f. | Proof. reflexivity. Qed. | Lemma | homFhomx | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
dprod {I : U} (C : I -> U) | := forall i, C i. | Definition | dprod | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | nary product of categories | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
dprod_hom_subdef (a b : dprod C) | := forall i, a i ~> b i. | Definition | dprod_hom_subdef | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"dprod"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
dprod_idmap_subdef (a : dprod C) : a ~> a | := fun=> idmap. | Definition | dprod_idmap_subdef | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"dprod"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
dprod_comp_subdef (a b c : dprod C) (f : a ~> b) (g : b ~> c) : a ~> c | :=
fun i => f i \; g i. | Definition | dprod_comp_subdef | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"dprod"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
type | := (dprod C). | Notation | type | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"dprod"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
dprod_is_cat : PreCat_IsCat type. | Proof.
split=> [a b f|a b f|a b c d f g h]; apply/funext => i;
[exact: comp1o | exact: compo1 | exact: compoA].
Qed. | Lemma | dprod_is_cat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"funext",
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
prod_hom_subdef (a b : C * D) | := ((a.1 ~> b.1) * (a.2 ~> b.2))%type. | Definition | prod_hom_subdef | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
type | := (C * D)%type. | Notation | type | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
prod_is_cat : PreCat_IsCat type. | Proof.
split=> [[a1 a2] [b1 b2] [f1 f2]|[a1 a2] [b1 b2] [f1 f2]|
[a1 a2] [b1 b2] [c1 c2] [d1 d2] [f1 f2] [g1 g2] [h1 h2]]; congr (_, _) => //=;
by [exact: comp1o | exact: compo1 | exact: compoA].
Qed. | Lemma | prod_is_cat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
naturalx (C : precat) (D : concrete_precat)
(F G : C ~>_quiver D) (n : F ~> G) (a b : C) (f : a ~> b) g :
(concrete <$> n b) ((concrete <$> F <$> f) g) =
(concrete <$> G <$> f) ((concrete <$> n a) g). | Proof.
have /(congr1 (fun h => (concrete <$> h) g)) := natural n f.
by rewrite !Fcomp.
Qed. | Lemma | naturalx | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"concrete"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
naturalU (C : precat) (F G : C ~>_quiver U) (n : F ~> G)
(a b : C) (f : a ~> b) g : n b (F^$ f g) = G^$ f (n a g). | Proof. exact: (naturalx n). Qed. | Lemma | naturalU | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"naturalx"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
natP (C D : precat) (F G : C ~>_quiver D) (n m : F ~> G) :
Natural.sort n = Natural.sort m -> n = m. | Proof.
case: n m => [/= n nP] [/= m mP] enm.
elim: _ / enm in mP *; congr Natural.Pack.
case: nP mP => [[?]] [[?]]; congr Natural.Class.
congr IsNatural.Axioms_.
exact: Prop_irrelevance.
Qed. | Lemma | natP | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"Prop_irrelevance",
"sort"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"F ~~> G" | := (F ~>_(homs quiver) G)
(at level 99, G at level 200, format "F ~~> G"). | Notation | F ~~> G | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"homs"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"F ~~> G :> C ~> D" | := (F ~> G :> (C ~>_quiver D))
(at level 99, G at level 200, C, D at level 0,
format "F ~~> G :> C ~> D"). | Notation | F ~~> G :> C ~> D | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
natural_id {C D : precat} (F : C ~>_quiver D) (a : C) | := \idmap_(F a). | Definition | natural_id | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
natural_id_natural (C D : cat) (F : C ~>_quiver D) :
IsNatural C D F F (natural_id F). | Proof. by constructor=> a b f; rewrite /natural_id/= compo1 comp1o. Qed. | Definition | natural_id_natural | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"natural_id"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
natural_comp {C D : precat} (F G H : C ~>_quiver D)
(m : F ~> G) (n : G ~> H) (a : C) | := m a \; n a. | Definition | natural_comp | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
natural_comp_natural (C D : cat) (F G H : C ~>_quiver D) m n :
IsNatural C D F H (@natural_comp C D F G H m n). | Proof.
constructor=> a b f; rewrite /natural_comp/=.
by rewrite compoA natural -compoA natural compoA.
Qed. | Definition | natural_comp_natural | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"natural_comp"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
prefunctor_cat {C D : cat} : PreCat_IsCat (PreFunctor.type C D). | Proof.
constructor => [F G f|F G f|F G H J f g h].
- by apply/natP/funext => a; rewrite /= /natural_comp comp1o.
- by apply/natP/funext => a; rewrite /= /natural_comp compo1.
- by apply/natP/funext => a; rewrite /= /natural_comp compoA.
Qed. | Lemma | prefunctor_cat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"funext",
"natP",
"natural_comp",
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
functor_cat {C D : cat} : PreCat_IsCat (Functor.type C D). | Proof.
constructor => [F G f|F G f|F G H J f g h].
- by apply/natP/funext => a; rewrite /= /natural_comp comp1o.
- by apply/natP/funext => a; rewrite /= /natural_comp compo1.
- by apply/natP/funext => a; rewrite /= /natural_comp compoA.
Qed. | Lemma | functor_cat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"funext",
"natP",
"natural_comp",
"type"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
idFmap (C : cat) (a b : C) (f : a ~> b) : idfun <$> f = f. | Proof. by []. Qed. | Lemma | idFmap | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
compFmap (C D E : cat) (F : C ~> D) (G : D ~> E) (a b : C) (f : a ~> b) :
(G \o F) <$> f = G <$> F <$> f. | Proof. by []. Qed. | Lemma | compFmap | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
whiskerl_fun (eta : forall c, F c ~> G c) (H : D ~> E) :
forall c, (F \; H) c ~> (G \; H) c | := fun c => H <$> eta c. | Definition | whiskerl_fun | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"eta"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
whiskerl_is_nat (eta : F ~> G) (H : D ~> E) :
IsNatural _ _ _ _ (whiskerl_fun eta H). | Proof. by constructor=> a b f; rewrite /whiskerl_fun/= -!Fcomp natural. Qed. | Lemma | whiskerl_is_nat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"eta",
"whiskerl_fun"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
whiskerl (eta : F ~> G) (H : D ~> E) : (F \; H) ~> (G \; H) | :=
whiskerl_fun eta H : Natural.type _ _. | Definition | whiskerl | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"eta",
"type",
"whiskerl_fun"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"F <o$> n" | := (whiskerl F n)
(at level 58, format "F <o$> n", right associativity) : cat_scope. | Notation | F <o$> n | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"whiskerl"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
whiskerr_fun (H : C ~> D) (eta : forall d, F d ~> G d)
(c : C) : (H \; F) c ~> (H \; G) c | := eta (H c). | Definition | whiskerr_fun | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"eta"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
whiskerr_is_nat (H : C ~> D) (eta : F ~> G) :
IsNatural _ _ _ _ (whiskerr_fun H eta). | Proof. by constructor=> a b f; rewrite /whiskerr_fun/= natural. Qed. | Lemma | whiskerr_is_nat | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"eta",
"whiskerr_fun"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
whiskerr (H : C ~> D) (eta : F ~> G) : (H \; F) ~> (H \; G) | :=
whiskerr_fun H eta : Natural.type _ _. | Definition | whiskerr | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"eta",
"type",
"whiskerr_fun"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa | |
"F <$o> n" | := (whiskerr F n)
(at level 58, format "F <$o> n", right associativity) : cat_scope. | Notation | F <$o> n | examples.cat | examples/cat/cat.v | [
"ssreflect",
"ssrfun",
"HB",
"structures"
] | [
"whiskerr"
] | https://github.com/math-comp/hierarchy-builder | 002a61eee7cf02e08e4b60abca0cf46a793497aa |
Structured dataset from Hierarchy Builder — High-level commands for packed class hierarchies.
002a61eee7cf02e08e4b60abca0cf46a793497aa| Column | Type | Description |
|---|---|---|
| statement | string | Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof |
| proof | string | Verbatim proof/body, empty if the declaration has none |
| type | string | Declaration keyword |
| symbolic_name | string | Declaration identifier |
| library | string | Sub-library |
| filename | string | Repository-relative source path |
| imports | list[string] | File-level Require/Import modules |
| deps | list[string] | Intra-corpus identifiers referenced |
| docstring | string | Preceding documentation comment, empty if absent |
| source_url | string | Upstream repository |
| commit | string | Upstream commit extracted |
| Type | Count |
|---|---|
| Lemma | 238 |
| Definition | 153 |
| Notation | 135 |
| Axiom | 29 |
| Record | 7 |
| Hypothesis | 6 |
| Coercion | 4 |
| Fact | 4 |
| Example | 4 |
| Canonical | 3 |
| Let | 3 |
| Inductive | 2 |
| Variant | 2 |
| Theorem | 1 |
| CoInductive | 1 |
| Class | 1 |
option_mul {T : Mul.type} (o1 o2 : option T) : option T
:=
match o1, o2 with
| Some n, Some m => Some (mul n m)
| _, _ => None
end.
option_mul | examples/hulk.vEach declaration is split into a statement (signature/claim) and a proof (body) that are disjoint
and together form the complete declaration, for proof modeling, autoformalization, retrieval, and
dependency analysis via deps.
@misc{coq_hierarchybuilder_dataset,
title = {Coq-HierarchyBuilder},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/math-comp/hierarchy-builder, commit 002a61eee7cf},
url = {https://huggingface.co/datasets/phanerozoic/Coq-HierarchyBuilder}
}