-
Notifications
You must be signed in to change notification settings - Fork 251
Modular arithmetic in terms of ideals #2729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Kernel file looks nice.
Would you want some help to get this further along? |
Yes, actually. I've been working on a module for the special case of ideals of the ring of integers, and I've been struggling to prove that (for a non-zero modulus) it's finite, which I think it important for the "yes this is modular arithmetic as you know it" feel. I'll post a WIP commit shortly |
Ok, once my students make further progress on the ones they are currently working on, I'll get them to look at this. |
Some errors thrown up by checking with
|
@jamesmckinna I've merged in master, are those two errors fixed now? |
ι : RawGroup.Carrier N → Carrier | ||
ι-monomorphism : IsGroupMonomorphism N rawGroup ι | ||
-- every element of N commutes in G | ||
normal : ∀ n g → ∃[ n′ ] g ∙ ι n ∙ g ⁻¹ ≈ ι n′ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... I was a bit surprised that this was an 'easier' formulation than
normal : ∀ n g → ∃[ n′ ] g ∙ ι n ∙ g ⁻¹ ≈ ι n′ | |
normal : ∀ n g → ∃[ n′ ] g ∙ ι n ≈ ι n′ ∙ g |
which I wondered as to whether
- it would be easier/smoother to show gives rise to an equivalence relation on the quotient
- it would generalise (better) to
Loop
,Quasigroup
or evenMagma
/Semigroup
?
Cf. comments elsewhere from @JacquesCarette about defining 'ideal' via 'sink'...
x * r * a ≈⟨ *-assoc x r a ⟩ | ||
x * (r * a) ≈⟨ *-congˡ (*-comm r a) ⟩ | ||
x * (a * r) ≈⟨ *-assoc x a r ⟨ | ||
x * a * r ∎ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of argument occurs in Algebra.Properties.CommutativeSemigroup
, and might usefully be re-used here?
x * a * r ∎ | ||
} | ||
} | ||
; injective = λ p → p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
; injective = λ p → p | |
; injective = id |
???
infix 0 _by_ | ||
|
||
data _≋_ (x y : Carrier) : Set (c ⊔ ℓ ⊔ c′) where | ||
_by_ : ∀ g → x // y ≈ ι g → x ≋ y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to the type of NormalSubgroup.normal
, is it 'easier' to write
_by_ : ∀ g → x // y ≈ ι g → x ≋ y | |
_by_ : ∀ g → x ≈ ι g ∙ y → x ≋ y |
???
x // z ≈⟨ ∙-congʳ (identityʳ x) ⟨ | ||
x ∙ ε // z ≈⟨ ∙-congʳ (∙-congˡ (inverseˡ y)) ⟨ | ||
x ∙ (y \\ y) // z ≈⟨ ∙-congʳ (assoc x (y ⁻¹) y) ⟨ | ||
(x // y) ∙ y // z ≈⟨ assoc (x // y) y (z ⁻¹) ⟩ | ||
(x // y) ∙ (y // z) ≈⟨ ∙-cong x//y≈ιg y//z≈ιh ⟩ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already covered by Algebra.Properties.Loop
...? And if not, could/should be added?
module _ .{{_ : NonZero m}} where | ||
|
||
from-% : ∀ {x y} → x % m ≡ y % m → x ≋ y | ||
from-% {x} {y} x%m≡y%m = x / m - y / m by begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much of this argument recapitulates concretely reasoning steps already used abstractly in CRT?
Opening this PR to share my WIP. I've got a messy proof of the Chinese remainder theorem for arbitrary rings, but in porting it from my standalone library to this I've somehow made some parameters not infer properly