Skip to content

Instantly share code, notes, and snippets.

@adrianparvino
Created November 15, 2018 16:26
Show Gist options
  • Save adrianparvino/1b5ea9bd56b66de10bd036966e9cf2ea to your computer and use it in GitHub Desktop.
Save adrianparvino/1b5ea9bd56b66de10bd036966e9cf2ea to your computer and use it in GitHub Desktop.
Require Import ZArith_base.
Require Import ZArith.BinInt.
Require Import Omega.
Local Open Scope Z.
Definition Even (x : Z) := exists (k : Z), x = 2*k.
Definition Odd (x : Z) := exists (k : Z), x = 2*k + 1.
Theorem even_plus_even : forall (x y : Z), Even x -> Even y -> Even (x + y).
Proof.
unfold Even.
intros until 0.
intros [k] [k'].
exists (k + k').
omega.
Qed.
Theorem even_plus_odd : forall (x y : Z), Even x -> Odd y -> Odd (x + y).
Proof.
unfold Even, Odd.
intros until 0.
intros [k] [k'].
exists (k + k').
omega.
Qed.
Theorem odd_plus_odd : forall (x y : Z), Odd x -> Odd y -> Even (x + y).
Proof.
unfold Even.
intros until 0.
intros [k] [k'].
exists (k' + k + 1).
omega.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment