Add Everything (#34)

This commit is contained in:
Patrick Stevens
2019-08-18 10:35:15 +01:00
committed by GitHub
parent a31ae0d1ea
commit e7c54fa48a
45 changed files with 415 additions and 378 deletions

View File

@@ -0,0 +1,39 @@
{-# OPTIONS --safe --warning=error #-}
open import LogicalFormulae
open import Groups.Groups
open import Functions
open import Numbers.Naturals
open import Numbers.Integers
open import IntegersModN
open import Rings.Examples.Proofs
open import PrimeNumbers
module Rings.Examples.Examples where
nToZn : (n : ) (pr : 0 <N n) (x : ) n n pr
nToZn n pr x = nToZn' n pr x
mod : (n : ) (pr : 0 <N n) n n pr
mod n pr a = mod' n pr a
modNExampleSurjective : (n : ) (pr : 0 <N n) Surjection (mod n pr)
modNExampleSurjective n pr = modNExampleSurjective' n pr
{-
modNExampleGroupHom : (n : ) → (pr : 0 <N n) → GroupHom Group (nGroup n pr) (mod n pr)
modNExampleGroupHom n pr = modNExampleGroupHom' n pr
embedZnInZ : {n : } {pr : 0 <N n} → (a : n n pr) →
embedZnInZ record { x = x } = nonneg x
modNRoundTrip : (n : ) → (pr : 0 <N n) → (a : n n pr) → mod n pr (embedZnInZ a) ≡ a
modNRoundTrip zero ()
modNRoundTrip (succ n) pr record { x = x ; xLess = xLess } with divisionAlg (succ n) x
modNRoundTrip (succ n) _ record { x = x ; xLess = xLess } | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall ; quotSmall = quotSmall } = equalityZn _ _ p
where
p : rem ≡ x
p = modIsUnique record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall ; quotSmall = quotSmall } record { quot = 0 ; rem = x ; pr = identityOfIndiscernablesLeft _ _ _ _≡_ refl (applyEquality (λ i → i +N x) (multiplicationNIsCommutative 0 n)) ; remIsSmall = inl xLess ; quotSmall = inl (succIsPositive n) }
modNRoundTrip (succ n) _ record { x = x ; xLess = xLess } | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inr () }
-}