Skip to content

Instantly share code, notes, and snippets.

@LeifW
Created September 29, 2016 05:21
Show Gist options
  • Save LeifW/7c31c8904f3b3f8477c3dd8504335931 to your computer and use it in GitHub Desktop.
Save LeifW/7c31c8904f3b3f8477c3dd8504335931 to your computer and use it in GitHub Desktop.
Natural number associativity proof in tactics and editor commands
natAssoc1 : (x, y, z : Nat) -> x + (y + z) = (x + y) + z
natAssoc1 = ?natAssocProof
natAssocProof = proof
intros
induction x
trivial
intros
compute
rewrite ihn__0
trivial
natAssoc2 : (x, y, z : Nat) -> x + (y + z) = (x + y) + z
natAssoc2 Z y z = Refl
natAssoc2 (S k) y z = cong {f = S} $ natAssoc2 k y z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment