RRS to QIC891, Fall 2026
Lecture 6, 2026-10-01
\Gamma ⊢ t : T
Lean's structure and class are used to define
structure ket; derives from objects previously built
structure CPTPMap, in QuantumInfo
extends Matrix → Matrix
Matrix m n α has instances for it, e.g. Matrix.add
HermitianMat, in QuantumInfo
structure MState
MState.instCoe
class InnerProductSpace, in Mathlib
class is structure with canonical instances
Lean finds canonical instances by typeclass resolution
E.g. [Fintype d]
Function types and more, with the no-cloning theorem
universe u v
#checkInnerProductSpace : (𝕜 : Type u) → (E : Type v) → [RCLike 𝕜] → [SeminormedAddCommGroup E] → Type (max u v) @InnerProductSpace.{u, v}
InnerProductSpace : (𝕜 : Type u) → (E : Type v) → [RCLike 𝕜] → [SeminormedAddCommGroup E] → Type (max u v)#printclass InnerProductSpace.{u_4, u_5} (𝕜 : Type u_4) (E : Type u_5) [RCLike 𝕜] [SeminormedAddCommGroup E] :
Type (max u_4 u_5)
number of parameters: 4
parents:
InnerProductSpace.toNormedSpace : NormedSpace 𝕜 E
InnerProductSpace.toInner : Inner 𝕜 E
fields:
SMul.smul : 𝕜 → E → E
SemigroupAction.mul_smul : ∀ (x y : 𝕜) (b : E), (x * y) • b = x • y • b
MulAction.one_smul : ∀ (b : E), 1 • b = b
DistribMulAction.smul_zero : ∀ (a : 𝕜), a • 0 = 0
DistribMulAction.smul_add : ∀ (a : 𝕜) (x y : E), a • (x + y) = a • x + a • y
Module.add_smul : ∀ (r s : 𝕜) (x : E), (r + s) • x = r • x + s • x
Module.zero_smul : ∀ (x : E), 0 • x = 0
NormedSpace.norm_smul_le : ∀ (a : 𝕜) (b : E), ‖a • b‖ ≤ ‖a‖ * ‖b‖
Inner.inner : E → E → 𝕜
InnerProductSpace.norm_sq_eq_re_inner : ∀ (x : E), ‖x‖ ^ 2 = RCLike.re (inner 𝕜 x x)
InnerProductSpace.conj_inner_symm : ∀ (x y : E), (starRingEnd 𝕜) (inner 𝕜 y x) = inner 𝕜 x y
InnerProductSpace.add_left : ∀ (x y z : E), inner 𝕜 (x + y) z = inner 𝕜 x z + inner 𝕜 y z
InnerProductSpace.smul_left : ∀ (x y : E) (r : 𝕜), inner 𝕜 (r • x) y = (starRingEnd 𝕜) r * inner 𝕜 x y
constructor:
InnerProductSpace.mk.{u_4, u_5} {𝕜 : Type u_4} {E : Type u_5} [RCLike 𝕜] [SeminormedAddCommGroup E]
[toNormedSpace : NormedSpace 𝕜 E] [toInner : Inner 𝕜 E]
(norm_sq_eq_re_inner : ∀ (x : E), ‖x‖ ^ 2 = RCLike.re (inner 𝕜 x x))
(conj_inner_symm : ∀ (x y : E), (starRingEnd 𝕜) (inner 𝕜 y x) = inner 𝕜 x y)
(add_left : ∀ (x y z : E), inner 𝕜 (x + y) z = inner 𝕜 x z + inner 𝕜 y z)
(smul_left : ∀ (x y : E) (r : 𝕜), inner 𝕜 (r • x) y = (starRingEnd 𝕜) r * inner 𝕜 x y) : InnerProductSpace 𝕜 E
field notation resolution order:
InnerProductSpace, NormedSpace, Inner, Module, DistribMulAction, MulAction, SemigroupAction, SMul InnerProductSpace
class InnerProductSpace.{u_4, u_5} (𝕜 : Type u_4) (E : Type u_5) [RCLike 𝕜] [SeminormedAddCommGroup E] :
Type (max u_4 u_5)
number of parameters: 4
parents:
InnerProductSpace.toNormedSpace : NormedSpace 𝕜 E
InnerProductSpace.toInner : Inner 𝕜 E
fields:
SMul.smul : 𝕜 → E → E
SemigroupAction.mul_smul : ∀ (x y : 𝕜) (b : E), (x * y) • b = x • y • b
MulAction.one_smul : ∀ (b : E), 1 • b = b
DistribMulAction.smul_zero : ∀ (a : 𝕜), a • 0 = 0
DistribMulAction.smul_add : ∀ (a : 𝕜) (x y : E), a • (x + y) = a • x + a • y
Module.add_smul : ∀ (r s : 𝕜) (x : E), (r + s) • x = r • x + s • x
Module.zero_smul : ∀ (x : E), 0 • x = 0
NormedSpace.norm_smul_le : ∀ (a : 𝕜) (b : E), ‖a • b‖ ≤ ‖a‖ * ‖b‖
Inner.inner : E → E → 𝕜
InnerProductSpace.norm_sq_eq_re_inner : ∀ (x : E), ‖x‖ ^ 2 = RCLike.re (inner 𝕜 x x)
InnerProductSpace.conj_inner_symm : ∀ (x y : E), (starRingEnd 𝕜) (inner 𝕜 y x) = inner 𝕜 x y
InnerProductSpace.add_left : ∀ (x y z : E), inner 𝕜 (x + y) z = inner 𝕜 x z + inner 𝕜 y z
InnerProductSpace.smul_left : ∀ (x y : E) (r : 𝕜), inner 𝕜 (r • x) y = (starRingEnd 𝕜) r * inner 𝕜 x y
constructor:
InnerProductSpace.mk.{u_4, u_5} {𝕜 : Type u_4} {E : Type u_5} [RCLike 𝕜] [SeminormedAddCommGroup E]
[toNormedSpace : NormedSpace 𝕜 E] [toInner : Inner 𝕜 E]
(norm_sq_eq_re_inner : ∀ (x : E), ‖x‖ ^ 2 = RCLike.re (inner 𝕜 x x))
(conj_inner_symm : ∀ (x y : E), (starRingEnd 𝕜) (inner 𝕜 y x) = inner 𝕜 x y)
(add_left : ∀ (x y z : E), inner 𝕜 (x + y) z = inner 𝕜 x z + inner 𝕜 y z)
(smul_left : ∀ (x y : E) (r : 𝕜), inner 𝕜 (r • x) y = (starRingEnd 𝕜) r * inner 𝕜 x y) : InnerProductSpace 𝕜 E
field notation resolution order:
InnerProductSpace, NormedSpace, Inner, Module, DistribMulAction, MulAction, SemigroupAction, SMul
No-cloning theorem located at: QuantumInfo/Operators/Unitary.lean.
We use it to study:
Dependent function types,
and the universal quantifier ∀
Many more tactics,
and the use of other definitions and theorems
Function_types in Blackboard.lean
Current state of quantum information formalization
Mathlib, CSLib, Physlib, QuantumInfo
There's still a lot to be done!
Contributing to open-source libraries is important:
A network of results that smoothly interface is another layer of trust
Getting definitions, statements, and foundations right becomes the hard part
Where to go from here?
What in physics can be formalized?
How to make the best use of this?