/- 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 FormalConjecturesUtil

Open 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}r = { e_0^{(r)}, \dots, e{d-1}^{(r)} }$ and $\mathcal{B}s = { e_0^{(s)}, \dots, e{d-1}^{(s)} }$, then $\mathcal{B}_r$ and $\mathcal{B}_s$ are mutually unbiased if for all $i, j$ and all $r \ne s$, $|\langle e_i^{(r)}, e_j^{(s)} \rangle| = d^{-1/2}$.

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

Primary source list entry:

    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ć, Geometrical description of quantal state determination, J. Phys. A 14, 3241-3245 (1981).

    W. K. Wootters and B. D. Fields, Optimal state-determination by mutually unbiased measurements, Ann. Phys. 191, 363-381 (1989).

General constructions and surveys

    A. Klappenecker and M. Rötteler, Constructions of mutually unbiased bases, in Finite Fields and Applications, LNCS 2948 (2004).

Dimension six and the maximal-number problem

    M. Grassl, On SIC-POVMs and MUBs in Dimension 6, arXiv:quant-ph/0406175 (2004).

    P. Butterley and W. Hall, Numerical evidence for the maximum number of mutually unbiased bases in dimension six, Phys. Lett. A 369, 5-8 (2007), arXiv:quant-ph/0701122.

    S. Brierley and S. Weigert, Maximal Sets of Mutually Unbiased Quantum States in Dimension Six, Phys. Rev. A 78, 042312 (2008), arXiv:0808.1614.

    P. Raynal, X. Lü, and B.-G. Englert, Mutually unbiased bases in dimension six: The four most distant bases, Phys. Rev. A 83, 062303 (2011), arXiv:1103.1025.

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 OpenQuantumProblem13

A 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 VIsUnbiased V U intro i d:U:UMat dV:UMat dhUV:IsUnbiased U Vi:Fin dj:Fin drelativeUnitary V U i j ^ 2 = (↑d)⁻¹ have hstar : relativeUnitary V U = star (relativeUnitary U V) := d:U:UMat dV:UMat dhUV:IsUnbiased U VIsUnbiased 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 i

A 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 B

There 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 k

Every 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 Qubit

A convenient phase with squared norm $1/2$. Using $\omega = (1+i)/2$ avoids square roots.

def ω : := (1 + Complex.I) / 2

The 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 {ζ : } ( : star ζ * ζ = 1) : star (phaseMatrix ζ) * phaseMatrix ζ = (2 : ) (1 : Matrix (Fin 2) (Fin 2) ) := ζ::star ζ * ζ = 1star (phaseMatrix ζ) * phaseMatrix ζ = 2 1 ζ::star ζ * ζ = 1!![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] = 2 1 ζ::star ζ * ζ = 1i:Fin 2j:Fin 2!![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] i j = (2 1) i j ζ::star ζ * ζ = 1j:Fin 2!![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) 0, ) j = (2 1) ((fun i => i) 0, ) jζ::star ζ * ζ = 1j:Fin 2!![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) 1, ) j = (2 1) ((fun i => i) 1, ) j ζ::star ζ * ζ = 1j:Fin 2!![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) 0, ) j = (2 1) ((fun i => i) 0, ) jζ::star ζ * ζ = 1j:Fin 2!![1 + star ζ * ζ, 1 - star ζ * ζ; 1 - star ζ * ζ, 1 + star ζ * ζ] ((fun i => i) 1, ) j = (2 1) ((fun i => i) 1, ) j ζ::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, )ζ::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, ) ζ::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, )ζ::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, )ζ::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, )ζ::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, ) ζ::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, ) ζ::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, )ζ::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, )ζ::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, )ζ::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 {ζ : } ( : star ζ * ζ = 1) : (ω phaseMatrix ζ) Matrix.unitaryGroup (Fin 2) := ζ::star ζ * ζ = 1ω phaseMatrix ζ Matrix.unitaryGroup (Fin 2) ζ::star ζ * ζ = 1star (ω phaseMatrix ζ) * ω phaseMatrix ζ = 1 calc star (ω phaseMatrix ζ) * (ω phaseMatrix ζ) = (star ω * ω) (star (phaseMatrix ζ) * phaseMatrix ζ) := ζ::star ζ * ζ = 1star (ω phaseMatrix ζ) * ω phaseMatrix ζ = (star ω * ω) (star (phaseMatrix ζ) * phaseMatrix ζ) All goals completed! 🐙 _ = ((star ω * ω) * (2 : )) (1 : Matrix (Fin 2) (Fin 2) ) := ζ::star ζ * ζ = 1(star ω * ω) (star (phaseMatrix ζ) * phaseMatrix ζ) = (star ω * ω * 2) 1 All goals completed! 🐙 _ = 1 := ζ::star ζ * ζ = 1(star ω * ω * 2) 1 = 1 ζ::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 (ζ : ) ( : star ζ * ζ = 1) : UMat 2 := ω phaseMatrix ζ, scaled_phaseMatrix_mem_unitary

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 {ζ : } ( : star ζ * ζ = 1) : ζ ^ (2 : ) = 1 := ζ::star ζ * ζ = 1ζ ^ 2 = 1 have hzC : ((ζ : ) ^ (2 : )) = 1 := ζ::star ζ * ζ = 1ζ ^ 2 = 1 calc ((ζ : ) ^ (2 : )) = star ζ * ζ := ζ::star ζ * ζ = 1ζ ^ 2 = star ζ * ζ All goals completed! 🐙 _ = 1 := 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 {ζ : } ( : star ζ * ζ = 1) : ω * ζ ^ (2 : ) = (2 : )⁻¹ := ζ::star ζ * ζ = 1ω * ζ ^ 2 = 2⁻¹ ζ::star ζ * ζ = 12⁻¹ * 1 = 2⁻¹; All goals completed! 🐙

