({{, (RefLink[Modulus, paclet:ref/Modulus])->n
is an option that can be given in certain algebraic functions to specify that integers should be treated modulo n. }})

OpenersNotesSection(Spacer1)Details

(RefLink[Modulus, paclet:ref/Modulus]) appears as an option in (RefLink[Solve, paclet:ref/Solve]), (RefLink[Reduce, paclet:ref/Reduce]), (RefLink[Factor, paclet:ref/Factor]), (RefLink[PolynomialGCD, paclet:ref/PolynomialGCD]), and (RefLink[PolynomialLCM, paclet:ref/PolynomialLCM]), as well as in linear algebra functions such as (RefLink[Inverse, paclet:ref/Inverse]), (RefLink[LinearSolve, paclet:ref/LinearSolve]), and (RefLink[Det, paclet:ref/Det]).

Arithmetic is usually done over the full ring ℤ of integers; setting the option (RefLink[Modulus, paclet:ref/Modulus]) specifies that arithmetic should instead be done in the finite ring (Subscript[ℤ, n]).

The setting (RefLink[Modulus, paclet:ref/Modulus])->0 specifies the full ring ℤ of integers.

Some functions require that (RefLink[Modulus, paclet:ref/Modulus]) be set to a prime, or a power of a prime. (Subscript[ℤ, n]) is a finite field when n is prime.

Equations for (RefLink[Modulus, paclet:ref/Modulus]) can be given in (RefLink[Eliminate, paclet:ref/Eliminate]) and related functions.

OpenersPrimaryExamplesSection(Spacer1)Examples  (9)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Solve equations:

Reduce[x^5==y^4+xy+1,{x,y},Modulus->4]

Factor polynomials:

Table[Factor[x^6+3x^4+x,Modulus->Prime[k]],{k,1,3}]

Compute inverse:

Inverse[{{1,2},{3,4}},Modulus->3]

OpenersExampleSection1(Spacer1)Scope  (6)

Compute (RefLink[PolynomialGCD, paclet:ref/PolynomialGCD]) over the integers modulo 2:

PolynomialGCD[x^3+x^2+x+1,(x+1)^4,Modulus->2]

(RefLink[Factor, paclet:ref/Factor]) a polynomial over the integers modulo 3:

Factor[x^3+2x^2+3x+5,Modulus->3]

Find a (RefLink[GroebnerBasis, paclet:ref/GroebnerBasis]) over the integers modulo 5:

GroebnerBasis[{x^3-2x y+y^2,y^3-x^2y+3},{x,y},Modulus->5]

(RefLink[Reduce, paclet:ref/Reduce]) equations over the integers modulo 7:

Reduce[x^3-3x y+2y^2==0&&y^3-x^2y+3==0,{x,y},Modulus->7]

Compute the determinant of a matrix modulo 8:

Det[{{1,2,3},{21,210,2100},{2221,3332,4443}},Modulus->8]

Find a modulus for which a system of equations has a solution:

Solve[x^2+y^2==1&&2x+3y==5&&x^3-x y==7,{x,y},Modulus->Automatic]

OpenersExampleSection2(Spacer1)Properties & Relations  (2)

(RefLink[Factor, paclet:ref/Factor]) a polynomial over a finite field:

Factor[x^4-2,Modulus->3]

(RefLink[Factor, paclet:ref/Factor]) a polynomial over a finite (RefLink[Extension, paclet:ref/Extension]) of rationals:

Factor[x^4-2,Extension->Sqrt[2]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Extension, paclet:ref/Extension])  ▪  (RefLink[Mod, paclet:ref/Mod])  ▪  (RefLink[Coefficient, paclet:ref/Coefficient])  ▪  (RefLink[Factor, paclet:ref/Factor])  ▪  (RefLink[FindInstance, paclet:ref/FindInstance])  ▪  (RefLink[Reduce, paclet:ref/Reduce])  ▪  (RefLink[PolynomialMod, paclet:ref/PolynomialMod])  ▪  (RefLink[Resultant, paclet:ref/Resultant])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Polynomials Modulo Primes, paclet:tutorial/PolynomialsModuloPrimes])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Polynomial Algebra, paclet:guide/PolynomialAlgebra])}, {▪(RefLinkPlain[Polynomial Factoring & Decomposition, paclet:guide/PolynomialFactoring])}, {▪(RefLinkPlain[Polynomial Division, paclet:guide/PolynomialDivision])}})}})