Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention .coerce() method in coercion tour #39069

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/doc/en/tutorial/tour_coercion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ we have:
x
sage: R2(y)
y
sage: R2.coerce(y)
y

If there is no name preserving ring homomorphism, coercion is not
defined. However, conversion may still be possible, namely by mapping
Expand All @@ -296,6 +298,12 @@ ring generators according to their position in the list of generators:
z
sage: R3(y)
x
sage: R3.coerce(y)
Traceback (most recent call last):
...
TypeError: no canonical coercion
from Multivariate Polynomial Ring in x, y over Integer Ring
to Multivariate Polynomial Ring in z, x over Integer Ring

But such position preserving conversions do not qualify as coercion:
By composing a name preserving map from ``ZZ['x','y']`` to ``ZZ['y','x']``
Expand Down
8 changes: 8 additions & 0 deletions src/doc/fr/tutorial/tour_coercion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ des variables. Nous avons donc :
x
sage: R2(y)
y
sage: R2.coerce(y)
y

En l'absence d'un morphisme d'anneau qui préserve les noms de variable, la
coercition entre anneaux de polynômes multivariés n'est pas définie. Il peut
Expand All @@ -296,6 +298,12 @@ celle de l'autre en fonction de leur position dans la liste des générateurs :
z
sage: R3(y)
x
sage: R3.coerce(y)
Traceback (most recent call last):
...
TypeError: no canonical coercion
from Multivariate Polynomial Ring in x, y over Integer Ring
to Multivariate Polynomial Ring in z, x over Integer Ring

Mais une telle conversion ne répond pas aux critères pour être une coercition :
en effet, en composant l'application de ``ZZ['x','y']`` dans ``ZZ['y','x']``
Expand Down
8 changes: 8 additions & 0 deletions src/doc/ja/tutorial/tour_coercion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ Sageが宗とするのは歩み寄りだ.
x
sage: R2(y)
y
sage: R2.coerce(y)
y


変数名を維持する環準同形写像が定義できなければ,型強制も成立しない.
Expand All @@ -268,6 +270,12 @@ Sageが宗とするのは歩み寄りだ.
z
sage: R3(y)
x
sage: R3.coerce(y)
Traceback (most recent call last):
...
TypeError: no canonical coercion
from Multivariate Polynomial Ring in x, y over Integer Ring
to Multivariate Polynomial Ring in z, x over Integer Ring

ところが,そうした順序依存の変換は型強制としては満足すべきものにならない.
``ZZ['x','y']`` から ``ZZ['y','x']`` への変数名維持写像と ``ZZ['y','x']`` から ``ZZ['a','b']`` への順序依存写像を合成すると,結果は変数名も順序も保存しない写像となって無矛盾性が破れてしまうからである.
Expand Down
8 changes: 8 additions & 0 deletions src/doc/pt/tutorial/tour_coercion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ preservam nomes. Então temos:
x
sage: R2(y)
y
sage: R2.coerce(y)
y

Se não existir homomorfismo de anel que preserve nomes, coação não é
definida. Todavia, conversão pode ainda ser possível, a saber,
Expand All @@ -302,6 +304,12 @@ geradores:
z
sage: R3(y)
x
sage: R3.coerce(y)
Traceback (most recent call last):
...
TypeError: no canonical coercion
from Multivariate Polynomial Ring in x, y over Integer Ring
to Multivariate Polynomial Ring in z, x over Integer Ring

Mas essas conversões que preservam a posição não se qualificam como
coação: Compondo um mapa que preserva nomes de ``ZZ['x','y']`` para
Expand Down
Loading