I make such codes, and cannot preceed.
From mathcomp Require Import all_ssreflect.
Require Import QArith.
Example example (f : Q -> bool) :
f 0 = false -> f 1 = true ->
exists g h : nat -> Q,
(g 0%nat = 0 /\ h 0%nat = 1) /\
(forall n : nat,
if (f ((g n%nat + h n%nat)/2))
then (g (n+1)%nat = g n%nat /\
h (n+1)%nat = ((g n%nat + h n%nat)/2))
else (g (n+1)%nat = ((g n%nat + h n%nat)/2) /\
h (n+1)%nat = h n%nat) ).
Proof.
intros.
(With Pierre Castéran's advice, I try to execute the following code.)
Fix g (n: nat) : Q :=
match n with
0% nat => 0
| S p => if (f ((g p + h p) /2))
then g p
else (g p + h p)/2
end
with h (n:nat) : Q :=
match n with
0% nat => 1
| S p => if (f ((g p + h p) /2))
then (g p + h p)/2
else h p
end.
The last code tells me that Syntax error.