The binary strategy

In the module strategies, we define a strategy as a mapping gamma on natural numbers,
such that, if n >4, then 1<gamma(n)<n. We prove here that the integer division by 2 is such a strategy.
In fact, it is the worst strategy (see our included paper); we obtained much better results with the so-called dichotomic strategy.

The Coq source is organized as a proof :

Lemma binary:strategy. 
Proof.
 Realizer [n:nat](quotient two n) .
 Program_all.
 Logical goal solving ...
Qed.
The logical part of the proof deals with inequalities, and uses the results of modules Le_lt_compl, euclid, and Mult_compl.

An example

For n=87, the binary strategy give us the chain:
(1,2,4,5,10,20,21,42,43,86,87) which can be viewed as the dag:

Apologies

I am sure that the proof of binary can be shortened. May be in the future releases ...

For the beginner ...

1

The variable quotient comes from $COQTH/PROGRAMS/Euclid_proof:
Lemma quotient : (b:nat)(gt b O)->
     (a:nat){q:nat|(Ex [r:nat](a=(plus (mult q b) r))/\
                              (gt b r))}.
This is why the sequence:
 Realizer [n:nat](quotient two n) .
 Program_all.
 Elim y;Induction 1; Intros  H1 H2.
gives us a goal:
 n0,x:nat.
 H1: n=(plus (mult n0 two) x)
 H2: (gt two x)
 ==================
     (lt (S O) n0) /\ (lt n0 n)

2

Then, the lemma enum1 of Le_lt_compl, used in
Case (enum1 x H2);Intro H3.
gives us two subgoals:

Remark

Perhaps we may have a simpler proof by removing the division in two cases.

A Demo in Caml-Light

#load "Demo.ml";;
##open "Demo";;

#binary;;
- : int -> int = <fun>

#binary 87;;
- : int = 43