two_power
with the Recursive
feature:
Recursive Definition two_power:nat->nat:= O => (S O) | (S n) => (mult two (two_power n)).
two_power
two_power
, which are mainly used in
the module log2
.
They state some relationships between this function and the order on natural
numbers:
two_power
is monotonous (lemmas
two_power_mono
,two_power_le
, two_power_mono_R
).
z
is in the interval
]2^n, 2^(n+1) [ , then z is not a power of 2:
(lemma holes_in_powers
).
This result is used in the proof of
chain_cases
of generation
:
chain_cases:(p:nat)(lt O p)-> {q:nat|(lt q p) /\ (le two q)}+ {l:nat|p=(two_power l)}+ {p=three}.
At some step of this proof, we have the following subgoal:
gamma : strategy log2_r : (n:nat)(lt O n)->(log2_spec n) p : nat H : (lt O p) n : ~p=three l : nat a : (lt (two_power l) p)/\(lt p (two_power (S l))) H4 : p=two ============================ ~p=(two_power one)The command:
Apply holes_in_powers with l;Elim a;Auto.solves this subgoal immediately.