代数几何与交换代数模#

介绍#

代数几何是两种地中海文化思想的混合体。它是阿拉伯科学对方程式解的轻量化计算,超越了希腊的位置和形状艺术。这种挂毯最初是在欧洲土地上编织的,在国际时尚的影响下仍在不断改进。代数几何学研究的是几何合理与代数可能之间的微妙平衡。无论何时,当一个有趣的数学搜索超过了另一个有趣的方面,立即失去了乐趣。

—George R. Kempf (1944 -- 2002)

代数几何是指通过代数方法研究几何问题(有时反之亦然)。虽然这是一个相当古老的话题,但今天所理解的代数几何在很大程度上是20世纪的发展。基于Riemann和Dedekind的思想,人们认识到多项式方程组(称为代数簇)的解集的性质与多项式函数集在该簇上的行为(称为坐标环)之间有密切的联系。

在许多几何学科中,我们可以区分局部问题和全局问题(和方法)。代数几何中的局部研究本质上等同于对某些环及其理想和模的研究。后一个主题也称为交换代数。它是代数几何仪的基本局部工具集,与微分分析是微分几何仪的局部工具集基本相同。

交换代数的一个很好的概念介绍是 [Atiyah69]. 一个更倾向于计算的介绍,以及本模块中大多数算法所基于的工作是 [Greuel2008].

这个模块的目标是最终允许表达和解决局部和全局几何问题,无论是在经典情况下还是在更现代的算术情况下。然而,到目前为止,还没有任何几何功能。目前该模块只提供域上计算交换代数的工具。

所有代码示例假定:

>>> from sympy import *
>>> x, y, z = symbols('x,y,z')
>>> init_printing(use_unicode=True, wrap_line=False)

参考文献#

在本节中,我们将介绍AGCA模块的用法。为了方便读者,本文还穿插了一些定义和例子/解释。

底座环#

交换代数中几乎所有的计算都与基环有关。(例如,当问一个理想的问题时,基环是理想的子集)原则上所有的多边形“域”都可以用作基环。然而,有用的功能只实现于域上的多项式环及其各种局部化和商。

如下面的示例所示,创建您感兴趣的对象的最方便方法是从地面场构建它们,然后使用各种方法从旧对象创建新对象。例如,为了创建局部环的结点立方 \(y^2 = x^3\) 在原点,完毕 \(\mathbb{{Q}}\) ,你需要:

>>> lr = QQ.old_poly_ring(x, y, order="ilex") / [y**2 - x**3]
>>> lr
ℚ[x, y, order=ilex]
───────────────────
    ╱   3    2╲
    ╲- x  + y ╱

注意python列表表示法是如何作为表达理想的捷径的。你可以使用 convert 方法将普通的sympy对象返回到AGCA模块可以理解的对象中(尽管在许多情况下这是自动完成的——例如,列表被自动转换为理想对象,并且在此过程中符号 \(x\)\(y\) 自动转换为其他表示形式)。例如::

>>> X, Y = lr.convert(x), lr.convert(y) ; X
    ╱   3    2╲
x + ╲- x  + y ╱

>>> x**3 == y**2
False

>>> X**3 == Y**2
True

当不需要本地化时,可以使用更数学的表示法。例如,让我们创建三维仿射空间的坐标环 \(\mathbb{{A}}^3\) ::

>>> ar = QQ.old_poly_ring(x, y, z); ar
ℚ[x, y, z]

有关更多详细信息,请参阅以下类文档。请注意,基环是域,是AGCA模块和polys模块其余部分之间的主要重叠点。所有的领域都在polis参考资料中有详细的记录,所以我们这里只展示了一个节略版本,其中包含与AGCA模块最相关的方法。

class sympy.polys.domains.ring.Ring[源代码]

表示环域。

free_module(rank)[源代码]

生成一个自由的秩模块 rank 过度自我。

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(2)
QQ[x]**2
ideal(*gens)[源代码]

产生一种理想 self .

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).ideal(x**2)
<x**2>
quotient_ring(e)[源代码]

形成一个商环 self .

在这里 e 可以是理想的,也可以是可接受的。

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).quotient_ring(QQ.old_poly_ring(x).ideal(x**2))
QQ[x]/<x**2>
>>> QQ.old_poly_ring(x).quotient_ring([x**2])
QQ[x]/<x**2>

除法运算符已为此过载:

>>> QQ.old_poly_ring(x)/[x**2]
QQ[x]/<x**2>
sympy.polys.domains.polynomialring.PolynomialRing(domain_or_ring, symbols=None, order=None)[源代码]

一个表示多元多项式环的类。

class sympy.polys.domains.quotientring.QuotientRing(ring, ideal)[源代码]

表示(交换)商环的类。

通常不应该手动实例化它,而是在构造中使用基环中的构造函数。

