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 |
|---|---|---|---|---|---|---|---|---|---|---|
list_eqb@{} (ls rs : list T) : bool | :=
match ls , rs with
| nil , nil => true
| cons l ls , cons r rs =>
if l ?[ eq ] r then list_eqb ls rs else false
| _ , _ => false
end. | Fixpoint | list_eqb | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_eq_list@{} : RelDec (@eq (list T)) | :=
{ rel_dec := list_eqb }. | Instance | RelDec_eq_list | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"RelDec",
"list_eqb"
] | Specialization for equality * | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
RelDec_Correct_eq_list@{v} : RelDec_Correct RelDec_eq_list. | Proof.
constructor; induction x; destruct y; split; simpl in *; intros;
try reflexivity + discriminate.
- destruct (_ : Reflect (rel_dec a t) _ _); try discriminate.
replace y with x by (apply IHx; auto); subst; auto.
- inversion H; subst. rewrite (rel_dec_eq_true _) by auto. apply IHx; auto.
... | Instance | RelDec_Correct_eq_list | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Reflect",
"RelDec_Correct",
"RelDec_eq_list",
"apply",
"rel_dec_eq_true",
"replace",
"split"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_cons@{u} (T : Type@{u}) (a : T) b c d : Injective (a :: b = c :: d). | refine {| result := a = c /\ b = d |}.
inversion 1; auto.
Defined. | Instance | Injective_cons | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_cons_nil@{u} (T : Type@{u}) (a : T) b : Injective (a :: b = nil). | refine {| result := False |}.
inversion 1; auto.
Defined. | Instance | Injective_cons_nil | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_nil_cons@{u} (T : Type@{u}) (a : T) b : Injective (nil = a :: b). | refine {| result := False |}.
inversion 1; auto.
Defined. | Instance | Injective_nil_cons | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_nil_nil@{u} (T : Type@{u}) : Injective (nil = @nil T). | refine {| result := True |}.
auto.
Defined. | Instance | Injective_nil_nil | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_app_cons@{u} {T : Type@{u}} (a : list T) b c d
: Injective (a ++ b :: nil = (c ++ d :: nil)). | Proof.
refine {| result := a = c /\ b = d |}.
eapply app_inj_tail.
Defined. | Instance | Injective_app_cons | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_app_same_L@{u} {T : Type@{u}} (a : list T) b c
: Injective (b ++ a = b ++ c). | Proof.
refine {| result := a = c |}.
apply app_inv_head.
Defined. | Instance | Injective_app_same_L | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective",
"apply"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_app_same_R@{u} {T : Type@{u}} (a : list T) b c
: Injective (a ++ b = c ++ b). | Proof.
refine {| result := a = c |}.
apply app_inv_tail.
Defined. | Instance | Injective_app_same_R | Data | theories/Data/List.v | [
"Coq",
"List",
"EquivDec",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Structures.Reducible",
"ExtLib.Data.Nat",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Functor",
"ExtLib.Structures.Monads",
"ExtLib.Structures.A... | [
"Injective",
"apply"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
firstn_app_L : forall T n (a b : list T),
n <= length a ->
firstn n (a ++ b) = firstn n a. | Proof.
induction n; destruct a; simpl in *; intros; auto.
exfalso; lia.
f_equal. eapply IHn; eauto. lia.
Qed. | Lemma | firstn_app_L | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"length"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
firstn_app_R : forall T n (a b : list T),
length a <= n ->
firstn n (a ++ b) = a ++ firstn (n - length a) b. | Proof.
induction n; destruct a; simpl in *; intros; auto.
exfalso; lia.
f_equal. eapply IHn; eauto. lia.
Qed. | Lemma | firstn_app_R | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"length"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
firstn_all : forall T n (a : list T),
length a <= n ->
firstn n a = a. | Proof.
induction n; destruct a; simpl; intros; auto.
exfalso; lia.
simpl. f_equal. eapply IHn; lia.
Qed. | Lemma | firstn_all | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"length"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
firstn_0 : forall T n (a : list T),
n = 0 ->
firstn n a = nil. | Proof.
intros; subst; auto.
Qed. | Lemma | firstn_0 | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
firstn_cons : forall T n a (b : list T),
0 < n ->
firstn n (a :: b) = a :: firstn (n - 1) b. | Proof.
destruct n; intros.
lia.
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
Qed. | Lemma | firstn_cons | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"replace"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
skipn_app_R : forall T n (a b : list T),
length a <= n ->
skipn n (a ++ b) = skipn (n - length a) b. | Proof.
induction n; destruct a; simpl in *; intros; auto.
exfalso; lia.
eapply IHn. lia.
Qed. | Lemma | skipn_app_R | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"length"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
skipn_app_L : forall T n (a b : list T),
n <= length a ->
skipn n (a ++ b) = (skipn n a) ++ b. | Proof.
induction n; destruct a; simpl in *; intros; auto.
exfalso; lia.
eapply IHn. lia.
Qed. | Lemma | skipn_app_L | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"length"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
skipn_0 : forall T n (a : list T),
n = 0 ->
skipn n a = a. | Proof.
intros; subst; auto.
Qed. | Lemma | skipn_0 | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
skipn_all : forall T n (a : list T),
length a <= n ->
skipn n a = nil. | Proof.
induction n; destruct a; simpl in *; intros; auto.
exfalso; lia.
apply IHn; lia.
Qed. | Lemma | skipn_all | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"apply",
"length"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
skipn_cons : forall T n a (b : list T),
0 < n ->
skipn n (a :: b) = skipn (n - 1) b. | Proof.
destruct n; intros.
lia.
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
Qed. | Lemma | skipn_cons | Data | theories/Data/ListFirstnSkipn.v | [
"Coq.Lists",
"List",
"Coq.ZArith",
"ZArith",
"Coq.micromega",
"Lia"
] | [
"replace"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_app_L : forall (A B : list T) n,
n < length A ->
nth_error (A ++ B) n = nth_error A n. | Proof.
induction A; destruct n; simpl; intros; auto.
{ inversion H. }
{ inversion H. }
{ eapply IHA. apply Nat.succ_lt_mono; assumption. }
Qed. | Lemma | nth_error_app_L | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"apply",
"length",
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_app_R : forall (A B : list T) n,
length A <= n ->
nth_error (A ++ B) n = nth_error B (n - length A). | Proof.
induction A; destruct n; simpl; intros; auto.
+ inversion H.
+ apply IHA. apply Nat.succ_le_mono; assumption.
Qed. | Lemma | nth_error_app_R | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"apply",
"length",
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_weaken : forall ls' (ls : list T) n v,
nth_error ls n = Some v ->
nth_error (ls ++ ls') n = Some v. | Proof.
clear. induction ls; destruct n; simpl; intros; unfold value, error in *; try congruence; auto.
Qed. | Lemma | nth_error_weaken | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"nth_error",
"value"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_nil : forall n,
nth_error nil n = @None T. | Proof.
destruct n; reflexivity.
Qed. | Lemma | nth_error_nil | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_past_end : forall (ls : list T) n,
length ls <= n ->
nth_error ls n = None. | Proof.
clear. induction ls; destruct n; simpl; intros; auto.
+ inversion H.
+ apply IHls. apply Nat.succ_le_mono; assumption.
Qed. | Lemma | nth_error_past_end | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"apply",
"length",
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_length : forall (ls ls' : list T) n,
nth_error (ls ++ ls') (n + length ls) = nth_error ls' n. | Proof.
induction ls; simpl; intros.
rewrite Nat.add_0_r. auto.
rewrite <-Nat.add_succ_comm.
simpl. eapply IHls.
Qed. | Lemma | nth_error_length | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"length",
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_length_ge : forall T (ls : list T) n,
nth_error ls n = None -> length ls <= n. | Proof.
induction ls; destruct n; simpl in *; auto; simpl in *.
+ intro. apply Nat.le_0_l.
+ inversion 1.
+ intros. apply ->Nat.succ_le_mono. auto.
Qed. | Theorem | nth_error_length_ge | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"apply",
"length",
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_length_lt : forall {T} (ls : list T) n val,
nth_error ls n = Some val -> n < length ls. | Proof.
induction ls; destruct n; simpl; intros; auto.
+ inversion H.
+ inversion H.
+ apply Nat.lt_0_succ.
+ apply ->Nat.succ_lt_mono. apply IHls with (1 := H).
Qed. | Lemma | nth_error_length_lt | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"apply",
"length",
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_error_map : forall U (f : T -> U) ls n,
nth_error (map f ls) n = match nth_error ls n with
| None => None
| Some x => Some (f x)
end. | Proof.
induction ls; destruct n; simpl; auto.
Qed. | Theorem | nth_error_map | Data | theories/Data/ListNth.v | [
"Coq.Lists",
"List",
"Coq.Arith",
"PeanoNat"
] | [
"nth_error"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
member (a : T) : list T -> Type | :=
| MZ : forall ls, member a (a :: ls)
| MN : forall l ls, member a ls -> member a (l :: ls). | Inductive | member | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
to_nat {ls} (m : member a ls) : nat | :=
match m with
| MZ _ => 0
| MN _ _ m => S (to_nat m)
end. | Fixpoint | to_nat | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"member"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
member_eta
: forall x ls (m : member x ls),
m = match m in member _ ls
return member x ls
with
| MZ ls => MZ x ls
| MN _ _ n => MN _ n
end. | Proof.
destruct m; auto.
Qed. | Lemma | member_eta | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"member"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
member_case
: forall x ls (m : member x ls),
match ls as ls return member x ls -> Prop with
| nil => fun _ => False
| l :: ls' => fun m =>
(exists (pf : l = x),
m = match pf in _ = z return member z (l :: ls') with
... | Proof.
induction m.
{ left. exists eq_refl. reflexivity. }
{ right. eauto. }
Qed. | Lemma | member_case | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"member"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
to_nat_eq_member_eq
: forall {_ : EqDec T (@eq T)} x ls (a b : member x ls),
to_nat a = to_nat b ->
a = b. | Proof.
induction a; intros.
{ destruct (member_case b).
{ destruct H0. subst.
rewrite (UIP_refl x0). reflexivity. }
{ destruct H0. subst.
simpl in *. congruence. } }
{ destruct (member_case b).
{ exfalso. destruct H0. subst. simpl in *. congruence. }
{ destruct H0. su... | Lemma | to_nat_eq_member_eq | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"UIP_refl",
"member",
"member_case",
"to_nat"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_member (ls : list T) (n : nat) {struct n}
: option { x : T & member x ls } | :=
match ls as ls return option { x : T & member x ls } with
| nil => None
| l :: ls =>
match n with
| 0 => Some (@existT _ (fun x => member x (l :: ls)) l (MZ _ _))
| S n =>
match nth_member ls n with
| Some (existT v m) => Some (@existT _ _ v (MN _... | Fixpoint | nth_member | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"member"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
get_next ls y x (m : member x (y :: ls))
: option (member x ls) | :=
match m in member _ ls'
return match ls' with
| nil => unit
| l' :: ls' => option (member x ls')
end
with
| MZ _ => None
| MN _ _ m => Some m
end. | Definition | get_next | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"member"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_MN x y ls m m' : Injective (@MN x y ls m = @MN x y ls m'). | Proof.
refine {| result := m = m' |}.
intro.
assert (get_next (MN y m) = get_next (MN y m')).
{ rewrite H. reflexivity. }
{ simpl in *. inversion H0. reflexivity. }
Defined. | Instance | Injective_MN | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"Injective",
"assert",
"get_next"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nth_member_nth_error
: forall ls p,
nth_member ls (to_nat (projT2 p)) = Some p <->
nth_error ls (to_nat (projT2 p)) = Some (projT1 p). | Proof.
destruct p. simpl in *.
induction m.
{ simpl. split; auto. }
{ simpl. split.
{ intros. destruct (nth_member ls (to_nat m)); try congruence.
{ destruct s.
inv_all. subst. inv_all. subst.
apply IHm. reflexivity. } }
{ intros.
eapply IHm in H. rewrite ... | Lemma | nth_member_nth_error | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"apply",
"inv_all",
"nth_error",
"nth_member",
"split",
"to_nat"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
member_In : forall ls (t : T), member t ls -> List.In t ls. | Proof.
induction 1; simpl; auto.
Qed. | Lemma | member_In | Data | theories/Data/Member.v | [
"Coq.Lists.List",
"Relations",
"RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Data.SigT",
"ExtLib.Data.ListNth",
"ExtLib.Data.Option",
"ExtLib.Tactics.Injection",
"ExtLib.Tactics.EqDep"
] | [
"member"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_eq : RelDec (@eq nat) | :=
{ rel_dec := Nat.eqb }. | Instance | RelDec_eq | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_lt : RelDec lt | :=
{ rel_dec := Nat.ltb }. | Instance | RelDec_lt | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec",
"lt"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_le : RelDec le | :=
{ rel_dec := Nat.leb }. | Instance | RelDec_le | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_gt : RelDec gt | :=
{ rel_dec := fun x y => Nat.ltb y x }. | Instance | RelDec_gt | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_ge : RelDec ge | :=
{ rel_dec := fun x y => Nat.leb y x }. | Instance | RelDec_ge | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDecCorrect_eq : RelDec_Correct RelDec_eq. | Proof.
constructor; simpl. apply PeanoNat.Nat.eqb_eq.
Qed. | Instance | RelDecCorrect_eq | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_eq",
"apply"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDecCorrect_lt : RelDec_Correct RelDec_lt. | Proof.
constructor; simpl. eapply PeanoNat.Nat.ltb_lt.
Qed. | Instance | RelDecCorrect_lt | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_lt"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDecCorrect_le : RelDec_Correct RelDec_le. | Proof.
constructor; simpl. eapply PeanoNat.Nat.leb_le.
Qed. | Instance | RelDecCorrect_le | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_le"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDecCorrect_gt : RelDec_Correct RelDec_gt. | Proof.
constructor; simpl. unfold rel_dec; simpl.
intros. eapply PeanoNat.Nat.ltb_lt.
Qed. | Instance | RelDecCorrect_gt | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_gt"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDecCorrect_ge : RelDec_Correct RelDec_ge. | Proof.
constructor; simpl. unfold rel_dec; simpl.
intros. eapply PeanoNat.Nat.leb_le.
Qed. | Instance | RelDecCorrect_ge | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_ge"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
R_nat_S : nat -> nat -> Prop | :=
| R_S : forall n, R_nat_S n (S n). | Inductive | R_nat_S | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
wf_R_S : well_founded R_nat_S. | Proof.
red; induction a; constructor; intros.
inversion H.
inversion H; subst; auto.
Defined. | Theorem | wf_R_S | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"R_nat_S"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
R_nat_lt : nat -> nat -> Prop | :=
| R_lt : forall n m, n < m -> R_nat_lt n m. | Inductive | R_nat_lt | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
wf_R_lt : well_founded R_nat_lt. | Proof.
red; induction a; constructor; intros.
{ inversion H. exfalso. subst. inversion H0. }
{ inversion H; clear H; subst. inversion H0; clear H0; subst; auto.
inversion IHa. eapply H. constructor. eapply H1. }
Defined. | Theorem | wf_R_lt | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"R_nat_lt"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Monoid_nat_plus : Monoid nat | :=
{| monoid_plus := plus
; monoid_unit := 0
|}. | Definition | Monoid_nat_plus | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Monoid"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Monoid_nat_mult : Monoid nat | :=
{| monoid_plus := mult
; monoid_unit := 1
|}. | Definition | Monoid_nat_mult | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Monoid"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_S (a b : nat) : Injective (S a = S b). | refine {| result := a = b |}.
abstract (inversion 1; auto).
Defined. | Instance | Injective_S | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nat_get_eq (n m : nat) (pf : unit -> n = m) : n = m | :=
match PeanoNat.Nat.eq_dec n m with
| left pf => pf
| right bad => match bad (pf tt) with end
end. | Definition | nat_get_eq | Data | theories/Data/Nat.v | [
"Coq.Arith",
"Arith",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Monoid",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"eq_dec"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Foldable_option {T} : Foldable (option T) T | :=
fun _ f d v =>
match v with
| None => d
| Some x => f x d
end. | Instance | Foldable_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Foldable"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Traversable_option : Traversable option | :=
{| mapT := fun F _ _ _ f o =>
match o with
| None => pure None
| Some o => ap (pure (@Some _)) (f o)
end
|}. | Instance | Traversable_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Traversable",
"pure"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Applicative_option : Applicative option | :=
{| pure := @Some
; ap := fun _ _ f x =>
match f , x with
| Some f , Some x => Some (f x)
| _ , _ => None
end
|}. | Instance | Applicative_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Applicative",
"pure"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Functor_option : Functor option | :=
{| fmap := fun _ _ f x => match x with
| None => None
| Some x => Some (f x)
end |}. | Instance | Functor_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Functor"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Roption : Relation_Definitions.relation (option T) | :=
| Roption_None : Roption None None
| Roption_Some : forall x y, R x y -> Roption (Some x) (Some y). | Inductive | Roption | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Reflexive_Roption : Reflexive R -> Reflexive Roption. | Proof. clear. compute. destruct x; try constructor; auto. Qed. | Lemma | Reflexive_Roption | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Symmetric_Roption : Symmetric R -> Symmetric Roption. | Proof. clear. compute. intros.
destruct H0; constructor. auto.
Qed. | Lemma | Symmetric_Roption | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Transitive_Roption : Transitive R -> Transitive Roption. | Proof.
clear. compute. intros.
destruct H0; auto.
inversion H1. constructor; auto. subst. eapply H; eassumption.
Qed. | Lemma | Transitive_Roption | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Roption_None
: Injective (Roption None None). | refine {| result := True |}.
auto.
Defined. | Instance | Injective_Roption_None | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Injective",
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Roption_None_Some a
: Injective (Roption None (Some a)). | refine {| result := False |}.
inversion 1.
Defined. | Instance | Injective_Roption_None_Some | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Injective",
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Roption_Some_None a
: Injective (Roption (Some a) None). | refine {| result := False |}.
inversion 1.
Defined. | Instance | Injective_Roption_Some_None | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Injective",
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Roption_Some_Some a b
: Injective (Roption (Some a) (Some b)). | refine {| result := R a b |}.
inversion 1. auto.
Defined. | Instance | Injective_Roption_Some_Some | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Injective",
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Proper_Roption_Some x
: Injective (Proper Roption (Some x)). | refine {| result := R x x |}.
abstract (inversion 1; assumption).
Defined. | Instance | Injective_Proper_Roption_Some | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Injective",
"Roption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Some (T : Type) (a b : T) : Injective (Some a = Some b) | :=
{ result := a = b
; injection :=
fun P : Some a = Some b =>
match P with
| eq_refl => eq_refl
end
}. | Instance | Injective_Some | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"Injective"
] | Global Instance FunctorLaws_option : FunctorLaws Functor_option type_option.
Proof.
constructor.
{ simpl. red. destruct x; destruct y; simpl; auto.
inversion 1; simpl. red in H0.
unfold id. constructor. etransitivity. eapply H0. 2: eauto.
eapply proper_left; eauto.
inversion 1. }
{ intros. simpl i... | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
EqDec_option (T : Type) (EDT : EquivDec.EqDec T (@eq T)) : EquivDec.EqDec (option T) (@eq _). | Proof.
red. unfold Equivalence.equiv, RelationClasses.complement. intros.
change (x = y -> False) with (x <> y).
decide equality. apply EDT.
Qed. | Instance | EqDec_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"apply"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_eq_option : RelDec (@eq (option T)) | :=
{ rel_dec := fun x y =>
match x , y with
| None , None => true
| Some x , Some y => eq_dec x y
| _ , _ => false
end }. | Instance | RelDec_eq_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"RelDec",
"eq_dec"
] | Specialization for equality * | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
RelDec_Correct_eq_option : RelDec_Correct RelDec_eq_option. | Proof.
constructor; destruct x; destruct y; split; simpl in *; intros; try congruence;
f_equal; try match goal with
| [ H : context [ eq_dec ?X ?Y ] |- _ ] =>
consider (eq_dec X Y)
| [ |- context [ eq_dec ?X ?Y ] ] =>
cons... | Instance | RelDec_Correct_eq_option | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [
"RelDec_Correct",
"RelDec_eq_option",
"consider",
"context",
"eq_dec",
"split"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
eq_option_eq
: forall T (a b : T) (pf : a = b) (F : _ -> Type) val,
match pf in _ = x return option (F x) with
| eq_refl => val
end = match val with
| None => None
| Some val => Some match pf in _ = x return F x with
| eq_refl => val
... | Proof.
destruct pf. destruct val; reflexivity.
Defined. | Lemma | eq_option_eq | Data | theories/Data/Option.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"Coq.Classes.Morphisms",
"ExtLib.Core.RelDec",
"ExtLib.Structures.Reducible",
"ExtLib.Structures.Traversable",
"ExtLib.Structures.Applicative",
"ExtLib.Structures.Functor",
"ExtLib.Structures.FunctorLaws",
"ExtLib.Data.Fun",
"E... | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Eqpair : relation (T * U) | :=
| Eqpair_both : forall a b c d, rT a b -> rU c d -> Eqpair (a,c) (b,d). | Inductive | Eqpair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Reflexive_Eqpair {RrT : Reflexive rT} {RrU : Reflexive rU}
: Reflexive Eqpair. | Proof. red. destruct x. constructor; reflexivity. Qed. | Instance | Reflexive_Eqpair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Eqpair"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Symmetric_Eqpair {RrT : Symmetric rT} {RrU : Symmetric rU}
: Symmetric Eqpair. | Proof. red. inversion 1; constructor; symmetry; assumption. Qed. | Instance | Symmetric_Eqpair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Eqpair"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Transitive_Eqpair {RrT : Transitive rT} {RrU : Transitive rU}
: Transitive Eqpair. | Proof. red. inversion 1; inversion 1; constructor; etransitivity; eauto. Qed. | Instance | Transitive_Eqpair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Eqpair"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_Eqpair a b c d : Injective (Eqpair (a,b) (c,d)). | refine {| result := rT a c /\ rU b d |}.
abstract (inversion 1; auto).
Defined. | Instance | Injective_Eqpair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Eqpair",
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
R_pair : T * U -> T * U -> Prop | :=
| L : forall l l' r r',
RT l l' -> R_pair (l,r) (l',r')
| R : forall l r r',
RU r r' -> R_pair (l,r) (l,r'). | Inductive | R_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
wf_RT : well_founded RT. | Hypothesis | wf_RT | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | ||
wf_RU : well_founded RU. | Hypothesis | wf_RU | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | ||
wf_R_pair : well_founded R_pair. | Proof.
red. intro x.
destruct x. generalize dependent u.
apply (well_founded_ind wf_RT (fun t => forall u : U, Acc R_pair (t, u))) .
do 2 intro.
apply (well_founded_ind wf_RU (fun u => Acc R_pair (x,u))). intros.
constructor. destruct y.
remember (t0,u). remember (x,x0). inversion 1; subst;... | Theorem | wf_R_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"R_pair",
"apply",
"wf_RT",
"wf_RU"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_equ_pair : RelDec (fun x y => eqT (fst x) (fst y) /\ eqU (snd x) (snd y)) | :=
{ rel_dec := fun x y =>
if rel_dec (fst x) (fst y) then
rel_dec (snd x) (snd y)
else false }. | Instance | RelDec_equ_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_Correct_equ_pair : RelDec_Correct RelDec_equ_pair. | Proof.
constructor; destruct x; destruct y; split; simpl in *; intros;
repeat match goal with
| [ H : context [ rel_dec ?X ?Y ] |- _ ] =>
consider (rel_dec X Y); intros; subst
| [ |- context [ rel_dec ?X ?Y ] ] =>
consider (rel_dec X Y); intros; ... | Instance | RelDec_Correct_equ_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_equ_pair",
"consider",
"context",
"split"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
RelDec_eq_pair : RelDec (@eq (T * U)) | :=
{ rel_dec := fun x y =>
if rel_dec (fst x) (fst y) then
rel_dec (snd x) (snd y)
else false }. | Instance | RelDec_eq_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec"
] | Specialization for equality * | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 |
RelDec_Correct_eq_pair : RelDec_Correct RelDec_eq_pair. | Proof.
constructor; destruct x; destruct y; split; simpl in *; intros;
repeat match goal with
| [ H : context [ rel_dec ?X ?Y ] |- _ ] =>
consider (rel_dec X Y); intros; subst
| [ |- context [ rel_dec ?X ?Y ] ] =>
consider (rel_dec X Y); intros; ... | Instance | RelDec_Correct_eq_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"RelDec_Correct",
"RelDec_eq_pair",
"consider",
"context",
"split"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
Injective_pair T U (a :T) (b:U) c d : Injective ((a,b) = (c,d)). | Proof.
refine {| result := a = c /\ b = d |}.
abstract (inversion 1; intuition).
Defined. | Instance | Injective_pair | Data | theories/Data/Pair.v | [
"Coq.Relations.Relation_Definitions",
"Coq.Classes.RelationClasses",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection"
] | [
"Injective"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
plist : Type@{i} | :=
| pnil
| pcons : T -> plist -> plist. | Inductive | plist | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
length (ls : plist) : nat | :=
match ls with
| pnil => 0
| pcons _ ls' => S (length ls')
end. | Fixpoint | length | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
app (ls ls' : plist) : plist | :=
match ls with
| pnil => ls'
| pcons l ls => pcons l (app ls ls')
end. | Fixpoint | app | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
hd (ls : plist) : poption T | :=
match ls with
| pnil => pNone
| pcons x _ => pSome x
end. | Definition | hd | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist",
"poption"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
tl (ls : plist) : plist | :=
match ls with
| pnil => ls
| pcons _ ls => ls
end. | Definition | tl | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
pIn (a : T) (l : plist) : Prop | :=
match l with
| pnil => False
| pcons b m => b = a \/ pIn a m
end. | Fixpoint | pIn | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
pNoDup : plist -> Prop | :=
pNoDup_nil : pNoDup pnil
| pNoDup_cons : forall (x : T) (l : plist),
~ pIn x l -> pNoDup l -> pNoDup (pcons x l). | Inductive | pNoDup | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"pIn",
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
inb {RelDecA : RelDec (@eq T)} (x : T) (lst : plist) | :=
match lst with
| pnil => false
| pcons l ls => if x ?[ eq ] l then true else inb x ls
end. | Fixpoint | inb | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"RelDec",
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
anyb (p : T -> bool) (ls : plist) : bool | :=
match ls with
| pnil => false
| pcons l ls0 => if p l then true else anyb p ls0
end. | Fixpoint | anyb | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
allb (p : T -> bool) (lst : plist) : bool | :=
match lst with
| pnil => true
| pcons l ls => if p l then allb p ls else false
end. | Fixpoint | allb | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"plist"
] | https://github.com/coq-community/coq-ext-lib | ddd03d257f6b85a93bfaa0ed4d03658e0ddf5075 | |
nodup {RelDecA : RelDec (@eq T)} (lst : plist) | :=
match lst with
| pnil => true
| pcons l ls => andb (negb (inb l ls)) (nodup ls)
end. | Fixpoint | nodup | Data | theories/Data/PList.v | [
"ExtLib.Structures.Functor",
"ExtLib.Structures.Applicative",
"ExtLib.Data.POption",
"ExtLib.Data.PPair",
"ExtLib.Core.RelDec",
"ExtLib.Tactics.Consider",
"ExtLib.Tactics.Injection",
"Coq.Bool.Bool"
] | [
"RelDec",
"inb",
"plist"
] | 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.