On 26 November 2014 at 12:58, Ondřej Čertík <ondrej.cer...@gmail.com> wrote:
> On Wed, Nov 26, 2014 at 10:17 AM, Bill Page <bill.p...@newsynthesis.org> 
> wrote:
>>
>> Does it help if a say the operations are defined "symbolically"?
>
> All I want is if you can give me an algorithm of your approach
> in sufficient detail, so that it can be implemented by me on a
> computer.  And by "your approach", I mean an approach, where
> conjugate(log(x)) = log(conjugate(x)) for all x.
>

I am sorry, we seem to be having some trouble communicating. Is that
something infecting this email list? :)

Making  "conjugate(log(x)) = log(conjugate(x)) for all x" is trivial
so long as it is treated symbolically: the 'conjugate' operation is
just defined to rewrite itself (auto-simplify) when applied to any
operand of the form log(_), so 'conjugate(log(_))' is evaluated as
'log(conjugate(_))', where _ stands for any element of the domain
Expression.  This is what I meant when I said it was considered true
by definition, i.e. by definition of the symbolic 'conjugate'
operation.  Exactly the same sort of thing happens when the
'conjugate' operation acts on 'conjugate'  so that
'conjugate(conjugate(x))' is simply rewritten as 'x'.

> I have provided all the details of the algorithm (B). In approach (B),
> it is not true that
> conjugate(log(x)) = log(conjugate(x)) for all x.
>
> This equation (when conjugate(log(x)) = log(conjugate(x)) holds)
> started this whole discussion.

That

  log(a*b) = log(a) + log(b)

is considerably less trivial that the case of 'conjugate'.  From my
point of view that is what actually started this branch of the
"fabric" of this discussion.  That is where 'normalize' comes in.

> So I was trying to understand your approach how to make this hold
> for all "x", and I suggested various ways how maybe it could be
> implemented, and to most of it you said "that's not how FriCAS does
> it". At this point I don't have any more ideas how it could be done,
> so I don't know how to implement your approach. Which is sad --
> even though I am not advocating for your approach, I wanted to
> really understand it, so that I can make my own opinion on the pros
> and cons.

Thank you for attempting to understand.

I think I only used the phrase "that's not how FriCAS does it" in the
context of multi-valued functions.  My point is that FriCAS makes no
attempt to evaluate a multi-valued function symbolically. But FriCAS
does rewrite expressions involving mutli-valued functions in some
cases automatically and in others when asked to do so by operators
like 'normalize'.

>
>> Maybe we need to define exactly what operations we are talking about.
>
> Sure. Let's just stick to one example, let me just copy & paste it
> from my previous email:
>
>>>> from cmath import log
>>>> a = -1
>>>> b = -1
>>>> log(a*b)
> 0j
>>>> log(a)+log(b)
> 6.283185307179586j
>
>>>> def arg(x): return log(x).imag
> ...
>>>> from math import floor, pi
>>>> I = 1j
>>>> log(a)+log(b)+2*pi*I*floor((
> pi-arg(a)-arg(b))/(2*pi))
> 0j
>
> As you confirmed, even if you evaluate this in FriCAS, log(a*b) is not
> equal to log(a) + log(b), when a=b=-1.

Yes, I showed that as expected this was not equal when 'log' is
evaluated in a numeric domain but I am talking about a domain
constructed by 'Expression' which is a "symbolic" domain.

> However, you claim that "symbolically" it is true that log(a*b) =
> log(a) - log(b) for all "a" and "b" and you provided a FriCAS function
> "normalize" that does it,

No not exactly.  I am sorry that I did not express myself more
clearly.  Actually if I evaluate

  test ( log(a*b) = log(a)+log(b) )

FriCAS returns 'false' since no automatic simplifications apply here
and these are obviously to different expressions.  What I showed was
that

  normalize(log(a*b)-log(a)-log(b))

returns 0.

> but you said that for deeper understanding you would need to consult
> Waldek Hebisch. Can you explain the discrepancy/inconsistency?

Well, um, what I tried to say was that for a deeper understanding of
'normalize' we would have to either read the source code of
'normalize' or talk with Waldek who as studied the source code more
carefully and throughly than I have. 'normalize' was written by Manuel
Bronstein.  There is no specific documentation except for that
contained in the source code:

https://github.com/fricas/fricas/blob/master/src/algebra/efstruc.spad#L83

and unfortunately Manuel Bronstein is dead. Bronstein did however
publish several books and numerous articles. In particular 'normalize'
is part of his implementation of the "Risch structure theorem".  E.g.
http://dl.acm.org/citation.cfm?id=74566  As I recall there was some
Google Summer of Code work on sympy related to this.

But Waldek has made a number if important recent changes to this package.

>
> How exactly are the operations in log(a*b) = log(a) - log(b) defined,
> so that this equation holds, even though when you put in a=b=-1, you
> get a different number on the LHS and RHS, as confirmed by FriCAS?
>

My admittedly primitive understanding of how 'normalize'  operates in
this case is that it is similar in principle to what one does to show
for example that '(a*b)/(a*c) - b/c = 0', i.e. by rewriting the
expression to a canonical equivalent  form (although of course this is
actually done by automatic simplifications in FriCAS).  It is my
intention to continue to work toward improving my understanding of
this part of FriCAS especially since Waldek has expressed doubts about
the soundness of introducing 'conjugate' into Expression in the
context of this function.

> ...

Bill.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to