>>> from sympy.abc import x
>>> from sympy import QQ
>>> I = QQ.old_poly_ring(x).ideal(x**3 + 1)
>>> QQ.old_poly_ring(x).quotient_ring(I)
QQ[x]/<x**3 + 1>

可以使用较短的版本:

>>> QQ.old_poly_ring(x)/I
QQ[x]/<x**3 + 1>
>>> QQ.old_poly_ring(x)/[x**3 + 1]
QQ[x]/<x**3 + 1>

属性:

  • 环-基环

  • 基本理想-用来形成商的理想

模、理想及其基本性质#

\(A\) 做一个戒指。安 \(A\) -模块是一个集合 \(M\) ,以及两个二进制运算 \(+: M \times M \to M\)\(\times: R \times M \to M\) 叫做加法和标量乘法。这些要求满足某些公理,这些公理可以在例如。 [Atiyah69]. 这样,模就是两个向量空间的直接推广 (\(A\) 作为一个场)和阿贝尔群 (\(A = \mathbb{{Z}}\) )。A 子模块\(A\) -模块 \(M\) 是子集 \(N \subset M\) ,使二进制操作限制为 \(N\)\(N\) 成为 \(A\) -模块进行这些操作。

戒指 \(A\) 它本身就有一种自然 \(A\) -模结构,模中的加法和乘法与环中的加法和乘法一致。这个 \(A\) -模块也写为 \(A\) . 安 \(A\) -的子模块 \(A\) 被称为 理想的 属于 \(A\) . 理想在代数几何中很自然地出现。更一般的模块可以被看作是一个技术上方便的“肘室”,而不仅仅是谈论理想。

如果 \(M\)\(N\)\(A\) -模块,则有一个自然的(组件式的) \(A\) -模块结构打开 \(M \times N\) . 同样也有 \(A\) -多分量笛卡尔积上的模结构。(对于绝对倾向:有限多的笛卡尔积 \(A\) -模块,用这个 \(A\) -模结构,是所有范畴中的有限二积 \(A\) -模块。对于无穷多个分量,它是直积(但无穷直和的构造必须不同) \(A\) -模块 \(M\) 表示 \(M, M^2, M^3 \ldots\)\(M^I\) 对于任意索引集 \(I\) .

\(A\) -模块 \(M\) 被称为 free 如果它与 \(A\) -模块 \(A^I\) 对于某些(不一定是有限的)索引集 \(I\) (关于同构的定义,请参阅下一节)。基数 \(I\) 被称为 rank 属于 \(M\) 有人可以证明这是明确的。一般情况下,AGCA模块只适用于有限秩的自由模和其他密切相关的模件。创建模块最简单的方法是使用组成模块的对象的成员方法。例如,让我们在 \(\mathbb{{A}}^2\) 我们在上面创建了一个子模块::

>>> F = ar.free_module(4) ; F
          4
ℚ[x, y, z]

>>> S = F.submodule([1, x, x**2, x**3], [0, 1, 0, y]) ; S
╱⎡       2   3⎤              ╲
╲⎣1, x, x , x ⎦, [0, 1, 0, y]╱

元素可以用python表示法作为一个简短的注释。像往常一样 convert 方法可用于将sympy/python对象转换为内部AGCA表示(请参阅下面的详细参考资料)。

以下是模块、自由模块和子模块类的详细文档:

class sympy.polys.agca.modules.Module(ring)[源代码]#

模块的抽象基类。

不要实例化-请改用环显式构造函数:

>>> from sympy import QQ
>>> from sympy.abc import x
>>> QQ.old_poly_ring(x).free_module(2)
QQ[x]**2

属性:

  • dtype—元素的类型

  • 含环环

未实现的方法:

  • 子模块

  • quotient_module

  • is_zero

  • is_submodule

  • multiply_ideal

方法convert可能需要在子类中进行更改。

contains(elem)[源代码]#

如果返回真 elem 是此模块的一个元素。

convert(elem, M=None)[源代码]#

转换 elem 这个模块的内部表示。

如果 M 不是None,它应该是一个包含它的模块。

identity_hom()[源代码]#

返回身份同态 self .

is_submodule(other)[源代码]#

返回true other 是的子模块 self .

is_zero()[源代码]#

返回true self 是零模。

multiply_ideal(other)[源代码]#

乘法 self 凭理想 other .

quotient_module(other)[源代码]#

生成商模。

submodule(*gens)[源代码]#

生成子模块。

subset(other)[源代码]#

返回true otherself .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> F.subset([(1, x), (x, 2)])
True
>>> F.subset([(1/x, x), (x, 2)])
False
class sympy.polys.agca.modules.FreeModule(ring, rank)[源代码]#

自由模块的抽象基类。

其他属性:

  • rank—自由模的秩

未实现的方法:

  • 子模块

basis()[源代码]#

返回一组基本元素。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(3).basis()
([1, 0, 0], [0, 1, 0], [0, 0, 1])
convert(elem, M=None)[源代码]#

转换 elem 进入内部表现。

每当计算涉及不在内部表示中的元素时,都隐式调用此方法。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> F.convert([1, 0])
[1, 0]
dtype[源代码]#

FreeModuleElement 的别名

identity_hom()[源代码]#

返回身份同态 self .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(2).identity_hom()
Matrix([
[1, 0], : QQ[x]**2 -> QQ[x]**2
[0, 1]])
is_submodule(other)[源代码]#

返回true other 是的子模块 self .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> M = F.submodule([2, x])
>>> F.is_submodule(F)
True
>>> F.is_submodule(M)
True
>>> M.is_submodule(F)
False
is_zero()[源代码]#

返回true self 是零模。

(如果,如本实现所假设的,系数环不是零环,则这相当于秩为零。)

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(0).is_zero()
True
>>> QQ.old_poly_ring(x).free_module(1).is_zero()
False
multiply_ideal(other)[源代码]#

乘法 self 凭理想 other .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> I = QQ.old_poly_ring(x).ideal(x)
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> F.multiply_ideal(I)
<[x, 0], [0, x]>
quotient_module(submodule)[源代码]#

返回商模。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> M = QQ.old_poly_ring(x).free_module(2)
>>> M.quotient_module(M.submodule([1, x], [x, 2]))
QQ[x]**2/<[1, x], [x, 2]>

或者更精确地说,使用重载除法运算符:

>>> QQ.old_poly_ring(x).free_module(2) / [[1, x], [x, 2]]
QQ[x]**2/<[1, x], [x, 2]>
class sympy.polys.agca.modules.FreeModuleElement(module, data)[源代码]#

自由模块的元素。以元组形式存储的数据。

class sympy.polys.agca.modules.SubModule(gens, container)[源代码]#

子模块的基类。

属性:

  • 容器盛装模块

  • 发电机(包含模块的子集)

  • rank—包含模块的秩

未实现的方法:

  • _contains

  • _syzygies

  • _in_terms_of_generators

  • _intersect

  • _module_quotient

可能需要更改子类的方法:

  • reduce_element

convert(elem, M=None)[源代码]#

转换 elem 进入内部压抑。

大多是隐式的。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> M = QQ.old_poly_ring(x).free_module(2).submodule([1, x])
>>> M.convert([2, 2*x])
[2, 2*x]
identity_hom()[源代码]#

返回身份同态 self .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(2).submodule([x, x]).identity_hom()
Matrix([
[1, 0], : <[x, x]> -> <[x, x]>
[0, 1]])
in_terms_of_generators(e)[源代码]#

Express元素 e 属于 self 就发电机而言。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> M = F.submodule([1, 0], [1, 1])
>>> M.in_terms_of_generators([x, x**2])  
[DMP_Python([-1, 1, 0], QQ), DMP_Python([1, 0, 0], QQ)]
inclusion_hom()[源代码]#

返回表示的包含映射的同态 self .

也就是说,自然地图 selfself.container .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(2).submodule([x, x]).inclusion_hom()
Matrix([
[1, 0], : <[x, x]> -> QQ[x]**2
[0, 1]])
intersect(other, **options)[源代码]#

返回的交集 self 带子模块 other .

实例

>>> from sympy.abc import x, y
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x, y).free_module(2)
>>> F.submodule([x, x]).intersect(F.submodule([y, y]))
<[x*y, x*y]>

Some implementation allow further options to be passed. Currently, to only one implemented is relations=True, in which case the function will return a triple (res, rela, relb), where res is the intersection module, and rela and relb are lists of coefficient vectors, expressing the generators of res in terms of the generators of self (rela) and other (relb).

>>> F.submodule([x, x]).intersect(F.submodule([y, y]), relations=True)
(<[x*y, x*y]>, [(DMP_Python([[1, 0]], QQ),)], [(DMP_Python([[1], []], QQ),)])

以上结果表明:交叉口模块由单个元素生成 \((-xy, -xy) = -y (x, x) = -x (y, y)\) 在哪里 \((x, x)\)\((y, y)\) 分别是相交的两个模块的唯一生成器。

is_full_module()[源代码]#

如果返回真 self 是整个自由模块。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> F.submodule([x, 1]).is_full_module()
False
>>> F.submodule([1, 1], [1, 2]).is_full_module()
True
is_submodule(other)[源代码]#

返回true other 是的子模块 self .

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> M = F.submodule([2, x])
>>> N = M.submodule([2*x, x**2])
>>> M.is_submodule(M)
True
>>> M.is_submodule(N)
True
>>> N.is_submodule(M)
False
is_zero()[源代码]#

如果返回真 self 是零模。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> F.submodule([x, 1]).is_zero()
False
>>> F.submodule([0, 0]).is_zero()
True
module_quotient(other, **options)[源代码]#

返回的模商 self 按子模块 other .

