Advanced maths

Polynomial Chinese remainder decomposition calculator over a finite field

Polynomial Chinese remainder decomposition connects a single quotient ring with several smaller factor quotients.

Your numbers

Ascending integer coefficients by row.
Same row count; ascending coefficients.
Prime 2–97.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Polynomial Chinese remainder decomposition connects a single quotient ring with several smaller factor quotients. This calculator constructs exact orthogonal idempotents, reconstructs a polynomial from prescribed component residues and checks both the component residues and idempotent multiplication identities modulo the selected prime.

THE FORMULAF_p[x]/(product f_i) ≅ product_i F_p[x]/(f_i), for pairwise coprime f_i.

A worked example

Over GF(5), use factors x−1 and x+1 with residues two and three. The reconstructed polynomial is 2x: at x=1 it gives two, while at x=−1 it gives −2=3 modulo five. The product modulus is x²−1.

Good to know

Two to five positive-degree factors, total degree at most 12, prime field 2–97. Factors are normalized monic. Noncoprime factors are rejected rather than treated as a direct product. Ascending integer coefficients and bounded modular arithmetic only.

Coprime factors create independent residue components

Each factor defines one polynomial quotient over the same prime coefficient field. Pairwise coprimality is the condition that makes the component residues independent. A repeated factor shares a nontrivial gcd and cannot be treated as a separate freely chosen coordinate under this direct-product Chinese remainder statement.

Factors may be reducible individually as long as different factors remain coprime. The result is then an isomorphism of quotient rings, not necessarily a product of fields. Calling every component a finite field would incorrectly exclude zero divisors that are allowed by a reducible factor inside its own component ring.

Two residue evaluations reconstruct two x modulo x squared minus onex=1 → residue 2x=−1 → residue 3Over GF(5): reconstructed f(x) = 2x2×1 = 2; 2×(−1) ≡ 3Product modulus: x² − 1
Over GF(5), use factors x−1 and x+1 with residues two and three. The reconstructed polynomial is 2x: at x=1 it gives two, while at x=−1 it gives −2=3 modulo five. The product modulus is x²−1.

The Finite polynomial quotient ring calculator covers the nearby task. Existing quotient arithmetic operates modulo one polynomial; CRT exposes a product-ring isomorphism and its inverse.

Idempotents reconstruct the product-ring coordinates

For each factor, the product of the other factors is inverted modulo that factor using extended Euclidean arithmetic. Multiplying those pieces produces an idempotent that equals one in its own component and zero in all others. The calculator checks these component identities through exact modular polynomial operations.

The idempotents are pairwise orthogonal under multiplication and each squares to itself modulo the product modulus. Multiplying them by the supplied residues and summing reconstructs the requested quotient element. These identities provide a certificate beyond a few sampled polynomial evaluations, which would not suffice for arbitrary positive-degree factors.

Reduction conventions determine the printed polynomials

Coefficient lists are ascending and all coefficients are reduced modulo the chosen prime. Factors are normalized to monic form without changing their ideals. The returned representative has degree below the product modulus; adding any multiple of that modulus would represent the same quotient element but is intentionally removed for a consistent display.

The two linear factors in the default reduce component checking to evaluation at plus and minus one. Other tests use higher-degree factors and round-trip arbitrary residues. Composite coefficient moduli, noncoprime factors and growth beyond the degree cap are rejected rather than silently using a direct-product conclusion that no longer applies.

Derive the reconstruction from polynomial idempotents

For pairwise-coprime factors fi over GF(p), let M=Πfi and Mi=M/fi. Since gcd(Mi,fi)=1, Mi has an inverse si modulo fi. The polynomial ei=Mi si modulo M is one modulo fi and zero modulo every other factor. These ei are orthogonal idempotents: ei²=ei and eiej=0 modulo M for i≠j.

For prescribed residues ri, the reconstruction is u=Σri ei modulo M. Reducing the degree below deg M selects one representative of a whole congruence class. Adding any multiple of M gives another polynomial with the same residues. The returned representative is therefore unique under the degree bound, not the only polynomial expression with those congruences.

Reconstruct the two linear residues over GF(5)

The factors x−1 and x+1 correspond to evaluation at 1 and −1. Request residues 2 and 3. For u=ax+b, the equations are a+b=2 and −a+b=3 modulo five. Adding them gives 2b=0, so b=0; then a=2. The reconstructed polynomial is 2x, entered or displayed as ascending coefficients 0,2.

The product modulus is x²−1. Substituting x=1 gives 2 and x=−1 gives −2=3 modulo five, independently checking the residues. Over GF(2), however, x−1 and x+1 are the same factor. They are no longer coprime, so the direct-product construction must be rejected instead of reusing the GF(5) answer.

Distinguish pairwise coprime from irreducible

The factors need not each be irreducible; they need to share no nonconstant divisor with one another. A reducible factor can define a quotient ring that is not a field, yet the Chinese remainder isomorphism still holds across pairwise-coprime factors. Calling every resulting component a finite field would therefore overstate the result.

Noncoprime moduli can have compatible residue systems, but they require a generalized congruence treatment and do not produce the same independent idempotent decomposition. This page rejects them. A failed coprimality check means this supported decomposition does not apply, not that every related polynomial congruence system is necessarily inconsistent.

Keep field arithmetic and coefficient order explicit

The prime selector chooses GF(p), with integer coefficients reduced modulo p. It does not implement an extension field GF(p^r), and a composite modulus such as six is not a field substitute. The factor rows are normalized to monic representatives, which preserves their generated ideals over the selected prime field.

Coefficients run constant first: 2,0,1 means x²+2. Residues may themselves need reduction modulo their corresponding factors. Check the recovered-residue table rather than comparing unreduced raw coefficient strings. Exact modular checks establish the algebraic round trip, while the degree and field limits keep the calculation suitable for a small educational example.

A few questions, answered

Do factors have to be irreducible?

No. They must be pairwise coprime; individual quotients may be rings rather than fields.

What happens with repeated factors?

The ordinary direct-product CRT assumption fails and the input is rejected.

Must every factor be irreducible?

No. Pairwise coprimality is required. A reducible factor is allowed, but its quotient component need not be a field.

Why do x−1 and x+1 fail over GF(2)?

Because −1=1 modulo two, so the two factors coincide and are not coprime.

Find your calculator

Start typing to explore the library.