Primes and mod-n into the fold (#47)

This commit is contained in:
Patrick Stevens
2019-10-02 18:59:46 +01:00
committed by GitHub
parent 00ce1dfdf8
commit 21ee0f899d
10 changed files with 48 additions and 39 deletions

View File

@@ -3,11 +3,13 @@
open import LogicalFormulae
open import Orders
open import Groups.Groups
open import Numbers.Naturals
open import PrimeNumbers
open import Numbers.Naturals.Naturals
open import Numbers.Naturals.WithK
open import Numbers.Primes.PrimeNumbers
open import Rings.Definition
open import Setoids.Setoids
open import IntegersModN
open import Numbers.Modulo.IntegersModN
open import Semirings.Definition
module IntegersModNRing where
modNTo : {n : } {pr : 0 <N n} (a : n n pr)
@@ -48,7 +50,7 @@ module IntegersModNRing where
nMultIdent {succ zero} {pr} record { x = (succ a) ; xLess = (le diff proof) } = exFalso f
where
f : False
f rewrite additionNIsCommutative diff (succ a) = naughtE (succInjective (equalityCommutative proof))
f rewrite Semiring.commutative Semiring diff (succ a) = naughtE (succInjective (equalityCommutative proof))
nMultIdent {succ (succ n)} {pr} record { x = a ; xLess = aLess } with orderIsTotal a (succ (succ n))
nMultIdent {succ (succ n)} {pr} record { x = a ; xLess = aLess } | inl (inl a<ssn) = equalityZn _ _ refl
nMultIdent {succ (succ n)} {pr} record { x = a ; xLess = aLess } | inl (inr ssn<a) = exFalso (PartialOrder.irreflexive (TotalOrder.order TotalOrder) (PartialOrder.transitive (TotalOrder.order TotalOrder) aLess ssn<a))