The standard qubit basis.

def ZU : UMat 2 := 1

The 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 (ζ : ) ( : star ζ * ζ = 1) : IsUnbiased ZU (phaseU ζ ) := ζ::star ζ * ζ = 1IsUnbiased ZU (phaseU ζ ) intro i ζ::star ζ * ζ = 1i:Fin 2j:Fin 2relativeUnitary ZU (phaseU ζ ) i j ^ 2 = (↑2)⁻¹ ζ::star ζ * ζ = 1j:Fin 2relativeUnitary ZU (phaseU ζ ) ((fun i => i) 0, ) j ^ 2 = (↑2)⁻¹ζ::star ζ * ζ = 1j:Fin 2relativeUnitary ZU (phaseU ζ ) ((fun i => i) 1, ) j ^ 2 = (↑2)⁻¹ ζ::star ζ * ζ = 1j:Fin 2relativeUnitary ZU (phaseU ζ ) ((fun i => i) 0, ) j ^ 2 = (↑2)⁻¹ζ::star ζ * ζ = 1j:Fin 2relativeUnitary ZU (phaseU ζ ) ((fun i => i) 1, ) j ^ 2 = (↑2)⁻¹ ζ::star ζ * ζ = 1relativeUnitary ZU (phaseU ζ ) ((fun i => i) 1, ) ((fun i => i) 0, ) ^ 2 = (↑2)⁻¹ζ::star ζ * ζ = 1relativeUnitary ZU (phaseU ζ ) ((fun i => i) 1, ) ((fun i => i) 1, ) ^ 2 = (↑2)⁻¹ ζ::star ζ * ζ = 1relativeUnitary ZU (phaseU ζ ) ((fun i => i) 0, ) ((fun i => i) 0, ) ^ 2 = (↑2)⁻¹ All goals completed! 🐙 ζ::star ζ * ζ = 1relativeUnitary ZU (phaseU ζ ) ((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 {ζ η : } ( : star ζ * ζ = 1) ( : star η * η = 1) (hζη : star ζ * η = Complex.I) : relativeUnitary (phaseU ζ ) (phaseU η ) = !![ω, star ω; star ω, ω] := ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.IrelativeUnitary (phaseU ζ ) (phaseU η ) = !![ω, star ω; star ω, ω] calc relativeUnitary (phaseU ζ ) (phaseU η ) = (star ω * ω) !![1 + star ζ * η, 1 - star ζ * η; 1 - star ζ * η, 1 + star ζ * η] := ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.IrelativeUnitary (phaseU ζ ) (phaseU η ) = (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] := ζ:η::star ζ * ζ = 1: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] := ζ:η::star ζ * ζ = 1: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 ω, ω] := ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I(↑2)⁻¹ !![1 + Complex.I, 1 - Complex.I; 1 - Complex.I, 1 + Complex.I] = !![ω, star ω; star ω, ω] ζ:η::star ζ * ζ = 1: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 ζ:η::star ζ * ζ = 1: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ζ:η::star ζ * ζ = 1: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 ζ:η::star ζ * ζ = 1: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ζ:η::star ζ * ζ = 1: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 ζ:η::star ζ * ζ = 1: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, )ζ:η::star ζ * ζ = 1: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, ) ζ:η::star ζ * ζ = 1: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, )ζ:η::star ζ * ζ = 1: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, )ζ:η::star ζ * ζ = 1: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, )ζ:η::star ζ * ζ = 1: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, ) ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I2⁻¹ * (1 + Complex.I) = (1 + Complex.I) * 2⁻¹ ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I2⁻¹ * (1 + Complex.I) = (1 + Complex.I) * 2⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I2⁻¹ * (1 + -Complex.I) = (1 + -Complex.I) * 2⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I2⁻¹ * (1 + -Complex.I) = (1 + -Complex.I) * 2⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I2⁻¹ * (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 {ζ η : } ( : star ζ * ζ = 1) ( : star η * η = 1) (hζη : star ζ * η = Complex.I) : IsUnbiased (phaseU ζ ) (phaseU η ) := ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.IIsUnbiased (phaseU ζ ) (phaseU η ) intro i ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.Ii:Fin 2j:Fin 2relativeUnitary (phaseU ζ ) (phaseU η ) i j ^ 2 = (↑2)⁻¹ ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.Ii:Fin 2j:Fin 2!![ω, star ω; star ω, ω] i j ^ 2 = (↑2)⁻¹ ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2!![ω, star ω; star ω, ω] ((fun i => i) 0, ) j ^ 2 = (↑2)⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2!![ω, star ω; star ω, ω] ((fun i => i) 1, ) j ^ 2 = (↑2)⁻¹ ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2!![ω, star ω; star ω, ω] ((fun i => i) 0, ) j ^ 2 = (↑2)⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.Ij:Fin 2!![ω, star ω; star ω, ω] ((fun i => i) 1, ) j ^ 2 = (↑2)⁻¹ ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I!![ω, star ω; star ω, ω] ((fun i => i) 1, ) ((fun i => i) 0, ) ^ 2 = (↑2)⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I!![ω, star ω; star ω, ω] ((fun i => i) 1, ) ((fun i => i) 1, ) ^ 2 = (↑2)⁻¹ ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I!![ω, star ω; star ω, ω] ((fun i => i) 0, ) ((fun i => i) 0, ) ^ 2 = (↑2)⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I!![ω, star ω; star ω, ω] ((fun i => i) 0, ) ((fun i => i) 1, ) ^ 2 = (↑2)⁻¹ζ:η::star ζ * ζ = 1:star η * η = 1hζη:star ζ * η = Complex.I!![ω, star ω; star ω, ω] ((fun i => i) 1, ) ((fun i => i) 0, ) ^ 2 = (↑2)⁻¹ζ:η::star ζ * ζ = 1: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 3i j (fun m n => IsUnbiased (qubitFamily m) (qubitFamily n)) i j i:Fin 3j:Fin 3hij:i jIsUnbiased (qubitFamily i) (qubitFamily j) j:Fin 3hij:(fun i => i) 0, jIsUnbiased (qubitFamily ((fun i => i) 0, )) (qubitFamily j)j:Fin 3hij:(fun i => i) 1, jIsUnbiased (qubitFamily ((fun i => i) 1, )) (qubitFamily j)j:Fin 3hij:(fun i => i) 2, jIsUnbiased (qubitFamily ((fun i => i) 2, )) (qubitFamily j) j:Fin 3hij:(fun i => i) 0, jIsUnbiased (qubitFamily ((fun i => i) 0, )) (qubitFamily j)j:Fin 3hij:(fun i => i) 1, jIsUnbiased (qubitFamily ((fun i => i) 1, )) (qubitFamily j)j:Fin 3hij:(fun i => i) 2, jIsUnbiased (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 0

The 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 0

The 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 2relativeUnitary 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 2Complex.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 2Complex.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) huComplex.normSq (u0 U) + Complex.normSq (u1 U) = 1 have h00' : (Complex.normSq (u0 U) + Complex.normSq (u1 U) : ) = 1 := U:UMat 2Complex.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 2inner (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1 U:UMat 2V:UMat 2a: := u0 Uinner (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1 U:UMat 2V:UMat 2a: := u0 Ub: := u1 Uinner (bloch U) (bloch V) = 2 * Complex.normSq (relativeUnitary U V 0 0) - 1 U:UMat 2V:UMat 2a: := u0 Ub: := u1 Uc: := u0 Vinner (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 Vinner (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 2inner (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 2inner (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 2inner (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 2inner (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 2relativeUnitary U U = 1 U:UMat 2star 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 2inner (bloch U) (bloch U) = 1 U:UMat 22 * 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 2bloch U 0 U:UMat 2h:bloch U = 0False have h0 : (0 : ) = 1 := U:UMat 2bloch 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 Vinner (bloch U) (bloch V) = 0 U:UMat 2V:UMat 2hUV:IsUnbiased U V2 * 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 Vinner (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 VComplex.normSq (relativeUnitary U V 0 0) = relativeUnitary U V 0 0 ^ 2 All goals completed! 🐙 _ = (2 : )⁻¹ := U:UMat 2V:UMat 2hUV:IsUnbiased U VrelativeUnitary 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 Bm 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 mv 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 mi 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 jinner (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_orthom 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 hlinm 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 Qubit

In 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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'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 declaration uses 'sorry'mutuallyUnbiasedBases (d : ) (hd : 2 d) : IsMaxMUBCount d ((answer(sorry) : ) d) := d:hd:2 dIsMaxMUBCount d (sorry d) All goals completed! 🐙 end OpenQuantumProblem13