Skip to content

Instantly share code, notes, and snippets.

@kik
Created November 17, 2011 14:23
Show Gist options
  • Select an option

  • Save kik/1373247 to your computer and use it in GitHub Desktop.

Select an option

Save kik/1373247 to your computer and use it in GitHub Desktop.
sqrt 2
Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq div fintype.
Require Import finfun path prime.
Theorem s2irr : forall n m, 2 * n ^ 2 = m ^ 2 -> n = 0 /\ m = 0.
Proof.
move=> n m H.
have: ~~((n > 0) && (m > 0)).
apply/negP; case/andP => H1 H2.
move/(congr1 (fun x => odd (logn 2 x))): H.
by rewrite !logn_mul //= ?addnn ?odd_double ?expn_gt0 ?H1.
rewrite negb_and -!eqn0Ngt.
case/orP; move/eqP=> H1; rewrite H1 /= in H *; split => //.
by move/eqP: H; rewrite eq_sym expn_eq0 andbT; move/eqP.
by move/eqP: H; rewrite muln_eq0 orFb expn_eq0 andbT; move/eqP.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment