Value groups of discrete valuations¶
This file defines additive sub(semi-)groups of \(\QQ\) and related structures.
AUTHORS:
Julian Rüth (2013-09-06): initial version
EXAMPLES:
sage: v = ZZ.valuation(2)
sage: v.value_group()
Additive Abelian Group generated by 1
sage: v.value_semigroup()
Additive Abelian Semigroup generated by 1
>>> from sage.all import *
>>> v = ZZ.valuation(Integer(2))
>>> v.value_group()
Additive Abelian Group generated by 1
>>> v.value_semigroup()
Additive Abelian Semigroup generated by 1
- class sage.rings.valuation.value_group.DiscreteValuationCodomain[source]¶
Bases:
UniqueRepresentation
,Parent
The codomain of discrete valuations, the rational numbers extended by \(\pm\infty\).
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValuationCodomain sage: C = DiscreteValuationCodomain(); C Codomain of Discrete Valuations
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValuationCodomain >>> C = DiscreteValuationCodomain(); C Codomain of Discrete Valuations
- class sage.rings.valuation.value_group.DiscreteValueGroup(generator)[source]¶
Bases:
UniqueRepresentation
,Parent
The value group of a discrete valuation, an additive subgroup of \(\QQ\) generated by
generator
.INPUT:
generator
– a rational number
Note
We do not rely on the functionality provided by additive abelian groups in Sage since these require the underlying set to be the integers. Therefore, we roll our own Z-module here. We could have used
AdditiveAbelianGroupWrapper
here, but it seems to be somewhat outdated. In particular, generic group functionality should now come from the category and not from the super-class. A facade of Q appeared to be the better approach.EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: D1 = DiscreteValueGroup(0); D1 Trivial Additive Abelian Group sage: D2 = DiscreteValueGroup(4/3); D2 Additive Abelian Group generated by 4/3 sage: D3 = DiscreteValueGroup(-1/3); D3 Additive Abelian Group generated by 1/3
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> D1 = DiscreteValueGroup(Integer(0)); D1 Trivial Additive Abelian Group >>> D2 = DiscreteValueGroup(Integer(4)/Integer(3)); D2 Additive Abelian Group generated by 4/3 >>> D3 = DiscreteValueGroup(-Integer(1)/Integer(3)); D3 Additive Abelian Group generated by 1/3
- denominator()[source]¶
Return the denominator of a generator of this group.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: DiscreteValueGroup(3/8).denominator() 8
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> DiscreteValueGroup(Integer(3)/Integer(8)).denominator() 8
- gen()[source]¶
Return a generator of this group.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: DiscreteValueGroup(-3/8).gen() 3/8
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> DiscreteValueGroup(-Integer(3)/Integer(8)).gen() 3/8
- index(other)[source]¶
Return the index of
other
in this group.INPUT:
other
– a subgroup of this group
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: DiscreteValueGroup(3/8).index(DiscreteValueGroup(3)) 8 sage: DiscreteValueGroup(3).index(DiscreteValueGroup(3/8)) Traceback (most recent call last): ... ValueError: other must be a subgroup of this group sage: DiscreteValueGroup(3).index(DiscreteValueGroup(0)) Traceback (most recent call last): ... ValueError: other must have finite index in this group sage: DiscreteValueGroup(0).index(DiscreteValueGroup(0)) 1 sage: DiscreteValueGroup(0).index(DiscreteValueGroup(3)) Traceback (most recent call last): ... ValueError: other must be a subgroup of this group
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> DiscreteValueGroup(Integer(3)/Integer(8)).index(DiscreteValueGroup(Integer(3))) 8 >>> DiscreteValueGroup(Integer(3)).index(DiscreteValueGroup(Integer(3)/Integer(8))) Traceback (most recent call last): ... ValueError: other must be a subgroup of this group >>> DiscreteValueGroup(Integer(3)).index(DiscreteValueGroup(Integer(0))) Traceback (most recent call last): ... ValueError: other must have finite index in this group >>> DiscreteValueGroup(Integer(0)).index(DiscreteValueGroup(Integer(0))) 1 >>> DiscreteValueGroup(Integer(0)).index(DiscreteValueGroup(Integer(3))) Traceback (most recent call last): ... ValueError: other must be a subgroup of this group
- is_trivial()[source]¶
Return whether this is the trivial additive abelian group.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: DiscreteValueGroup(-3/8).is_trivial() False sage: DiscreteValueGroup(0).is_trivial() True
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> DiscreteValueGroup(-Integer(3)/Integer(8)).is_trivial() False >>> DiscreteValueGroup(Integer(0)).is_trivial() True
- numerator()[source]¶
Return the numerator of a generator of this group.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: DiscreteValueGroup(3/8).numerator() 3
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> DiscreteValueGroup(Integer(3)/Integer(8)).numerator() 3
- some_elements()[source]¶
Return some typical elements in this group.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueGroup sage: DiscreteValueGroup(-3/8).some_elements() [3/8, -3/8, 0, 42, 3/2, -3/2, 9/8, -9/8]
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueGroup >>> DiscreteValueGroup(-Integer(3)/Integer(8)).some_elements() [3/8, -3/8, 0, 42, 3/2, -3/2, 9/8, -9/8]
- class sage.rings.valuation.value_group.DiscreteValueSemigroup(generators)[source]¶
Bases:
UniqueRepresentation
,Parent
The value semigroup of a discrete valuation, an additive subsemigroup of \(\QQ\) generated by
generators
.INPUT:
generators
– rational numbers
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueSemigroup sage: D1 = DiscreteValueSemigroup(0); D1 Trivial Additive Abelian Semigroup sage: D2 = DiscreteValueSemigroup(4/3); D2 Additive Abelian Semigroup generated by 4/3 sage: D3 = DiscreteValueSemigroup([-1/3, 1/2]); D3 Additive Abelian Semigroup generated by -1/3, 1/2
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueSemigroup >>> D1 = DiscreteValueSemigroup(Integer(0)); D1 Trivial Additive Abelian Semigroup >>> D2 = DiscreteValueSemigroup(Integer(4)/Integer(3)); D2 Additive Abelian Semigroup generated by 4/3 >>> D3 = DiscreteValueSemigroup([-Integer(1)/Integer(3), Integer(1)/Integer(2)]); D3 Additive Abelian Semigroup generated by -1/3, 1/2
- gens()[source]¶
Return the generators of this semigroup.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueSemigroup sage: DiscreteValueSemigroup(-3/8).gens() (-3/8,)
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueSemigroup >>> DiscreteValueSemigroup(-Integer(3)/Integer(8)).gens() (-3/8,)
- is_group()[source]¶
Return whether this semigroup is a group.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueSemigroup sage: DiscreteValueSemigroup(1).is_group() False sage: D = DiscreteValueSemigroup([-1, 1]) sage: D.is_group() True
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueSemigroup >>> DiscreteValueSemigroup(Integer(1)).is_group() False >>> D = DiscreteValueSemigroup([-Integer(1), Integer(1)]) >>> D.is_group() True
Invoking this method also changes the category of this semigroup if it is a group:
sage: D in AdditiveMagmas().AdditiveAssociative().AdditiveUnital().AdditiveInverse() True
>>> from sage.all import * >>> D in AdditiveMagmas().AdditiveAssociative().AdditiveUnital().AdditiveInverse() True
- is_trivial()[source]¶
Return whether this is the trivial additive abelian semigroup.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueSemigroup sage: DiscreteValueSemigroup(-3/8).is_trivial() False sage: DiscreteValueSemigroup([]).is_trivial() True
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueSemigroup >>> DiscreteValueSemigroup(-Integer(3)/Integer(8)).is_trivial() False >>> DiscreteValueSemigroup([]).is_trivial() True
- some_elements()[source]¶
Return some typical elements in this semigroup.
EXAMPLES:
sage: from sage.rings.valuation.value_group import DiscreteValueSemigroup sage: list(DiscreteValueSemigroup([-3/8,1/2]).some_elements()) # needs sage.numerical.mip [0, -3/8, 1/2, ...]
>>> from sage.all import * >>> from sage.rings.valuation.value_group import DiscreteValueSemigroup >>> list(DiscreteValueSemigroup([-Integer(3)/Integer(8),Integer(1)/Integer(2)]).some_elements()) # needs sage.numerical.mip [0, -3/8, 1/2, ...]