Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
350 stars 235 forks source link

Feature request: [D] as notation for class of D #3268

Open mahrud opened 6 months ago

mahrud commented 6 months ago

Very frequently in math, given an object (say divisor) D and an equivalence relation D~D', we denote the equivalency class with [D]. I think it would be cool if we could define methods on [T], for instance:

[Divisor] := D -> -* the class of D in the class group *-

How hard would this be?

Related: #1978


As a potentially far fetched extension, allowing (a,b] and [a,b) to produce half open intervals would be useful (both [a,b] and (a,b) work fine and can be interpreted appropriately by methods, so that's not a concern).

pzinn commented 6 months ago

funny, I had the same thought for a different reason, I wanted to define q-numbers, something like

[ZZ] := n -> (q^n-1)//(q-1)
mahrud commented 6 months ago

We'd have to be careful that this doesn't break I^[n] for frobenius powers, but otherwise it seems fine to me!