Skip to content

Instantly share code, notes, and snippets.

@keigoi
Last active February 25, 2018 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keigoi/c3817d2aad09e9179465d4261cf5ef9b to your computer and use it in GitHub Desktop.
Save keigoi/c3817d2aad09e9179465d4261cf5ef9b to your computer and use it in GitHub Desktop.
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.
@keigoi
Copy link
Author

keigoi commented Feb 25, 2018

ゴミが残ってるのはご愛嬌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment