File: test_triangular.m2

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (48 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

--###################################
-- Binomial triangularize
--###################################

checkTriangularize "Binomial"

--###################################
-- Triangular sets
--###################################

-- regular chains

R = QQ[x,y,t,s, MonomialOrder=>Lex];
F = {x + y^2 - t, t^2 -s};
T = triaSystem(R,F,{});
assert(isRegularChain T)
assert(isStronglyNormalized T)
f = x*y*t;
assert(resultant(f,T)==y^2*s^2-y^6*s)
assert(codim T == 2)
assert(dim T == 2)

R = QQ[x,y,z, MonomialOrder=>Lex];
F = {x*y - y*z, y^2 - z^2};
T = triaSystem(R,F,{y});
assert(isRegularChain T)
assert(not isStronglyNormalized T)

-- prem

R = QQ[a,b,c,d,e, MonomialOrder=>Lex];
T = triaSystem (R,{a*b-c,b^2-c},{b})
assert(isRegularChain T)
assert(not isStronglyNormalized T)
assert((a-b) % T == 0)

--###################################
-- Others
--###################################

-- minimalObjects

L = 2..50
cmp = (i,j) -> if i%j==0 then 1 else if j%i==0 then -1 else 0;
minl = minimalObjects (L,cmp);
primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47)
assert( select(L,i ->minl#i) == primes )