-
Notifications
You must be signed in to change notification settings - Fork 113
/
homological-algebra.jl
71 lines (63 loc) · 1.9 KB
/
homological-algebra.jl
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@testset "mpoly_affine_homological-algebra.fitting_ideal" begin
R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
F = free_module(R, 3)
I = ideal(R, [zero(R)])
@test fitting_ideal(F, 2) == I
@test fitting_ideal(F, 3) == R
end
@testset "mpoly_affine_homological-algebra.is_flat" begin
R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
F = free_module(R, 3)
@test is_flat(F) == true
end
@testset "mpoly_affine_homological-algebra.non_flat_locus" begin
R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
F = free_module(R, 3)
@test non_flat_locus(F) == ideal(R, [one(R)])
end
@testset "mpoly_affine_homological-algebra.is_regular_sequence" begin
R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
F = free_module(R, 1)
U = matrix([x*y-y])
M = quo(F, U)[1]
V = [x, x*z-z]
@test is_regular_sequence(V, M) == true
W = [x*z-z, x]
@test is_regular_sequence(W, M) == false
end
@testset "mpoly_affine_homological-algebra.koszul_matrix" begin
R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
V = gens(R)
KM = koszul_matrix(V, 1)
@test nrows(KM) == 2
@test KM[1] == R[1]
end
@testset "mpoly_affine_homological-algebra.koszul_complex" begin
R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
V = gens(R)
K = koszul_complex(V)
KM = matrix(map(K, 2))
@test ncols(KM) == 2
@test KM[1, 1] == -R[2]
end
@testset "mpoly_affine_homological-algebra.koszul_homology" begin
R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
F = free_module(R, 1)
U = matrix([x*y-y])
M = quo(F, U)[1]
V = [x, x*z-z]
@test is_zero(koszul_homology(V, M, 0)) == false
@test is_zero(koszul_homology(V, M, 1)) == true
end
@testset "mpoly_affine_homological-algebra.depth" begin
R, (x, y) = polynomial_ring(QQ, ["x", "y"]);
F = free_module(R, 1)
U = matrix([x*y])
M = quo(F, U)[1]
I = ideal(R, gens(R))
@test depth(I, M) == 1
R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]);
F = free_module(R, 1);
I = ideal(R, [x*z-z, x*y-y, x])
@test depth(I, F) == 3
end