Skip to content

Ugly computations with complex numbers #44

@SnarkBoojum

Description

@SnarkBoojum

Playing with complex numbers, I can't help but notice that some computations are pretty ugly:

From mathcomp Require Import all_ssreflect all_algebra.
From mathcomp.real_closed Require Import complex realalg.

Import GRing GRing.Field.

Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Open Scope ring_scope.
Open Scope complex_scope.

Definition RR := { realclosure rat }.
Definition CC := complex RR.

Section EasyTests.

(* too ugly, report! *)
Compute Re (1+i*1).
Compute 'i * 'i.
Compute 'i + 'i.
Compute 'i^*.

End EasyTests.

There's also a lemma where I have the following line, just for 'i * 'i = -1:

rewrite -[(_ +i* _) * (_ +i* _)]/(_ +i* _) !mul0r mulr0 mulr1 !add0r complexr0 in H.

Perhaps there's something to be done to improve matters?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions