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/Numbers/Integer | |
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/Numbers/Integer')
-rw-r--r-- | theories/Numbers/Integer/Abstract/ZAxioms.v | 4 | ||||
-rw-r--r-- | theories/Numbers/Integer/SpecViaZ/ZSigZAxioms.v | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/theories/Numbers/Integer/Abstract/ZAxioms.v b/theories/Numbers/Integer/Abstract/ZAxioms.v index a5be98aab..fd20ce725 100644 --- a/theories/Numbers/Integer/Abstract/ZAxioms.v +++ b/theories/Numbers/Integer/Abstract/ZAxioms.v @@ -114,9 +114,9 @@ Module Type ZQuot' (Z:ZAxiomsMiniSig) := QuotRem' Z <+ QuotRemSpec Z. Module Type ZAxiomsSig := ZAxiomsMiniSig <+ OrderFunctions <+ HasAbs <+ HasSgn <+ NZParity.NZParity <+ NZPow.NZPow <+ NZSqrt.NZSqrt <+ NZLog.NZLog2 <+ NZGcd.NZGcd - <+ ZDiv <+ ZQuot <+ NZBits.NZBits. + <+ ZDiv <+ ZQuot <+ NZBits.NZBits <+ NZSquare. Module Type ZAxiomsSig' := ZAxiomsMiniSig' <+ OrderFunctions' <+ HasAbs <+ HasSgn <+ NZParity.NZParity <+ NZPow.NZPow' <+ NZSqrt.NZSqrt' <+ NZLog.NZLog2 <+ NZGcd.NZGcd' - <+ ZDiv' <+ ZQuot' <+ NZBits.NZBits'. + <+ ZDiv' <+ ZQuot' <+ NZBits.NZBits' <+ NZSquare. diff --git a/theories/Numbers/Integer/SpecViaZ/ZSigZAxioms.v b/theories/Numbers/Integer/SpecViaZ/ZSigZAxioms.v index 5a0f590ba..bfbc063ce 100644 --- a/theories/Numbers/Integer/SpecViaZ/ZSigZAxioms.v +++ b/theories/Numbers/Integer/SpecViaZ/ZSigZAxioms.v @@ -14,7 +14,7 @@ Module ZTypeIsZAxioms (Import ZZ : ZType'). Hint Rewrite spec_0 spec_1 spec_2 spec_add spec_sub spec_pred spec_succ - spec_mul spec_opp spec_of_Z spec_div spec_modulo spec_sqrt + spec_mul spec_opp spec_of_Z spec_div spec_modulo spec_square spec_sqrt spec_compare spec_eqb spec_ltb spec_leb spec_max spec_min spec_abs spec_sgn spec_pow spec_log2 spec_even spec_odd spec_gcd spec_quot spec_rem spec_testbit spec_shiftl spec_shiftr @@ -303,6 +303,13 @@ Proof. intros a b. red. now rewrite spec_pow_N, spec_pow_pos. Qed. +(** Square *) + +Lemma square_spec n : square n == n * n. +Proof. + now zify. +Qed. + (** Sqrt *) Lemma sqrt_spec : forall n, 0<=n -> |