Skip to content

Commit

Permalink
Update book examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lkastner committed Oct 15, 2024
1 parent 534513f commit 4103888
Show file tree
Hide file tree
Showing 52 changed files with 253 additions and 355 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ julia> degree(X)
9

julia> S = ambient_coordinate_ring(X)
Multivariate polynomial ring in 5 variables over GF(31991) graded by
Multivariate polynomial ring in 5 variables over GF(31991) graded by
x -> [1]
y -> [1]
z -> [1]
Expand Down
16 changes: 8 additions & 8 deletions test/book/cornerstones/algebraic-geometry/circlepar.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ julia> I = ideal(R, [x^2 + y^2 - 1, y - t*x - 1]);

julia> Gy = groebner_basis(I, ordering = lex([y, x, t]), complete_reduction=true)
Gröbner basis with elements
1 -> x^2*t^2 + x^2 + 2*x*t
2 -> y - x*t - 1
1 -> x^2*t^2 + x^2 + 2*x*t
2 -> y - x*t - 1
with respect to the ordering
lex([y, x, t])
lex([y, x, t])

julia> factor(Gy[1])
1 * (x*t^2 + x + 2*t) * x

julia> Gx = groebner_basis(I, ordering = lex([x, y, t]), complete_reduction=true)
Gröbner basis with elements
1 -> y^2*t^2 + y^2 - 2*y - t^2 + 1
2 -> x*t - y + 1
3 -> x*y - x + y^2*t - t
4 -> x^2 + y^2 - 1
1 -> y^2*t^2 + y^2 - 2*y - t^2 + 1
2 -> x*t - y + 1
3 -> x*y - x + y^2*t - t
4 -> x^2 + y^2 - 1
with respect to the ordering
lex([x, y, t])
lex([x, y, t])

julia> factor(Gx[1])
1 * (y - 1) * (y*t^2 + y + t^2 - 1)
8 changes: 4 additions & 4 deletions test/book/cornerstones/algebraic-geometry/ex11.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ julia> I = ideal(R, [x^2+y^2+2*z^2-8, x^2-y^2-z^2+1, x-y+z]);

julia> groebner_basis(I, ordering = lex(R), complete_reduction = true)
Gröbner basis with elements
1 -> 6*z^4 - 18*z^2 + 1
2 -> y + 3*z^3 - 9*z
3 -> x + 3*z^3 - 8*z
1 -> 6*z^4 - 18*z^2 + 1
2 -> y + 3*z^3 - 9*z
3 -> x + 3*z^3 - 8*z
with respect to the ordering
lex([x, y, z])
lex([x, y, z])
2 changes: 1 addition & 1 deletion test/book/cornerstones/algebraic-geometry/ex21a.jlcon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia> J1 = ideal([H(I[1]), H(I[2])])
julia> J1 = ideal([H(I[1]), H(I[2])])
Ideal generated by
x0*x2 - x1^2
x0*x3 - x1*x2
Expand Down
5 changes: 2 additions & 3 deletions test/book/cornerstones/algebraic-geometry/ex23a.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ julia> other_pos_abs = pos_abs == 1 ? 2 : 1
julia> cI2 = cIabs[other_pos_abs][3]
Ideal generated by
648*y + (-160*_a^3 - 1269*_a^2 + 22446*_a + 972)*z
184147758075888*x + (2850969000960*_a^3 + 22611747888864*_a^2 - 399955313722176*_a - 17319636680832)*y + (2884707374400*_a^3 + 2
2782606070410*_a^2 - 405172045313820*_a - 57843867366864)*z
184147758075888*x + (2850969000960*_a^3 + 22611747888864*_a^2 - 399955313722176*_a - 17319636680832)*y + (2884707374400*_a^3 + 22782606070410*_a^2 - 405172045313820*_a - 57843867366864)*z

julia> R2 = base_ring(cI2)
Multivariate polynomial ring in 3 variables over number field graded by
Multivariate polynomial ring in 3 variables over number field graded by
x -> [1]
y -> [1]
z -> [1]
Expand Down
2 changes: 0 additions & 2 deletions test/book/cornerstones/algebraic-geometry/ex314.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ M1 -> M
e[1] -> (-x_0*x_3 + x_1*x_2)*e[1]
Graded module homomorphism of degree [2]


julia> phi2 = psi(tohomM1M(hom1[2]))
M1 -> M
e[1] -> (-x_0*x_2 + x_1^2)*e[1]
Graded module homomorphism of degree [2]


julia> kerphi2, _ = kernel(phi2);

julia> iszero(kerphi2)
Expand Down
20 changes: 10 additions & 10 deletions test/book/cornerstones/algebraic-geometry/exres.jlcon
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]);
julia> S, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]);

