fact stringlengths 8 1.54k | type stringclasses 19 values | library stringclasses 8 values | imports listlengths 1 10 | filename stringclasses 98 values | symbolic_name stringlengths 1 42 | docstring stringclasses 1 value |
|---|---|---|---|---|---|---|
double_eq0n : (n.*2 == 0) = (n == 0).
Proof. by case: n. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | double_eq0 | |
doubleMlm n : (m * n).*2 = m.*2 * n.
Proof. by rewrite -!mul2n mulnA. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | doubleMl | |
doubleMrm n : (m * n).*2 = m * n.*2.
Proof. by rewrite -!muln2 mulnA. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | doubleMr | |
half(n : nat) : nat := if n is n'.+1 then uphalf n' else n
with uphalf (n : nat) : nat := if n is n'.+1 then n'./2.+1 else n
where "n ./2" := (half n) : nat_scope. | Fixpoint | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | half | |
uphalfEn : uphalf n = n.+1./2.
Proof. by []. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | uphalfE | |
doubleK: cancel double half.
Proof. by elim=> //= n ->. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | doubleK | |
half_double:= doubleK. | Definition | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | half_double | |
double_inj:= can_inj doubleK. | Definition | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | double_inj | |
uphalf_doublen : uphalf n.*2 = n.
Proof. by elim: n => //= n ->. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | uphalf_double | |
uphalf_halfn : uphalf n = odd n + n./2.
Proof. by elim: n => //= n ->; rewrite addnA addn_negb. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | uphalf_half | |
odd_double_halfn : odd n + n./2.*2 = n.
Proof.
by elim: n => //= n {3}<-; rewrite uphalf_half doubleD; case (odd n).
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_double_half | |
halfKn : n./2.*2 = n - odd n.
Proof. by rewrite -[n in n - _]odd_double_half addnC addnK. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | halfK | |
uphalfKn : (uphalf n).*2 = odd n + n.
Proof. by rewrite uphalfE halfK/=; case: odd; rewrite ?subn1. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | uphalfK | |
odd_halfKn : odd n -> n./2.*2 = n.-1.
Proof. by rewrite halfK => ->; rewrite subn1. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_halfK | |
even_halfKn : ~~ odd n -> n./2.*2 = n.
Proof. by rewrite halfK => /negbTE->; rewrite subn0. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | even_halfK | |
odd_uphalfKn : odd n -> (uphalf n).*2 = n.+1.
Proof. by rewrite uphalfK => ->. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_uphalfK | |
even_uphalfKn : ~~ odd n -> (uphalf n).*2 = n.
Proof. by rewrite uphalfK => /negbTE->. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | even_uphalfK | |
half_bit_doublen (b : bool) : (b + n.*2)./2 = n.
Proof. by case: b; rewrite /= (half_double, uphalf_double). Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | half_bit_double | |
halfDm n : (m + n)./2 = (odd m && odd n) + (m./2 + n./2).
Proof.
rewrite -[n in LHS]odd_double_half addnCA.
rewrite -[m in LHS]odd_double_half -addnA -doubleD.
by do 2!case: odd; rewrite /= ?add0n ?half_double ?uphalf_double.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | halfD | |
half_leqm n : m <= n -> m./2 <= n./2.
Proof. by move/subnK <-; rewrite halfD addnA leq_addl. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | half_leq | |
geq_half_doublem n : (m <= n./2) = (m.*2 <= n).
Proof.
rewrite -[X in _.*2 <= X]odd_double_half.
case: odd; last by rewrite leq_double.
by case: m => // m; rewrite doubleS ltnS ltn_double.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | geq_half_double | |
ltn_half_doublem n : (m./2 < n) = (m < n.*2).
Proof. by rewrite ltnNge geq_half_double -ltnNge. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltn_half_double | |
leq_half_doublem n : (m./2 <= n) = (m <= n.*2.+1).
Proof. by case: m => [|[|m]] //; rewrite ltnS ltn_half_double. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leq_half_double | |
gtn_half_doublem n : (n < m./2) = (n.*2.+1 < m).
Proof. by rewrite ltnNge leq_half_double -ltnNge. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | gtn_half_double | |
half_gt0n : (0 < n./2) = (1 < n).
Proof. by case: n => [|[]]. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | half_gt0 | |
uphalf_leqm n : m <= n -> uphalf m <= uphalf n.
Proof.
move/subnK <-; rewrite !uphalf_half oddD halfD !addnA.
by do 2 case: odd; apply: leq_addl.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | uphalf_leq | |
leq_uphalf_doublem n : (uphalf m <= n) = (m <= n.*2).
Proof. by rewrite uphalfE leq_half_double. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leq_uphalf_double | |
geq_uphalf_doublem n : (m <= uphalf n) = (m.*2 <= n.+1).
Proof. by rewrite uphalfE geq_half_double. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | geq_uphalf_double | |
gtn_uphalf_doublem n : (n < uphalf m) = (n.*2 < m).
Proof. by rewrite uphalfE gtn_half_double. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | gtn_uphalf_double | |
ltn_uphalf_doublem n : (uphalf m < n) = (m.+1 < n.*2).
Proof. by rewrite uphalfE ltn_half_double. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltn_uphalf_double | |
uphalf_gt0n : (0 < uphalf n) = (0 < n).
Proof. by case: n. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | uphalf_gt0 | |
odd_geqm n : odd n -> (m <= n) = (m./2.*2 <= n).
Proof.
move=> odd_n; rewrite -[m in LHS]odd_double_half -[n]odd_double_half odd_n.
by case: (odd m); rewrite // leq_Sdouble ltnS leq_double.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_geq | |
odd_ltnm n : odd n -> (n < m) = (n < m./2.*2).
Proof. by move=> odd_n; rewrite !ltnNge odd_geq. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_ltn | |
odd_gt0n : odd n -> n > 0. Proof. by case: n. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_gt0 | |
odd_gt2n : odd n -> n > 1 -> n > 2.
Proof. by move=> odd_n n_gt1; rewrite odd_geq. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | odd_gt2 | |
mulnnm : m * m = m ^ 2.
Proof. by rewrite !expnS muln1. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | mulnn | |
sqrnDm n : (m + n) ^ 2 = m ^ 2 + n ^ 2 + 2 * (m * n).
Proof.
rewrite -!mulnn mul2n mulnDr !mulnDl (mulnC n) -!addnA.
by congr (_ + _); rewrite addnA addnn addnC.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | sqrnD | |
sqrnBm n : n <= m -> (m - n) ^ 2 = m ^ 2 + n ^ 2 - 2 * (m * n).
Proof.
move/subnK <-; rewrite addnK sqrnD -addnA -addnACA -addnA.
by rewrite addnn -mul2n -mulnDr -mulnDl addnK.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | sqrnB | |
sqrnD_subm n : n <= m -> (m + n) ^ 2 - 4 * (m * n) = (m - n) ^ 2.
Proof.
move=> le_nm; rewrite -[4]/(2 * 2) -mulnA mul2n -addnn subnDA.
by rewrite sqrnD addnK sqrnB.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | sqrnD_sub | |
subn_sqrm n : m ^ 2 - n ^ 2 = (m - n) * (m + n).
Proof. by rewrite mulnBl !mulnDr addnC (mulnC m) subnDl. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | subn_sqr | |
ltn_sqrm n : (m ^ 2 < n ^ 2) = (m < n).
Proof. by rewrite ltn_exp2r. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltn_sqr | |
leq_sqrm n : (m ^ 2 <= n ^ 2) = (m <= n).
Proof. by rewrite leq_exp2r. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leq_sqr | |
sqrn_gt0n : (0 < n ^ 2) = (0 < n).
Proof. exact: (ltn_sqr 0). Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | sqrn_gt0 | |
eqn_sqrm n : (m ^ 2 == n ^ 2) = (m == n).
Proof. by rewrite eqn_exp2r. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | eqn_sqr | |
sqrn_inj: injective (expn ^~ 2).
Proof. exact: expIn. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | sqrn_inj | |
leqifm n C := ((m <= n) * ((m == n) = C))%type. | Definition | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif | |
leq_of_leqifm n C (H : m <= n ?= iff C) := H.1 : m <= n. | Coercion | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leq_of_leqif | |
leqifPm n C : reflect (m <= n ?= iff C) (if C then m == n else m < n).
Proof.
rewrite ltn_neqAle; apply: (iffP idP) => [|lte]; last by rewrite !lte; case C.
by case C => [/eqP-> | /andP[/negPf]]; split=> //; apply: eqxx.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqifP | |
leqif_reflm C : reflect (m <= m ?= iff C) C.
Proof. by apply: (iffP idP) => [-> | <-] //; split; rewrite ?eqxx. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif_refl | |
leqif_transm1 m2 m3 C12 C23 :
m1 <= m2 ?= iff C12 -> m2 <= m3 ?= iff C23 -> m1 <= m3 ?= iff C12 && C23.
Proof.
move=> ltm12 ltm23; apply/leqifP; rewrite -ltm12.
have [->|eqm12] := eqVneq; first by rewrite ltn_neqAle !ltm23 andbT; case C23.
by rewrite (@leq_trans m2) ?ltm23 // ltn_neqAle eqm12 ltm12.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif_trans | |
mono_leqiff : {mono f : m n / m <= n} ->
forall m n C, (f m <= f n ?= iff C) = (m <= n ?= iff C).
Proof. by move=> f_mono m n C; rewrite /leqif !eqn_leq !f_mono. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | mono_leqif | |
leqif_geqm n : m <= n -> m <= n ?= iff (m >= n).
Proof. by move=> lemn; split=> //; rewrite eqn_leq lemn. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif_geq | |
leqif_eqm n : m <= n -> m <= n ?= iff (m == n).
Proof. by []. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif_eq | |
geq_leqifa b C : a <= b ?= iff C -> (b <= a) = C.
Proof. by case=> le_ab; rewrite eqn_leq le_ab. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | geq_leqif | |
ltn_leqifa b C : a <= b ?= iff C -> (a < b) = ~~ C.
Proof. by move=> le_ab; rewrite ltnNge (geq_leqif le_ab). Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltn_leqif | |
ltnNleqifx y C : x <= y ?= iff ~~ C -> (x < y) = C.
Proof. by move=> /ltn_leqif; rewrite negbK. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltnNleqif | |
eq_leqifx y C : x <= y ?= iff C -> (x == y) = C.
Proof. by move=> /leqifP; case: C ltngtP => [] []. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | eq_leqif | |
eqTleqifx y C : x <= y ?= iff C -> C -> x = y.
Proof. by move=> /eq_leqif<-/eqP. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | eqTleqif | |
leqif_addm1 n1 C1 m2 n2 C2 :
m1 <= n1 ?= iff C1 -> m2 <= n2 ?= iff C2 ->
m1 + m2 <= n1 + n2 ?= iff C1 && C2.
Proof.
rewrite -(mono_leqif (leq_add2r m2)) -(mono_leqif (leq_add2l n1) m2).
exact: leqif_trans.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif_add | |
leqif_mulm1 n1 C1 m2 n2 C2 :
m1 <= n1 ?= iff C1 -> m2 <= n2 ?= iff C2 ->
m1 * m2 <= n1 * n2 ?= iff (n1 * n2 == 0) || (C1 && C2).
Proof.
case: n1 => [|n1] le1; first by case: m1 le1 => [|m1] [_ <-] //.
case: n2 m2 => [|n2] [|m2] /=; try by case=> // _ <-; rewrite !muln0 ?andbF.
have /leq_pmul2l-/mono_leqif<-: 0 < n1.+1 by [].
by apply: leqif_trans; have /leq_pmul2r-/mono_leqif->: 0 < m2.+1.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqif_mul | |
nat_Cauchym n : 2 * (m * n) <= m ^ 2 + n ^ 2 ?= iff (m == n).
Proof.
without loss le_nm: m n / n <= m.
by have [?|/ltnW ?] := leqP n m; last rewrite eq_sym addnC (mulnC m); apply.
apply/leqifP; have [-> | ne_mn] := eqVneq; first by rewrite addnn mul2n.
by rewrite -subn_gt0 -sqrnB // sqrn_gt0 subn_gt0 ltn_neqAle eq_sym ne_mn.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | nat_Cauchy | |
nat_AGM2m n : 4 * (m * n) <= (m + n) ^ 2 ?= iff (m == n).
Proof.
rewrite -[4]/(2 * 2) -mulnA mul2n -addnn sqrnD; apply/leqifP.
by rewrite ltn_add2r eqn_add2r ltn_neqAle !nat_Cauchy; case: eqVneq.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | nat_AGM2 | |
contraTleqb m n : (n < m -> ~~ b) -> (b -> m <= n).
Proof. by rewrite ltnNge; apply: contraTT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraTleq | |
contraTltnb m n : (n <= m -> ~~ b) -> (b -> m < n).
Proof. by rewrite ltnNge; apply: contraTN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraTltn | |
contraPleqP m n : (n < m -> ~ P) -> (P -> m <= n).
Proof. by rewrite ltnNge; apply: contraPT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraPleq | |
contraPltnP m n : (n <= m -> ~ P) -> (P -> m < n).
Proof. by rewrite ltnNge; apply: contraPN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraPltn | |
contraNleqb m n : (n < m -> b) -> (~~ b -> m <= n).
Proof. by rewrite ltnNge; apply: contraNT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraNleq | |
contraNltnb m n : (n <= m -> b) -> (~~ b -> m < n).
Proof. by rewrite ltnNge; apply: contraNN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraNltn | |
contra_not_leqP m n : (n < m -> P) -> (~ P -> m <= n).
Proof. by rewrite ltnNge; apply: contra_notT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_not_leq | |
contra_not_ltnP m n : (n <= m -> P) -> (~ P -> m < n).
Proof. by rewrite ltnNge; apply: contra_notN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_not_ltn | |
contraFleqb m n : (n < m -> b) -> (b = false -> m <= n).
Proof. by rewrite ltnNge; apply: contraFT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraFleq | |
contraFltnb m n : (n <= m -> b) -> (b = false -> m < n).
Proof. by rewrite ltnNge; apply: contraFN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contraFltn | |
contra_leqTb m n : (~~ b -> m < n) -> (n <= m -> b).
Proof. by rewrite ltnNge; apply: contraTT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_leqT | |
contra_ltnTb m n : (~~ b -> m <= n) -> (n < m -> b).
Proof. by rewrite ltnNge; apply: contraNT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_ltnT | |
contra_leqNb m n : (b -> m < n) -> (n <= m -> ~~ b).
Proof. by rewrite ltnNge; apply: contraTN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_leqN | |
contra_ltnNb m n : (b -> m <= n) -> (n < m -> ~~ b).
Proof. by rewrite ltnNge; apply: contraNN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_ltnN | |
contra_leq_notP m n : (P -> m < n) -> (n <= m -> ~ P).
Proof. by rewrite ltnNge; apply: contraTnot. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_leq_not | |
contra_ltn_notP m n : (P -> m <= n) -> (n < m -> ~ P).
Proof. by rewrite ltnNge; apply: contraNnot. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_ltn_not | |
contra_leqFb m n : (b -> m < n) -> (n <= m -> b = false).
Proof. by rewrite ltnNge; apply: contraTF. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_leqF | |
contra_ltnFb m n : (b -> m <= n) -> (n < m -> b = false).
Proof. by rewrite ltnNge; apply: contraNF. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_ltnF | |
contra_leqm n p q : (q < p -> n < m) -> (m <= n -> p <= q).
Proof. by rewrite !ltnNge; apply: contraTT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_leq | |
contra_leq_ltnm n p q : (q <= p -> n < m) -> (m <= n -> p < q).
Proof. by rewrite !ltnNge; apply: contraTN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_leq_ltn | |
contra_ltn_leqm n p q : (q < p -> n <= m) -> (m < n -> p <= q).
Proof. by rewrite !ltnNge; apply: contraNT. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_ltn_leq | |
contra_ltnm n p q : (q <= p -> n <= m) -> (m < n -> p < q).
Proof. by rewrite !ltnNge; apply: contraNN. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | contra_ltn | |
homo_ltn_in(D : {pred nat}) (f : nat -> T) (r : T -> T -> Prop) :
(forall y x z, r x y -> r y z -> r x z) ->
{in D &, forall i j k, i < k < j -> k \in D} ->
{in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} ->
{in D &, {homo f : i j / i < j >-> r i j}}.
Proof.
move=> r_trans Dcx r_incr i j iD jD lt_ij; move: (lt_ij) (jD) => /subnKC<-.
elim: (_ - _) => [|k ihk]; first by rewrite addn0 => Dsi; apply: r_incr.
move=> DSiSk [: DSik]; apply: (r_trans _ _ _ (ihk _)); rewrite ?addnS.
by abstract: DSik; apply: (Dcx _ _ iD DSiSk); rewrite ltn_addr ?addnS /=.
by apply: r_incr; rewrite -?addnS.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | homo_ltn_in | |
homo_ltn(f : nat -> T) (r : T -> T -> Prop) :
(forall y x z, r x y -> r y z -> r x z) ->
(forall i, r (f i) (f i.+1)) -> {homo f : i j / i < j >-> r i j}.
Proof. by move=> /(@homo_ltn_in predT f) fr fS i j; apply: fr. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | homo_ltn | |
homo_leq_in(D : {pred nat}) (f : nat -> T) (r : T -> T -> Prop) :
(forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) ->
{in D &, forall i j k, i < k < j -> k \in D} ->
{in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} ->
{in D &, {homo f : i j / i <= j >-> r i j}}.
Proof.
move=> r_refl r_trans Dcx /(homo_ltn_in r_trans Dcx) lt_r i j iD jD.
case: ltngtP => [? _||->] //; exact: lt_r.
Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | homo_leq_in | |
homo_leq(f : nat -> T) (r : T -> T -> Prop) :
(forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) ->
(forall i, r (f i) (f i.+1)) -> {homo f : i j / i <= j >-> r i j}.
Proof. by move=> rrefl /(@homo_leq_in predT f r) fr fS i j; apply: fr. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | homo_leq | |
ltnW_homo: {homo f : m n / m < n} -> {homo f : m n / m <= n}.
Proof. exact: homoW. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltnW_homo | |
inj_homo_ltn: injective f -> {homo f : m n / m <= n} ->
{homo f : m n / m < n}.
Proof. exact: inj_homo. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | inj_homo_ltn | |
ltnW_nhomo: {homo f : m n /~ m < n} -> {homo f : m n /~ m <= n}.
Proof. exact: homoW. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltnW_nhomo | |
inj_nhomo_ltn: injective f -> {homo f : m n /~ m <= n} ->
{homo f : m n /~ m < n}.
Proof. exact: inj_homo. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | inj_nhomo_ltn | |
incn_inj: {mono f : m n / m <= n} -> injective f.
Proof. exact: mono_inj. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | incn_inj | |
decn_inj: {mono f : m n /~ m <= n} -> injective f.
Proof. exact: mono_inj. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | decn_inj | |
leqW_mono: {mono f : m n / m <= n} -> {mono f : m n / m < n}.
Proof. exact: anti_mono. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqW_mono | |
leqW_nmono: {mono f : m n /~ m <= n} -> {mono f : m n /~ m < n}.
Proof. exact: anti_mono. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leqW_nmono | |
leq_mono: {homo f : m n / m < n} -> {mono f : m n / m <= n}.
Proof. exact: total_homo_mono. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leq_mono | |
leq_nmono: {homo f : m n /~ m < n} -> {mono f : m n /~ m <= n}.
Proof. exact: total_homo_mono. Qed.
Variables (D D' : {pred nat}). | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | leq_nmono | |
ltnW_homo_in: {in D & D', {homo f : m n / m < n}} ->
{in D & D', {homo f : m n / m <= n}}.
Proof. exact: homoW_in. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltnW_homo_in | |
ltnW_nhomo_in: {in D & D', {homo f : m n /~ m < n}} ->
{in D & D', {homo f : m n /~ m <= n}}.
Proof. exact: homoW_in. Qed. | Lemma | boot | [
"From Corelib Require Import PosDef",
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype"
] | boot/ssrnat.v | ltnW_nhomo_in |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.