Coq beginner here, I recently went by myself through the first 7 chapters of "Logical Foundations".
I am trying to create a proof by induction in Coq of
∀ n>= 3, 2n+1 < 2^n
.
I start with destruct
removing the false hypotheses until reaching n=3.
Then, I do induction on n, the case for n=3 is trivial but, how can I prove the inductive step??
I can see the goal holds. I can prove it by case analysis using destruct
but, haven't been able to show it in a general form.
The functions I'm using are from "Logical Foundations" and can be seen here.
My proof so far:
(* n>=3, 2n+1 < 2^n *)
Theorem two_n_plus_one_leq_three_lt_wo_pow_n : forall n:nat,
(blt_nat (two_n_plus_one n) (exp 2 n)) = true
-> (bge_nat n 3) = true.
Proof.
intros n.
destruct n.
(* n = 0 *)
compute.
intros H.
inversion H.
destruct n.
(* n = 1 *)
compute.
intros H.
inversion H.
destruct n.
(* n = 2 *)
compute.
intros H.
inversion H.
induction n as [ | k IHk].
(* n = 3 *)
- compute.
reflexivity.
- rewrite <- IHk.
(* Inductive step... *)
n>= 3, 2n+1 < 2^n
does not make any sense. According to the Coq code, you want to prove2n+1 < 2^n -> n >=3
. Shouldn't it be the other way around? – eponierdestruct n
's in one step if you dointros [|[|[|n]]]
. Then based on what you've already written,intros [|[|[|n]]]; try (compute; intro H; inversion H).
should be able to create and then immediately clear then=0,1,2
cases. – tlon