julia> I = ideal([w^2-x*z,w*x-y*z,x^2-w*y,x*y-z^2,y^2-w*z]);
julia> J = ideal([w^2-x*z,w*x-y*z,x^2-w*y,x*y-z^2,y^2-w*z]);

julia> A, _ = quo(R, I);
julia> A, _ = quo(S, J);

julia> FA = free_resolution(A)
Free resolution of A
R^1 <---- R^5 <---- R^6 <---- R^2 <---- 0
S^1 <---- S^5 <---- S^6 <---- S^2 <---- 0
0 1 2 3 4

julia> FA[1]
Graded free module R^5([-2]) of rank 5 over R
Graded free module S^5([-2]) of rank 5 over S

julia> FA[2]
Graded free module R^5([-3]) + R^1([-4]) of rank 6 over R
Graded free module S^5([-3]) + S^1([-4]) of rank 6 over S

julia> FA[3]
Graded free module R^1([-4]) + R^1([-5]) of rank 2 over R
Graded free module S^1([-4]) + S^1([-5]) of rank 2 over S

julia> map(FA,1)
R^5 -> R^1
S^5 -> S^1
e[1] -> (-w*z + y^2)*e[1]
e[2] -> (x*y - z^2)*e[1]
e[3] -> (-w*y + x^2)*e[1]
Expand All @@ -28,7 +28,7 @@ e[5] -> (w^2 - x*z)*e[1]
Homogeneous module homomorphism

julia> map(FA,2)
R^6 -> R^5
S^6 -> S^5
e[1] -> -x*e[1] + y*e[2] - z*e[4]
e[2] -> w*e[1] - x*e[2] + y*e[3] + z*e[5]
e[3] -> -w*e[3] + x*e[4] - y*e[5]
Expand All @@ -38,7 +38,7 @@ e[6] -> (-w^2 + x*z)*e[1] + (-w*z + y^2)*e[5]
Homogeneous module homomorphism

julia> map(FA,3)
R^2 -> R^6
S^2 -> S^6
e[1] -> -w*e[2] - y*e[3] + x*e[4] - e[6]
e[2] -> (-w^2 + x*z)*e[1] + y*z*e[2] + z^2*e[3] - w*y*e[4] + (w*z - y^2)*e[5] + x*e[6]
Homogeneous module homomorphism
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
julia> R, (w,x,y,z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]);
julia> S, (w,x,y,z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]);

julia> I = ideal(R, [x*w-y*z, y*w-(x-z)*(x-2*z)]);
julia> I = ideal(S, [x*w-y*z, y*w-(x-z)*(x-2*z)]);

julia> Q = projective_scheme(I);

Expand Down
3 changes: 1 addition & 2 deletions test/book/cornerstones/algebraic-geometry/param.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ julia> f = x^5 + 10*x^4*y + 20*x^3*y^2 + 130*x^2*y^3 - 20*x*y^4 + 20*y^5 - 2*x^4

julia> C = plane_curve(f)
Projective plane curve
defined by 0 = x^5 + 10*x^4*y - 2*x^4*z + 20*x^3*y^2 - 40*x^3*y*z + x^3*z^2 + 130*x^2*y^3 - 150*x^2*y^2*z + 30*x^2*y*z^2 - 20*x*
y^4 - 90*x*y^3*z + 110*x*y^2*z^2 + 20*y^5 - 40*y^4*z + 20*y^3*z^2
defined by 0 = x^5 + 10*x^4*y - 2*x^4*z + 20*x^3*y^2 - 40*x^3*y*z + x^3*z^2 + 130*x^2*y^3 - 150*x^2*y^2*z + 30*x^2*y*z^2 - 20*x*y^4 - 90*x*y^3*z + 110*x*y^2*z^2 + 20*y^5 - 40*y^4*z + 20*y^3*z^2

julia> conics = [x^2-x*z, y^2-y*z];

Expand Down
21 changes: 9 additions & 12 deletions test/book/cornerstones/groups/actions.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ G-set of
Alt(4)
with seeds 1:4

julia> G = dihedral_group(6)
Pc group of order 6
julia> G = dihedral_group(6);

julia> U = sub(G, [g for g in gens(G) if order(g) == 2])[1]
Sub-pc group of order 2
Pc group of order 2

julia> r = right_cosets(G, U)
Right cosets of
sub-pc group of order 2 in
pc group of order 2 in
pc group of order 6

julia> acting_group(r)
Expand All @@ -37,7 +36,7 @@ Group homomorphism
julia> phi(G[1]), phi(G[2])
((2,3), (1,2,3))