也就是说,如果 self 是模块吗 \(M\)other\(N\) ,然后回归理想 \(\{{f \in R | fN \subset M\}}\) .

实例

>>> from sympy import QQ
>>> from sympy.abc import x, y
>>> F = QQ.old_poly_ring(x, y).free_module(2)
>>> S = F.submodule([x*y, x*y])
>>> T = F.submodule([x, x])
>>> S.module_quotient(T)
<y>

允许进一步传递一些选项。目前,唯一实现的是 relations=True ,只有在 other 是校长。在这种情况下,函数将返回一对 (res, rel) 在哪里? res 是理想的,而且 rel 是系数向量的列表,表示理想的生成元,乘以 other 就发电机而言 self .

>>> S.module_quotient(T, relations=True)
(<y>, [[DMP_Python([[1]], QQ)]])

这意味着商理想是由单个元素生成的 \(y\)\(y (x, x) = 1 (xy, xy)\)\((x, x)\)\((xy, xy)\)\(T\)\(S\) ,分别。

multiply_ideal(I)[源代码]#

乘法 self 凭理想 I .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> I = QQ.old_poly_ring(x).ideal(x**2)
>>> M = QQ.old_poly_ring(x).free_module(2).submodule([1, 1])
>>> I*M
<[x**2, x**2]>
quotient_module(other, **opts)[源代码]#

返回商模。

取这个模的一个子模的商是相同的。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> S1 = F.submodule([x, 1])
>>> S2 = F.submodule([x**2, x])
>>> S1.quotient_module(S2)
<[x, 1] + <[x**2, x]>>

或者更准确地说,使用重载除法运算符:

>>> F.submodule([x, 1]) / [(x**2, x)]
<[x, 1] + <[x**2, x]>>
reduce_element(x)[源代码]#

减少元素 x 我们的环模的理想 self .

这里的“reduce”没有特定的含义,它可以返回一个唯一的范式,稍微简化表达式,或者什么都不做。

submodule(*gens)[源代码]#

生成子模块。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> M = QQ.old_poly_ring(x).free_module(2).submodule([x, 1])
>>> M.submodule([x**2, x])
<[x**2, x]>
syzygy_module(**opts)[源代码]#

计算 self .

假设 \(M\) 由生成 \(f_1, \ldots, f_n\) 在拳台上 \(R\) . 考虑同态 \(\phi: R^n \to M\) ,通过发送 \((r_1, \ldots, r_n) \to r_1 f_1 + \cdots + r_n f_n\) . syzyy模块被定义为 \(\phi\) .

实例

如果生成器自由生成一个自由子模块,则Syzyy模块为零:

>>> from sympy.abc import x, y
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).free_module(2).submodule([1, 0], [1, 1]).syzygy_module().is_zero()
True

一个更有趣的例子:

>>> M = QQ.old_poly_ring(x, y).free_module(2).submodule([x, 2*x], [y, 2*y])
>>> S = QQ.old_poly_ring(x, y).free_module(2).submodule([y, -x])
>>> M.syzygy_module() == S
True
union(other)[源代码]#

返回由的并集生成的模块 selfother .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(1)
>>> M = F.submodule([x**2 + x]) # <x(x+1)>
>>> N = F.submodule([x**2 - 1]) # <(x-1)(x+1)>
>>> M.union(N) == F.submodule([x+1])
True

理想的创建非常类似于模块。例如,让我们验证节点立方在原点确实是奇异的:

>>> I = lr.ideal(x, y)
>>> I == lr.ideal(x)
False

>>> I == lr.ideal(y)
False

我们在这里使用的事实是,曲线在一点上是非奇异的当且仅当局部环的最大理想是主理想,并且在这种情况下至少有一个 \(x\)\(y\) 一定是发电机。

本课程的理想文档是详细的文档。请注意,大多数关于理想性质(素性等)的方法尚未实现。

class sympy.polys.agca.ideals.Ideal(ring)[源代码]#

理想的抽象基类。

不要实例化-在ring类中使用显式构造函数:

>>> from sympy import QQ
>>> from sympy.abc import x
>>> QQ.old_poly_ring(x).ideal(x+1)
<x + 1>

属性

  • 戒指-这个理想属于的戒指

未实现的方法:

  • _contains_elem

  • _contains_ideal

  • _quotient

  • _intersect

  • _union

  • _product

  • is_whole_ring

  • is_zero

  • 是素,是最大,是原,是根

  • is_principal

  • 高度、深度

  • 激进的

可能应该在子类中重写的方法:

  • reduce_element

contains(elem)[源代码]#

如果返回真 elem 是这个理想的一个要素。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).ideal(x+1, x-1).contains(3)
True
>>> QQ.old_poly_ring(x).ideal(x**2, x**3).contains(x)
False
depth()[源代码]#

计算 self .

height()[源代码]#

计算 self .

intersect(J)[源代码]#

计算自我与理想J的交集。

