Theory Complex_Vector_Spaces0
section ‹‹Complex_Vector_Spaces0› -- Vector Spaces and Algebras over the Complex Numbers›
theory Complex_Vector_Spaces0
imports HOL.Real_Vector_Spaces HOL.Topological_Spaces HOL.Vector_Spaces
Complex_Main
"HOL-Library.Complex_Order"
"HOL-Analysis.Product_Vector"
begin
subsection ‹Complex vector spaces›
class scaleC = scaleR +
fixes scaleC :: "complex ⇒ 'a ⇒ 'a" (infixr ‹*⇩C› 75)
assumes scaleR_scaleC: "scaleR r = scaleC (complex_of_real r)"
begin
abbreviation divideC :: "'a ⇒ complex ⇒ 'a" (infixl ‹'/⇩C› 70)
where "x /⇩C c ≡ inverse c *⇩C x"
end
class complex_vector = scaleC + ab_group_add +
assumes scaleC_add_right: "a *⇩C (x + y) = (a *⇩C x) + (a *⇩C y)"
and scaleC_add_left: "(a + b) *⇩C x = (a *⇩C x) + (b *⇩C x)"
and scaleC_scaleC[simp]: "a *⇩C (b *⇩C x) = (a * b) *⇩C x"
and scaleC_one[simp]: "1 *⇩C x = x"
subclass (in complex_vector) real_vector
by (standard, simp_all add: scaleR_scaleC scaleC_add_right scaleC_add_left)
class complex_algebra = complex_vector + ring +
assumes mult_scaleC_left [simp]: "a *⇩C x * y = a *⇩C (x * y)"
and mult_scaleC_right [simp]: "x * a *⇩C y = a *⇩C (x * y)"
subclass (in complex_algebra) real_algebra
by (standard, simp_all add: scaleR_scaleC)
class complex_algebra_1 = complex_algebra + ring_1
subclass (in complex_algebra_1) real_algebra_1 ..
class complex_div_algebra = complex_algebra_1 + division_ring
subclass (in complex_div_algebra) real_div_algebra ..
class complex_field = complex_div_algebra + field
subclass (in complex_field) real_field ..
instantiation complex :: complex_field
begin
definition complex_scaleC_def [simp]: "scaleC a x = a * x"
instance
proof intro_classes
fix r :: real and a b x y :: complex
show "((*⇩R) r::complex ⇒ _) = (*⇩C) (complex_of_real r)"
by (auto simp add: scaleR_conv_of_real)
show "a *⇩C (x + y) = a *⇩C x + a *⇩C y"
by (simp add: ring_class.ring_distribs(1))
show "(a + b) *⇩C x = a *⇩C x + b *⇩C x"
by (simp add: algebra_simps)
show "a *⇩C b *⇩C x = (a * b) *⇩C x"
by simp
show "1 *⇩C x = x"
by simp
show "a *⇩C (x::complex) * y = a *⇩C (x * y)"
by simp
show "(x::complex) * a *⇩C y = a *⇩C (x * y)"
by simp
qed
end
locale clinear = Vector_Spaces.linear "scaleC::_⇒_⇒'a::complex_vector" "scaleC::_⇒_⇒'b::complex_vector"
begin
sublocale real: linear
apply standard
by (auto simp add: add scale scaleR_scaleC)
lemmas scaleC = scale
end
global_interpretation complex_vector: vector_space "scaleC :: complex ⇒ 'a ⇒ 'a :: complex_vector"
rewrites "Vector_Spaces.linear (*⇩C) (*⇩C) = clinear"
and "Vector_Spaces.linear (*) (*⇩C) = clinear"
defines cdependent_raw_def: cdependent = complex_vector.dependent
and crepresentation_raw_def: crepresentation = complex_vector.representation
and csubspace_raw_def: csubspace = complex_vector.subspace
and cspan_raw_def: cspan = complex_vector.span
and cextend_basis_raw_def: cextend_basis = complex_vector.extend_basis
and cdim_raw_def: cdim = complex_vector.dim
proof unfold_locales
show "Vector_Spaces.linear (*⇩C) (*⇩C) = clinear" "Vector_Spaces.linear (*) (*⇩C) = clinear"
by (force simp: clinear_def complex_scaleC_def[abs_def])+