Univariate polynomials parametrised by the variable name.

- newtype CommutativeRing r => UPoly r x = UP [r]
- deg :: CommutativeRing r => UPoly r x -> Integer
- type Qx = UPoly Q X_
- x :: Qx
- toUPoly :: (CommutativeRing r, Eq r) => [r] -> UPoly r x
- monomial :: CommutativeRing r => r -> Integer -> UPoly r x
- lt :: CommutativeRing r => UPoly r x -> r
- deriv :: CommutativeRing r => UPoly r x -> UPoly r x
- cont :: (GCDDomain a, Eq a) => UPoly a x -> a
- isPrimitive :: (ExplicitUnits a, GCDDomain a, Eq a) => UPoly a x -> Bool
- toPrimitive :: (GCDDomain a, Eq a) => UPoly (FieldOfFractions a) x -> (FieldOfFractions a, UPoly a x)
- propToPrimitive :: (ExplicitUnits a, GCDDomain a, Eq a) => UPoly (FieldOfFractions a) x -> Property
- gaussLemma :: (ExplicitUnits a, GCDDomain a, Eq a) => UPoly a x -> UPoly a x -> Property
- gcdUPolyWitness :: (GCDDomain a, Eq a) => UPoly a x -> UPoly a x -> (UPoly a x, UPoly a x, UPoly a x)
- sqfr :: (Num k, Field k) => UPoly k x -> UPoly k x
- sqfrDec :: (Num k, Field k) => UPoly k x -> [UPoly k x]

# Documentation

newtype CommutativeRing r => UPoly r x Source

Polynomials over a commutative ring, indexed by a phantom type x that denote the name of the variable that the polynomial is over. For example UPoly Q X_ is Q[x] and UPoly Q T_ is Q[t].

UP [r] |

Eq r => Eq (UPoly r x) | |

(Show r, Field r, Num r, Show x) => Num (UPoly r x) | |

(Show k, Field k, Num k, Show x) => Num (FieldOfRationalFunctions k x) | |

Ord r => Ord (UPoly r x) | |

(CommutativeRing r, Eq r, Show r, Show x) => Show (UPoly r x) | |

(CommutativeRing r, Eq r, Arbitrary r) => Arbitrary (UPoly r x) | |

(CommutativeRing r, Eq r) => Ring (UPoly r x) | |

(CommutativeRing r, Eq r) => CommutativeRing (UPoly r x) | |

(CommutativeRing r, Eq r) => IntegralDomain (UPoly r x) | |

(Field k, Eq k) => EuclideanDomain (UPoly k x) | |

(ExplicitUnits a, Eq a) => ExplicitUnits (UPoly a x) | |

(Field k, Eq k) => PruferDomain (UPoly k x) |

deg :: CommutativeRing r => UPoly r x -> IntegerSource

The degree of the polynomial.

toUPoly :: (CommutativeRing r, Eq r) => [r] -> UPoly r xSource

Take a list and construct a polynomial by removing all zeroes in the end.

monomial :: CommutativeRing r => r -> Integer -> UPoly r xSource

Take an element of the ring and the degree of the desired monomial, for example: monomial 3 7 = 3x^7

lt :: CommutativeRing r => UPoly r x -> rSource

Compute the leading term of a polynomial.

deriv :: CommutativeRing r => UPoly r x -> UPoly r xSource

Formal derivative of polynomials in k[x].

cont :: (GCDDomain a, Eq a) => UPoly a x -> aSource

Compute the content of a polynomial, i.e. the gcd of the coefficients.

isPrimitive :: (ExplicitUnits a, GCDDomain a, Eq a) => UPoly a x -> BoolSource

If all coefficients are relatively prime then the polynomial is primitive.

toPrimitive :: (GCDDomain a, Eq a) => UPoly (FieldOfFractions a) x -> (FieldOfFractions a, UPoly a x)Source

Lemma 4.2: Given a polynomial p in K[x] where K=Quot(A) we can find c in K and q primitive in A[x] such that p = cq.

propToPrimitive :: (ExplicitUnits a, GCDDomain a, Eq a) => UPoly (FieldOfFractions a) x -> PropertySource

gaussLemma :: (ExplicitUnits a, GCDDomain a, Eq a) => UPoly a x -> UPoly a x -> PropertySource

Gauss lemma says that if p and q are polynomials over a GCD domain then cont(pq) = cont(p) * cont(q).