实例

>>> from sympy.abc import x, y
>>> from sympy import QQ
>>> R = QQ.old_poly_ring(x, y)
>>> R.ideal(x).intersect(R.ideal(y))
<x*y>
is_maximal()[源代码]#

如果返回真 self 是一个极大的理想。

is_primary()[源代码]#

如果返回真 self 初衷是理想。

is_prime()[源代码]#

如果返回真 self 是最理想的。

is_principal()[源代码]#

如果返回真 self 是一个主要的理想。

is_radical()[源代码]#

如果返回真 self 是一个激进的理想。

is_whole_ring()[源代码]#

如果返回真 self 是整个戒指。

is_zero()[源代码]#

如果返回真 self 是零理想。

product(J)[源代码]#

计算理想乘积 selfJ .

即计算产品产生的理想 \(xy\) ,为了 \(x\) 元素 self\(y \in J\) .

实例

>>> from sympy.abc import x, y
>>> from sympy import QQ
>>> QQ.old_poly_ring(x, y).ideal(x).product(QQ.old_poly_ring(x, y).ideal(y))
<x*y>
quotient(J, **opts)[源代码]#

计算理想商 self 通过 J .

也就是说,如果 self 是最理想的 \(I\) ,计算集合 \(I : J = \{{x \in R | xJ \subset I \}}\) .

实例

>>> from sympy.abc import x, y
>>> from sympy import QQ
>>> R = QQ.old_poly_ring(x, y)
>>> R.ideal(x*y).quotient(R.ideal(x))
<y>
radical()[源代码]#

计算 self .

reduce_element(x)[源代码]#

减少元素 x 我们的环模的理想 self .

这里“reduce”没有特定的含义:它可以返回一个唯一的范式,稍微简化表达式,或者什么都不做。

saturate(J)[源代码]#

计算理想饱和度 self 通过 J .

也就是说,如果 self 是最理想的 \(I\) ,计算集合 \(I : J^\infty = \{{x \in R | xJ^n \subset I \text{{ for some }} n\}}\) .

subset(other)[源代码]#

返回true otherself .

在这里 other 可能是个理想。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> I = QQ.old_poly_ring(x).ideal(x+1)
>>> I.subset([x**2 - 1, x**2 + 2*x + 1])
True
>>> I.subset([x**2 + 1, x + 1])
False
>>> I.subset(QQ.old_poly_ring(x).ideal(x**2 - 1))
True
union(J)[源代码]#

计算由 selfJ .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> QQ.old_poly_ring(x).ideal(x**2 - 1).union(QQ.old_poly_ring(x).ideal((x+1)**2)) == QQ.old_poly_ring(x).ideal(x+1)
True

如果 \(M\) 是一个 \(A\) -模块和 \(N\) 是一个 \(A\) -子模块,我们可以定义两个元素 \(x\)\(y\) 属于 \(M\) 如果 \(x - y \in N\) . 编写了一组等价类 \(M/N\) ,并具有自然 \(A\) -模块结构。这被称为的商模 \(M\) 通过 \(N\) .如果 \(K\) 是的子模块 \(M\) 包含 \(N\) 然后 \(K/N\) 以自然的方式是 \(M/N\) . 这样的模称为子商。以下是商和子商模块的文档:

class sympy.polys.agca.modules.QuotientModule(ring, base, submodule)[源代码]#

商模的类。

不要直接实例化它。有关子商的信息,请参阅SubQuotentientModule类。

属性:

  • 基-基模的商

  • killed_模块-用于形成商的子模块

  • 基地军衔

convert(elem, M=None)[源代码]#

转换 elem 进入内部表现。

每当计算涉及不在内部表示中的元素时,都隐式调用此方法。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2) / [(1, 2), (1, x)]
>>> F.convert([1, 0])
[1, 0] + <[1, 2], [1, x]>
dtype[源代码]#

QuotientModuleElement 的别名

identity_hom()[源代码]#

返回身份同态 self .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> M = QQ.old_poly_ring(x).free_module(2) / [(1, 2), (1, x)]
>>> M.identity_hom()
Matrix([
[1, 0], : QQ[x]**2/<[1, 2], [1, x]> -> QQ[x]**2/<[1, 2], [1, x]>
[0, 1]])
is_submodule(other)[源代码]#

如果返回真 other 是的子模块 self .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> Q = QQ.old_poly_ring(x).free_module(2) / [(x, x)]
>>> S = Q.submodule([1, 0])
>>> Q.is_submodule(S)
True
>>> S.is_submodule(Q)
False
is_zero()[源代码]#

如果返回真 self 是零模。

当且仅当基模块与被终止的子模块相同时,才会发生这种情况。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> (F/[(1, 0)]).is_zero()
False
>>> (F/[(1, 0), (0, 1)]).is_zero()
True
quotient_hom()[源代码]#

将商同态返回给 self .

