Lesson 10 of 15

Ideals

Ideals

An ideal II of a ring RR is a subset that is:

  1. A subgroup of (R,+)(R, +)
  2. Absorbing under multiplication: for all r∈Rr \in R and a∈Ia \in I, both ra∈Ira \in I and ar∈Iar \in I

Ideals are to rings what normal subgroups are to groups — they let us form quotient structures.

Ideals in Zn\mathbb{Z}_n

In Zn\mathbb{Z}_n, every ideal is principal — generated by a single element. The ideal generated by aa is:

⟨a⟩={0,a,2a,3a,…}(modn)\langle a \rangle = \{0, a, 2a, 3a, \ldots\} \pmod{n}

which equals {ka mod n:k=0,1,…}\{ka \bmod n : k = 0, 1, \ldots\}.

Example: Ideals of Z6\mathbb{Z}_6

  • ⟨0⟩={0}\langle 0 \rangle = \{0\}
  • ⟨1⟩={0,1,2,3,4,5}=Z6\langle 1 \rangle = \{0, 1, 2, 3, 4, 5\} = \mathbb{Z}_6
  • ⟨2⟩={0,2,4}\langle 2 \rangle = \{0, 2, 4\}
  • ⟨3⟩={0,3}\langle 3 \rangle = \{0, 3\}

Note: ⟨4⟩={0,4,2}=⟨2⟩\langle 4 \rangle = \{0, 4, 2\} = \langle 2 \rangle and ⟨5⟩=⟨1⟩\langle 5 \rangle = \langle 1 \rangle.

Maximal and Prime Ideals

  • An ideal I≠RI \neq R is maximal if no ideal lies strictly between II and RR
  • An ideal II is prime if ab∈Iab \in I implies a∈Ia \in I or b∈Ib \in I

In Zn\mathbb{Z}_n, ⟨d⟩\langle d \rangle is a prime ideal if and only if dd is prime (or d=0d = 0 when nn is prime).

Your Task

Implement principal_ideal(a, n) returning the sorted elements of ⟨a⟩\langle a \rangle in Zn\mathbb{Z}_n, 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.