diff options
author | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-07-01 17:38:17 +0000 |
---|---|---|
committer | letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-07-01 17:38:17 +0000 |
commit | d2204e78c2d8bfc4f46ba541749b07dedd5e7969 (patch) | |
tree | d2c9de4d986dc2f37744fad6f434ddac1506a8e0 /theories/ZArith/BinInt.v | |
parent | ae95b79d0912a7b1a5370854cb6fb1aadb1db6b2 (diff) |
Cleanup of files related with power over Z.
- Zpow_def, Zpower, Zpow_facts shortened thanks to stuff in BinInt.Z
- The alternative Zpower_alt is now in a separate file Zpow_alt.v,
not loaded by default.
- Some more injection lemmas in Znat (pow, div, mod, quot, rem)
- Btw, added a "square" function in Z, N, Pos, ... (instead of
Zpow_facts.Zsquare).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14253 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/ZArith/BinInt.v')
-rw-r--r-- | theories/ZArith/BinInt.v | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/theories/ZArith/BinInt.v b/theories/ZArith/BinInt.v index 9e559b68c..4f6fb39c5 100644 --- a/theories/ZArith/BinInt.v +++ b/theories/ZArith/BinInt.v @@ -576,6 +576,20 @@ Proof. now destruct m. Qed. +(** For folding back a [pow_pos] into a [pow] *) + +Lemma pow_pos_fold n p : pow_pos n p = n ^ (Zpos p). +Proof. + reflexivity. +Qed. + +(** ** Specification of square *) + +Lemma square_spec n : square n = n * n. +Proof. + destruct n; trivial; simpl; f_equal; apply Pos.square_spec. +Qed. + (** ** Specification of square root *) Lemma sqrtrem_spec n : 0<=n -> |