Last active
August 29, 2015 14:05
-
-
Save gallais/f687b7b14ba11e0a342d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import NArith. | |
Fixpoint sum_of (f : nat -> nat) (n : nat) : nat := | |
match n with | |
| O => f O | |
| S m => f (S m) + sum_of f m | |
end. | |
Lemma sum_of_pow : forall n, | |
S (sum_of (NPeano.pow 2) n) = NPeano.pow 2 (S n). | |
intro n; induction n. | |
- reflexivity. | |
- simpl sum_of ; rewrite plus_n_Sm, IHn. | |
simpl ; repeat rewrite <- plus_n_O ; reflexivity. | |
Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment