mathlib4 review helperopen PRs by @themathqueen on leanprover-community/mathlib4

← queue

#42744 feat(Analysis/InnerProductSpace): complexification of Hilbert spaces

blocked-by-other-PR awaiting-author t-analysis CI success

+707 −0 · 4 files · 19 commits · head 3e61ee5 · updated 42 days ago · Files changed on GitHub

In plain words

Defines the complexification of an inner product space over (RCLike) as with the norm, writing for . Complex scalars act by , and the complex inner product is . So it is the complexification of the underlying real space, which makes it a complex Hilbert space. The PR then complexifies continuous linear maps, , and shows that has the same norm, adjoint, kernel and range, the same real spectrum, and keeps positivity, normality and so on. It also characterises complexified submodules and operators as those invariant under conjugation (two exercises in Roman's Advanced Linear Algebra). A second file identifies the complexification with and deduces results on rank, bases, tensor products and matrices.

Transcriptions are drafted with an LLM from the diff and are a reading aid, not a verified statement: the Lean code is the reference.

PR description

This provides the framework for complexifying inner product spaces and operators on inner product spaces.

In a later PR, we transfer over the continuous functional calculus onto RCLike spaces, allowing the space of operators on RCLike Hilbert spaces to be a star ordered ring.


![Open in Gitpod](gitpod.io/from-referrer/)

Conversation on GitHub 12
github-actions[bot] · comment · 2026-08-13
PR summary 3e61ee50ca
Import changes for modified files

No significant changes to the import graph

<details><summary>Import changes for all files</summary>

|Files|Import difference| |-|-| | Mathlib.Analysis.InnerProductSpace.Complexification.Basic (new file)|2513| | Mathlib.Analysis.InnerProductSpace.Complexification.TensorProduct (new file)|2574|

</details>


<details><summary>

Declarations diff (regex)

</summary>

+ Complexification + Complexification.finrank_eq + Complexification.rank_eq + Complexification.symm_toTensor_tmul + Complexification.toTensor + Complexification.toTensor_apply + ContinuousLinearMap.arrowCongr_toTensor_toComplexification + ContinuousLinearMap.toMatrix_complexification_toComplexification + I_smul + I_smul_mk + Module.Basis.complexification + Module.Basis.complexification_apply + Module.Basis.complexification_repr_apply + TensorProduct.complexificationLinearEquiv + TensorProduct.complexificationLinearEquiv_mk_tmul + TensorProduct.symm_complexificationLinearEquiv_mk_tmul_mk + _root_.Submodule.complexification + _root_.Submodule.exists_complexification_eq_iff + _root_.Submodule.mem_complexification + adjoint_toComplexification + bijective_toComplexification_iff + conj + conj_I_smul + conj_conj + conj_eq_self_iff + conj_mk + conjugate + conjugate_adjoint + conjugate_comp + conjugate_conjugate + conjugate_id + conjugate_mul + conjugate_one + conjugate_star + conjugate_toComplexification + continuous_im + continuous_mk + continuous_mk_zero_left + continuous_mk_zero_right + continuous_re + continuous_toComplexification + exists_toComplexification_eq_iff + ext + im + imL + im_add + im_inner + im_mk + im_neg + im_real_smul + im_smul + im_sub + im_zero + inclusion + injective_toComplexification_iff + inner_conj_conj + inner_conj_left + inner_conj_right + inner_def + instInner + instInnerProductSpace + instSMul + instance : Module ℂ (Complexification 𝕜 E) + instance : NormedSpace ℂ (Complexification 𝕜 E) where norm_smul_le z v := (norm_smul_eq z v).le + instance [NormedAddCommGroup E] : NormedAddCommGroup (Complexification 𝕜 E) + instance [NormedAddCommGroup E] [CompleteSpace E] : CompleteSpace (Complexification 𝕜 E) + isIdempotentElem_toComplexification_iff + isPositive_toComplexification_iff + isSelfAdjoint_toComplexification_iff + isStarNormal_toComplexification_iff + isStarProjection_toComplexification_iff + isUnit_toComplexification_iff + isometry_mk_zero_left + isometry_mk_zero_right + isometry_toComplexification + isometry_toComplexification_iff + ker_toComplexification + lipschitzWith_im + lipschitzWith_re + mk + mk_add_mk + mk_eq_add_I_smul + mk_re_im + mk_sub_mk + mk_zero_zero + neg_mk + norm_eq + norm_im_le + norm_mk_zero_left + norm_mk_zero_right + norm_re_le + norm_smul_eq + norm_sq_eq + ofComplexification + ofComplexification_id + ofComplexification_one + ofComplexification_toComplexification + ofComplexification_zero + opENorm_toComplexification + opNNNorm_toComplexification + opNorm_toComplexification + quasispectrum_toComplexification + quasispectrum_toComplexification_real + range_toComplexification + re + reL + re_add + re_inner + re_mk + re_neg + re_real_smul + re_smul + re_sub + re_zero + realLinearIsometryEquivComplex + realLinearIsometryEquivComplex_apply + realLinearIsometryEquivComplex_symm_apply + restrictScalars_ofComplexification + smul_def + spectrum_toComplexification + spectrum_toComplexification_real + star_toComplexification + surjective_toComplexification_iff + symm_conj + symm_conjugate + toComplexification + toComplexification_comp + toComplexification_id + toComplexification_inj + toComplexification_injective + toComplexification_le_toComplexification_iff + toComplexification_mul + toComplexification_nonneg_iff + toComplexification_ofComplexification + toComplexification_one <details> <summary>You can run this locally as follows</summary>

## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

</details>

The doc-module for scripts/pr_summary/declarations_diff.sh in the undefined repository contains some details about this script.

</details>

<details><summary>

Declarations diff (Lean -- stale; merge master and push to refresh)

</summary>

✅ Lean-aware diff — post-build, computed from the Lean environment (commit bf215d3).

  • +154 new declarations
  • −0 removed declarations
+Complexification
+Complexification.I_smul
+Complexification.I_smul_mk
+Complexification.conj
+Complexification.conj_I_smul
+Complexification.conj_apply
+Complexification.conj_conj
+Complexification.conj_eq_self_iff
+Complexification.conj_mk
+Complexification.continuous_im
+Complexification.continuous_mk
+Complexification.continuous_mk_zero_left
+Complexification.continuous_mk_zero_right
+Complexification.continuous_re
+Complexification.ext
+Complexification.ext_iff
+Complexification.finrank_eq
+Complexification.im
+Complexification.imL
+Complexification.imL_apply
+Complexification.im_add
+Complexification.im_inner
+Complexification.im_mk
+Complexification.im_neg
+Complexification.im_real_smul
+Complexification.im_smul
+Complexification.im_sub
+Complexification.im_zero
+Complexification.inclusion
+Complexification.inclusion.congr_simp
+Complexification.inclusion_apply
+Complexification.inner_conj_conj
+Complexification.inner_conj_left
+Complexification.inner_conj_right
+Complexification.inner_def
+Complexification.instInner
+Complexification.instInnerProductSpace
+Complexification.instModuleComplex
+Complexification.instNormedSpaceComplex
+Complexification.instSMul
+Complexification.isometry_mk_zero_left
+Complexification.isometry_mk_zero_right
+Complexification.lipschitzWith_im
+Complexification.lipschitzWith_re
+Complexification.mk
+Complexification.mk_add_mk
+Complexification.mk_eq_add_I_smul
+Complexification.mk_re_im
+Complexification.mk_sub_mk
+Complexification.mk_zero_zero
+Complexification.neg_mk
+Complexification.norm_eq
+Complexification.norm_im_le
+Complexification.norm_mk_zero_left
+Complexification.norm_mk_zero_right
+Complexification.norm_re_le
+Complexification.norm_smul_eq
+Complexification.norm_sq_eq
+Complexification.rank_eq
+Complexification.re
+Complexification.reL
+Complexification.reL.congr_simp
+Complexification.reL_apply
+Complexification.re_add
+Complexification.re_inner
+Complexification.re_mk
+Complexification.re_neg
+Complexification.re_real_smul
+Complexification.re_smul
+Complexification.re_sub
+Complexification.re_zero
+Complexification.realLinearIsometryEquivComplex
+Complexification.realLinearIsometryEquivComplex_apply
+Complexification.realLinearIsometryEquivComplex_symm_apply
+Complexification.smul_def
+Complexification.symm_conj
+Complexification.symm_toTensor_tmul
+Complexification.toTensor
+Complexification.toTensor.congr_simp
+Complexification.toTensor_apply
+ContinuousLinearEquiv.arrowCongrEquivₛₗ.congr_simp
+ContinuousLinearMap.adjoint_toComplexification
+ContinuousLinearMap.arrowCongr_toTensor_toComplexification
+ContinuousLinearMap.bijective_toComplexification_iff
+ContinuousLinearMap.conjugate
+ContinuousLinearMap.conjugate_adjoint
+ContinuousLinearMap.conjugate_apply_apply
+ContinuousLinearMap.conjugate_comp
+ContinuousLinearMap.conjugate_conjugate
+ContinuousLinearMap.conjugate_id
+ContinuousLinearMap.conjugate_mul
+ContinuousLinearMap.conjugate_one
+ContinuousLinearMap.conjugate_star
+ContinuousLinearMap.conjugate_toComplexification
+ContinuousLinearMap.continuous_toComplexification
+ContinuousLinearMap.exists_toComplexification_eq_iff
+ContinuousLinearMap.injective_toComplexification_iff
+ContinuousLinearMap.isIdempotentElem_toComplexification_iff
+ContinuousLinearMap.isPositive_toComplexification_iff
+ContinuousLinearMap.isSelfAdjoint_toComplexification_iff
+ContinuousLinearMap.isStarNormal_toComplexification_iff
+ContinuousLinearMap.isStarProjection_toComplexification_iff
+ContinuousLinearMap.isUnit_toComplexification_iff
+ContinuousLinearMap.isometry_toComplexification
+ContinuousLinearMap.isometry_toComplexification_iff
+ContinuousLinearMap.ker_toComplexification
+ContinuousLinearMap.ofComplexification
+ContinuousLinearMap.ofComplexification.congr_simp
+ContinuousLinearMap.ofComplexification_apply
+ContinuousLinearMap.ofComplexification_id
+ContinuousLinearMap.ofComplexification_one
+ContinuousLinearMap.ofComplexification_toComplexification
+ContinuousLinearMap.ofComplexification_zero
+ContinuousLinearMap.opENorm_toComplexification
+ContinuousLinearMap.opNNNorm_toComplexification
+ContinuousLinearMap.opNorm_toComplexification
+ContinuousLinearMap.quasispectrum_toComplexification
+ContinuousLinearMap.quasispectrum_toComplexification_real
+ContinuousLinearMap.range_toComplexification
+ContinuousLinearMap.restrictScalars_ofComplexification
+ContinuousLinearMap.spectrum_toComplexification
+ContinuousLinearMap.spectrum_toComplexification_real
+ContinuousLinearMap.star_toComplexification
+ContinuousLinearMap.surjective_toComplexification_iff
+ContinuousLinearMap.symm_conjugate
+ContinuousLinearMap.toComplexification
+ContinuousLinearMap.toComplexification_apply_apply
+ContinuousLinearMap.toComplexification_comp
+ContinuousLinearMap.toComplexification_id
+ContinuousLinearMap.toComplexification_inj
+ContinuousLinearMap.toComplexification_injective
+ContinuousLinearMap.toComplexification_le_toComplexification_iff
+ContinuousLinearMap.toComplexification_mul
+ContinuousLinearMap.toComplexification_nonneg_iff
+ContinuousLinearMap.toComplexification_ofComplexification
+ContinuousLinearMap.toComplexification_one
+ContinuousLinearMap.toMatrix_complexification_toComplexification
+IsIdempotentElem.toComplexification
+IsSelfAdjoint.toComplexification
+IsStarNormal.toComplexification
+Module.Basis.complexification
+Module.Basis.complexification.congr_simp
+Module.Basis.complexification_apply
+Module.Basis.complexification_repr_apply
+Submodule.complexification
+Submodule.exists_complexification_eq_iff
+Submodule.mem_complexification
+TensorProduct.complexificationLinearEquiv
+TensorProduct.complexificationLinearEquiv_apply
+TensorProduct.complexificationLinearEquiv_mk_tmul
+TensorProduct.complexificationLinearEquiv_symm_apply
+TensorProduct.symm_complexificationLinearEquiv_mk_tmul_mk
+instCompleteSpaceComplexification
+instNormedAddCommGroupComplexification

</details>


No changes to strong technical debt. No changes to weak technical debt.

Current commit 3e61ee50ca Reference commit 1e5fa86cf6

This script lives in the undefined repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
themathqueen · comment · 2026-08-15

@ADedecker, so this is a huge PR, but would you like to take a look? 🙏 Take your time of course. Most of the code is just really basic API, which is why it's long. I can split out the TensorProduct file into another PR, but thought it could be nice to have the equivalence Complexification 𝕜 E ≃ₗ[ℂ] ℂ ⊗[ℝ] E in this PR, since that's another way of defining this.

mcdoll · on Mathlib/Analysis/InnerProductSpace/Complexification/Basic.lean:68 (outdated) · 2026-08-17

What is the reason to expose these?

mcdoll · on Mathlib/Analysis/InnerProductSpace/Complexification/Basic.lean:135 (outdated) · 2026-08-17
  suffices Continuous fun (p : E × E) ↦ mk 𝕜 p.1 0 + mk 𝕜 0 p.2 by simpa
  fun_prop
themathqueen · on Mathlib/Analysis/InnerProductSpace/Complexification/Basic.lean:68 (outdated) · 2026-08-17

they definitely should not be!

j-loreaux · on Mathlib/Analysis/InnerProductSpace/Complexification/Basic.lean:412 (outdated) · 2026-08-25
  simp only [LinearMap.mem_range, coe_coe, toComplexification_apply_apply,
    Complexification.ext_iff, re_mk, im_mk, Submodule.mem_complexification]
  exact ⟨by grind, fun ⟨⟨y, hy⟩, ⟨z, hz⟩⟩ ↦ ⟨.mk 𝕜 y z, by simp [hy, hz]⟩⟩
j-loreaux · on Mathlib/Analysis/InnerProductSpace/Complexification/TensorProduct.lean:11 (outdated) · 2026-08-25
/-! # Tensor product description of complexifications
j-loreaux · on Mathlib/Analysis/InnerProductSpace/Complexification/TensorProduct.lean:71 (outdated) · 2026-08-25
/-- The complexification of a basis, given by `b.complexification i = (b i, 0)`. -/
j-loreaux · on Mathlib/Analysis/InnerProductSpace/Complexification/TensorProduct.lean:80 (outdated) · 2026-08-25
      (b.baseChange ℂ).repr (Complex.I ⊗ₜ[ℝ] v.im) := by simp [Module.Basis.complexification]
j-loreaux · commented · 2026-08-25

Okay, there is a lot of boilerplate here, you are correct about that, but I think there are several things I would like to see and room for major improvement.

  1. Before anything, we should decide whether to use ℂ ⊗[ℝ] E or E × E as the type backing this. I am tempted to agree that E × E is the correct choice, because we will so often want to access the real and imaginary parts, but it should come with a detailed ## Implementation Notes section in the module documentation justifying the choice.
  2. As indicated in a comment below, use E × E instead of WithLp 2 (E × E) so we can reuse Complexification for C⋆-algebras (and maybe other things?)
  3. Please, please, let's add some scoped notation for this if we can come up with a good one.
  4. Let's drop the 𝕜 parameter
  5. Due to (1) split out all the norm material from the module material.
  6. I would like to see this split into at least three, but maybe closer to 5 PRs as follows:
  • module structure (and even star algebra structures) and basic API
  • norm properties of WithLp 2 (Complexification E)
  • properties specific to complexification of spaces involving continuous linear maps
  • connection to tensor products

I'll certainly have more to say later, but I think I've given you enough to chew on.

ADedecker · comment · 2026-08-26

Argh, I forgot that I was pinged here, and I had important comments to make, sorry.

We discussed this a bit with Jireh and Filippo at ICERM, and I think I disagree with a key design choice: when E is a complex vector space, I think Complexification ℂ E should be (complex-isomorphic to) E; if you really want to complexify the underlying real vector space then you should simply use Complexification ℝ E. This works out of the box if you use the "tensoring with ℂ over 𝕜 definition" (at least mathematically).

Now, one issue with our approach is that we don't know that ℂ is a 𝕜-algebra for RCLike 𝕜, and that we can't write such an instance without creating bad diamonds; I think we ended up agreeing that we should have a type alias RCLike.complexField for ℂ viewed as a 𝕜-algebra, but I'm still not 100% sure what things would look like afterwards (e.g if we go this route it seems like we need a CLike structure, and generalize the whole theory of complex C*-algebras to C*-algebras over a CLike field?)

mathlib-dependent-issues[bot] · comment · 2026-10-25

This PR/issue depends on:

  • leanprover-community/mathlib4#45280

By Dependent Issues (🤖). Happy coding!

Mathlib.lean +2 −0

public import Mathlib.Analysis.InnerProductSpace.Calculus
2055public import Mathlib.Analysis.InnerProductSpace.CanonicalTensor
2056public import Mathlib.Analysis.InnerProductSpace.Coalgebra
2057public import Mathlib.Analysis.InnerProductSpace.Completion
2058public import Mathlib.Analysis.InnerProductSpace.Complexification.Basic
2059public import Mathlib.Analysis.InnerProductSpace.Complexification.TensorProduct
2060public import Mathlib.Analysis.InnerProductSpace.ConformalLinearMap
2061public import Mathlib.Analysis.InnerProductSpace.Continuous
2062public import Mathlib.Analysis.InnerProductSpace.Convex

Mathlib/Analysis/InnerProductSpace/Complexification/Basic.lean +591 −0 new file

1/-
2Copyright (c) 2026 Monica Omar. All rights reserved.
3Released under Apache 2.0 license as described in the file LICENSE.
4Authors: Monica Omar
5-/
6module
7
8public import Mathlib.Analysis.InnerProductSpace.Positive
9
10/-! # Complexification of inner product spaces
12In this file we define the complexification of an inner product space. So we can essentially
13extend a `𝕜`-space `E` to a `ℂ`-space `E × E`, and extend operators to its complexification
14in order to use `ℂ`-results. We call the first component the "real part" (`Complexification.re`)
15and the second the "imaginary part" (`Complexification.im`).
16This way, we can (informally) think of `(x, y) : Complexification 𝕜 E` as `x + I • y`.
18In particular, `ℂ`-scalar multiplication is given by
19`α • (x, y) = (ℜ α • x - ℑ α • y, ℜ α • y + ℑ α • x)`
20and the `ℂ`-inner product is given by
21`⟪(x, y), (z, w)⟫_ℂ = ℜ (⟪x, z⟫_𝕜 + ⟪y, w⟫_𝕜) + (ℜ (⟪x, w⟫_𝕜 - ⟪y, z⟫_𝕜)) * I`.
23## Main definitions and results
25* `Complexification.instSMul`: Complex scalar multiplication on complexifications.
26* `Complexification.instInnerProductSpace`: The complex inner product space on complexifications.
27* `Submodule.complexification`: The complexification of a submodule.
28* `Complexification.conj`: Conjugation on complexification, i.e., `(x, y) ↦ (x, -y)`.
29* `Complexification.realLinearIsometryEquivComplex`: The complexification of
30 `ℝ` is equivalent to `ℂ`.
31* `ContinuousLinearMap.toComplexification`: The complexification of an operator `T`, which is
32 defined as `x ↦ (T x.re, T x.im)`.
33* `ContinuousLinearMap.ofComplexification`: Decomplexifying an operator on complexifications given
34 that it commutes with the complexification of `algebraMapCLM 𝕜 _ RCLike.I`,
35 and is defined as `x ↦ (T (x, 0)).re`.
37## References
39[Steven Roman, *Advanced linear algebra*][roman_advanced_linear_algebra]
41-/
43public section
45open scoped InnerProductSpace
47set_option linter.unusedVariables false in
  • L47 A linter is switched off: worth a justification. guide
def Complexification newL48–51
48/-- The complexification of an inner product space.
49This is a type synonym of `WithLp 2 (E × E)`, with the same norm. -/
50@[expose, nolint unusedArguments, implicit_reducible] def Complexification (𝕜 E : Type*) :
51 Type _ := WithLp 2 (E × E)
j-loreaux · 2026-08-25

I think that this should be E × E instead of WithLp 2 (E × E).

The reason is that we could then reuse the Complexification 𝕜 E material for real C⋆-algebras instead of duplicating all the boilerplate (we can't as-is because the 2-norm is not the C⋆-norm … fun). Introducing real (or rather, RCLike) C⋆-algebras is on my radar for the near future.

Then to get the inner product space structure on the complexification, you simply define instances for WithLp 2 (Complexification 𝕜 E) and use that instead.

j-loreaux · 2026-08-25

Side note: I'm actually not at all sure what the 𝕜 is doing here. What I mean is the following: your current usage does two things:

  1. it allows you to define the SMul ℂ instance use the 𝕜 smul, but you could just as easily use the ℝ smul (the difference is that you need to carry Module ℝ E around as a hypothesis, but we have to do that many places anyway, so it's not weird).
  2. Makes Complexification ℝ E and Complexification ℂ E different, even though there should really be only one.

But you're never putting instances with 𝕜 parameters on Complexification (like making it a 𝕜 module).

ADedecker · 2026-08-26

See my comment below: right now the parameter 𝕜 is indeed a bit useless, because regardless of 𝕜 Monca complexifies E as a real vector space. I claim instead we should complexify it as a 𝕜-vector space, which should do nothing for 𝕜 = ℂ.

53variable {𝕜 E F G : Type*} {Eₗ Fₗ Gₗ : Type*}
54 [NormedAddCommGroup Eₗ] [NormedAddCommGroup Fₗ] [NormedAddCommGroup Gₗ]
55 [InnerProductSpace ℝ Eₗ] [InnerProductSpace ℝ Fₗ] [InnerProductSpace ℝ Gₗ]
instance (anonymous instance) newL57–58
57noncomputable instance [NormedAddCommGroup E] : NormedAddCommGroup (Complexification 𝕜 E) :=
58 inferInstanceAs (NormedAddCommGroup (WithLp 2 (E × E)))
instance (anonymous instance) newL60–61
60instance [NormedAddCommGroup E] [CompleteSpace E] : CompleteSpace (Complexification 𝕜 E) :=
61 inferInstanceAs (CompleteSpace (WithLp 2 (E × E)))
63namespace Complexification
def re newL65–66
65/-- The real part of the complexification (the first component of the complexification). -/
66protected def re (v : Complexification 𝕜 E) : E := WithLp.fst v
def im newL68–69
68/-- The imaginary part of the complexification (the second component of the complexification). -/
69protected def im (v : Complexification 𝕜 E) : E := WithLp.snd v
def mk newL71–72
71/-- Converting real and imaginary parts to the complexification. -/
72def mk (𝕜 : Type*) (x y : E) : Complexification 𝕜 E := WithLp.toLp 2 (x, y)
lemma re_mk newL74–74
74@[simp] lemma re_mk (x y : E) : (mk 𝕜 x y).re = x := by rfl
lemma im_mk newL75–75
75@[simp] lemma im_mk (x y : E) : (mk 𝕜 x y).im = y := by rfl
lemma mk_re_im newL76–76
76@[simp] lemma mk_re_im (v : Complexification 𝕜 E) : mk 𝕜 v.re v.im = v := by rfl
lemma ext newL78–79
78@[ext] lemma ext {v w : Complexification 𝕜 E} (h₁ : v.re = w.re) (h₂ : v.im = w.im) : v = w := by
79 rw [← mk_re_im v, ← mk_re_im w, h₁, h₂]
81variable [NormedAddCommGroup E]
lemma re_zero newL83–83
83@[simp] lemma re_zero : (0 : Complexification 𝕜 E).re = 0 := by rfl
lemma im_zero newL84–84
84@[simp] lemma im_zero : (0 : Complexification 𝕜 E).im = 0 := by rfl
lemma re_add newL85–85
85@[simp] lemma re_add (v w : Complexification 𝕜 E) : (v + w).re = v.re + w.re := by rfl
lemma im_add newL86–86
86@[simp] lemma im_add (v w : Complexification 𝕜 E) : (v + w).im = v.im + w.im := by rfl
lemma re_sub newL87–87
87@[simp] lemma re_sub (v w : Complexification 𝕜 E) : (v - w).re = v.re - w.re := by rfl
lemma im_sub newL88–88
88@[simp] lemma im_sub (v w : Complexification 𝕜 E) : (v - w).im = v.im - w.im := by rfl
lemma re_neg newL89–89
89@[simp] lemma re_neg (v : Complexification 𝕜 E) : (-v).re = -v.re := by rfl
lemma im_neg newL90–90
90@[simp] lemma im_neg (v : Complexification 𝕜 E) : (-v).im = -v.im := by rfl
lemma mk_zero_zero newL91–91
91@[simp] lemma mk_zero_zero : mk 𝕜 (0 : E) 0 = 0 := by rfl
lemma neg_mk newL92–92
92@[simp] lemma neg_mk (x y : E) : -mk 𝕜 x y = mk 𝕜 (-x) (-y) := by ext <;> simp
lemma mk_add_mk newL94–95
94@[simp] lemma mk_add_mk (x y z w : E) : mk 𝕜 x y + mk 𝕜 z w = mk 𝕜 (x + z) (y + w) := by
95 ext <;> simp
lemma mk_sub_mk newL96–97
96@[simp] lemma mk_sub_mk (x y z w : E) : mk 𝕜 x y - mk 𝕜 z w = mk 𝕜 (x - z) (y - w) := by
97 simp [sub_eq_add_neg]
lemma norm_sq_eq newL99–100
99lemma norm_sq_eq (v : Complexification 𝕜 E) : ‖v‖ ^ 2 = ‖v.re‖ ^ 2 + ‖v.im‖ ^ 2 :=
100 WithLp.prod_norm_sq_eq_of_L2 v
lemma norm_eq newL101–102
101lemma norm_eq (v : Complexification 𝕜 E) : ‖v‖ = √(‖v.re‖ ^ 2 + ‖v.im‖ ^ 2) :=
102 WithLp.prod_norm_eq_of_L2 v
lemma norm_mk_zero_right newL104–104
104@[simp] lemma norm_mk_zero_right (x : E) : ‖mk 𝕜 x 0‖ = ‖x‖ := by simp [norm_eq]
lemma norm_mk_zero_left newL105–105
105@[simp] lemma norm_mk_zero_left (x : E) : ‖mk 𝕜 0 x‖ = ‖x‖ := by simp [norm_eq]
lemma norm_re_le newL107–109
107lemma norm_re_le (x : Complexification 𝕜 E) : ‖x.re‖ ≤ ‖x‖ := by
108 rw [norm_eq, Real.le_sqrt (norm_nonneg _) (by positivity)]
109 simp
lemma norm_im_le newL111–113
111lemma norm_im_le (x : Complexification 𝕜 E) : ‖x.im‖ ≤ ‖x‖ := by
112 rw [norm_eq, Real.le_sqrt (norm_nonneg _) (by positivity)]
113 simp
lemma lipschitzWith_re newL115–116
115lemma lipschitzWith_re : LipschitzWith 1 (Complexification.re (𝕜 := 𝕜) (E := E)) :=
116 .of_dist_le_mul fun v w ↦ by simpa [dist_eq_norm] using norm_re_le (v - w)
lemma lipschitzWith_im newL117–118
117lemma lipschitzWith_im : LipschitzWith 1 (Complexification.im (𝕜 := 𝕜) (E := E)) :=
118 .of_dist_le_mul fun v w ↦ by simpa [dist_eq_norm] using norm_im_le (v - w)
lemma continuous_re newL120–121
120@[fun_prop] lemma continuous_re : Continuous (Complexification.re (𝕜 := 𝕜) (E := E)) :=
121 lipschitzWith_re.continuous
lemma continuous_im newL122–123
122@[fun_prop] lemma continuous_im : Continuous (Complexification.im (𝕜 := 𝕜) (E := E)) :=
123 lipschitzWith_im.continuous
lemma isometry_mk_zero_right newL125–126
125lemma isometry_mk_zero_right : Isometry (mk 𝕜 · (0 : E)) :=
126 .of_dist_eq fun x y ↦ by simp [dist_eq_norm]
lemma isometry_mk_zero_left newL127–128
127lemma isometry_mk_zero_left : Isometry (mk 𝕜 (0 : E) ·) :=
128 .of_dist_eq fun x y ↦ by simp [dist_eq_norm]
lemma continuous_mk_zero_right newL130–131
130@[fun_prop] lemma continuous_mk_zero_right : Continuous (mk 𝕜 · (0 : E)) :=
131 isometry_mk_zero_right.continuous
lemma continuous_mk_zero_left newL132–133
132@[fun_prop] lemma continuous_mk_zero_left : Continuous (mk 𝕜 (0 : E) ·) :=
133 isometry_mk_zero_left.continuous
lemma continuous_mk newL134–136
134@[fun_prop] lemma continuous_mk : Continuous fun p : E × E ↦ mk 𝕜 p.1 p.2 := by
135 suffices Continuous fun (p : E × E) ↦ mk 𝕜 p.1 0 + mk 𝕜 0 p.2 by simpa
136 fun_prop
138variable [RCLike 𝕜] [InnerProductSpace 𝕜 E]
instance instSMul newL140–141
140instance instSMul : SMul ℂ (Complexification 𝕜 E) where
141 smul z v := .mk 𝕜 ((z.re : 𝕜) • v.re - (z.im : 𝕜) • v.im) ((z.im : 𝕜) • v.re + (z.re : 𝕜) • v.im)
lemma smul_def newL143–145
143lemma smul_def (z : ℂ) (v : Complexification 𝕜 E) :
144 z • v = .mk 𝕜 ((z.re : 𝕜) • v.re - (z.im : 𝕜) • v.im) ((z.im : 𝕜) • v.re + (z.re : 𝕜) • v.im) :=
145 rfl
lemma re_smul newL147–148
147@[simp] lemma re_smul (z : ℂ) (v : Complexification 𝕜 E) :
148 (z • v).re = (z.re : 𝕜) • v.re - (z.im : 𝕜) • v.im := by rfl
lemma im_smul newL149–150
149@[simp] lemma im_smul (z : ℂ) (v : Complexification 𝕜 E) :
150 (z • v).im = (z.im : 𝕜) • v.re + (z.re : 𝕜) • v.im := by rfl
instance (anonymous instance) newL152–158
152instance : Module ℂ (Complexification 𝕜 E) where
153 one_smul _ := by ext <;> simp
154 mul_smul _ _ _ := by ext <;> simp <;> module
155 smul_zero _ := by ext <;> simp
156 smul_add _ _ _ := by ext <;> simp <;> grind
157 add_smul _ _ _ := by ext <;> simp <;> module
158 zero_smul _ := by ext <;> simp
lemma re_real_smul newL160–161
160@[simp] lemma re_real_smul (r : ℝ) (v : Complexification 𝕜 E) : (r • v).re = (r : 𝕜) • v.re := by
161 simp [RCLike.real_smul_eq_coe_smul (K := ℂ) r, -Complex.coe_smul]
lemma im_real_smul newL163–164
163@[simp] lemma im_real_smul (r : ℝ) (v : Complexification 𝕜 E) : (r • v).im = (r : 𝕜) • v.im := by
164 simp [RCLike.real_smul_eq_coe_smul (K := ℂ) r, -Complex.coe_smul]
lemma I_smul newL166–167
166@[simp] lemma I_smul (v : Complexification 𝕜 E) : Complex.I • v = mk 𝕜 (-v.im) v.re := by
167 ext <;> simp
lemma I_smul_mk newL169–169
169lemma I_smul_mk (x y : E) : Complex.I • (mk 𝕜 x y) = mk 𝕜 (-y) x := I_smul _
lemma mk_eq_add_I_smul newL171–172
171/-- `(x, y) = (x, 0) + I • (y, 0)`. -/
172lemma mk_eq_add_I_smul (x y : E) : mk 𝕜 x y = mk 𝕜 x 0 + Complex.I • mk 𝕜 y 0 := by simp
lemma norm_smul_eq newL174–180
174lemma norm_smul_eq (z : ℂ) (v : Complexification 𝕜 E) : ‖z • v‖ = ‖z‖ * ‖v‖ := by
175 rw [← sq_eq_sq₀ (norm_nonneg _) (by positivity)]
176 simp [mul_pow, norm_sq_eq, Complex.sq_norm, Complex.normSq_apply,
177 -inner_self_eq_norm_sq_to_K, ← inner_self_eq_norm_sq (𝕜 := 𝕜),
178 inner_sub_left, inner_sub_right, inner_add_left, inner_add_right,
179 inner_smul_left, inner_smul_right, inner_re_symm v.im v.re]
180 grind
instance (anonymous instance) newL182–182
182instance : NormedSpace ℂ (Complexification 𝕜 E) where norm_smul_le z v := (norm_smul_eq z v).le
184variable (𝕜 E) in
def reL newL185–189
185/-- The real part of a complexification of a real space as a real continuous linear map. -/
186@[expose, simps] def reL [Module ℝ E] [IsScalarTower ℝ 𝕜 E] : Complexification 𝕜 E →L[ℝ] E where
187 toFun x := x.re
188 map_add' := by simp
189 map_smul' := by simp
191variable (𝕜 E) in
def imL newL192–196
192/-- The imaginary part of a complexification of a real space as a real continuous linear map. -/
193@[expose, simps] def imL [Module ℝ E] [IsScalarTower ℝ 𝕜 E] : Complexification 𝕜 E →L[ℝ] E where
194 toFun x := x.im
195 map_add' := by simp
196 map_smul' := by simp
instance instInner newL198–200
198instance instInner : Inner ℂ (Complexification 𝕜 E) where
199 inner v w := .mk (RCLike.re (⟪v.re, w.re⟫_𝕜 + ⟪v.im, w.im⟫_𝕜))
200 (RCLike.re (⟪v.re, w.im⟫_𝕜 - ⟪v.im, w.re⟫_𝕜))
lemma inner_def newL202–204
202lemma inner_def (v w : Complexification 𝕜 E) :
203 inner ℂ v w = RCLike.re (⟪v.re, w.re⟫_𝕜 + ⟪v.im, w.im⟫_𝕜) +
204 RCLike.re (⟪v.re, w.im⟫_𝕜 - ⟪v.im, w.re⟫_𝕜) * .I := by simp [inner, Complex.mk_eq_add_mul_I]
lemma re_inner newL206–207
206@[simp] lemma re_inner (v w : Complexification 𝕜 E) :
207 (⟪v, w⟫_ℂ).re = RCLike.re (⟪v.re, w.re⟫_𝕜 + ⟪v.im, w.im⟫_𝕜) := rfl
lemma im_inner newL208–209
208@[simp] lemma im_inner (v w : Complexification 𝕜 E) :
209 (⟪v, w⟫_ℂ).im = RCLike.re (⟪v.re, w.im⟫_𝕜 - ⟪v.im, w.re⟫_𝕜) := rfl
instance instInnerProductSpace newL211–216
211instance instInnerProductSpace : InnerProductSpace ℂ (Complexification 𝕜 E) where
212 norm_sq_eq_re_inner v := by simp [norm_sq_eq, RCLike.re_to_complex]
213 conj_inner_symm _ _ := by simp [Complex.ext_iff, inner_re_symm]
214 add_left _ _ _ := by simp [Complex.ext_iff, inner_add_left]; grind
215 smul_left _ _ _ := by
216 simp [Complex.ext_iff, inner_sub_left, inner_add_left, inner_smul_left]; grind
218variable (𝕜 E) in
def conj newL219–227
219/-- Conjugation on the complexification space, given by `(x, y) ↦ (x, -y)`. -/
220@[expose, simps -isSimp apply] def conj : Complexification 𝕜 E ≃ₗᵢ⋆[ℂ] Complexification 𝕜 E where
221 toFun v := .mk 𝕜 v.re (-v.im)
222 invFun v := .mk 𝕜 v.re (-v.im)
223 map_add' := by simp [add_comm]
224 map_smul' _ _ := by ext <;> simp [RCLike.algebraMap_eq_ofReal, add_comm]
225 norm_map' := by simp [norm_eq]
226 left_inv _ := by simp
227 right_inv _ := by simp
lemma symm_conj newL229–229
229@[simp] lemma symm_conj : (conj 𝕜 E).symm = conj 𝕜 E := rfl
lemma conj_conj newL230–230
230@[simp] lemma conj_conj (x) : conj 𝕜 E (conj 𝕜 E x) = x := by simp [conj_apply]
lemma conj_mk newL231–231
231@[simp] lemma conj_mk (x y : E) : conj 𝕜 E (.mk 𝕜 x y) = .mk 𝕜 x (-y) := by rfl
lemma conj_I_smul newL233–234
233lemma conj_I_smul (x) : conj 𝕜 E (Complex.I • x) = -Complex.I • conj 𝕜 E x := by
234 simp [conj_apply]
lemma inner_conj_conj newL236–237
236@[simp] lemma inner_conj_conj (x y) : inner ℂ (conj 𝕜 E x) (conj 𝕜 E y) = inner ℂ y x := by
237 simp [Complex.ext_iff, inner_re_symm, sub_eq_add_neg, add_comm, conj_apply]
lemma inner_conj_left newL239–240
239lemma inner_conj_left (x y) : inner ℂ (conj 𝕜 E x) y = inner ℂ (conj 𝕜 E y) x := by
240 simp [Complex.ext_iff, inner_re_symm, sub_eq_add_neg, add_comm, conj_apply]
lemma inner_conj_right newL242–243
242lemma inner_conj_right (x y) : inner ℂ x (conj 𝕜 E y) = inner ℂ y (conj 𝕜 E x) := by
243 rw [← inner_conj_symm, inner_conj_left]; simp
lemma conj_eq_self_iff newL245–248
245@[simp] lemma conj_eq_self_iff {x} : conj 𝕜 E x = x ↔ x.im = 0 := by
246 simp only [conj_apply, Complexification.ext_iff, re_mk, im_mk, true_and]
247 rw [eq_comm, ← sub_eq_zero]
248 simp [← two_smul 𝕜]
def realLinearIsometryEquivComplex newL250–261
250/-- The complexification of `ℝ` is equivalent to `ℂ`. -/
251def realLinearIsometryEquivComplex : Complexification ℝ ℝ ≃ₗᵢ[ℂ] ℂ where
252 toFun x := x.re + x.im * Complex.I
253 invFun x := .mk ℝ x.re x.im
254 map_add' _ _ := by simp [add_mul]; grind
255 map_smul' z _ := by
256 rw [← Complex.re_add_im z]
257 simp [add_mul, mul_add, -Complex.re_add_im, mul_mul_mul_comm _ Complex.I]
258 grind
259 norm_map' := by simp [norm_eq, Complex.norm_def, Complex.normSq, sq]
260 left_inv _ := by simp
261 right_inv _ := by simp
lemma realLinearIsometryEquivComplex_apply newL263–265
263@[simp] lemma realLinearIsometryEquivComplex_apply (v : Complexification ℝ ℝ) :
264 realLinearIsometryEquivComplex v = v.re + v.im * Complex.I := by
265 rfl
lemma realLinearIsometryEquivComplex_symm_apply newL267–269
267@[simp] lemma realLinearIsometryEquivComplex_symm_apply (z : ℂ) :
268 realLinearIsometryEquivComplex.symm z = .mk ℝ z.re z.im := by
269 rfl
def _root_.Submodule.complexification newL270–276
270/-- Complexification of a submodule, i.e., `(a, b) ∈ K.complexification ↔ a ∈ K ∧ b ∈ K`. -/
271@[expose]
272def _root_.Submodule.complexification (K : Submodule 𝕜 E) : Submodule ℂ (Complexification 𝕜 E) where
273 carrier := { v | v.re ∈ K } ∩ { v | v.im ∈ K }
274 add_mem' := by aesop
275 zero_mem' := by simp
276 smul_mem' := by aesop
lemma _root_.Submodule.mem_complexification newL278–279
278@[simp] lemma _root_.Submodule.mem_complexification {K : Submodule 𝕜 E} (x : Complexification 𝕜 E) :
279 x ∈ K.complexification ↔ x.re ∈ K ∧ x.im ∈ K := by simp [Submodule.complexification]
281variable (𝕜 E) in
def inclusion newL282–289
282/-- The inclusion map of a space into its complexification as a linear isometry, given by
283`x ↦ (x, 0)`. -/
284@[expose, simps] def inclusion [Module ℝ E] [IsScalarTower ℝ 𝕜 E] :
285 E →ₗᵢ[ℝ] Complexification 𝕜 E where
286 toFun x := .mk 𝕜 x 0
287 map_add' := by simp
288 map_smul' _ _ := by ext <;> simp
289 norm_map' := by simp
lemma _root_.Submodule.exists_complexification_eq_iff newL291–308
291/-- A submodule `U` over the complexificationn of a real space is a complexified submodule
292(i.e., there exists a real submodule `S` such that `S.complexification = U`)
293iff `U` is closed under conjugation.
295This is Chapter 1, Exercise 26 in [roman_advanced_linear_algebra]. -/
296lemma _root_.Submodule.exists_complexification_eq_iff (U : Submodule ℂ (Complexification ℝ Eₗ)) :
297 (∃ S : Submodule ℝ Eₗ, S.complexification = U) ↔ ∀ v ∈ U, conj ℝ Eₗ v ∈ U := by
298 refine ⟨fun ⟨S, hS⟩ v hv ↦ by simpa [← hS, conj_apply] using hv, fun h ↦ ?_⟩
299 refine ⟨(U.restrictScalars ℝ).comap (inclusion ℝ Eₗ).toLinearMap, Submodule.ext fun x ↦ ?_⟩
300 simp only [Submodule.mem_complexification, Submodule.mem_comap, LinearIsometry.coe_toLinearMap,
301 inclusion_apply, Submodule.restrictScalars_mem]
302 refine ⟨fun h2 ↦ ?_, fun h2 ↦ ⟨?_, ?_⟩⟩
303 · rw [← mk_re_im x, mk_eq_add_I_smul]
304 exact add_mem h2.1 (Submodule.smul_mem _ _ h2.2)
305 · convert Submodule.smul_mem _ (2 : ℂ)⁻¹ (add_mem h2 (h _ h2))
306 simp [conj_apply, Complexification.ext_iff, ← two_smul ℝ]
307 · convert Submodule.smul_mem _ (2 * Complex.I)⁻¹ (sub_mem h2 (h _ h2))
308 simp [Complexification.ext_iff, conj_apply, ← two_smul ℝ]
310end Complexification
312namespace ContinuousLinearMap
313variable [RCLike 𝕜]
314 [NormedAddCommGroup E] [InnerProductSpace 𝕜 E]
315 [NormedAddCommGroup F] [InnerProductSpace 𝕜 F]
316 [NormedAddCommGroup G] [InnerProductSpace 𝕜 G]
318open Complexification
def toComplexification newL320–328
320/-- Complexification of a continuous linear map between inner product spaces. -/
321@[expose, simps apply_apply] def toComplexification :
322 (E →L[𝕜] F) →+ Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F where
323 toFun T :=
324 { toFun v := .mk 𝕜 (T v.re) (T v.im)
325 map_add' _ _ := by ext <;> simp
326 map_smul' _ _ := by ext <;> simp }
j-loreaux · 2026-08-25

you should probably write this as a bare function (between spaces of continuous linear maps) because there are several ways it could be bundled (e.g., a linear map). Also, I would be tempted to call it Complexification.ContinuousLinearMap.map, and then the existing decl could be: Complexification.ContinuousLinearMap.mapAddMonoidHom?

327 map_add' _ _ := by ext <;> simp
328 map_zero' := by ext <;> simp
lemma toComplexification_id newL330–332
330@[simp] lemma toComplexification_id :
331 (ContinuousLinearMap.id 𝕜 E).toComplexification = .id ℂ (Complexification 𝕜 E) := by
332 ext <;> simp
lemma toComplexification_comp newL334–336
334@[simp] lemma toComplexification_comp (S : F →L[𝕜] G) (T : E →L[𝕜] F) :
335 (S.comp T).toComplexification = S.toComplexification.comp T.toComplexification := by
336 ext <;> simp
lemma toComplexification_one newL338–338
338@[simp] lemma toComplexification_one : (1 : E →L[𝕜] E).toComplexification = 1 := by ext <;> simp
lemma toComplexification_mul newL340–341
340@[simp] lemma toComplexification_mul (S T : E →L[𝕜] E) :
341 (S * T).toComplexification = S.toComplexification * T.toComplexification := by simp [mul_def]
lemma opNorm_toComplexification newL343–350
343@[simp] lemma opNorm_toComplexification (T : E →L[𝕜] F) : ‖T.toComplexification‖ = ‖T‖ := by
344 refine le_antisymm ((opNorm_le_iff (norm_nonneg _)).mpr fun _ ↦ ?_) ?_
345 · refine le_of_pow_le_pow_left₀ two_ne_zero (by positivity) ?_
346 simp only [mul_pow, norm_sq_eq, mul_add, toComplexification_apply_apply, re_mk, im_mk]
347 grw [T.le_opNorm, T.le_opNorm]
348 simp [mul_pow]
349 · refine opNorm_le_bound _ (norm_nonneg _) fun x ↦ ?_
350 simpa using T.toComplexification.le_opNorm (.mk 𝕜 x 0)
lemma opNNNorm_toComplexification newL352–353
352@[simp] lemma opNNNorm_toComplexification (T : E →L[𝕜] F) : ‖T.toComplexification‖₊ = ‖T‖₊ := by
353 ext; simp
lemma opENorm_toComplexification newL354–355
354@[simp] lemma opENorm_toComplexification (T : E →L[𝕜] F) : ‖T.toComplexification‖ₑ = ‖T‖ₑ := by
355 simp [enorm_eq_nnnorm]
lemma toComplexification_injective newL357–359
357lemma toComplexification_injective :
358 Function.Injective (toComplexification (𝕜 := 𝕜) (E := E) (F := F)) := fun S T h ↦ by
359 ext x; simpa using congr(($h (.mk 𝕜 x 0)).re)
lemma toComplexification_inj newL361–363
361@[simp] lemma toComplexification_inj {S T : E →L[𝕜] F} :
362 S.toComplexification = T.toComplexification ↔ S = T :=
363 toComplexification_injective.eq_iff
lemma isIdempotentElem_toComplexification_iff newL365–367
365@[simp] lemma isIdempotentElem_toComplexification_iff {S : E →L[𝕜] E} :
366 IsIdempotentElem S.toComplexification ↔ IsIdempotentElem S := by
367 simp [IsIdempotentElem, ← toComplexification_mul]
369alias ⟨_, _root_.IsIdempotentElem.toComplexification⟩ := isIdempotentElem_toComplexification_iff
lemma injective_toComplexification_iff newL371–378
371@[simp] lemma injective_toComplexification_iff {T : E →L[𝕜] F} :
372 Function.Injective T.toComplexification ↔ Function.Injective T := by
373 refine ⟨fun h x y hxy ↦ ?_, fun h x y hxy ↦ ?_⟩
374 · simpa using congr(($(h (a₁ := .mk 𝕜 x 0) (a₂ := .mk 𝕜 y 0)
375 (by ext <;> simp [hxy]))).re)
376 · have := by simpa [h.eq_iff] using congr(($hxy).re)
377 have := by simpa [h.eq_iff] using congr(($hxy).im)
378 simp_all [Complexification.ext_iff]
lemma surjective_toComplexification_iff newL380–387
380@[simp] lemma surjective_toComplexification_iff {T : E →L[𝕜] F} :
381 Function.Surjective T.toComplexification ↔ Function.Surjective T := by
382 refine ⟨fun h x ↦ ?_, fun h x ↦ ?_⟩
383 · obtain ⟨v, hv⟩ := h (.mk 𝕜 x 0)
384 exact ⟨v.re, by simpa using congr(($hv).re)⟩
385 · obtain ⟨v, hv⟩ := h x.re
386 obtain ⟨w, hw⟩ := h x.im
387 exact ⟨.mk 𝕜 v w, by simp [hv, hw]⟩
lemma bijective_toComplexification_iff newL389–391
389@[simp] lemma bijective_toComplexification_iff {T : E →L[𝕜] F} :
390 Function.Bijective T.toComplexification ↔ Function.Bijective T := by
391 simp [Function.Bijective]
lemma isometry_toComplexification newL393–394
393lemma isometry_toComplexification : Isometry (toComplexification (𝕜 := 𝕜) (E := E) (F := F)) :=
394 .of_dist_eq <| by simp [dist_eq_norm, ← map_sub]
lemma isometry_toComplexification_iff newL396–400
396@[simp] lemma isometry_toComplexification_iff {T : E →L[𝕜] F} :
397 Isometry T.toComplexification ↔ Isometry T := by
398 simp only [AddMonoidHomClass.isometry_iff_norm]
399 refine ⟨fun h x ↦ by simpa using h (.mk 𝕜 x 0), fun h v ↦ ?_⟩
400 simp [← sq_eq_sq₀, norm_sq_eq, h]
lemma continuous_toComplexification newL402–404
402@[fun_prop] lemma continuous_toComplexification :
403 Continuous (toComplexification (𝕜 := 𝕜) (E := E) (F := F)) :=
404 isometry_toComplexification.continuous
lemma ker_toComplexification newL406–408
406@[simp] lemma ker_toComplexification (T : E →L[𝕜] F) :
407 T.toComplexification.ker = T.ker.complexification := by
408 ext; simp [Complexification.ext_iff]
lemma range_toComplexification newL410–415
410@[simp] lemma range_toComplexification (T : E →L[𝕜] F) :
411 T.toComplexification.range = T.range.complexification := by
412 ext x
413 simp only [LinearMap.mem_range, coe_coe, toComplexification_apply_apply,
414 Complexification.ext_iff, re_mk, im_mk, Submodule.mem_complexification]
415 exact ⟨by grind, fun ⟨⟨y, hy⟩, ⟨z, hz⟩⟩ ↦ ⟨.mk 𝕜 y z, by simp [hy, hz]⟩⟩
def conjugate newL417–425
417/-- Conjugation of a complexified operator given by `T ↦ conj ∘ T ∘ conj`.
419An opeartor is equal to its conjugate iff it is a complexified operator
420(see `exists_toComplexification_eq_iff`). -/
421@[expose, simps! apply_apply] noncomputable def conjugate :
422 (Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F) ≃ₗᵢ⋆[ℂ]
423 (Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F) where
424 __ := (conj 𝕜 E).toContinuousLinearEquiv.arrowCongrEquivₛₗ (conj 𝕜 F).toContinuousLinearEquiv
425 norm_map' x := by simpa using! opNorm_comp_linearIsometryEquiv _ (conj 𝕜 E).symm
lemma conjugate_conjugate newL427–428
427@[simp] lemma conjugate_conjugate (T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F) :
428 T.conjugate.conjugate = T := by ext1; simp
lemma symm_conjugate newL430–430
430@[simp] lemma symm_conjugate : conjugate (𝕜 := 𝕜) (E := E) (F := F).symm = conjugate := rfl
lemma conjugate_id newL432–433
432@[simp] lemma conjugate_id :
433 (ContinuousLinearMap.id ℂ (Complexification 𝕜 E)).conjugate = .id ℂ _ := by ext1; simp
lemma conjugate_one newL435–436
435@[simp] lemma conjugate_one :
436 (1 : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 E).conjugate = 1 := conjugate_id
lemma conjugate_comp newL438–440
438@[simp] lemma conjugate_comp (S : Complexification 𝕜 F →L[ℂ] Complexification 𝕜 G)
439 (T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F) :
440 (S ∘SL T).conjugate = S.conjugate ∘SL T.conjugate := by ext1; simp
lemma conjugate_mul newL442–443
442@[simp] lemma conjugate_mul (S T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 E) :
443 (S * T).conjugate = S.conjugate * T.conjugate := conjugate_comp _ _
lemma conjugate_toComplexification newL445–446
445@[simp] lemma conjugate_toComplexification (S : E →L[𝕜] F) :
446 S.toComplexification.conjugate = S.toComplexification := by ext1; simp [conj_apply]
def ofComplexification newL448–464
448/-- Decomplexifying an operator on complexifications given that it commutes with
449the complexification of `algebraMapCLM 𝕜 _ RCLike.I`. -/
450@[expose, simps!]
451noncomputable def ofComplexification [Module ℝ E] [IsScalarTower ℝ 𝕜 E]
452 [NormedSpace ℝ F] [IsScalarTower ℝ 𝕜 F]
453 (T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F)
454 (hT : T ∘SL (algebraMapCLM 𝕜 (E →L[𝕜] E) RCLike.I).toComplexification =
455 (algebraMapCLM 𝕜 (F →L[𝕜] F) RCLike.I).toComplexification ∘SL T) :
456 E →L[𝕜] F :=
457 let S := reL 𝕜 F ∘SL T.restrictScalars ℝ ∘SL (inclusion 𝕜 E).toContinuousLinearMap
458 { __ := S.toAddMonoidHom
459 map_smul' a x := by
460 suffices ∀ x, S ((RCLike.I : 𝕜) • x) = (RCLike.I : 𝕜) • S x by
461 rw [← RCLike.re_add_im a, add_smul, mul_smul]
462 simp [this, -RCLike.re_add_im, add_smul, mul_smul]
463 intro x
464 simpa [S] using congr(($hT (.mk 𝕜 x 0)).re) }
lemma ofComplexification_zero newL466–469
466@[simp] lemma ofComplexification_zero [Module ℝ E] [IsScalarTower ℝ 𝕜 E]
467 [NormedSpace ℝ F] [IsScalarTower ℝ 𝕜 F] :
468 (0 : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F).ofComplexification (by simp) = 0 := by
469 ext; simp
lemma ofComplexification_id newL471–474
471@[simp] lemma ofComplexification_id [NormedSpace ℝ E] [IsScalarTower ℝ 𝕜 E] :
472 (.id ℂ _ : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 E).ofComplexification (by simp) =
473 .id _ _ := by
474 ext; simp
lemma ofComplexification_one newL476–479
476@[simp] lemma ofComplexification_one [NormedSpace ℝ E] [IsScalarTower ℝ 𝕜 E] :
477 (1 : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 E).ofComplexification (by simp [one_def]) =
478 1 :=
479 ofComplexification_id
lemma ofComplexification_toComplexification newL481–484
481@[simp] lemma ofComplexification_toComplexification
482 [Module ℝ E] [NormedSpace ℝ F] [IsScalarTower ℝ 𝕜 E] [IsScalarTower ℝ 𝕜 F]
483 (T : E →L[𝕜] F) (h) :
484 T.toComplexification.ofComplexification h = T := by ext; simp
lemma restrictScalars_ofComplexification newL486–490
486@[simp] lemma restrictScalars_ofComplexification
487 [Module ℝ E] [NormedSpace ℝ F] [IsScalarTower ℝ 𝕜 E] [IsScalarTower ℝ 𝕜 F]
488 (T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F) (h) :
489 (T.ofComplexification h).restrictScalars ℝ =
490 reL 𝕜 F ∘SL T.restrictScalars ℝ ∘SL (inclusion 𝕜 E).toContinuousLinearMap := rfl
lemma toComplexification_ofComplexification newL492–505
492lemma toComplexification_ofComplexification
493 [Module ℝ E] [IsScalarTower ℝ 𝕜 E] [NormedSpace ℝ F] [IsScalarTower ℝ 𝕜 F]
494 {T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F} (h) (hT : T.conjugate = T) :
495 (T.ofComplexification h).toComplexification = T := by
496 ext1 v
497 conv_rhs => rw [← mk_re_im v, mk_eq_add_I_smul]
498 simp only [map_add, map_smul]
499 have (x : E) : T (.mk 𝕜 x 0) = .mk 𝕜 (T (.mk 𝕜 x 0)).re 0 := by
500 refine Complexification.ext rfl ?_
501 rw [im_mk, ← conj_eq_self_iff]
502 conv_rhs => rw [← hT]
503 simp
504 simp +singlePass only [this]
505 ext <;> simp
lemma exists_toComplexification_eq_iff newL507–519
507/-- An operator `T` on a complexification space of a real space is a complexified operator
508(i.e., there exists an operator `S` such that `S.toComplexification = T`) iff `T.conjugate = T`
509and it commutes with the complexification of `algebraMapCLM 𝕜 _ RCLike.I`.
511This is Chapter 2, Exercise 32 in [roman_advanced_linear_algebra]. -/
512lemma exists_toComplexification_eq_iff
513 [Module ℝ E] [IsScalarTower ℝ 𝕜 E] [NormedSpace ℝ F] [IsScalarTower ℝ 𝕜 F]
514 {T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F} :
515 (∃ S : E →L[𝕜] F, S.toComplexification = T) ↔ T.conjugate = T ∧
516 T ∘SL (algebraMapCLM 𝕜 (E →L[𝕜] E) RCLike.I).toComplexification =
517 (algebraMapCLM 𝕜 (F →L[𝕜] F) RCLike.I).toComplexification ∘SL T := by
518 refine ⟨fun ⟨S, hS⟩ ↦ ?_, fun ⟨h1, h2⟩ ↦ ⟨_, toComplexification_ofComplexification h2 h1⟩⟩
519 simp [← hS, ContinuousLinearMap.ext_iff]
521variable [CompleteSpace E] [CompleteSpace F]
lemma adjoint_toComplexification newL523–525
523@[simp] lemma adjoint_toComplexification (T : E →L[𝕜] F) :
524 T.toComplexification.adjoint = T.adjoint.toComplexification := by
525 simp [eq_comm, eq_adjoint_iff, Complex.ext_iff, adjoint_inner_left]
lemma star_toComplexification newL527–529
527@[simp] lemma star_toComplexification (T : E →L[𝕜] E) :
528 star T.toComplexification = (star T).toComplexification :=
529 adjoint_toComplexification T
lemma isSelfAdjoint_toComplexification_iff newL531–532
531@[simp] lemma isSelfAdjoint_toComplexification_iff {T : E →L[𝕜] E} :
532 IsSelfAdjoint T.toComplexification ↔ IsSelfAdjoint T := by simp [isSelfAdjoint_iff]
534alias ⟨_, _root_.IsSelfAdjoint.toComplexification⟩ := isSelfAdjoint_toComplexification_iff
536attribute [aesop safe apply] IsSelfAdjoint.toComplexification
lemma isStarNormal_toComplexification_iff newL538–540
538@[simp] lemma isStarNormal_toComplexification_iff {T : E →L[𝕜] E} :
539 IsStarNormal T.toComplexification ↔ IsStarNormal T := by
540 simp [isStarNormal_iff, commute_iff_eq, ← toComplexification_mul]
542alias ⟨_, _root_.IsStarNormal.toComplexification⟩ := isStarNormal_toComplexification_iff
lemma isStarProjection_toComplexification_iff newL544–546
544@[simp] lemma isStarProjection_toComplexification_iff {T : E →L[𝕜] E} :
545 IsStarProjection T.toComplexification ↔ IsStarProjection T := by
546 simp [isStarProjection_iff]
lemma isUnit_toComplexification_iff newL548–549
548@[simp] lemma isUnit_toComplexification_iff {T : E →L[𝕜] E} :
549 IsUnit T.toComplexification ↔ IsUnit T := by simp [isUnit_iff_bijective]
lemma spectrum_toComplexification newL551–557
551@[simp] lemma spectrum_toComplexification (T : E →L[𝕜] E) :
552 spectrum ℝ T.toComplexification = algebraMap ℝ 𝕜 ⁻¹' spectrum 𝕜 T := by
553 ext r
554 simp only [spectrum.mem_iff, Set.mem_preimage, not_iff_not]
555 conv_rhs => rw [← isUnit_toComplexification_iff]
556 congr! 1
557 simp [Algebra.algebraMap_eq_smul_one, ContinuousLinearMap.ext_iff, Complexification.ext_iff]
lemma spectrum_toComplexification_real newL559–560
559lemma spectrum_toComplexification_real [Algebra ℝ (E →L[𝕜] E)] [IsScalarTower ℝ 𝕜 (E →L[𝕜] E)]
560 (T : E →L[𝕜] E) : spectrum ℝ T.toComplexification = spectrum ℝ T := by simp
lemma quasispectrum_toComplexification newL562–564
562@[simp] lemma quasispectrum_toComplexification (T : E →L[𝕜] E) :
563 quasispectrum ℝ T.toComplexification = algebraMap ℝ 𝕜 ⁻¹' quasispectrum 𝕜 T := by
564 simp [quasispectrum_eq_spectrum_union_zero, Set.ext_iff]
lemma quasispectrum_toComplexification_real newL566–568
566lemma quasispectrum_toComplexification_real [Algebra ℝ (E →L[𝕜] E)]
567 [IsScalarTower ℝ 𝕜 (E →L[𝕜] E)] (T : E →L[𝕜] E) :
568 quasispectrum ℝ T.toComplexification = quasispectrum ℝ T := by simp
lemma conjugate_adjoint newL570–572
570@[simp] lemma conjugate_adjoint (T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 F) :
571 T.adjoint.conjugate = T.conjugate.adjoint := by
572 simp [eq_adjoint_iff, inner_conj_left (T.adjoint _), adjoint_inner_right, inner_conj_right (T _)]
lemma conjugate_star newL574–575
574@[simp] lemma conjugate_star (T : Complexification 𝕜 E →L[ℂ] Complexification 𝕜 E) :
575 (star T).conjugate = star T.conjugate := conjugate_adjoint _
lemma isPositive_toComplexification_iff newL577–583
577@[simp] lemma isPositive_toComplexification_iff {T : E →L[𝕜] E} :
578 T.toComplexification.IsPositive ↔ T.IsPositive := by
579 simp only [isPositive_def', isSelfAdjoint_toComplexification_iff, reApplyInnerSelf_apply,
580 toComplexification_apply_apply, RCLike.re_to_complex, re_inner, re_mk, im_mk, map_add,
581 and_congr_right_iff]
582 refine fun _ ↦ ⟨fun hT x ↦ ?_, fun hT x ↦ add_nonneg (hT x.re) (hT x.im)⟩
583 simpa using hT (.mk 𝕜 x 0)
lemma toComplexification_nonneg_iff newL585–586
585@[simp] lemma toComplexification_nonneg_iff {T : E →L[𝕜] E} :
586 0 ≤ T.toComplexification ↔ 0 ≤ T := by simp [nonneg_iff_isPositive]
lemma toComplexification_le_toComplexification_iff newL588–589
588@[simp] lemma toComplexification_le_toComplexification_iff {S T : E →L[𝕜] E} :
589 S.toComplexification ≤ T.toComplexification ↔ S ≤ T := by simp [le_def, ← map_sub]
591end ContinuousLinearMap

Mathlib/Analysis/InnerProductSpace/Complexification/TensorProduct.lean +104 −0 new file

1/-
2Copyright (c) 2026 Monica Omar. All rights reserved.
3Released under Apache 2.0 license as described in the file LICENSE.
4Authors: Monica Omar
5-/
6module
7
8public import Mathlib.Analysis.InnerProductSpace.Complexification.Basic
9public import Mathlib.Analysis.InnerProductSpace.TensorProduct
11/-! # Tensor product description of complexifications
13The complexification space of a real space `E` is equivalent to `ℂ ⊗[ℝ] E` (see
14`Complexification.toTensor`.) And so the complexification of a tensor product is the tensor product
15of the complexifications (see `TensorProduct.complexificationLinearEquiv`).
17The matrix of a complexified operator is essentially the matrix of the original operator lifted
18to `ℂ`. -/
20public section
22variable {𝕜 E Eₗ Fₗ : Type*} [RCLike 𝕜] [NormedAddCommGroup E]
23 [NormedAddCommGroup Eₗ] [NormedAddCommGroup Fₗ]
24 [InnerProductSpace 𝕜 E] [InnerProductSpace ℝ Eₗ] [InnerProductSpace ℝ Fₗ]
25 [Module ℝ E] [IsScalarTower ℝ 𝕜 E]
27open TensorProduct Complexification
def Complexification.toTensor newL29–44
29/-- The complexification of a space `E` is `ℂ`-linearly equivalent to `ℂ ⊗[ℝ] E`. -/
30@[expose] noncomputable def Complexification.toTensor :
31 Complexification 𝕜 E ≃ₗ[ℂ] ℂ ⊗[ℝ] E := .symm
32 { toLinearMap := AlgebraTensorModule.lift (.toSpanSingleton ℂ _ (inclusion 𝕜 E).toLinearMap)
33 invFun v := 1 ⊗ₜ v.re + Complex.I ⊗ₜ v.im
34 right_inv _ := by simp
35 left_inv x := by
36 induction x using TensorProduct.induction_on with
37 | zero => simp
38 | tmul z x =>
39 conv_rhs => rw [← Complex.re_add_im z]
40 simp [-Complex.re_add_im, add_tmul, smul_def, smul_tmul']
41 | add _ _ h1 h2 =>
42 conv_rhs => rw [← h1, ← h2]
43 simp [tmul_add]
44 grind }
lemma Complexification.toTensor_apply newL46–47
46@[simp] lemma Complexification.toTensor_apply (v : Complexification 𝕜 E) :
47 v.toTensor = 1 ⊗ₜ v.re + .I ⊗ₜ v.im := rfl
lemma Complexification.symm_toTensor_tmul newL49–50
49@[simp] lemma Complexification.symm_toTensor_tmul (z : ℂ) (x : E) :
50 toTensor.symm (z ⊗ₜ x) = .mk 𝕜 (z.re • x) (z.im • x) := by simp [smul_def, toTensor]
lemma Complexification.rank_eq newL52–56
52/-- The rank of the complexification of a space over `ℂ` is equal to the rank of the original
53space over `ℝ`. -/
54@[simp] lemma Complexification.rank_eq :
55 Module.rank ℂ (Complexification 𝕜 E) = Module.rank ℝ E := by
56 simp [toTensor.rank_eq]
lemma Complexification.finrank_eq newL58–60
58@[simp] lemma Complexification.finrank_eq :
59 Module.finrank ℂ (Complexification 𝕜 E) = Module.finrank ℝ E := by
60 simp [toTensor.finrank_eq]
62open scoped RingTheory.LinearMap in
lemma ContinuousLinearMap.arrowCongr_toTensor_toComplexification newL63–68
63/-- The tensor version of `T.toComplexification` is `id ⊗ₘ T`. -/
64lemma ContinuousLinearMap.arrowCongr_toTensor_toComplexification {F : Type*} [NormedAddCommGroup F]
65 [InnerProductSpace 𝕜 F] [Module ℝ F] [IsScalarTower ℝ 𝕜 F] (T : E →L[𝕜] F) :
66 toTensor.arrowCongr toTensor T.toComplexification.toLinearMap =
67 (.id : ℂ →ₗ[ℝ] ℂ) ⊗ₘ (T.toLinearMap.restrictScalars ℝ) := by
68 ext; simp [smul_tmul', ← add_tmul]
70variable (𝕜) in
def Module.Basis.complexification newL71–73
71/-- The complexification of a basis, given by `b.complexification i = (b i, 0)`. -/
72@[expose] noncomputable def Module.Basis.complexification {ι} (b : Module.Basis ι ℝ E) :
73 Module.Basis ι ℂ (Complexification 𝕜 E) := (b.baseChange ℂ).map toTensor.symm
lemma Module.Basis.complexification_apply newL75–76
75@[simp] lemma Module.Basis.complexification_apply {ι} (b : Module.Basis ι ℝ E) (i : ι) :
76 b.complexification 𝕜 i = .mk 𝕜 (b i) 0 := by simp [Module.Basis.complexification]
lemma Module.Basis.complexification_repr_apply newL78–80
78@[simp] lemma Module.Basis.complexification_repr_apply {ι} (b : Module.Basis ι ℝ E) (v) :
79 (b.complexification 𝕜).repr v = (b.baseChange ℂ).repr (1 ⊗ₜ[ℝ] v.re) +
80 (b.baseChange ℂ).repr (Complex.I ⊗ₜ[ℝ] v.im) := by simp [Module.Basis.complexification]
def TensorProduct.complexificationLinearEquiv newL82–89
82/-- Complexifying `ℝ`-tensor products of real spaces is equivalent to `ℂ`-tensor products
83of the complexification of each of those spaces. -/
84@[expose, simps! -isSimp] noncomputable def TensorProduct.complexificationLinearEquiv :
85 Complexification ℝ (Eₗ ⊗[ℝ] Fₗ) ≃ₗ[ℂ] Complexification ℝ Eₗ ⊗[ℂ] Complexification ℝ Fₗ :=
86 toTensor ≪≫ₗ
87 (AlgebraTensorModule.assoc ..).symm ≪≫ₗ
88 (AlgebraTensorModule.cancelBaseChange ..).symm ≪≫ₗ
89 TensorProduct.congr toTensor.symm toTensor.symm
lemma TensorProduct.complexificationLinearEquiv_mk_tmul newL91–93
91@[simp] lemma TensorProduct.complexificationLinearEquiv_mk_tmul (x : Eₗ) (y : Fₗ) :
92 TensorProduct.complexificationLinearEquiv (.mk ℝ (x ⊗ₜ y) 0) =
93 .mk ℝ x 0 ⊗ₜ .mk ℝ y 0 := by simp [TensorProduct.complexificationLinearEquiv_apply]
lemma TensorProduct.symm_complexificationLinearEquiv_mk_tmul_mk newL95–97
95@[simp] lemma TensorProduct.symm_complexificationLinearEquiv_mk_tmul_mk (x : Eₗ) (y : Fₗ) :
96 TensorProduct.complexificationLinearEquiv.symm (.mk ℝ x 0 ⊗ₜ .mk ℝ y 0) =
97 .mk ℝ (x ⊗ₜ y) 0 := by simp [TensorProduct.complexificationLinearEquiv_symm_apply]
lemma ContinuousLinearMap.toMatrix_complexification_toComplexification newL99–104
99lemma ContinuousLinearMap.toMatrix_complexification_toComplexification
100 {F ι₁ ι₂ : Type*} [NormedAddCommGroup F]
101 [InnerProductSpace 𝕜 F] [Module ℝ F] [IsScalarTower ℝ 𝕜 F] [Fintype ι₁] [Finite ι₂]
102 [DecidableEq ι₁] (T : E →L[𝕜] F) (b₁ : Module.Basis ι₁ ℝ E) (b₂ : Module.Basis ι₂ ℝ F) :
103 T.toComplexification.toMatrix (b₁.complexification 𝕜) (b₂.complexification 𝕜) =
104 (T.toMatrix b₁ b₂).map (algebraMap ℝ ℂ) := by ext; simp [LinearMap.toMatrix_apply]

docs/references.bib +10 −0

@Book{ roigdomingues1992
5151 zbl = {0760.57001}
5154@Book{ roman_advanced_linear_algebra,
5155 author = {Roman, Steven},
5156 title = {Advanced linear algebra},
5157 series = {Graduate Texts in Mathematics},
5158 publisher = {Springer New York, NY},
5159 isbn = {978-0-387-72828-5},
5160 year = {2007},
5161 language = {English}
5164@Article{ rooij1970,
5165 title = {Non-Archimedean uniformities},
5166 author = {van Rooij, A. C. M.},
0/135 declarations checked

Your review, as Markdown

Paste it as a comment or a review on the PR. Line links to the head commit unfold into code snippets on GitHub.