From 9491740bf86fef9ef22201a6590605019bec0c1d Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Mon, 2 Dec 2024 07:06:22 +0700 Subject: [PATCH 1/2] Mention .coerce() method in coercion tour --- src/doc/en/tutorial/tour_coercion.rst | 6 ++++++ src/doc/fr/tutorial/tour_coercion.rst | 6 ++++++ src/doc/ja/tutorial/tour_coercion.rst | 6 ++++++ src/doc/pt/tutorial/tour_coercion.rst | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/src/doc/en/tutorial/tour_coercion.rst b/src/doc/en/tutorial/tour_coercion.rst index f5c17d619d9..bbbb263a0ed 100644 --- a/src/doc/en/tutorial/tour_coercion.rst +++ b/src/doc/en/tutorial/tour_coercion.rst @@ -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 @@ -296,6 +298,10 @@ 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']`` diff --git a/src/doc/fr/tutorial/tour_coercion.rst b/src/doc/fr/tutorial/tour_coercion.rst index e19487c0cbd..5e3cd3806b7 100644 --- a/src/doc/fr/tutorial/tour_coercion.rst +++ b/src/doc/fr/tutorial/tour_coercion.rst @@ -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 @@ -296,6 +298,10 @@ 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']`` diff --git a/src/doc/ja/tutorial/tour_coercion.rst b/src/doc/ja/tutorial/tour_coercion.rst index c9815f9e4b3..95fe692115e 100644 --- a/src/doc/ja/tutorial/tour_coercion.rst +++ b/src/doc/ja/tutorial/tour_coercion.rst @@ -252,6 +252,8 @@ Sageが宗とするのは歩み寄りだ. x sage: R2(y) y + sage: R2.coerce(y) + y 変数名を維持する環準同形写像が定義できなければ,型強制も成立しない. @@ -268,6 +270,10 @@ 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']`` への順序依存写像を合成すると,結果は変数名も順序も保存しない写像となって無矛盾性が破れてしまうからである. diff --git a/src/doc/pt/tutorial/tour_coercion.rst b/src/doc/pt/tutorial/tour_coercion.rst index 94efa8cec15..d0a1472e2e9 100644 --- a/src/doc/pt/tutorial/tour_coercion.rst +++ b/src/doc/pt/tutorial/tour_coercion.rst @@ -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, @@ -302,6 +304,10 @@ 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 From 2257b7fefaa7f4c0e6fd0bad766038dfbbf3f5fc Mon Sep 17 00:00:00 2001 From: user202729 <25191436+user202729@users.noreply.github.com> Date: Sat, 7 Dec 2024 10:57:35 +0700 Subject: [PATCH 2/2] Add line breaks --- src/doc/en/tutorial/tour_coercion.rst | 4 +++- src/doc/fr/tutorial/tour_coercion.rst | 4 +++- src/doc/ja/tutorial/tour_coercion.rst | 4 +++- src/doc/pt/tutorial/tour_coercion.rst | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/doc/en/tutorial/tour_coercion.rst b/src/doc/en/tutorial/tour_coercion.rst index bbbb263a0ed..a078a52b069 100644 --- a/src/doc/en/tutorial/tour_coercion.rst +++ b/src/doc/en/tutorial/tour_coercion.rst @@ -301,7 +301,9 @@ ring generators according to their position in the list of generators: 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 + 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']`` diff --git a/src/doc/fr/tutorial/tour_coercion.rst b/src/doc/fr/tutorial/tour_coercion.rst index 5e3cd3806b7..cbd18ad6598 100644 --- a/src/doc/fr/tutorial/tour_coercion.rst +++ b/src/doc/fr/tutorial/tour_coercion.rst @@ -301,7 +301,9 @@ celle de l'autre en fonction de leur position dans la liste des générateurs : 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 + 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']`` diff --git a/src/doc/ja/tutorial/tour_coercion.rst b/src/doc/ja/tutorial/tour_coercion.rst index 95fe692115e..972cfa47af7 100644 --- a/src/doc/ja/tutorial/tour_coercion.rst +++ b/src/doc/ja/tutorial/tour_coercion.rst @@ -273,7 +273,9 @@ Sageが宗とするのは歩み寄りだ. 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 + 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']`` への順序依存写像を合成すると,結果は変数名も順序も保存しない写像となって無矛盾性が破れてしまうからである. diff --git a/src/doc/pt/tutorial/tour_coercion.rst b/src/doc/pt/tutorial/tour_coercion.rst index d0a1472e2e9..7a2708eb01e 100644 --- a/src/doc/pt/tutorial/tour_coercion.rst +++ b/src/doc/pt/tutorial/tour_coercion.rst @@ -307,7 +307,9 @@ geradores: 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 + 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