import scas.base.{, }
import scas.power.Lexicographic
import scas.module.{Array, ArrayModule}
import scas.polynomial.tree.Polynomial
import .given
import .given

val r = Polynomial(using , Lexicographic[Int]("x"))
val x = r.generators
import r.given

val s = ArrayModule(x)(2)
val e = s.generators
import s.given

assert (112 >< e(0) + 12 *%e(1))
assert (1x >< e(0) + x *%e(1))
assert (2 *%e(0) >< e(0)%* 2)
assert (12 *%e(0) >< e(0)%* (12))
assert (x *%e(0) >< e(0)%* x)
assert (2 * x *%e(0) >< e(0)%* (2 * x))
assert (12 * x *%e(0) >< e(0)%* (12 * x))
assert (e(0) + e(1) >< e(0) + e(1))
assert ((2 *%e(0) + e(1)).toList == 21.toList)
assert ((12 *%e(0) + e(1)).toList == 121.toList)
assert (s == x2)