statement stringlengths 1 1.02k | proof stringlengths 0 5.19k | type stringclasses 13
values | symbolic_name stringlengths 1 30 | library stringclasses 15
values | filename stringclasses 117
values | imports listlengths 0 16 | deps listlengths 0 16 | docstring stringclasses 50
values | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
destruct_ands H | :=
match type of H with
| _ /\ _ =>
let H1 := fresh in
let H2 := fresh in
destruct H as [ H1 H2 ] ;
destruct_ands H1 ; destruct_ands H2
| exists x , _ =>
let H1 := fresh in
destruct H as [ ? H1 ] ;
destruct_ands H1
| _ => idtac
end. | Ltac | destruct_ands | Tactics | theories/Tactics/Injection.v | [] | [
"type"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
inv_all | :=
repeat match goal with
| [ H : ?X |- _ ] =>
let z := constr:(_ : Injective X) in
eapply (@injection X z) in H; do 2 red in H ; destruct_ands H
end. | Ltac | inv_all | Tactics | theories/Tactics/Injection.v | [] | [
"Injective",
"destruct_ands"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Proper_red : forall T U (rT : relation T) (rU : relation U) (f : T -> U),
(forall x x', rT x x' -> rU (f x) (f x')) ->
Proper (rT ==> rU) f. | intuition.
Qed. | Theorem | Proper_red | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | The purpose of this tactic is to try to automatically derive morphisms
for functions
* | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
respectful_red : forall T U (rT : relation T) (rU : relation U) (f g : T -> U),
(forall x x', rT x x' -> rU (f x) (g x')) ->
respectful rT rU f g. | intuition.
Qed. | Theorem | respectful_red | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
respectful_if_bool T : forall (x x' : bool) (t t' f f' : T) eqT,
x = x' ->
eqT t t' -> eqT f f' ->
eqT (if x then t else f) (if x' then t' else f') . | intros; subst; auto; destruct x'; auto.
Qed. | Theorem | respectful_if_bool | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
derive_morph | :=
repeat
first [ lazymatch goal with
| |- Proper _ _ => red; intros
| |- (_ ==> _)%signature _ _ => red; intros
end
| apply respectful_red; intros
| apply respectful_if_bool; intros
| match goal with
| [ H : (_ ==> ?EQ)%signature ?F ?F' |- ?EQ (?F _) (?... | Ltac | derive_morph | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [
"apply",
"respectful_if_bool",
"respectful_red"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Proper_andb : Proper (@eq bool ==> @eq bool ==> @eq bool) andb. | derive_morph; auto.
Qed. | Instance | Proper_andb | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [
"derive_morph"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Fproper : Proper (@eq bool ==> @eq bool ==> @eq bool) F. | Hypothesis | Fproper | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | ||
food (x y z : bool) : bool | :=
F x (F y z). | Definition | food | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Proper_food : Proper (@eq bool ==> @eq bool ==> @eq bool ==> @eq bool) food. | Proof.
derive_morph; auto.
Qed. | Instance | Proper_food | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [
"derive_morph",
"food"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Proper_S : Proper (@eq nat ==> @eq nat) S. | Proof.
derive_morph; auto.
Qed. | Instance | Proper_S | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [
"derive_morph"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
listEq {T} (eqT : relation T) : relation (list T) | :=
| listEq_nil : listEq eqT nil nil
| listEq_cons : forall x x' y y', eqT x x' -> listEq eqT y y' ->listEq eqT (x :: y) (x' :: y'). | Inductive | listEq | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
listEq_match V U (eqV : relation V) (eqU : relation U) : forall x x' : list V,
forall X X' Y Y',
eqU X X' ->
(eqV ==> listEq eqV ==> eqU)%signature Y Y' ->
listEq eqV x x' ->
eqU (match x with
| nil => X
| x :: xs => Y x xs
end)
(match x' with
| nil ... | Proof.
intros. induction H1; auto. derive_morph; auto.
Qed. | Theorem | listEq_match | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [
"derive_morph",
"listEq"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
hd (l : list T) : option T | :=
match l with
| nil => None
| l :: _ => Some l
end. | Definition | hd | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
map' (l : list T) : list U | :=
match l with
| nil => nil
| l :: ls => f l :: map' ls
end. | Fixpoint | map' | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [] | Global Instance Proper_hd : Proper (listEq eqT ==> optionEq eqT) hd.
Proof.
foo. (** This has binders in the match... **)
Abort. | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
Proper_map' : Proper (listEq eqT ==> listEq eqU) map'. | Proof.
derive_morph. induction H; econstructor; derive_morph; auto.
Qed. | Instance | Proper_map' | Tactics | theories/Tactics/Parametric.v | [
"Setoid",
"RelationClasses",
"Morphisms",
"List"
] | [
"derive_morph",
"listEq",
"map'"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
ClassReify (v : Q) : Type | :=
{ reify : P
; reify_sound : D reify = v
}. | Class | ClassReify | Tactics | theories/Tactics/Reify.v | [
"Lists.List"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Reflect_nil : ClassReify (map f) nil | :=
{ reify := nil
; reify_sound := refl_equal
}. | Instance | Reflect_nil | Tactics | theories/Tactics/Reify.v | [
"Lists.List"
] | [
"ClassReify"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Reflect_cons a b (Ra : ClassReify f a) (Rb : ClassReify (map f) b)
: ClassReify (map f) (a :: b). | refine {| reify := cons (@reify _ _ _ _ Ra) (@reify _ _ _ _ Rb) |}.
simpl; f_equal; eapply reify_sound.
Defined. | Instance | Reflect_cons | Tactics | theories/Tactics/Reify.v | [
"Lists.List"
] | [
"ClassReify"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.