也就是说,从 self.baseself .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> M = QQ.old_poly_ring(x).free_module(2) / [(1, 2), (1, x)]
>>> M.quotient_hom()
Matrix([
[1, 0], : QQ[x]**2 -> QQ[x]**2/<[1, 2], [1, x]>
[0, 1]])
submodule(*gens, **opts)[源代码]#

生成子模块。

这与取基模的子模的商相同。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> Q = QQ.old_poly_ring(x).free_module(2) / [(x, x)]
>>> Q.submodule([x, 0])
<[x, 0] + <[x, x]>>
class sympy.polys.agca.modules.QuotientModuleElement(module, data)[源代码]#

商模的元素。

eq(d1, d2)[源代码]#

Equality comparison.

class sympy.polys.agca.modules.SubQuotientModule(gens, container, **opts)[源代码]#

商模的子模。

等价地,子模的商模。

不要对此进行实例化,而是使用submodule或quantity_module构造方法:

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> S = F.submodule([1, 0], [1, x])
>>> Q = F/[(1, 0)]
>>> S/[(1, 0)] == Q.submodule([5, x])
True

属性:

  • 基-基模是我们的商

  • killed_module-用于形成商的子模块

is_full_module()[源代码]#

如果返回真 self 是整个自由模块。

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> F.submodule([x, 1]).is_full_module()
False
>>> F.submodule([1, 1], [1, 2]).is_full_module()
True
quotient_hom()[源代码]#

将商同态返回给self。

也就是说,从 self.baseself .

实例

>>> from sympy.abc import x
>>> from sympy import QQ
>>> M = (QQ.old_poly_ring(x).free_module(2) / [(1, x)]).submodule([1, 0])
>>> M.quotient_hom()
Matrix([
[1, 0], : <[1, 0], [1, x]> -> <[1, 0] + <[1, x]>, [1, x] + <[1, x]>>
[0, 1]])

模同态与合成#

