Opened 5 years ago

## #21160 new enhancement

# the default implementation of Homset.identity is wrong

Reported by: | vdelecroix | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-7.3 |

Component: | categories | Keywords: | |

Cc: | nthiery, SimonKing | Merged in: | |

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

The method `sage.categories.Homset.identity`

should not try to bypass the `_element_constructor_`

... as a consequence of the current behavior

sage: R.<x,y> = QQ[] sage: A = AffineSpace(R) sage: Ai = A.Hom(A).identity() sage: f = A.Hom(A)([1,2]) sage: f * Ai Traceback (most recent call last): ... TypeError: right (=Identity endomorphism of Affine Space of dimension 2 over Rational Field) must be a SchemeMorphism to multiply it by Scheme endomorphism of Affine Space of dimension 2 over Rational Field Defn: Defined on coordinates by sending (x, y) to (1, 2)

(Vincent): I think that this `IdentityMorphism`

should just not exist. There is no such thing as `OneElement`

and `ZeroElement`

that is spoiled all over Sage for the zero and one of algebraic structures...

**Note:**See TracTickets for help on using tickets.