Created
March 9, 2015 15:15
-
-
Save puffnfresh/67dee64b8a713ab4211a to your computer and use it in GitHub Desktop.
Z + n = n, (S n) + m = S (n + m)
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
%default total | |
record PlusLike : (Nat -> Nat -> Nat) -> Type where | |
PL : {plus : Nat -> Nat -> Nat} -> | |
(plusIdentity : (n : Nat) -> plus Z n = n) -> | |
(plusSucc : (n, m : Nat) -> plus (S n) m = S (plus n m)) -> | |
PlusLike plus | |
isPlus : (f : Nat -> Nat -> Nat) -> PlusLike f -> (n, m : Nat) -> f n m = plus n m | |
isPlus f (PL plusIdentity _) Z m = plusIdentity m | |
isPlus f (PL plusIdentity plusSucc) (S k) m = | |
let inductiveHypothesis = isPlus f (PL plusIdentity plusSucc) k m | |
in ?isPlusStepCase | |
---------- Proofs ---------- | |
isPlusStepCase = proof | |
intros | |
rewrite sym (plusSucc k m) | |
rewrite inductiveHypothesis | |
trivial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment