Opened 8 years ago

# Equality in PowerSeriesRing can be unpredictable

Reported by: Owned by: darij AlexGhitza minor sage-6.4 algebra power series, halting problem, discreteness, equality N/A

I know this is unavoidable, but I'd say it should be better documented...

Over a finite field:

```sage: K.<u> = PowerSeriesRing(GF(5))
sage: u = K.gen()
sage: u ** 25
u^25
sage: u ** 25 == 0
False
sage: (1 + u) ** 25
1 + u^25
sage: (1 + u) ** 25 == 1
False
sage: (1 / (1 - u)) ** 25
1 + O(u^20)
sage: (1 / (1 - u)) ** 25 == 1
True
```

I suspect the last `True` is due to `1 / (1 - u)` being a dense series, which leads to Sage keeping precision at `O(u^20)` rather than moving to a higher exponent.

### comment:1 Changed 8 years ago by darij

• Description modified (diff)

### comment:2 Changed 8 years ago by darij

• Description modified (diff)

### comment:3 Changed 8 years ago by darij

• Description modified (diff)

### comment:4 Changed 8 years ago by vbraun

• Description modified (diff)

The power series ring tries to keep arbitrary precision if possible, and only switches to series expansion if necessary. So `u^25` is kept as exact, even though it is zero to the `default_prec=20`.

For interactive use, I think this is what one would want. However, for non-interactive use an "always approximate" mode where `u^25` is immediately zero would be nice. I have written lots of code where many lines end in `+O(u^prec)` to get the precision back down.

### comment:5 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:6 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:7 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.