Theory Complex_Lexorder
section ‹The lexicographic ordering on complex numbers›
theory Complex_Lexorder
imports Complex_Main "HOL-Library.Multiset"
begin
text ‹
We define a lexicographic order on the complex numbers, comparing first the real parts
and, if they are equal, the imaginary parts. This ordering is of course not compatible with
multiplication, but it is compatible with addition.
›
definition less_eq_complex_lex (infix ‹≤⇩ℂ› 50) where
"less_eq_complex_lex x y ⟷ Re x < Re y ∨ Re x = Re y ∧ Im x ≤ Im y"
definition less_complex_lex (infix ‹<⇩ℂ› 50) where
"less_complex_lex x y ⟷ Re x < Re y ∨ Re x = Re y ∧ Im x < Im y"