julia> function optimal_perm_rep(G)
julia> function optimal_transitive_perm_rep(G)
is_natural_symmetric_group(G) && return hom(G,G,gens(G))
is_natural_alternating_group(G) && return hom(G,G,gens(G))
cand = [] # pairs (U,h) with U ≤ G and h a map G -> Sym(G/U)
Expand All @@ -52,21 +51,21 @@ julia> function optimal_perm_rep(G)
julia> U = dihedral_group(8)
Pc group of order 8

julia> optimal_perm_rep(U)
julia> optimal_transitive_perm_rep(U)
Group homomorphism
from pc group of order 8
to permutation group of degree 4 and order 8

julia> isomorphism(PermGroup, U)
Group homomorphism
from pc group of order 8
to permutation group of degree 4 and order 8
to permutation group of degree 8 and order 8

julia> permutation_group(U)
Permutation group of degree 4 and order 8
Permutation group of degree 8 and order 8

julia> for g in all_transitive_groups(degree => 3:9, !is_primitive)
h = image(optimal_perm_rep(g))[1]
julia> for g in all_transitive_groups(degree => 3:8, !is_primitive)
h = image(optimal_transitive_perm_rep(g))[1]
if degree(h) < degree(g)
id = transitive_group_identification(g)
id_new = transitive_group_identification(h)
Expand All @@ -81,5 +80,3 @@ julia> for g in all_transitive_groups(degree => 3:9, !is_primitive)
(8, 13) => (6, 6)
(8, 14) => (4, 5)
(8, 24) => (6, 11)
(9, 4) => (6, 5)
(9, 8) => (6, 9)
2 changes: 1 addition & 1 deletion test/book/cornerstones/groups/chars.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ julia> all(i -> s[i] == 0, ord5)
true

julia> (x -> [x["1a"], x["2b"], x["3a"], x["3b"]]).(filt)
2-element Vector{Vector{QQAbFieldElem{AbsSimpleNumFieldElem}}}:
2-element Vector{Vector{QQAbElem{AbsSimpleNumFieldElem}}}:
[100, 0, 10, 4]
[1800, 20, 0, 6]

Expand Down
48 changes: 32 additions & 16 deletions test/book/cornerstones/groups/explSL25.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,37 @@ SL(2,5)
julia> T = character_table(G)
Character table of SL(2,5)

2 3 1 1 3 1 1 1 1 2
3 1 . . 1 . . 1 1 .
5 1 1 1 1 1 1 . . .

1a 10a 10b 2a 5a 5b 3a 6a 4a

X_1 1 1 1 1 1 1 1 1 1
X_2 2 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 -2 -z_5^3 - z_5^2 - 1 z_5^3 + z_5^2 -1 1 .
X_3 2 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 -2 z_5^3 + z_5^2 -z_5^3 - z_5^2 - 1 -1 1 .
X_4 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 . . -1
X_5 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 . . -1
X_6 4 -1 -1 4 -1 -1 1 1 .
X_7 4 1 1 -4 -1 -1 1 -1 .
X_8 5 . . 5 . . -1 -1 1
X_9 6 -1 -1 -6 1 1 . . .
2 3 1 1 3 1
3 1 . . 1 .
5 1 1 1 1 1

1a 10a 10b 2a 5a

X_1 1 1 1 1 1
X_2 2 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 -2 -z_5^3 - z_5^2 - 1
X_3 2 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 -2 z_5^3 + z_5^2
X_4 3 -z_5^3 - z_5^2 z_5^3 + z_5^2 + 1 3 -z_5^3 - z_5^2
X_5 3 z_5^3 + z_5^2 + 1 -z_5^3 - z_5^2 3 z_5^3 + z_5^2 + 1
X_6 4 -1 -1 4 -1
X_7 4 1 1 -4 -1
X_8 5 . . 5 .
X_9 6 -1 -1 -6 1

2 1 1 1 2
3 . 1 1 .
5 1 . . .

5b 3a 6a 4a

X_1 1 1 1 1
X_2 z_5^3 + z_5^2 -1 1 .
X_3 -z_5^3 - z_5^2 - 1 -1 1 .
X_4 z_5^3 + z_5^2 + 1 . . -1
X_5 -z_5^3 - z_5^2 . . -1
X_6 -1 1 1 .
X_7 -1 1 -1 .
X_8 . -1 -1 1
X_9 1 . . .

julia> R = gmodule(T[end])
G-module for G acting on vector space of dimension 6 over abelian closure of Q
Expand All @@ -30,7 +46,7 @@ julia> schur_index(T[end])
2

julia> gmodule_minimal_field(S)
G-module for G acting on vector space of dimension 6 over number field
G-module for G acting on vector space of dimension 6 over number field of degree 4 over QQ

julia> B, mB = relative_brauer_group(base_ring(S), character_field(S));

Expand Down
16 changes: 5 additions & 11 deletions test/book/cornerstones/groups/intro.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,12 @@ julia> pts = collect(orb)

julia> visualize(convex_hull(pts))

