Lesson 10 of 15
Ideals
Ideals
An ideal of a ring is a subset that is:
- A subgroup of
- Absorbing under multiplication: for all and , both and
Ideals are to rings what normal subgroups are to groups — they let us form quotient structures.
Ideals in
In , every ideal is principal — generated by a single element. The ideal generated by is:
which equals .
Example: Ideals of
Note: and .
Maximal and Prime Ideals
- An ideal is maximal if no ideal lies strictly between and
- An ideal is prime if implies or
In , is a prime ideal if and only if is prime (or when is prime).
Your Task
Implement principal_ideal(a, n) returning the sorted elements of in , all_ideals(n) returning all distinct ideals (sorted by size then lex), and is_prime_ideal(ideal, n) checking the prime ideal condition.
Pyodide loading...
Loading...
Click "Run" to execute your code.