\(M\)\(N\)\(A\) -模块。地图 \(f: M \to N\) 满足各种明显的特性(参见 [Atiyah69]) 被称为 \(A\) -模同态。在这种情况下 \(M\) 被称为 N 这个 辅酶 . 布景 \(\{{x \in M | f(x) = 0\}}\) 被称为 内核 \(ker(f)\) ,而 \(\{{f(x) | x \in M\}}\) 被称为 形象 \(im(f)\) . 内核是 \(M\) ,图像是 \(N\) . 同态 \(f\) 是内射的当且仅当 \(ker(f) = 0\) 当且仅当 \(im(f) = N\) . 双射同态称为 同构 . 相当于, \(ker(f) = 0\)\(im(f) = N\) . (一个相关的概念是 果仁\(coker(f) = N/im(f)\)

现在假设一下 \(M\) 是一个 \(A\) -模块。 \(M\) 被称为 有限生成 如果存在满射同态 \(A^n \to M\) 对某些人来说 \(n\) . 如果这样一个态射 \(f\) 影像选择的基础是影像 \(A^n\) 被称为 生成器 属于 \(M\) . 模块 \(ker(f)\) 被称为 合冲模 关于发电机。一个模块被调用 有限呈现 如果它是用有限生成的syzygy模有限生成的。有限表示模的类本质上是我们能够有意义地计算的最大类。

考虑到模是有限生成的,因此我们给出了有限生成模的一个定理。

合群的概念,虽然一开始看起来相当抽象,但实际上是非常计算性的。这是因为存在(相当容易)计算它们的算法,而且更一般的问题(核、交集等)通常被简化为综合计算。

Let us say a few words about the definition of homomorphisms in the AGCA module. Suppose first that \(f : M \to N\) is an arbitrary morphism of \(A\)-modules. Then if \(K\) is a submodule of \(M\), \(f\) naturally defines a new homomorphism \(g: K \to N\) (via \(g(x) = f(x)\)), called the restriction of \(f\) to \(K\). If now \(K\) contained in the kernel of \(f\), then moreover \(f\) defines in a natural homomorphism \(g: M/K \to N\) (same formula as above!), and we say that \(f\) descends to \(M/K\). Similarly, if \(L\) is a submodule of \(N\), there is a natural homomorphism \(g: M \to N/L\), we say that \(g\) factors through \(f\). Finally, if now \(L\) contains the image of \(f\), then there is a natural homomorphism \(g: M \to L\) (defined, again, by the same formula), and we say \(g\) is obtained from \(f\) by restriction of codomain. Observe also that each of these four operations is reversible, in the sense that given \(g\), one can always (non-uniquely) find \(f\) such that \(g\) is obtained from \(f\) in the above way.

请注意,AGCA中实现的所有模块都是通过取一系列子模块和商从自由模块中获得的。因此,为了解释如何定义任意模之间的同态,我们只需要解释如何定义自由模的同态。但是,本质上是由自由模的定义,自由模的同态 \(A^n\) 到任何模块 \(M\) 完全等同于给予 \(n\) 要素 \(M\) (标准基的图像),并给出一个自由模块的元素 \(A^m\) 完全等同于给予 \(m\) 要素 \(A\) . 因此自由模的同态 \(A^n \to A^m\) 可以通过矩阵来指定,完全类似于向量空间的情况。

功能 restrict_domainHomomorphism 可用于执行上述操作,并且自由模块的同态原则上可以手动实例化。由于这些操作非常常见,所以有一个方便函数 homomorphism 通过上述方法定义任意模之间的同态。它本质上是用户创建同态的唯一方法。

sympy.polys.agca.homomorphisms.homomorphism(domain, codomain, matrix)[源代码]#

创建同态对象。

此函数尝试从 domaincodomain 通过矩阵 matrix .

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> R = QQ.old_poly_ring(x)
>>> T = R.free_module(2)

如果 domain 是由生成的自由模块 \(e_1, \ldots, e_n\) 然后 matrix 应该是一个n元素iterable \((b_1, \ldots, b_n)\) 何处 \(b_i\) 是的元素 codomain . 构造的同态是唯一的同态发送 \(e_i\)\(b_i\) .

>>> F = R.free_module(2)
>>> h = homomorphism(F, T, [[1, x], [x**2, 0]])
>>> h
Matrix([
[1, x**2], : QQ[x]**2 -> QQ[x]**2
[x,    0]])
>>> h([1, 0])
[1, x]
>>> h([0, 1])
[x**2, 0]
>>> h([1, 1])
[x**2 + 1, x]

如果 domain 是自由模块的子模块,它们 matrix 确定从包含的自由模块到 codomain ,返回的同态是通过限制 domain .

>>> S = F.submodule([1, 0], [0, x])
>>> homomorphism(S, T, [[1, x], [x**2, 0]])
Matrix([
[1, x**2], : <[1, 0], [0, x]> -> QQ[x]**2
[x,    0]])

如果 domain 是(次)商 \(N/K\) 然后 matrix 确定同态 \(N\)codomain . 如果内核包含 \(K\) ,这个同态下降到 domain 返回;否则引发异常。

>>> homomorphism(S/[(1, 0)], T, [0, [x**2, 0]])
Matrix([
[0, x**2], : <[1, 0] + <[1, 0]>, [0, x] + <[1, 0]>, [1, 0] + <[1, 0]>> -> QQ[x]**2
[0,    0]])
>>> homomorphism(S/[(0, x)], T, [0, [x**2, 0]])
Traceback (most recent call last):
...
ValueError: kernel <[1, 0], [0, 0]> must contain sm, got <[0,x]>

最后,下面是实际同态类的详细参考:

class sympy.polys.agca.homomorphisms.ModuleHomomorphism(domain, codomain)[源代码]#

模块同构的抽象基类。不要实例化。

相反,使用 homomorphism 功能:

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [0, 1]])
Matrix([
[1, 0], : QQ[x]**2 -> QQ[x]**2
[0, 1]])

属性:

  • 环-我们正在考虑模块的环

  • 域-域模块

  • 密码域-密码域模块

  • _kercached内核

  • _img-缓存图像

未实现的方法:

  • _kernel

  • _image

  • _restrict_domain

  • _restrict_codomain

  • _quotient_domain

  • _quotient_codomain

  • _apply

  • _mul_scalar

  • _compose

  • _add

image()[源代码]#

计算图像 self .

也就是说,如果 self 是同态 \(\phi: M \to N\) ,然后计算 \(im(\phi) = \{{\phi(x) | x \in M \}}\) . 这是 \(N\) .

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [x, 0]]).image() == F.submodule([1, 0])
True
is_injective()[源代码]#

如果返回真 self 是内射的。

也就是说,检查域的元素是否映射到同一个codomain元素。

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h.is_injective()
False
>>> h.quotient_domain(h.kernel()).is_injective()
True
is_isomorphism()[源代码]#

如果返回真 self 是同构的。

也就是说,检查codomain的每个元素是否都有一个preimage。相当于, self 既是内射的又是满射的。

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h = h.restrict_codomain(h.image())
>>> h.is_isomorphism()
False
>>> h.quotient_domain(h.kernel()).is_isomorphism()
True
is_surjective()[源代码]#

如果返回真 self 是满意足的。

也就是说,检查codomain的每个元素是否至少有一个preimage。

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h.is_surjective()
False
>>> h.restrict_codomain(h.image()).is_surjective()
True
is_zero()[源代码]#

如果返回真 self 是零态射。

也就是说,检查域的每个元素是否都映射到self下的0。

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h.is_zero()
False
>>> h.restrict_domain(F.submodule()).is_zero()
True
>>> h.quotient_codomain(h.image()).is_zero()
True
kernel()[源代码]#

计算 self .

