Rearrange some of Naturals (#48)

This commit is contained in:
Patrick Stevens
2019-10-03 06:53:13 +01:00
committed by GitHub
parent 21ee0f899d
commit 7ed41b0c09
10 changed files with 135 additions and 166 deletions

View File

@@ -80,3 +80,15 @@ multiplicationNIsAssociative (succ a) b c =
transitivity refl
(transitivity refl
(transitivity (applyEquality ((λ x b *N c +N x)) (multiplicationNIsAssociative a b c)) (transitivity (equalityCommutative (productDistributesRight b (a *N b) c)) refl)))
productOne : {a b : } a a *N b (a 0) || (b 1)
productOne {zero} {b} pr = inl refl
productOne {succ a} {zero} pr rewrite multiplicationNIsCommutative a 0 = exFalso (naughtE (equalityCommutative pr))
productOne {succ a} {succ zero} pr = inr refl
productOne {succ a} {succ (succ b)} pr rewrite multiplicationNIsCommutative a (succ (succ b)) | additionNIsCommutative (succ b) (a +N (a +N b *N a)) | additionNIsAssociative (succ a) (a +N b *N a) (succ b) | additionNIsCommutative (a +N b *N a) (succ b) = exFalso (bad pr)
where
bad' : {x : } x succ x False
bad' ()
bad : {x y : } x x +N succ y False
bad {succ x} {zero} pr rewrite additionNIsCommutative x 1 = bad' pr
bad {succ x} {succ y} pr = bad (succInjective pr)