julia> R2 = free_module(K, 2) # the "euclidean" plane over K
Vector space of dimension 2 over QQBar

julia> A = R2([0,1])
(Root 0 of x, Root 1.00000 of x - 1)

julia> pts = [A*mat_rot^i for i in 0:4];
julia> R2 = vector_space(K, 2); # the "euclidean" plane over K

julia> sigma_1 = hom(R2, R2, [-R2[1], R2[2]])
Module homomorphism
from vector space of dimension 2 over QQBar
to vector space of dimension 2 over QQBar
from vector space of dimension 2 over field of algebraic numbers
to vector space of dimension 2 over field of algebraic numbers

julia> rot = hom(R2, R2, mat_rot);

Expand Down Expand Up @@ -127,10 +121,10 @@ julia> describe(H)
"a finitely presented group"

julia> H1, _ = derived_subgroup(H)
(Sub-finitely presented group, Hom: H1 -> H)
(Finitely presented group, Hom: H1 -> H)

julia> H2, _ = derived_subgroup(H1)
(Sub-finitely presented group, Hom: H2 -> H1)
(Finitely presented group, Hom: H2 -> H1)

julia> describe(H2)
"Z x Z"
Expand Down
16 changes: 8 additions & 8 deletions test/book/cornerstones/groups/reps.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ julia> M = regular_gmodule(GF(7), G);

julia> C = composition_factors_with_multiplicity(M)
3-element Vector{Any}:
(G-module for G acting on vector space of dimension 1 over GF(7), 1)
(G-module for G acting on vector space of dimension 1 over GF(7), 1)
(G-module for G acting on vector space of dimension 4 over GF(7), 2)
(G-module for G acting on vector space of dimension 1 over prime field of characteristic 7, 1)
(G-module for G acting on vector space of dimension 1 over prime field of characteristic 7, 1)
(G-module for G acting on vector space of dimension 4 over prime field of characteristic 7, 2)

julia> [is_absolutely_irreducible(x[1]) for x in C]
3-element Vector{Bool}:
Expand All @@ -28,12 +28,12 @@ Morphism of finite fields
to finite field of degree 2 and characteristic 7

julia> M = extension_of_scalars(C[3][1], phi)
G-module for G acting on vector space of dimension 4 over GF(7, 2)
G-module for G acting on vector space of dimension 4 over finite field of degree 2 and characteristic 7

julia> composition_factors_with_multiplicity(M)
2-element Vector{Any}:
(G-module for G acting on vector space of dimension 2 over GF(7, 2), 1)
(G-module for G acting on vector space of dimension 2 over GF(7, 2), 1)
(G-module for G acting on vector space of dimension 2 over finite field of degree 2 and characteristic 7, 1)
(G-module for G acting on vector space of dimension 2 over finite field of degree 2 and characteristic 7, 1)

julia> G = pc_group(symmetric_group(4));

Expand Down Expand Up @@ -63,15 +63,15 @@ julia> pushfirst!(im, hom(FF, FF, matrix(C, [0 1; 1 0])));
julia> phi = gmodule(G, im);

julia> character(phi)
class_function(character table of G, [2, 0, -1, 2, 0])
class_function(character table of G, QQAbElem{AbsSimpleNumFieldElem}[2, 0, -1, 2, 0])

julia> schur_index(ans)
1

julia> T = matrix(C, [C(1) -z; z+1 z]);

julia> [matrix(x)^T for x in action(phi)]
4-element Vector{AbstractAlgebra.Generic.MatSpaceElem{QQAbFieldElem{AbsSimpleNumFieldElem}}}:
4-element Vector{AbstractAlgebra.Generic.MatSpaceElem{QQAbElem{AbsSimpleNumFieldElem}}}:
[1 0; -1 -1]
[0 1; -1 -1]
[1 0; 0 1]
Expand Down
6 changes: 3 additions & 3 deletions test/book/cornerstones/number-theory/galoismod.jlcon
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ julia> V, f = galois_module(K); OK = ring_of_integers(K); M = f(OK);
julia> fl, c = is_free_with_basis(M); # the elements of c are a basis

julia> b = preimage(f, c[1]) # the element might different per session
a^3
a

julia> A, mA = automorphism_group(K);

julia> X = matrix(ZZ, [coordinates(OK(mA(s)(b))) for s in A])
[0 1 0 0]
[0 0 0 1]
[1 -1 1 -1]
[0 0 -1 0]
[0 1 0 0]

julia> det(X)
-1
1

julia> k, = number_field(x^4 - 13*x^2 + 16); candidates = []; for F in abelian_normal_extensions(k, [2], ZZ(10)^13)
K, = absolute_simple_field(number_field(F))
Expand Down
Loading

0 comments on commit 4103888

Please sign in to comment.