也就是说,如果 self 是同态 \(\phi: M \to N\) ,然后计算 \(ker(\phi) = \{{x \in M | \phi(x) = 0\}}\) . 这是 \(M\) .

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> homomorphism(F, F, [[1, 0], [x, 0]]).kernel()
<[x, -1]>
quotient_codomain(sm)[源代码]#

返回 self 密码域替换为 codomain/sm .

在这里 sm 必须是的子模块 self.codomain .

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.quotient_codomain(F.submodule([1, 1]))
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2/<[1, 1]>
[0, 0]])

这与使用左侧的商贴图合成相同:

>>> (F/[(1, 1)]).quotient_hom() * h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2/<[1, 1]>
[0, 0]])
quotient_domain(sm)[源代码]#

返回 self 域替换为 domain/sm .

在这里 sm 必须是的子模块 self.kernel() .

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.quotient_domain(F.submodule([-x, 1]))
Matrix([
[1, x], : QQ[x]**2/<[-x, 1]> -> QQ[x]**2
[0, 0]])
restrict_codomain(sm)[源代码]#

返回 self ,密码域限制为 sm .

在这里 sm 必须是 self.codomain 包含图像。

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.restrict_codomain(F.submodule([1, 0]))
Matrix([
[1, x], : QQ[x]**2 -> <[1, 0]>
[0, 0]])
restrict_domain(sm)[源代码]#

返回 self ,域限制为 sm .

在这里 sm 必须是 self.domain .

实例

>>> from sympy import QQ
>>> from sympy.abc import x
>>> from sympy.polys.agca import homomorphism
>>> F = QQ.old_poly_ring(x).free_module(2)
>>> h = homomorphism(F, F, [[1, 0], [x, 0]])
>>> h
Matrix([
[1, x], : QQ[x]**2 -> QQ[x]**2
[0, 0]])
>>> h.restrict_domain(F.submodule([1, 0]))
Matrix([
[1, x], : <[1, 0]> -> QQ[x]**2
[0, 0]])

这与在右侧包含子模块一样:

>>> h * F.submodule([1, 0]).inclusion_hom()
Matrix([
[1, x], : <[1, 0]> -> QQ[x]**2
[0, 0]])

有限扩张#

\(A\)为(交换)环,\(B\)\(A\)的扩展环。如果\(B\)的所有元素都可以表示为\(t\)中的多项式,系数为\(a\),则\(B\)的元素\(t\)就是\(B\)(超过\(a\))的生成器。当且仅当\(t\)不满足非平凡多项式关系时,表示是唯一的,在这种情况下,\(B\)可以与超过\(a\)的(单变量)多项式环进行识别。

\(t\)为根的多项式一般形成非零理想。实践中最重要的情况是由一元多项式生成的理想。如果\(t\)满足这样一个多项式关系,那么它的最高幂\(t^n\)可以写成低次幂的线性组合。因此,归纳地说,所有新台币的更高权力也有这样的代表性。因此,低次幂\(t^i\)\(i=0,\dots,n-1\))构成\(B\)的基础,然后称为\(a\)的有限延伸,或者更准确地说,是由单个元素\(t\)生成的单基因有限延伸。

class sympy.polys.agca.extensions.MonogenicFiniteExtension(mod)[源代码]#

由积分单元生成的有限扩张。

生成器是由一元一元多项式定义的 mod .

一个较短的别名是 FiniteExtension .

实例

Quadratic integer ring \(\mathbb{Z}[\sqrt2]\):

>>> from sympy import Symbol, Poly
>>> from sympy.polys.agca.extensions import FiniteExtension
>>> x = Symbol('x')
>>> R = FiniteExtension(Poly(x**2 - 2)); R
ZZ[x]/(x**2 - 2)
>>> R.rank
2
>>> R(1 + x)*(3 - 2*x)
x - 1

有限域\(GF(5^3)\)由本原多项式\(x^3+x^2+2\)(超过\(\mathbb{Z}u 5\))定义。

>>> F = FiniteExtension(Poly(x**3 + x**2 + 2, modulus=5)); F
GF(5)[x]/(x**3 + x**2 + 2)
>>> F.basis
(1, x, x**2)
>>> F(x + 3)/(x**2 + 2)
-2*x**2 + x + 2

椭圆曲线的函数场:

>>> t = Symbol('t')
>>> FiniteExtension(Poly(t**2 - x**3 - x + 1, t, field=True))
ZZ(x)[t]/(t**2 - x**3 - x + 1)
dtype[源代码]#

ExtensionElement 的别名

class sympy.polys.agca.extensions.ExtensionElement(rep, ext)[源代码]#

Element of a finite extension.

A class of univariate polynomials modulo the modulus of the extension ext. It is represented by the unique polynomial rep of lowest degree. Both rep and the representation mod of modulus are of class DMP.

inverse()[源代码]#

Multiplicative inverse.

加薪:

NotInvertible

If the element is a zero divisor.