Created
April 26, 2014 16:32
-
-
Save KeenS/11324597 to your computer and use it in GitHub Desktop.
This file contains 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 Arith. | |
Fixpoint sum_odd(n:nat) : nat := | |
match n with | |
| 0 => 0 | |
| S m => 1 + m + m + sum_odd m | |
end. | |
Goal forall n, sum_odd n = n * n. | |
Proof. | |
intros. | |
induction n. | |
simpl. | |
ring. | |
simpl. | |
rewrite <- (eq_S (n + n + sum_odd n) (n + n * S n)). | |
ring. | |
rewrite IHn. | |
ring. | |
Qed. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment