FAQ - math-comp/math-comp GitHub Wiki
Mathcomp and SSReflect FAQ
Boolean reflexion
-
proving a
reflect A B
lemmaapply: (iffP idP).
-
This works with more complicated reflexion lemmas than
idP
, for example:reflect (forall x, x \in E -> ...) [forall (x | x \in E), ...]
is proved using:
apply (iffP forall_inP)
-
proving the equality of two booleans by double implications:
apply/idP/idP.
congr in hypothesis:
- My goal is of the form
I'd like to transform it asa = b -> P
This is achieved byf a = f b -> P
move/(congr1 f).
Bigops
\big_(i <- r | P i) F i
Bigops of the form In general lemmas on bigops on sequences are not relativized by the sequence. e.g. eq_bigr
asks to prove forall i, P i -> _
instead of forall i, i \in r -> P i -> _
...
The reason is threefold:
- the dependency on the indexes drops from eqType to Type
- the lemma applies seamlessly to other summations, on fintypes, without introducing a spurious forall r, r \in T, ... quantification in the premisse
- the relativisation can always be recovered using big_seq_cond.
\big_(i in A | P i) F i
Bigops of the form They might seem not general enough to cover goals containing a bigop of the form \big_(i <- r | P i) _
, but they can always be used
by turning the latter into \big_(i < size r | P (tnth r i)) F (tnth r i)
through big_tnth
.