fact
stringlengths
6
2.88k
type
stringclasses
17 values
library
stringclasses
2 values
imports
listlengths
0
16
filename
stringclasses
89 values
symbolic_name
stringlengths
1
36
docstring
stringclasses
1 value
foo:= nosimpl bar, foo (or foo t') will NOT be expanded by the /= and //= switches unless it is in a forcing context (e.g., in match foo t' with ... end, foo t' will be reduced if this allows the match to be reduced). Note that nosimpl bar is simply notation for a a term that beta-iota reduces to bar; h...
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
foo
master_key: unit. Proof. exact tt. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
master_key
lockedA := let: tt := master_key in fun x : A => x. Register master_key as plugins.ssreflect.master_key. Register locked as plugins.ssreflect.locked.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
locked
lockA x : x = locked x :> A. Proof. unlock; reflexivity. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
lock
done:= trivial; hnf; intros; solve [ do ![solve [trivial | simple refine (@sym_equal _ _ _ _); trivial] | discriminate | contradiction | split] | match goal with H : ~ _ |- _ => solve [case H; trivial] end ].
Ltac
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
done
ssrdone0:= trivial; hnf; intros; solve [ do ![solve [trivial | apply: sym_equal; trivial] | discriminate | contradiction ] | match goal with H : ~ _ |- _ => solve [case H; trivial] end ].
Ltac
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
ssrdone0
unlockableT v := Unlockable {unlocked : T; _ : unlocked = v}.
Structure
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
unlockable
unlockT x C : @unlocked T x C = x. Proof. by case: C. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
unlock
locked_withk := let: tt := k in fun T x => x : T.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
locked_with
locked_withET k x : unkeyed (locked_with k x) = x :> T. Proof. by case: k. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
locked_withE
unlock_withT k x : unlocked (locked_with_unlockable k x) = x :> T. Proof. exact: unlock. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
unlock_with
ssr_have(Plemma : Prop) (Pgoal : Prop) (step : Plemma) (rest : Plemma -> Pgoal) : Pgoal. Proof. exact: rest step. Qed. Register ssr_have as plugins.ssreflect.ssr_have. Polymorphic Lemma ssr_have_upoly@{s1 s2;u1 u2} (Plemma : Type@{s1;u1}) (Pgoal : Type@{s2;u2}) (step : Plemma) (rest : Plemma -> Pgoal) : Pgoal...
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
ssr_have
nary_congruence_statement(n : nat) : (forall B, (B -> B -> Prop) -> Prop) -> Prop := match n with | O => fun k => forall B, k B (fun x1 x2 : B => x1 = x2) | S n' => let k' A B e (f1 f2 : A -> B) := forall x1 x2, x1 = x2 -> (e (f1 x1) (f2 x2) : Prop) in fun k => forall A, nary_congruence_sta...
Fixpoint
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
nary_congruence_statement
nary_congruencen (k := fun B e => forall y : B, (e y y : Prop)) : nary_congruence_statement n k. Proof. have: k _ _ := _; rewrite {1}/k. elim: n k => [|n IHn] k k_P /= A; first exact: k_P. by apply: IHn => B e He; apply: k_P => f x1 x2 <-. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
nary_congruence
ssr_congr_arrowPlemma Pgoal : Plemma = Pgoal -> Plemma -> Pgoal. Proof. by move->. Qed. Arguments ssr_congr_arrow : clear implicits. Register nary_congruence as plugins.ssreflect.nary_congruence. Register ssr_congr_arrow as plugins.ssreflect.ssr_congr_arrow.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
ssr_congr_arrow
iffLR: P -> Q. Proof. by case: eqPQ. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
iffLR
iffRL: Q -> P. Proof. by case: eqPQ. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
iffRL
iffLRn: ~P -> ~Q. Proof. by move=> nP tQ; case: nP; case: eqPQ tQ. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
iffLRn
iffRLn: ~Q -> ~P. Proof. by move=> nQ tP; case: nQ; case: eqPQ tP. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
iffRLn
abstract_contextT (P : T -> Type) x : (forall Q, Q = P -> Q x) -> P x. Proof. by move=> /(_ P); apply. Qed.
Lemma
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
abstract_context
over:= over_rel.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
over
over:= by [ apply: Under_rel.under_rel_done | rewrite over ].
Ltac
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
over
UnderE:= Under_relE.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
UnderE
call_of(condition : unit) (result : bool) := Call {callee : Type}.
Structure
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
call_of
maybeProp(T : Type) := tt.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
maybeProp
callT := Call (maybeProp T) false T.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
call
test_of(result : bool) := Test {condition :> unit}.
Structure
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
test_of
test_Prop(P : Prop) := Test true (maybeProp P).
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
test_Prop
test_negative:= Test false tt.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
test_negative
type:= Check {result : bool; test : test_of result; frame : call_of test result}.
Structure
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
type
checkresult test frame := @Check result test frame.
Definition
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
check
callee: call_of >-> Sortclass.
Coercion
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
callee
frame: type >-> call_of. Abbreviation notProp T := (@check false test_negative (call T)).
Coercion
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
frame
vm_compute_eq{T : Type} (x y : T) := vm_compute : x = y. #[global] Hint Extern 0 (@vm_compute_eq _ _ _) => vm_compute; reflexivity : typeclass_instances.
Class
Corelib
[ "Require Import ssrmatching", "Require Export ssrunder" ]
Corelib/ssr/ssreflect.v
vm_compute_eq
inference, as in the implementation of the mxdirect predicate in matrix.v. - The empty type: void == a notation for the Empty_set type of the standard library. of_void T == the canonical injection void -> T. - Sigma types: tag w == the i of w : {i : I & T i}. ...
Structure
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
inference
fooT sT & T -> sort sT := ... We can avoid specifying sT directly by calling foo (@id T), or specify the call completely while still ensuring the consistency of T and sT, by calling @foo T sT idfun. The phant_id type allows us to extend this trick to non-Type canonical projections. It also allows us to sidestep de...
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
foo
r:= R {x; y : T(x)}. if we need to build an r from a given y0 while inferring some x0, such that y0 : T(x0), we pose
Record
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
r
mk_r.. y .. (x := ...) y' & phant_id y y' := R x y'. Calling @mk_r .. y0 .. id will cause Rocq to use y' := y0, while checking the dependent type constraint y0 : T(x0). - Extensional equality for functions and relations (i.e. functions of two arguments): f1 =1 f2 == f1 x is equal to f2 x for all x. ...
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
mk_r
foox y .. := #[#rec e1, ... #]#. + proofs about foo
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
foo
pair_of_andP Q (PandQ : P /\ Q) := (proj1 PandQ, proj2 PandQ).
Coercion
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
pair_of_and
all_pairI T U (w : forall i : I, T i * U i) := (fun i => (w i).1, fun i => (w i).2).
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
all_pair
applyaT rT (f : aT -> rT) x u := if u is Some y then f y else x.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
apply
defaultT := apply (fun x : T => x).
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
default
bindaT rT (f : aT -> option rT) := apply f None.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
bind
mapaT rT (f : aT -> rT) := bind (fun x => Some (f x)).
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
map
liftaT rT (f : aT -> rT) := fun x => Some (f x).
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
lift
esym:= sym_eq.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
esym
nesym:= sym_not_eq.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
nesym
etrans:= trans_eq.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
etrans
congr1:= f_equal.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
congr1
congr2:= f_equal2.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
congr2
all_equal_toT (x0 : T) := forall x, unkeyed x = x0.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
all_equal_to
unitE: all_equal_to tt. Proof. by case. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
unitE
wrappedT := Wrap {unwrap : T}. Canonical wrap T x := @Wrap T x. Prenex Implicits unwrap wrap Wrap. Delimit Scope function_scope with FUN. Open Scope function_scope.
Structure
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
wrapped
simpl_fun(aT rT : Type) := SimplFun of aT -> rT.
Variant
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
simpl_fun
fun_of_simpl(f : simpl_fun aT rT) := fun x => let: SimplFun lam := f in lam x.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
fun_of_simpl
fun_of_simpl: simpl_fun >-> Funclass.
Coercion
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
fun_of_simpl
SimplFunDeltaaT rT (f : aT -> aT -> rT) := [fun z => f z z].
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
SimplFunDelta
eqfun(f g : B -> A) : Prop := forall x, f x = g x.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
eqfun
eqrel(r s : C -> B -> A) : Prop := forall x y, r x y = s x y.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
eqrel
freflf : eqfun f f. Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
frefl
fsymf g : eqfun f g -> eqfun g f. Proof. by move=> eq_fg x. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
fsym
ftransf g h : eqfun f g -> eqfun g h -> eqfun f h. Proof. by move=> eq_fg eq_gh x; rewrite eq_fg. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
ftrans
rreflr : eqrel r r. Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
rrefl
comp(f : B -> A) (g : C -> B) x := f (g x).
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
comp
catcompg f := comp f g.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
catcomp
pcomp(f : B -> option A) (g : C -> option B) x := obind f (g x).
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
pcomp
eq_compf f' g g' : f =1 f' -> g =1 g' -> comp f g =1 comp f' g'. Proof. by move=> eq_ff' eq_gg' x; rewrite /comp eq_gg' eq_ff'. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
eq_comp
compA{A B C D : Type} (f : B -> A) (g : C -> B) (h : D -> C) : f \o (g \o h) = (f \o g) \o h. Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
compA
idfunT x : T := x. Arguments idfun {T} x /.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
idfun
phant_idT1 T2 v1 v2 := phantom T1 v1 -> phantom T2 v2.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
phant_id
obindEapp(fo : aT -> option rT) : obind fo = oapp fo None. Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
obindEapp
omapEbind: omap f = obind (olift f). Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
omapEbind
omap_id(x : option rT) : omap id x = x. Proof. by case: x. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
omap_id
eq_omap(h : aT -> rT) : f =1 h -> omap f =1 omap h. Proof. by move=> Ef [?|] //=; rewrite Ef. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
eq_omap
omapEapp: omap f = oapp (olift f) None. Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
omapEapp
oappEmap(y0 : rT) x : oapp f y0 x = odflt y0 (omap f x). Proof. by case: x. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
oappEmap
omap_comp: omap (g \o f) =1 omap g \o omap f. Proof. by case. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
omap_comp
oapp_compx : oapp (g \o f) x =1 (@oapp _ _)^~ x g \o omap f. Proof. by case. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
oapp_comp
oapp_comp_f(x : rT) : oapp (g \o f) (g x) =1 g \o oapp f x. Proof. by case. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
oapp_comp_f
olift_comp: olift (g \o f) = olift g \o f. Proof. by []. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
olift_comp
of_voidT (x : void) : T := match x with end.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
of_void
tag:= projT1.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tag
tagged: forall w, T_(tag w) := @projT2 I [eta T_].
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tagged
Taggedx := @existT I [eta T_] i x.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
Tagged
tag2(w : @sigT2 I T_ U_) := let: existT2 _ _ i _ _ := w in i.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tag2
tagged2w : T_(tag2 w) := let: existT2 _ _ _ x _ := w in x.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tagged2
tagged2'w : U_(tag2 w) := let: existT2 _ _ _ _ y := w in y.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tagged2'
Tagged2x y := @existT2 I [eta T_] [eta U_] i x y.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
Tagged2
tag_of_tag2I T_ U_ (w : @sigT2 I T_ U_) := Tagged (fun i => T_ i * U_ i)%type (tagged2 w, tagged2' w).
Coercion
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tag_of_tag2
all_tagI T U : (forall x : I, {y : T x & U x y}) -> {f : forall x, T x & forall x, U x (f x)}. Proof. by move=> fP; exists (fun x => tag (fP x)) => x; case: (fP x). Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
all_tag
all_tag2I T U V : (forall i : I, {y : T i & U i y & V i y}) -> {f : forall i, T i & forall i, U i (f i) & forall i, V i (f i)}. Proof. by case/all_tag=> f /all_pair[]; exists f. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
all_tag2
svalP(u : sig P) : P (sval u). Proof. by case: u. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
svalP
s2val(u : sig2 P Q) := let: exist2 _ _ x _ _ := u in x.
Definition
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
s2val
s2valPu : P (s2val u). Proof. by case: u. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
s2valP
s2valP'u : Q (s2val u). Proof. by case: u. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
s2valP'
tag_of_sigI P (u : @sig I P) := Tagged P (svalP u).
Coercion
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
tag_of_sig
sig_of_sig2I P Q (u : @sig2 I P Q) := exist (fun i => P i /\ Q i) (s2val u) (conj (s2valP u) (s2valP' u)).
Coercion
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
sig_of_sig2
all_sigI T P : (forall x : I, {y : T x | P x y}) -> {f : forall x, T x | forall x, P x (f x)}. Proof. by case/all_tag=> f; exists f. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
all_sig
all_sig2I T P Q : (forall x : I, {y : T x | P x y & Q x y}) -> {f : forall x, T x | forall x, P x (f x) & forall x, Q x (f x)}. Proof. by case/all_sig=> f /all_pair[]; exists f. Qed.
Lemma
Corelib
[ "Require Import ssreflect" ]
Corelib/ssr/ssrfun.v
all_sig2