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

Simplifying 0**x gives 0, with no assumptions on x #22027

Open
pelegm opened this issue Dec 6, 2016 · 6 comments
Open

Simplifying 0**x gives 0, with no assumptions on x #22027

pelegm opened this issue Dec 6, 2016 · 6 comments

Comments

@pelegm
Copy link
Contributor

pelegm commented Dec 6, 2016

Check this:

sage: simplify(0**x)
0

but

sage: 0**0
1

Upstream: Not yet reported upstream; Will do shortly.

Component: symbolics

Keywords: simplify

Issue created by migration from https://trac.sagemath.org/ticket/22027

@pelegm pelegm added this to the sage-7.5 milestone Dec 6, 2016
@rwst
Copy link

rwst commented Jan 14, 2017

comment:1

That is a Maxima bug.

@pelegm
Copy link
Contributor Author

pelegm commented Jun 29, 2018

comment:2

Are we ok with sage returning 1 for 0^0? This is the case in Python, but in Maxima is it undefined.

Is maxima under active development? Should we report that issue there?

Note that sympy handles this properly:

In [6]: sympy.simplify(0**x)
Out[6]: 0**x

@DaveWitteMorris
Copy link
Member

comment:3

Singular says 0^n = 0 (where n must be an integer):

CanonicalForm
power ( const CanonicalForm & f, int n )
{
  ASSERT( n >= 0, "illegal exponent" );

  if ( f.isZero() )
    return CanonicalForm(0L);
  ...

I would say this is clearly wrong: x^0 needs to be 1 for all x if the exponent is an integer variable.

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Mar 5, 2022

comment:4

Ask Sage question 61400 makes me raise the priority of this one.

One should note that

  • Sympy does not give an explicit 1 and returns the sum unevaluated
  • Giac returns undef
  • Mathematica raises an error claiming that 0^0 is indeterminate

Furthermore:

sage: sum(x^j/factorial(j),j,0,oo)
e^x
sage: sum(x^j/factorial(j),j,0,oo).limit(x=0)
1
sage: sum(x^j/factorial(j),j,0,oo).subs(x=0)
1

But, indeed:

sage: with assuming(j, "integer", j >= 0): 0^j
0^j
sage: with assuming(j, "integer", j >= 0): (0^j).simplify()
0

Since simplify does its work by passing its argument to Maxima,
and uses the returned value as a result, the ball is well in Maxima's camp...

@EmmanuelCharpentier
Copy link
Mannequin

EmmanuelCharpentier mannequin commented Mar 5, 2022

Upstream: Not yet reported upstream; Will do shortly.

@slel
Copy link
Member

slel commented Mar 6, 2022

comment:5

The "maxima-discuss" mailing list had a thread last month
about zero to the zero:

(from there click "View entire thread").

@mkoeppe mkoeppe removed this from the sage-7.5 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants