/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilOpen Quantum Problem 13: Mutually unbiased bases
Mathematical problem
For each integer $d \ge 2$, determine the maximum number $k$ for which there exist orthonormal bases $\mathcal{B}_1, \dots, \mathcal{B}_k$ of the complex Hilbert space $\mathbb{C}^d$ such that any two distinct bases are mutually unbiased.
Concretely, if
$\mathcal{B}
The problem is therefore to determine the maximal value $\mu(d) := \max { k : \text{there exist } k \text{ pairwise mutually unbiased orthonormal bases in } \mathbb{C}^d }$.
In this file, an orthonormal basis is represented by a unitary matrix whose columns are the
basis vectors. For two such bases U and V, the matrix relativeUnitary U V, which is
$U^\dagger V$, contains all cross-basis overlaps as its entries. Since Lean works more
smoothly with squared norms, we formalize mutual unbiasedness by requiring
$| (relativeUnitary\ U\ V)_{ij} |^2 = 1 / d$
for all $i, j$, which is equivalent to
$|\langle e_i^{(r)}, e_j^{(s)} \rangle| = d^{-1/2}$.
Background
Mutually unbiased bases are a basic structure in finite-dimensional quantum theory. They arise in quantum state determination, quantum tomography, quantum cryptography, finite geometry, and combinatorics.
A general upper bound is $\mu(d) \le d + 1$. Equality is known when $d$ is a prime power, via constructions over finite fields. For composite dimensions that are not prime powers, the exact value of $\mu(d)$ is in general open.
The smallest and most famous unresolved case is $d = 6$. The IQOQI OQP page emphasizes this dimension in particular: although many equivalent reformulations are known, no construction yielding more than three mutually unbiased bases in dimension six is known.
What this file formalizes
This file is organized around the quantity IsMaxMUBCount d k, which expresses that
$k$ is the maximum number of mutually unbiased orthonormal bases in dimension $d$.
the open theorem mutuallyUnbiasedBases expresses the full problem for all $d \ge 2$;
the open theorem mutuallyUnbiasedBases_dim6 expresses the especially important case
$d = 6$;
the solved theorem mutuallyUnbiasedBases_dim2 proves the qubit case $\mu(2) = 3$.
References
IQOQI Vienna Open Quantum Problems, problem 13: https://oqp.iqoqi.oeaw.ac.at/mutually-unbiased-bases
Master list of open quantum problems: https://oqp.iqoqi.oeaw.ac.at/open-quantum-problems
Foundational papers
I. D. Ivanović,
W. K. Wootters and B. D. Fields,
General constructions and surveys
A. Klappenecker and M. Rötteler,
Dimension six and the maximal-number problem
M. Grassl,
P. Butterley and W. Hall,
S. Brierley and S. Weigert,
P. Raynal, X. Lü, and B.-G. Englert,
Remark on the status of $d = 6$
The dimension-six case is not known to be solved. At present, the best-known general picture is:
$3 \le \mu(6) \le 7$,
complete sets of $7$ MUBs are not known,
and several analytic and numerical works give strong evidence that one cannot go beyond $3$.
This is why the theorem mutuallyUnbiasedBases_dim6 is marked as an open research statement.
noncomputable sectionnamespace OpenQuantumProblem13A unitary matrix representing an orthonormal basis of $\mathbb{C}^d$ via its columns.
abbrev UMat (d : ℕ) := ↥(Matrix.unitaryGroup (Fin d) ℂ)The relative unitary between two bases.
def relativeUnitary {d : ℕ} (U V : UMat d) : Matrix (Fin d) (Fin d) ℂ :=
star (U : Matrix (Fin d) (Fin d) ℂ) * (V : Matrix (Fin d) (Fin d) ℂ)Two unitary matrices represent mutually unbiased bases if every entry of the relative unitary has squared norm $1 / d$.
def IsUnbiased {d : ℕ} (U V : UMat d) : Prop :=
∀ i j : Fin d, ‖relativeUnitary U V i j‖ ^ (2 : ℕ) = (d : ℝ)⁻¹Mutual unbiasedness is symmetric.
@[category API, AMS 5 15 81 94]
lemma IsUnbiased.symm {d : ℕ} {U V : UMat d} (hUV : IsUnbiased U V) :
IsUnbiased V U := d:ℕU:UMat dV:UMat dhUV:IsUnbiased U V⊢ IsUnbiased V U
intro i d:ℕU:UMat dV:UMat dhUV:IsUnbiased U Vi:Fin dj:Fin d⊢ ‖relativeUnitary V U i j‖ ^ 2 = (↑d)⁻¹
have hstar : relativeUnitary V U = star (relativeUnitary U V) := d:ℕU:UMat dV:UMat dhUV:IsUnbiased U V⊢ IsUnbiased V U
All goals completed! 🐙
calc
‖relativeUnitary V U i j‖ ^ (2 : ℕ)
= ‖star (relativeUnitary U V) i j‖ ^ (2 : ℕ) := d:ℕU:UMat dV:UMat dhUV:IsUnbiased U Vi:Fin dj:Fin dhstar:relativeUnitary V U = star (relativeUnitary U V) :=
of_eq_true
(Eq.trans
(congrArg (Eq (star ↑V * ↑U))
(Eq.trans (Matrix.star_mul (star ↑U) ↑V) (congrArg (HMul.hMul (star ↑V)) (star_star ↑U))))
(eq_self (star ↑V * ↑U)))⊢ ‖relativeUnitary V U i j‖ ^ 2 = ‖star (relativeUnitary U V) i j‖ ^ 2 All goals completed! 🐙
_ = ‖relativeUnitary U V j i‖ ^ (2 : ℕ) := d:ℕU:UMat dV:UMat dhUV:IsUnbiased U Vi:Fin dj:Fin dhstar:relativeUnitary V U = star (relativeUnitary U V) :=
of_eq_true
(Eq.trans
(congrArg (Eq (star ↑V * ↑U))
(Eq.trans (Matrix.star_mul (star ↑U) ↑V) (congrArg (HMul.hMul (star ↑V)) (star_star ↑U))))
(eq_self (star ↑V * ↑U)))⊢ ‖star (relativeUnitary U V) i j‖ ^ 2 = ‖relativeUnitary U V j i‖ ^ 2 All goals completed! 🐙
_ = (d : ℝ)⁻¹ := hUV j iA family of unitary matrices is a family of mutually unbiased bases if every two distinct members are unbiased.
def IsMUBFamily {d k : ℕ} (B : Fin k → UMat d) : Prop :=
Pairwise fun m n => IsUnbiased (B m) (B n)There exist $k$ mutually unbiased bases in $\mathbb{C}^d$.
def HasMUBs (d k : ℕ) : Prop :=
∃ B : Fin k → UMat d, IsMUBFamily BThere exists a complete set of $d + 1$ mutually unbiased bases in $\mathbb{C}^d$.
def HasCompleteMUBs (d : ℕ) : Prop :=
HasMUBs d (d + 1)$k$ is the maximal size of a family of mutually unbiased bases in dimension $d$.
def IsMaxMUBCount (d k : ℕ) : Prop :=
HasMUBs d k ∧ ∀ m : ℕ, HasMUBs d m → m ≤ kEvery dimension admits the empty family of mutually unbiased bases.
@[category test, AMS 5 15 81 94]
theorem hasMUBs_zero (d : ℕ) : HasMUBs d 0 := d:ℕ⊢ HasMUBs d 0
All goals completed! 🐙Every dimension admits a family of one mutually unbiased basis.
@[category test, AMS 5 15 81 94]
theorem hasMUBs_one (d : ℕ) : HasMUBs d 1 := d:ℕ⊢ HasMUBs d 1
All goals completed! 🐙
namespace QubitA convenient phase with squared norm $1/2$. Using $\omega = (1+i)/2$ avoids square roots.
def ω : ℂ := (1 + Complex.I) / 2The raw phase-parametrized Hadamard matrix. The cases $\zeta = 1$ and $\zeta = i$ give the $X$ and $Y$ bases.
def phaseMatrix (ζ : ℂ) : Matrix (Fin 2) (Fin 2) ℂ :=
!![1, 1;
ζ, -ζ]
The squared norm of ω is $1/2$.
@[category API, AMS 5 15 81 94]
lemma omega_norm_sq : ‖ω‖ ^ (2 : ℕ) = (2 : ℝ)⁻¹ := ⊢ ‖ω‖ ^ 2 = 2⁻¹
⊢ RCLike.re ω * RCLike.re ω + RCLike.im ω * RCLike.im ω = 2⁻¹
⊢ 2⁻¹ * 2⁻¹ + 2⁻¹ * 2⁻¹ = 2⁻¹
All goals completed! 🐙The product $\overline{\omega},\omega$ is $1/2$.
@[category API, AMS 5 15 81 94]
lemma conj_omega_mul_omega : star ω * ω = ((2 : ℝ)⁻¹ : ℂ) := ⊢ star ω * ω = (↑2)⁻¹
calc
star ω * ω = ((‖ω‖ : ℂ) ^ (2 : ℕ)) := ⊢ star ω * ω = ↑‖ω‖ ^ 2
All goals completed! 🐙
_ = ((2 : ℝ)⁻¹ : ℂ) := ⊢ ↑‖ω‖ ^ 2 = (↑2)⁻¹
All goals completed! 🐙Taking the star of a scalar multiple on the left and multiplying by another scalar multiple collects the scalar factor as $\overline{a} a$.
@[category API, AMS 5 15 81 94]
lemma star_smul_mul_smul (a : ℂ) (A B : Matrix (Fin 2) (Fin 2) ℂ) :
star (a • A) * (a • B) = (star a * a) • (star A * B) := a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ star (a • A) * a • B = (star a * a) • (star A * B)
a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂi:Fin 2j:Fin 2⊢ (star (a • A) * a • B) i j = ((star a * a) • (star A * B)) i j
a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂj:Fin 2⊢ (star (a • A) * a • B) ((fun i => i) ⟨0, ⋯⟩) j = ((star a * a) • (star A * B)) ((fun i => i) ⟨0, ⋯⟩) ja:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂj:Fin 2⊢ (star (a • A) * a • B) ((fun i => i) ⟨1, ⋯⟩) j = ((star a * a) • (star A * B)) ((fun i => i) ⟨1, ⋯⟩) j a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂj:Fin 2⊢ (star (a • A) * a • B) ((fun i => i) ⟨0, ⋯⟩) j = ((star a * a) • (star A * B)) ((fun i => i) ⟨0, ⋯⟩) ja:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂj:Fin 2⊢ (star (a • A) * a • B) ((fun i => i) ⟨1, ⋯⟩) j = ((star a * a) • (star A * B)) ((fun i => i) ⟨1, ⋯⟩) j a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (star (a • A) * a • B) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
((star a * a) • (star A * B)) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (star (a • A) * a • B) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
((star a * a) • (star A * B)) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (star (a • A) * a • B) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
((star a * a) • (star A * B)) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (star (a • A) * a • B) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
((star a * a) • (star A * B)) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (star (a • A) * a • B) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
((star a * a) • (star A * B)) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (star (a • A) * a • B) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
((star a * a) • (star A * B)) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)
a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (starRingEnd ℂ) a * (starRingEnd ℂ) (A 0 1) * (a * B 0 1) + (starRingEnd ℂ) a * (starRingEnd ℂ) (A 1 1) * (a * B 1 1) =
(starRingEnd ℂ) a * a * ((starRingEnd ℂ) (A 0 1) * B 0 1 + (starRingEnd ℂ) (A 1 1) * B 1 1) a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (starRingEnd ℂ) a * (starRingEnd ℂ) (A 0 0) * (a * B 0 0) + (starRingEnd ℂ) a * (starRingEnd ℂ) (A 1 0) * (a * B 1 0) =
(starRingEnd ℂ) a * a * ((starRingEnd ℂ) (A 0 0) * B 0 0 + (starRingEnd ℂ) (A 1 0) * B 1 0)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (starRingEnd ℂ) a * (starRingEnd ℂ) (A 0 0) * (a * B 0 1) + (starRingEnd ℂ) a * (starRingEnd ℂ) (A 1 0) * (a * B 1 1) =
(starRingEnd ℂ) a * a * ((starRingEnd ℂ) (A 0 0) * B 0 1 + (starRingEnd ℂ) (A 1 0) * B 1 1)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (starRingEnd ℂ) a * (starRingEnd ℂ) (A 0 1) * (a * B 0 0) + (starRingEnd ℂ) a * (starRingEnd ℂ) (A 1 1) * (a * B 1 0) =
(starRingEnd ℂ) a * a * ((starRingEnd ℂ) (A 0 1) * B 0 0 + (starRingEnd ℂ) (A 1 1) * B 1 0)a:ℂA:Matrix (Fin 2) (Fin 2) ℂB:Matrix (Fin 2) (Fin 2) ℂ⊢ (starRingEnd ℂ) a * (starRingEnd ℂ) (A 0 1) * (a * B 0 1) + (starRingEnd ℂ) a * (starRingEnd ℂ) (A 1 1) * (a * B 1 1) =
(starRingEnd ℂ) a * a * ((starRingEnd ℂ) (A 0 1) * B 0 1 + (starRingEnd ℂ) (A 1 1) * B 1 1) All goals completed! 🐙The relative product of two phase matrices has the expected $2 \times 2$ form.
@[category API, AMS 5 15 81 94]
lemma star_phaseMatrix_mul_phaseMatrix (ζ η : ℂ) :
star (phaseMatrix ζ) * phaseMatrix η =
!![1 + star ζ * η, 1 - star ζ * η;
1 - star ζ * η, 1 + star ζ * η] := ζ:ℂη:ℂ⊢ star (phaseMatrix ζ) * phaseMatrix η = !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η]
ζ:ℂη:ℂi:Fin 2j:Fin 2⊢ (star (phaseMatrix ζ) * phaseMatrix η) i j = !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] i j
ζ:ℂη:ℂj:Fin 2⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨0, ⋯⟩) j =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨0, ⋯⟩) jζ:ℂη:ℂj:Fin 2⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨1, ⋯⟩) j =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨1, ⋯⟩) j ζ:ℂη:ℂj:Fin 2⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨0, ⋯⟩) j =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨0, ⋯⟩) jζ:ℂη:ℂj:Fin 2⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨1, ⋯⟩) j =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨1, ⋯⟩) j ζ:ℂη:ℂ⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂη:ℂ⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) ζ:ℂη:ℂ⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂη:ℂ⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)ζ:ℂη:ℂ⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂη:ℂ⊢ (star (phaseMatrix ζ) * phaseMatrix η) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
!![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)
All goals completed! 🐙If $\zeta$ has unit modulus, then the phase matrix is orthogonal up to the scalar factor $2$.
@[category API, AMS 5 15 81 94]
lemma star_phaseMatrix_mul_self_of_unit_phase {ζ : ℂ} (hζ : star ζ * ζ = 1) :
star (phaseMatrix ζ) * phaseMatrix ζ = (2 : ℂ) • (1 : Matrix (Fin 2) (Fin 2) ℂ) := ζ:ℂhζ:star ζ * ζ = 1⊢ star (phaseMatrix ζ) * phaseMatrix ζ = 2 • 1
ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] = 2 • 1
ζ:ℂhζ:star ζ * ζ = 1i:Fin 2j:Fin 2⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] i j = (2 • 1) i j
ζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨0, ⋯⟩) j =
(2 • 1) ((fun i => i) ⟨0, ⋯⟩) jζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨1, ⋯⟩) j =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) j ζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨0, ⋯⟩) j =
(2 • 1) ((fun i => i) ⟨0, ⋯⟩) jζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨1, ⋯⟩) j =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) j ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + 1, 1 - 1; 1 - 1, 1 + 1] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + 1, 1 - 1; 1 - 1, 1 + 1] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + 1, 1 - 1; 1 - 1, 1 + 1] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + 1, 1 - 1; 1 - 1, 1 + 1] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂhζ:star ζ * ζ = 1⊢ !![1 + 1, 1 - 1; 1 - 1, 1 + 1] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
(2 • 1) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) All goals completed! 🐙Scaling a phase matrix by $\omega$ produces a unitary matrix whenever the phase has unit modulus.
@[category API, AMS 5 15 81 94]
lemma scaled_phaseMatrix_mem_unitary {ζ : ℂ} (hζ : star ζ * ζ = 1) :
(ω • phaseMatrix ζ) ∈ Matrix.unitaryGroup (Fin 2) ℂ := ζ:ℂhζ:star ζ * ζ = 1⊢ ω • phaseMatrix ζ ∈ Matrix.unitaryGroup (Fin 2) ℂ
ζ:ℂhζ:star ζ * ζ = 1⊢ star (ω • phaseMatrix ζ) * ω • phaseMatrix ζ = 1
calc
star (ω • phaseMatrix ζ) * (ω • phaseMatrix ζ)
= (star ω * ω) • (star (phaseMatrix ζ) * phaseMatrix ζ) := ζ:ℂhζ:star ζ * ζ = 1⊢ star (ω • phaseMatrix ζ) * ω • phaseMatrix ζ = (star ω * ω) • (star (phaseMatrix ζ) * phaseMatrix ζ)
All goals completed! 🐙
_ = ((star ω * ω) * (2 : ℂ)) • (1 : Matrix (Fin 2) (Fin 2) ℂ) := ζ:ℂhζ:star ζ * ζ = 1⊢ (star ω * ω) • (star (phaseMatrix ζ) * phaseMatrix ζ) = (star ω * ω * 2) • 1
All goals completed! 🐙
_ = 1 := ζ:ℂhζ:star ζ * ζ = 1⊢ (star ω * ω * 2) • 1 = 1
ζ:ℂhζ:star ζ * ζ = 1⊢ ((↑2)⁻¹ * 2) • 1 = 1
All goals completed! 🐙The relative product of two scaled phase matrices is obtained by scaling the corresponding relative product of phase matrices.
@[category API, AMS 5 15 81 94]
lemma star_phaseBasis_mul_phaseBasis (ζ η : ℂ) :
star (ω • phaseMatrix ζ) * (ω • phaseMatrix η) =
(star ω * ω) • !![1 + star ζ * η, 1 - star ζ * η;
1 - star ζ * η, 1 + star ζ * η] := ζ:ℂη:ℂ⊢ star (ω • phaseMatrix ζ) * ω • phaseMatrix η =
(star ω * ω) • !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η]
All goals completed! 🐙The bundled qubit basis associated to a unit-modulus phase $\zeta$.
def phaseU (ζ : ℂ) (hζ : star ζ * ζ = 1) : UMat 2 :=
⟨ω • phaseMatrix ζ, scaled_phaseMatrix_mem_unitary hζ⟩A complex number with $\overline{\zeta},\zeta = 1$ has squared norm $1$.
@[category API, AMS 5 15 81 94]
lemma phase_norm_sq_eq_one {ζ : ℂ} (hζ : star ζ * ζ = 1) :
‖ζ‖ ^ (2 : ℕ) = 1 := ζ:ℂhζ:star ζ * ζ = 1⊢ ‖ζ‖ ^ 2 = 1
have hzC : ((‖ζ‖ : ℂ) ^ (2 : ℕ)) = 1 := ζ:ℂhζ:star ζ * ζ = 1⊢ ‖ζ‖ ^ 2 = 1
calc
((‖ζ‖ : ℂ) ^ (2 : ℕ)) = star ζ * ζ := ζ:ℂhζ:star ζ * ζ = 1⊢ ↑‖ζ‖ ^ 2 = star ζ * ζ
All goals completed! 🐙
_ = 1 := hζ
All goals completed! 🐙Multiplying $\omega$ by a unit-modulus phase preserves the squared norm $1/2$.
@[category API, AMS 5 15 81 94]
lemma omega_mul_phase_norm_sq {ζ : ℂ} (hζ : star ζ * ζ = 1) :
‖ω * ζ‖ ^ (2 : ℕ) = (2 : ℝ)⁻¹ := ζ:ℂhζ:star ζ * ζ = 1⊢ ‖ω * ζ‖ ^ 2 = 2⁻¹
ζ:ℂhζ:star ζ * ζ = 1⊢ 2⁻¹ * 1 = 2⁻¹; All goals completed! 🐙The standard qubit basis.
def ZU : UMat 2 := 1The qubit $X$ basis as a bundled unitary matrix.
def XU : UMat 2 := phaseU 1 (⊢ star 1 * 1 = 1 All goals completed! 🐙)The qubit $Y$ basis as a bundled unitary matrix.
def YU : UMat 2 := phaseU Complex.I (⊢ star Complex.I * Complex.I = 1 All goals completed! 🐙)The standard basis is mutually unbiased with any phase basis of unit-modulus phase.
@[category API, AMS 5 15 81 94]
lemma isUnbiased_Z_phaseU (ζ : ℂ) (hζ : star ζ * ζ = 1) :
IsUnbiased ZU (phaseU ζ hζ) := ζ:ℂhζ:star ζ * ζ = 1⊢ IsUnbiased ZU (phaseU ζ hζ)
intro i ζ:ℂhζ:star ζ * ζ = 1i:Fin 2j:Fin 2⊢ ‖relativeUnitary ZU (phaseU ζ hζ) i j‖ ^ 2 = (↑2)⁻¹
ζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨0, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨1, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ ζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨0, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ζ:ℂhζ:star ζ * ζ = 1j:Fin 2⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨1, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ ζ:ℂhζ:star ζ * ζ = 1⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ζ:ℂhζ:star ζ * ζ = 1⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)‖ ^ 2 = (↑2)⁻¹
ζ:ℂhζ:star ζ * ζ = 1⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ All goals completed! 🐙
ζ:ℂhζ:star ζ * ζ = 1⊢ ‖relativeUnitary ZU (phaseU ζ hζ) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ All goals completed! 🐙
all_goals All goals completed! 🐙If $\overline{\zeta},\eta = i$, then the relative unitary between the corresponding phase bases is the qubit mutually unbiased overlap matrix.
@[category API, AMS 5 15 81 94]
lemma relative_phaseU_phaseU_of_mul_eq_I {ζ η : ℂ}
(hζ : star ζ * ζ = 1) (hη : star η * η = 1) (hζη : star ζ * η = Complex.I) :
relativeUnitary (phaseU ζ hζ) (phaseU η hη) = !![ω, star ω;
star ω, ω] := ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ relativeUnitary (phaseU ζ hζ) (phaseU η hη) = !![ω, star ω; star ω, ω]
calc
relativeUnitary (phaseU ζ hζ) (phaseU η hη) =
(star ω * ω) • !![1 + star ζ * η, 1 - star ζ * η;
1 - star ζ * η, 1 + star ζ * η] := ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ relativeUnitary (phaseU ζ hζ) (phaseU η hη) =
(star ω * ω) • !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η]
All goals completed! 🐙
_ = (star ω * ω) • !![1 + Complex.I, 1 - Complex.I;
1 - Complex.I, 1 + Complex.I] := ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ (star ω * ω) • !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] =
(star ω * ω) • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]
All goals completed! 🐙
_ = ((2 : ℝ)⁻¹ : ℂ) • !![1 + Complex.I, 1 - Complex.I;
1 - Complex.I, 1 + Complex.I] := ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ (star ω * ω) • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I] =
(↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]
All goals completed! 🐙
_ = !![ω, star ω;
star ω, ω] := ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ (↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I] = !![ω, star ω; star ω, ω]
ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ii:Fin 2j:Fin 2⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) i j = !![ω, star ω; star ω, ω] i j
ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨0, ⋯⟩) j =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) jζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨1, ⋯⟩) j =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) j ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨0, ⋯⟩) j =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) jζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨1, ⋯⟩) j =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) j ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩) =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ((↑2)⁻¹ • !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I]) ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩) =
!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)
ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ 2⁻¹ * (1 + Complex.I) = (1 + Complex.I) * 2⁻¹ ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ 2⁻¹ * (1 + Complex.I) = (1 + Complex.I) * 2⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ 2⁻¹ * (1 + -Complex.I) = (1 + -Complex.I) * 2⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ 2⁻¹ * (1 + -Complex.I) = (1 + -Complex.I) * 2⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ 2⁻¹ * (1 + Complex.I) = (1 + Complex.I) * 2⁻¹ All goals completed! 🐙If $\overline{\zeta},\eta = i$, then the corresponding phase bases are mutually unbiased.
@[category API, AMS 5 15 81 94]
lemma isUnbiased_phaseU_phaseU_of_mul_eq_I {ζ η : ℂ}
(hζ : star ζ * ζ = 1) (hη : star η * η = 1) (hζη : star ζ * η = Complex.I) :
IsUnbiased (phaseU ζ hζ) (phaseU η hη) := ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ IsUnbiased (phaseU ζ hζ) (phaseU η hη)
intro i ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ii:Fin 2j:Fin 2⊢ ‖relativeUnitary (phaseU ζ hζ) (phaseU η hη) i j‖ ^ 2 = (↑2)⁻¹
ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ii:Fin 2j:Fin 2⊢ ‖!![ω, star ω; star ω, ω] i j‖ ^ 2 = (↑2)⁻¹
ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) j‖ ^ 2 = (↑2)⁻¹ ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨0, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨0, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ζ:ℂη:ℂhζ:star ζ * ζ = 1hη:star η * η = 1hζη:star ζ * η = Complex.I⊢ ‖!![ω, star ω; star ω, ω] ((fun i => i) ⟨1, ⋯⟩) ((fun i => i) ⟨1, ⋯⟩)‖ ^ 2 = (↑2)⁻¹ All goals completed! 🐙The three standard qubit mutually unbiased bases: $Z$, $X$, and $Y$.
def qubitFamily : Fin 3 → UMat 2 :=
![ZU, XU, YU]The standard qubit family is a family of mutually unbiased bases.
@[category API, AMS 5 15 81 94]
lemma qubitFamily_isMUB : IsMUBFamily qubitFamily := ⊢ IsMUBFamily qubitFamily
intro i i:Fin 3j:Fin 3⊢ i ≠ j → (fun m n => IsUnbiased (qubitFamily m) (qubitFamily n)) i j i:Fin 3j:Fin 3hij:i ≠ j⊢ IsUnbiased (qubitFamily i) (qubitFamily j)
j:Fin 3hij:(fun i => i) ⟨0, ⋯⟩ ≠ j⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily j)j:Fin 3hij:(fun i => i) ⟨1, ⋯⟩ ≠ j⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily j)j:Fin 3hij:(fun i => i) ⟨2, ⋯⟩ ≠ j⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily j) j:Fin 3hij:(fun i => i) ⟨0, ⋯⟩ ≠ j⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily j)j:Fin 3hij:(fun i => i) ⟨1, ⋯⟩ ≠ j⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily j)j:Fin 3hij:(fun i => i) ⟨2, ⋯⟩ ≠ j⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily j) hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨0, ⋯⟩))hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨1, ⋯⟩))hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily ((fun i => i) ⟨0, ⋯⟩))hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily ((fun i => i) ⟨1, ⋯⟩))hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily ((fun i => i) ⟨2, ⋯⟩))hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily ((fun i => i) ⟨0, ⋯⟩))hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily ((fun i => i) ⟨1, ⋯⟩))hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily ((fun i => i) ⟨2, ⋯⟩))hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨0, ⋯⟩))hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨1, ⋯⟩))hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) try All goals completed! 🐙
hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) simpa [qubitFamily, XU] using isUnbiased_Z_phaseU (ζ := 1) (hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ star 1 * 1 = 1 All goals completed! 🐙)
hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) simpa [qubitFamily, YU] using isUnbiased_Z_phaseU (ζ := Complex.I) (hij:(fun i => i) ⟨0, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ star Complex.I * Complex.I = 1 All goals completed! 🐙)
hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) simpa [qubitFamily, XU] using
(IsUnbiased.symm <| isUnbiased_Z_phaseU (ζ := 1) (hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ star 1 * 1 = 1 All goals completed! 🐙))
hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) simpa [qubitFamily, XU, YU] using
isUnbiased_phaseU_phaseU_of_mul_eq_I
(ζ := 1) (η := Complex.I) (hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ star 1 * 1 = 1 All goals completed! 🐙) (hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ star Complex.I * Complex.I = 1 All goals completed! 🐙) (hij:(fun i => i) ⟨1, ⋯⟩ ≠ (fun i => i) ⟨2, ⋯⟩⊢ star 1 * Complex.I = Complex.I All goals completed! 🐙)
hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨0, ⋯⟩)) simpa [qubitFamily, YU] using
(IsUnbiased.symm <| isUnbiased_Z_phaseU (ζ := Complex.I) (hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨0, ⋯⟩⊢ star Complex.I * Complex.I = 1 All goals completed! 🐙))
hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ IsUnbiased (qubitFamily ((fun i => i) ⟨2, ⋯⟩)) (qubitFamily ((fun i => i) ⟨1, ⋯⟩)) simpa [qubitFamily, XU, YU] using
(IsUnbiased.symm <|
isUnbiased_phaseU_phaseU_of_mul_eq_I
(ζ := 1) (η := Complex.I) (hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ star 1 * 1 = 1 All goals completed! 🐙) (hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ star Complex.I * Complex.I = 1 All goals completed! 🐙) (hij:(fun i => i) ⟨2, ⋯⟩ ≠ (fun i => i) ⟨1, ⋯⟩⊢ star 1 * Complex.I = Complex.I All goals completed! 🐙))There exist three mutually unbiased bases in dimension $2$.
@[category API, AMS 5 15 81 94]
lemma qubit_hasThreeMUBs : HasMUBs 2 3 := ⊢ HasMUBs 2 3
All goals completed! 🐙The first entry of the first column of a qubit unitary basis matrix.
@[category API, AMS 5 15 81 94]
def u0 (U : UMat 2) : ℂ :=
(U : Matrix (Fin 2) (Fin 2) ℂ) 0 0The second entry of the first column of a qubit unitary basis matrix.
@[category API, AMS 5 15 81 94]
def u1 (U : UMat 2) : ℂ :=
(U : Matrix (Fin 2) (Fin 2) ℂ) 1 0The real Bloch-vector space for qubits.
abbrev BlochVec := EuclideanSpace ℝ (Fin 3)The Bloch vector associated to the first column of a qubit basis matrix.
@[category API, AMS 5 15 81 94]
def bloch (U : UMat 2) : BlochVec :=
!2[ 2 * Complex.re (star (u0 U) * u1 U)
, 2 * Complex.im (star (u0 U) * u1 U)
, Complex.normSq (u0 U) - Complex.normSq (u1 U) ]The $(0,0)$ entry of the relative unitary is the overlap of the first columns.
@[category API, AMS 5 15 81 94]
lemma relativeUnitary_apply_zero_zero (U V : UMat 2) :
relativeUnitary U V 0 0 = star (u0 U) * u0 V + star (u1 U) * u1 V := U:UMat 2V:UMat 2⊢ relativeUnitary U V 0 0 = star (u0 U) * u0 V + star (u1 U) * u1 V
All goals completed! 🐙The first column of a unitary matrix has squared norm $1$.
@[category API, AMS 5 15 81 94]
lemma firstCol_normSq (U : UMat 2) :
Complex.normSq (u0 U) + Complex.normSq (u1 U) = 1 := U:UMat 2⊢ Complex.normSq (u0 U) + Complex.normSq (u1 U) = 1
have hu : star (U : Matrix (Fin 2) (Fin 2) ℂ) * (U : Matrix (Fin 2) (Fin 2) ℂ) = 1 := U:UMat 2⊢ Complex.normSq (u0 U) + Complex.normSq (u1 U) = 1
All goals completed! 🐙
U:UMat 2hu:star ↑U * ↑U = 1 := Matrix.mem_unitaryGroup_iff'.mp U.propertyh00:(fun M => M 0 0) (star ↑U * ↑U) = (fun M => M 0 0) 1 := congrArg (fun M => M 0 0) hu⊢ Complex.normSq (u0 U) + Complex.normSq (u1 U) = 1
have h00' : (Complex.normSq (u0 U) + Complex.normSq (u1 U) : ℂ) = 1 := U:UMat 2⊢ Complex.normSq (u0 U) + Complex.normSq (u1 U) = 1
All goals completed! 🐙
All goals completed! 🐙
The real part of $z \overline{w}$ is the Euclidean dot product of the coordinate pairs of
z and w.
@[category API, AMS 5 15 81 94]
lemma re_mul_conj (z w : ℂ) :
Complex.re (z * star w) = Complex.re z * Complex.re w + Complex.im z * Complex.im w := z:ℂw:ℂ⊢ (z * star w).re = z.re * w.re + z.im * w.im
All goals completed! 🐙The Bloch inner product is determined by the $(0,0)$ entry of the relative unitary.
@[category API, AMS 5 15 81 94]
lemma bloch_inner_eq_two_normSq_sub_one (U V : UMat 2) :
inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1 := U:UMat 2V:UMat 2⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
U:UMat 2V:UMat 2a:ℂ := u0 U⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 U⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 V⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 V⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
have hsumU : Complex.normSq a + Complex.normSq b = 1 := U:UMat 2V:UMat 2⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
All goals completed! 🐙
have hsumV : Complex.normSq c + Complex.normSq d = 1 := U:UMat 2V:UMat 2⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
All goals completed! 🐙
have hnorm :
Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d
+ 2 * Complex.re (star a * c * (b * star d)) := U:UMat 2V:UMat 2⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
All goals completed! 🐙
have hdot :
inner ℝ (bloch U) (bloch V) =
4 * Complex.re (star a * c * (b * star d))
+ (Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) := U:UMat 2V:UMat 2⊢ inner ℝ (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1
calc
inner ℝ (bloch U) (bloch V)
= (2 * Complex.re (star a * b)) * (2 * Complex.re (star c * d))
+ (2 * Complex.im (star a * b)) * (2 * Complex.im (star c * d))
+ (Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) := U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ inner ℝ (bloch U) (bloch V) =
2 * (star a * b).re * (2 * (star c * d).re) + 2 * (star a * b).im * (2 * (star c * d).im) +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d)
U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ inner ℝ ((bloch U).ofLp 0) ((bloch V).ofLp 0) + inner ℝ ((bloch U).ofLp 1) ((bloch V).ofLp 1) +
inner ℝ ((bloch U).ofLp 2) ((bloch V).ofLp 2) =
2 * (star a * b).re * (2 * (star c * d).re) + 2 * (star a * b).im * (2 * (star c * d).im) +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d)
U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ 2 * ((u0 V).re * (u1 V).re + (u0 V).im * (u1 V).im) * (2 * ((u0 U).re * (u1 U).re + (u0 U).im * (u1 U).im)) +
2 * ((u0 V).re * (u1 V).im + -((u0 V).im * (u1 V).re)) *
(2 * ((u0 U).re * (u1 U).im + -((u0 U).im * (u1 U).re))) +
(Complex.normSq (u0 V) - Complex.normSq (u1 V)) * (Complex.normSq (u0 U) - Complex.normSq (u1 U)) =
2 * ((u0 U).re * (u1 U).re + (u0 U).im * (u1 U).im) * (2 * ((u0 V).re * (u1 V).re + (u0 V).im * (u1 V).im)) +
2 * ((u0 U).re * (u1 U).im + -((u0 U).im * (u1 U).re)) *
(2 * ((u0 V).re * (u1 V).im + -((u0 V).im * (u1 V).re))) +
(Complex.normSq (u0 U) - Complex.normSq (u1 U)) * (Complex.normSq (u0 V) - Complex.normSq (u1 V))
All goals completed! 🐙
_ = 4 * (Complex.re (star a * b) * Complex.re (star c * d)
+ Complex.im (star a * b) * Complex.im (star c * d))
+ (Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) := U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ 2 * (star a * b).re * (2 * (star c * d).re) + 2 * (star a * b).im * (2 * (star c * d).im) +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) =
4 * ((star a * b).re * (star c * d).re + (star a * b).im * (star c * d).im) +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d)
All goals completed! 🐙
_ = 4 * Complex.re ((star a * b) * star (star c * d))
+ (Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) := U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ 4 * ((star a * b).re * (star c * d).re + (star a * b).im * (star c * d).im) +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) =
4 * (star a * b * star (star c * d)).re +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d)
All goals completed! 🐙
_ = 4 * Complex.re (star a * c * (b * star d))
+ (Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) := U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ 4 * (star a * b * star (star c * d)).re +
(Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d) =
4 * (star a * c * (b * star d)).re + (Complex.normSq a - Complex.normSq b) * (Complex.normSq c - Complex.normSq d)
U:UMat 2V:UMat 2a:ℂ := u0 Ub:ℂ := u1 Uc:ℂ := u0 Vd:ℂ := u1 VhsumU:Complex.normSq a + Complex.normSq b = 1 := id (firstCol_normSq U)hsumV:Complex.normSq c + Complex.normSq d = 1 := id (firstCol_normSq V)hnorm:Complex.normSq (relativeUnitary U V 0 0) =
Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * (star a * c * (b * star d)).re :=
Eq.mpr
(id
(congr (congrArg (fun x => Eq (Complex.normSq x)) (relativeUnitary_apply_zero_zero U V))
(congrArg (fun x => Complex.normSq a * Complex.normSq c + Complex.normSq b * Complex.normSq d + 2 * x)
(Eq.trans (congrArg Complex.re (mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d)))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Eq.mp
(congrArg (Eq (Complex.normSq ((starRingEnd ℂ) a * c + (starRingEnd ℂ) b * d)))
(congr
(congrArg HAdd.hAdd
(congr
(congrArg HAdd.hAdd
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) a) c)
(congrArg (fun x => x * Complex.normSq c) (Complex.normSq_conj a))))
(Eq.trans (Complex.normSq_mul ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * Complex.normSq d) (Complex.normSq_conj b)))))
(congrArg (HMul.hMul 2)
(Eq.trans
(congrArg Complex.re
(Eq.trans
(congrArg (HMul.hMul ((starRingEnd ℂ) a * c))
(Eq.trans (map_mul (starRingEnd ℂ) ((starRingEnd ℂ) b) d)
(congrArg (fun x => x * (starRingEnd ℂ) d) RingHomCompTriple.comp_apply)))
(mul_assoc ((starRingEnd ℂ) a) c (b * (starRingEnd ℂ) d))))
(Eq.trans
(congr
(congrArg (fun x => HSub.hSub (a.re * x))
(congr
(congrArg (fun x => HSub.hSub (c.re * x))
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))
(congrArg (fun x => c.im * (x + b.im * d.re)) (mul_neg b.re d.im))))
(Eq.trans
(congrArg (HMul.hMul (-a.im))
(congr (congrArg (fun x => HAdd.hAdd (c.re * (x + b.im * d.re))) (mul_neg b.re d.im))
(congrArg (HMul.hMul c.im)
(Eq.trans (congrArg (HSub.hSub (b.re * d.re)) (mul_neg b.im d.im))
(sub_neg_eq_add (b.re * d.re) (b.im * d.im))))))
(neg_mul a.im (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))
(sub_neg_eq_add (a.re * (c.re * (b.re * d.re + b.im * d.im) - c.im * (-(b.re * d.im) + b.im * d.re)))
(a.im * (c.re * (-(b.re * d.im) + b.im * d.re) + c.im * (b.re * d.re + b.im * d.im)))))))))
(Complex.normSq_add (star a * c) (star b * d)))⊢ (a.re * b.re + a.im * b.im) * (c.re * d.re + c.im * d.im) -
(a.re * b.im + -(a.im * b.re)) * (-(c.re * d.im) + c.im * d.re) =
(a.re * c.re + a.im * c.im) * (b.re * d.re + b.im * d.im) -
(a.re * c.im + -(a.im * c.re)) * (-(b.re * d.im) + b.im * d.re)
All goals completed! 🐙
All goals completed! 🐙The relative unitary of a basis with itself is the identity matrix.
@[category API, AMS 5 15 81 94]
lemma relativeUnitary_self (U : UMat 2) : relativeUnitary U U = 1 := U:UMat 2⊢ relativeUnitary U U = 1
U:UMat 2⊢ star ↑U * ↑U = 1
All goals completed! 🐙Every qubit Bloch vector has squared Euclidean norm $1$.
@[category API, AMS 5 15 81 94]
lemma bloch_inner_self (U : UMat 2) : inner ℝ (bloch U) (bloch U) = 1 := U:UMat 2⊢ inner ℝ (bloch U) (bloch U) = 1
U:UMat 2⊢ 2 * Complex.normSq (1 0 0) - 1 = 1
All goals completed! 🐙A qubit Bloch vector is never the zero vector.
@[category API, AMS 5 15 81 94]
lemma bloch_ne_zero (U : UMat 2) : bloch U ≠ 0 := U:UMat 2⊢ bloch U ≠ 0
U:UMat 2h:bloch U = 0⊢ False
have h0 : (0 : ℝ) = 1 := U:UMat 2⊢ bloch U ≠ 0
All goals completed! 🐙
All goals completed! 🐙Mutually unbiased qubit bases have orthogonal Bloch vectors.
@[category API, AMS 5 15 81 94]
lemma bloch_inner_eq_zero_of_isUnbiased {U V : UMat 2} (hUV : IsUnbiased U V) :
inner ℝ (bloch U) (bloch V) = 0 := U:UMat 2V:UMat 2hUV:IsUnbiased U V⊢ inner ℝ (bloch U) (bloch V) = 0
U:UMat 2V:UMat 2hUV:IsUnbiased U V⊢ 2 * Complex.normSq (relativeUnitary U V 0 0) - 1 = 0
have h00 : Complex.normSq (relativeUnitary U V 0 0) = (2 : ℝ)⁻¹ := U:UMat 2V:UMat 2hUV:IsUnbiased U V⊢ inner ℝ (bloch U) (bloch V) = 0
calc
Complex.normSq (relativeUnitary U V 0 0) = ‖relativeUnitary U V 0 0‖ ^ 2 := U:UMat 2V:UMat 2hUV:IsUnbiased U V⊢ Complex.normSq (relativeUnitary U V 0 0) = ‖relativeUnitary U V 0 0‖ ^ 2
All goals completed! 🐙
_ = (2 : ℝ)⁻¹ := U:UMat 2V:UMat 2hUV:IsUnbiased U V⊢ ‖relativeUnitary U V 0 0‖ ^ 2 = 2⁻¹
All goals completed! 🐙
U:UMat 2V:UMat 2hUV:IsUnbiased U Vh00:Complex.normSq (relativeUnitary U V 0 0) = 2⁻¹ := Trans.trans (RCLike.normSq_eq_def' (relativeUnitary U V 0 0)) (hUV 0 0)⊢ 2 * 2⁻¹ - 1 = 0
All goals completed! 🐙No family of mutually unbiased bases in dimension $2$ has size greater than $3$.
@[category API, AMS 5 15 81 94]
lemma qubit_upper_bound (m : ℕ) : HasMUBs 2 m → m ≤ 3 := m:ℕ⊢ HasMUBs 2 m → m ≤ 3
m:ℕB:Fin m → UMat 2hB:IsMUBFamily B⊢ m ≤ 3
m:ℕB:Fin m → UMat 2hB:IsMUBFamily Bv:Fin m → BlochVec := fun i => bloch (B i)⊢ m ≤ 3
have hv_ne : ∀ i, v i ≠ 0 := m:ℕ⊢ HasMUBs 2 m → m ≤ 3
m:ℕB:Fin m → UMat 2hB:IsMUBFamily Bv:Fin m → BlochVec := fun i => bloch (B i)i:Fin m⊢ v i ≠ 0
All goals completed! 🐙
have hv_ortho : Pairwise fun i j => inner ℝ (v i) (v j) = 0 := m:ℕ⊢ HasMUBs 2 m → m ≤ 3
intro i m:ℕB:Fin m → UMat 2hB:IsMUBFamily Bv:Fin m → BlochVec := fun i => bloch (B i)hv_ne:∀ (i : Fin m), v i ≠ 0 := fun i => id (bloch_ne_zero (B i))i:Fin mj:Fin m⊢ i ≠ j → (fun i j => inner ℝ (v i) (v j) = 0) i j m:ℕB:Fin m → UMat 2hB:IsMUBFamily Bv:Fin m → BlochVec := fun i => bloch (B i)hv_ne:∀ (i : Fin m), v i ≠ 0 := fun i => id (bloch_ne_zero (B i))i:Fin mj:Fin mhij:i ≠ j⊢ inner ℝ (v i) (v j) = 0
All goals completed! 🐙
m:ℕB:Fin m → UMat 2hB:IsMUBFamily Bv:Fin m → BlochVec := fun i => bloch (B i)hv_ne:∀ (i : Fin m), v i ≠ 0 := fun i => id (bloch_ne_zero (B i))hv_ortho:Pairwise fun i j => inner ℝ (v i) (v j) = 0 := fun ⦃i j⦄ hij => id (bloch_inner_eq_zero_of_isUnbiased (hB hij))hlin:LinearIndependent ℝ v := linearIndependent_of_ne_zero_of_inner_eq_zero hv_ne hv_ortho⊢ m ≤ 3
m:ℕB:Fin m → UMat 2hB:IsMUBFamily Bv:Fin m → BlochVec := fun i => bloch (B i)hv_ne:∀ (i : Fin m), v i ≠ 0 := fun i => id (bloch_ne_zero (B i))hv_ortho:Pairwise fun i j => inner ℝ (v i) (v j) = 0 := fun ⦃i j⦄ hij => id (bloch_inner_eq_zero_of_isUnbiased (hB hij))hlin:LinearIndependent ℝ v := linearIndependent_of_ne_zero_of_inner_eq_zero hv_ne hv_orthohcard:Fintype.card (Fin m) ≤ Module.finrank ℝ BlochVec := LinearIndependent.fintype_card_le_finrank hlin⊢ m ≤ 3
All goals completed! 🐙The maximum number of mutually unbiased bases in dimension $2$ is $3$.
@[category API, AMS 5 15 81 94]
theorem qubit_maximal : IsMaxMUBCount 2 3 := ⊢ IsMaxMUBCount 2 3
All goals completed! 🐙
end QubitIn dimension $2$, the maximum number of mutually unbiased orthonormal bases is $3$.
@[category research solved, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases_dim2 : IsMaxMUBCount 2 3 := ⊢ IsMaxMUBCount 2 3
All goals completed! 🐙Known general bounds in dimension $6$: the maximal number of mutually unbiased bases satisfies $3 \le \mu(6) \le 7$.
@[category research solved, AMS 5 15 81 94,
formal_proof using formal_conjectures at "https://github.com/XC0R/formal-conjectures/blob/c8733543568e8011288a9fa7ef33375f5e5907d3/FormalConjectures/OpenQuantumProblems/13.lean#L1168"]
theorem mutuallyUnbiasedBases_dim6_bounds :
HasMUBs 6 3 ∧ ∀ m : ℕ, HasMUBs 6 m → m ≤ 7 := ⊢ HasMUBs 6 3 ∧ ∀ (m : ℕ), HasMUBs 6 m → m ≤ 7
All goals completed! 🐙Special case in dimension $6$: determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^6$.
@[category research open, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases_dim6 :
IsMaxMUBCount 6 (answer(sorry)) := ⊢ IsMaxMUBCount 6 sorry
All goals completed! 🐙Special case in dimension $10$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{10}$.
@[category research open, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases_dim10 :
IsMaxMUBCount 10 (answer(sorry)) := ⊢ IsMaxMUBCount 10 sorry
All goals completed! 🐙Special case in dimension $12$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{12}$.
@[category research open, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases_dim12 :
IsMaxMUBCount 12 (answer(sorry)) := ⊢ IsMaxMUBCount 12 sorry
All goals completed! 🐙Special case in dimension $14$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{14}$.
@[category research open, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases_dim14 :
IsMaxMUBCount 14 (answer(sorry)) := ⊢ IsMaxMUBCount 14 sorry
All goals completed! 🐙Special case in dimension $15$ (not a prime power): determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^{15}$.
@[category research open, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases_dim15 :
IsMaxMUBCount 15 (answer(sorry)) := ⊢ IsMaxMUBCount 15 sorry
All goals completed! 🐙Open Quantum Problem 13: determine the maximal number of mutually unbiased orthonormal bases in $\mathbb{C}^d$ for $d \ge 2$.
@[category research open, AMS 5 15 81 94]
theorem mutuallyUnbiasedBases (d : ℕ) (hd : 2 ≤ d) :
IsMaxMUBCount d ((answer(sorry) : ℕ → ℕ) d) := d:ℕhd:2 ≤ d⊢ IsMaxMUBCount d (sorry d)
All goals completed! 🐙
end OpenQuantumProblem13