Cleanup finset and modulo (#92)

This commit is contained in:
Patrick Stevens
2020-01-01 10:14:55 +00:00
committed by GitHub
parent b6ef9b46f2
commit 019a9d9a07
66 changed files with 1154 additions and 1431 deletions

View File

@@ -1,7 +1,6 @@
{-# OPTIONS --warning=error --safe --without-K #-}
open import Functions
open import Sets.FinSet
open import LogicalFormulae
open import Groups.Definition
open import Groups.Groups

View File

@@ -8,6 +8,7 @@ open import Rings.Definition
open import Numbers.Naturals.Semiring
open import Numbers.Naturals.Naturals
open import Numbers.Naturals.Order
open import Numbers.Naturals.Order.Lemmas
open import Numbers.Integers.Integers
open import Numbers.Primes.PrimeNumbers
open import Numbers.Modulo.Definition
@@ -32,25 +33,25 @@ module Rings.Examples.Proofs where
subtractionEquiv (succ a) {b} {c} c<b pr = equivalentSubtraction 0 b (succ a) c (succIsPositive a) c<b (equalityCommutative pr)
modNExampleSurjective' : (n : ) (pr : 0 <N n) Surjection (mod' n pr)
Surjection.property (modNExampleSurjective' zero ())
Surjection.property (modNExampleSurjective' (succ n) pr) record { x = x ; xLess = xLess } with divisionAlg (succ n) x
Surjection.property (modNExampleSurjective' (succ n) p) record { x = x ; xLess = xLess } | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall ; quotSmall = q } = nonneg x , lhs'
modNExampleSurjective' zero ()
modNExampleSurjective' (succ n) pr record { x = x ; xLess = xLess } with divisionAlg (succ n) x
modNExampleSurjective' (succ n) p record { x = x ; xLess = xLess } | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall ; quotSmall = q } = nonneg x , lhs'
where
rs' : rem x
rs' = modIsUnique (record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall ; quotSmall = q }) (record { quot = 0 ; rem = x ; pr = blah ; remIsSmall = inl xLess ; quotSmall = inl (succIsPositive n) })
rs' = modIsUnique (record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall ; quotSmall = q }) (record { quot = 0 ; rem = x ; pr = blah ; remIsSmall = inl (<NProp xLess) ; quotSmall = inl (succIsPositive n) })
where
blah : n *N 0 +N x x
blah rewrite multiplicationNIsCommutative n 0 = refl
lhs : nToZn' (succ n) p x record { x = rem ; xLess = remIsSmall }
lhs with divisionAlg (succ n) x
lhs | record { quot = quot' ; rem = rem' ; pr = pr' ; remIsSmall = inl t ; quotSmall = quotSmall } = equalityZn _ _ (equalityCommutative rs)
lhs | record { quot = quot' ; rem = rem' ; pr = pr' ; remIsSmall = inl t ; quotSmall = quotSmall } = equalityZn (equalityCommutative rs)
where
rs : rem rem'
rs = modIsUnique (record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inl remIsSmall; quotSmall = q }) (record { quot = quot' ; rem = rem' ; pr = pr' ; remIsSmall = inl t ; quotSmall = quotSmall })
lhs | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inr () ; quotSmall = quotSmall }
lhs' : nToZn' (succ n) p x record { x = x ; xLess = xLess }
lhs' = transitivity lhs (equalityZn _ _ rs')
Surjection.property (modNExampleSurjective' (succ n) p) record { x = x ; xLess = xLess } | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inr () ; quotSmall = quotSmall }
lhs' = transitivity lhs (equalityZn rs')
modNExampleSurjective' (succ n) p record { x = x ; xLess = xLess } | record { quot = quot ; rem = rem ; pr = pr ; remIsSmall = inr () ; quotSmall = quotSmall }
{-
modNExampleGroupHom' : (n : ) → (pr : 0 <N n) → GroupHom Group (nGroup n pr) (mod' n pr)

View File

@@ -1,7 +1,6 @@
{-# OPTIONS --warning=error --safe --without-K #-}
open import Functions
open import Sets.FinSet
open import LogicalFormulae
open import Groups.Definition
open import Groups.Groups