Last active
February 25, 2018 14:35
-
-
Save keigoi/c3817d2aad09e9179465d4261cf5ef9b 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 Nat. | |
Require Import Omega. (* fixme *) | |
Fixpoint sum (n:nat) : nat := | |
match n with | |
| O => O | |
| S n => S n + sum n | |
end. | |
Lemma sum_double : forall (n:nat), sum n * 2 = n * (n + 1). | |
Proof. | |
induction n. | |
trivial. | |
unfold sum; fold sum. | |
rewrite Nat.mul_add_distr_r. | |
rewrite IHn. | |
Require Import ArithRing. | |
ring. | |
Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ゴミが残ってるのはご愛嬌