begin defer assuming x.
- exists x. (* We can use the [x] we got as a witness *)
repeat split.
+ defer.
+ defer.
+ (* This case is interesting: we can prove this subgoal from the
first side-condition we procrastinated earlier.
There are several ways of doing that.
*)
(* omega alone is not able to fetch the fact from the group *)
Fail omega.
apply dup.
(* [deferred exploit] iterates on already deferred subgoals *)
{ deferred exploit (fun H => generalize H). omega. }
apply dup.
(* [deferred] adds the procrastinated facts to the goal *)
{ deferred. omega. }
apply dup.
(* [deferred H: E] adds E as H if it has already been deferred. *)
deferred H: (x >= 2). omega.
(* [deferred H: E] can also be used to add facts _derivable_ from deferred facts *)
deferred H: (x >= 1).
{ (* we get a subgoal with all the deferred facts *)
omega. }
assumption.
- end defer.
(* The [eomega] tactic (from Eomega.v) finds instantiations by using a bruteforce strategy. *)
eomega.
Qed.
(* More realistic example, inspired by the proof of asymptotic complexity for the binary search program below.  See the manual for a more detailed description. *)
(* let rec bsearch (arr: int array) v i j = if j <= i then -1 else begin let m = i + (j - i) / 2 in if v = arr.(m) then m else if v < arr.(m) then bsearch arr v i m else bsearch arr v (m+1) j end *)

Lemma log2_step:
forall n,
2 <= n ->
1 + log2 (n/2) = log2 n.