Representation of Bezout domains. That is non-Noetherian analogues of principal ideal domains. This means that all finitely generated ideals are principal.

- class IntegralDomain a => BezoutDomain a where
- bezout :: a -> a -> (a, a, a, a, a)

- propBezoutDomain :: (BezoutDomain a, Eq a) => a -> a -> Property
- toPrincipal :: BezoutDomain a => Ideal a -> (Ideal a, [a], [a])
- propToPrincipal :: (BezoutDomain a, Eq a) => Ideal a -> Bool
- propIsSameIdeal :: (BezoutDomain a, Eq a) => Ideal a -> Bool
- gcdB :: BezoutDomain a => a -> a -> a
- intersectionB :: (BezoutDomain a, Eq a) => Ideal a -> Ideal a -> Ideal a
- intersectionBWitness :: (BezoutDomain a, Eq a) => Ideal a -> Ideal a -> (Ideal a, [[a]], [[a]])
- solveB :: (BezoutDomain a, Eq a) => Vector a -> Matrix a
- crt :: (BezoutDomain a, Eq a) => [a] -> [a] -> (a, a)

# Documentation

class IntegralDomain a => BezoutDomain a whereSource

Bezout domains

Has a Bezout function which given a and b give g, a1, b1, x and y such that:

- g = gcd(a,b)
- a = g * a1 and b = g * b1
- g = a * x + b * y

(EuclideanDomain a, Eq a) => BezoutDomain a |

propBezoutDomain :: (BezoutDomain a, Eq a) => a -> a -> PropertySource

toPrincipal :: BezoutDomain a => Ideal a -> (Ideal a, [a], [a])Source

Compute a principal ideal from another ideal. Also give witness that the principal ideal is equal to the first ideal.

toPrincipal <a_1,...,a_n> = (<a>,u_i,v_i) where

sum (u_i * a_i) = a

a_i = v_i * a

propToPrincipal :: (BezoutDomain a, Eq a) => Ideal a -> BoolSource

Test that the generated ideal is principal.

propIsSameIdeal :: (BezoutDomain a, Eq a) => Ideal a -> BoolSource

Test that the generated ideal generate the same elements as the given.

gcdB :: BezoutDomain a => a -> a -> aSource

intersectionB :: (BezoutDomain a, Eq a) => Ideal a -> Ideal a -> Ideal aSource

Intersection without witness.

intersectionBWitness :: (BezoutDomain a, Eq a) => Ideal a -> Ideal a -> (Ideal a, [[a]], [[a]])Source

Intersection of ideals with witness.

If one of the ideals is the zero ideal then the intersection is the zero ideal.

crt :: (BezoutDomain a, Eq a) => [a] -> [a] -> (a, a)Source

Chinese remainder theorem

Given a_1,...,a_n and m_1,...,m_n such that gcd(m_i,m_j) = 1. Let m = m_1*...*m_n compute a such that:

- a = a_i (mod m_i)
- If b is such that b = a_i (mod m_i) then a = b (mod m)

The function return (a,m).