Skip to content

A conjugate, with re, im and arg, as functions #2145

Closed

Description

@Rafael-SOWNet

Chapter III of Modenov's Problems in Geometry (#2131) writes every point as a complex number and every statement in z and z̄. Its lines are āz + az̄ = b, a point is on the unit circle when z̄ = 1/z, a slope is (z₂ − z₁)/(z̄₂ − z̄₁), and areas and similarity tests are determinants in z, z̄, 1. Chapter V states the distance, angle, area and collinearity in the same terms. About 150 of the book's rows need a conjugate. Today the parser refuses conjugate by name, so each was written out by hand.

Wanted, as #809's research planned it:

  • conjugate(z), with conj as an alias, rendered \overline{z}. It is an involution, distributes over +, *, / and integer powers but not across ^(1/2), sends i to -i and fixes real numbers.
  • re(z), im(z) and arg(z).

The rules above need no assumptions. What makes the book's method work is rewriting conj(a) as 1/a for a point on the unit circle, and as a for a real symbol. That needs facts attached to a symbol, which is a 3.0 sub-issue of #2131.

Until this lands, #2136 refuses these names, which today are read as products.

Activity

  1. added this to the 2.8 milestone on Oct 27, 2026
  2. Rafael-SOWNet commented on Oct 28, 2026

    @Rafael-SOWNet
    MemberAuthor

    conjugate(z) (also conj) and arg(z) are functions since #2181. The conjugate is carried through the arithmetic and whole powers, not through roots or logarithms, and fixes what is known to be real. arg is the principal argument in (-pi, pi], exact on numbers, with no value at 0.

    Still open here: re(z) and im(z). Making them functions changes how re(x) reads for a variable named re, which MissingFunctionNamesRefusedTest.TheTwoLetterNamesAreLeftAsProducts keeps as a product today. That is the next PR, with a breaking entry. Rewriting conj(a) as 1/a on the unit circle needs facts on a symbol, which is #2148.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  3. Happypig375 commented on Oct 28, 2026

    @Happypig375
    Member

    I feel that the R in Re is capitalized, same for Im. Consult different sources for how this is written...

    Though it's also arguable that functions should be consistently lowercase. Do mathematicians upload this though?

  4. Rafael-SOWNet commented on Oct 28, 2026

    @Rafael-SOWNet
    MemberAuthor

    You're right. The sources I checked:

    Real part Imaginary part
    ISO 80000-2, and Wikipedia Re z Im z
    Mathematica Re[z] Im[z]
    Maple Re(z) Im(z)
    SymPy re(z) im(z)
    MATLAB, NumPy real(z) imag(z)

    SymPy is the outlier, and the register in #2182 had followed it. So the next PR prints Re(z) and Im(z) and draws them upright, \operatorname{Re}\left(z\right), as ISO writes them, rather than with the fraktur \Re. It also accepts re, im, real and imag on input, since a SymPy or MATLAB user types those. ToSympy still emits sympy.re. The register's rows are updated.

    arg stays lower case. ISO writes arg z for the argument, SymPy's arg is also the principal value, and Mathematica's Arg is the one capitalised.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

  5. Rafael-SOWNet commented on Oct 28, 2026

    @Rafael-SOWNet
    MemberAuthor

    Done: conjugate/conj and arg in #2181, Re and Im (also re, im, real, imag) in #2185. Rewriting conj(a) as 1/a on the unit circle needs facts on a symbol, which is #2148.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions