Exact Lean source
TensorFlatProjectorEmbedding
formalization/Cloning/TensorFlatProjectorEmbedding.lean
Source hash: 0b053eab923a52ec401760f57b65f71f7a82228c8b6c4641d677793f61546eba
Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.
The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.
Declarations in this module
definition
Cloning.TensorLie.registerEmbeddingtheorem Cloning.TensorLie.registerEmbedding_basistheorem Cloning.TensorLie.registerEmbedding_singletheorem Cloning.TensorLie.registerEmbedding_applytheorem Cloning.TensorLie.registerEmbedding_apply_imagetheorem Cloning.TensorLie.registerEmbedding_apply_not_memtheorem Cloning.TensorLie.registerEmbedding_adjoint_applytheorem Cloning.TensorLie.slotGenerator_basisdefinition Cloning.TensorLie.coordinateWordEmbeddingdefinition Cloning.TensorLie.coordinateTensorEmbeddingtheorem Cloning.TensorLie.coordinateTensorEmbedding_basis1import Cloning.TensorFlatProjectorLaw
2
3/-! Literal coordinate inclusions of finite physical tensor registers. -/
4noncomputable section
5open scoped BigOperators InnerProductSpace
6namespace Cloning.TensorLie
7open Cloning.PCT
8set_option maxHeartbeats 1000000
9set_option backward.isDefEq.respectTransparency false
10variable {A B : Type*} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B]
11
12/-- The genuine Hilbert-space embedding induced by an injection of basis labels. -/
13def registerEmbedding (ι : A ↪ B) : Register A →ₗᵢ[ℂ] Register B :=
14 (((registerBasis B).orthonormal.comp ι ι.injective).orthogonalFamily).linearIsometry
15
16@[simp] theorem registerEmbedding_basis (ι : A ↪ B) (a : A) :
17 registerEmbedding ι (registerBasis A a) = registerBasis B (ι a) := by
18 rw [registerBasis_apply, registerEmbedding, OrthogonalFamily.linearIsometry_apply_single]
19 exact one_smul ℂ _
20
21@[simp] theorem registerEmbedding_single (ι : A ↪ B) (a : A) :
22 registerEmbedding ι (lp.single 2 a 1) = lp.single 2 (ι a) 1 := by
23 simpa only [registerBasis_apply] using registerEmbedding_basis ι a
24
25/-- Every coefficient is the actual zero extension along the injection. -/
26theorem registerEmbedding_apply (ι : A ↪ B) (x : Register A) (b : B) :
27 registerEmbedding ι x b = ∑ a : A, if ι a = b then x a else 0 := by
28 rw [← (registerBasis A).toOrthonormalBasis.sum_repr x, map_sum]
29 simp only [map_smul, lp.coeFn_sum, Finset.sum_apply, lp.coeFn_smul, Pi.smul_apply,
30 HilbertBasis.coe_toOrthonormalBasis, OrthonormalBasis.repr_apply_apply,
31 registerEmbedding_basis, registerBasis_apply, registerEmbedding_single, register_inner_single,
32 lp.single_apply, Pi.single_apply]
33 apply Finset.sum_congr rfl
34 intro a _
35 split_ifs <;> simp_all
36
37@[simp] theorem registerEmbedding_apply_image (ι : A ↪ B) (x : Register A) (a : A) :
38 registerEmbedding ι x (ι a) = x a := by
39 rw [registerEmbedding_apply]
40 simp [ι.injective.eq_iff]
41
42theorem registerEmbedding_apply_not_mem (ι : A ↪ B) (x : Register A) (b : B)
43 (hb : b ∉ Set.range ι) : registerEmbedding ι x b = 0 := by
44 rw [registerEmbedding_apply]
45 apply Finset.sum_eq_zero
46 intro a _
47 simp only [if_neg (fun h => hb ⟨a,h⟩)]
48
49@[simp] theorem registerEmbedding_adjoint_apply (ι : A ↪ B) (y : Register B) (a : A) :
50 (registerEmbedding ι).toContinuousLinearMap.adjoint y a = y (ι a) := by
51 rw [← register_inner_single]
52 change ⟪lp.single 2 a 1, (registerEmbedding ι).toContinuousLinearMap.adjoint y⟫_ℂ = _
53 rw [ContinuousLinearMap.adjoint_inner_right]
54 change ⟪registerEmbedding ι (lp.single 2 a 1), y⟫_ℂ = _
55 rw [registerEmbedding_single, register_inner_single]
56
57/-- A matrix unit replaces exactly one letter of a computational word. -/
58theorem slotGenerator_basis {n : ℕ} (t : Fin n) (a b : A) (v : Fin n → A) :
59 slotGenerator t a b (registerBasis _ v) =
60 if v t = b then registerBasis _ (Function.update v t a) else 0 := by
61 by_cases hv : v t = b
62 · rw [if_pos hv]
63 ext w
64 rw [slotGenerator_apply]
65 by_cases hw : w = Function.update v t a
66 · subst w
67 have he : Function.update (Function.update v t a) t b = v := by
68 rw [Function.update_idem, ← hv, Function.update_eq_self]
69 simp only [registerBasis_apply, lp.single_apply, Function.update_self, if_true,
70 Pi.single_eq_same]
71 rw [he]
72 simp
73 · have he : w t = a → Function.update w t b ≠ v := by
74 intro ha heq
75 have hu := (update_relation t a b w v).mp ⟨ha,heq.symm⟩
76 exact hw hu.2
77 by_cases ha : w t = a
78 · simp [ha, registerBasis_apply, lp.single_apply, he ha, hw]
79 · have hw' : Function.update v t a ≠ w := Ne.symm hw
80 simp [ha, registerBasis_apply, lp.single_apply, hw, hw']
81 · rw [if_neg hv]
82 ext w
83 have he : Function.update w t b ≠ v := by
84 intro h
85 have hh := congrFun h t
86 exact hv (by simpa using hh.symm)
87 simp [slotGenerator_apply, registerBasis_apply, lp.single_apply, he]
88
89/-- The coordinate embedding on the literal tensor word basis. -/
90def coordinateWordEmbedding (n r k : ℕ) : (Fin n → Fin r) ↪ (Fin n → Fin (r+k)) where
91 toFun v := fun t => Fin.castAdd k (v t)
92 inj' v w h := by
93 funext t
94 apply Fin.ext
95 exact congrArg (fun z : Fin (r+k) => z.val) (congrFun h t)
96
97def coordinateTensorEmbedding (n r k : ℕ) :
98 TensorRegister n (Fin r) →ₗᵢ[ℂ] TensorRegister n (Fin (r+k)) :=
99 registerEmbedding (coordinateWordEmbedding n r k)
100
101@[simp] theorem coordinateTensorEmbedding_basis (n r k : ℕ) (v : Fin n → Fin r) :
102 coordinateTensorEmbedding n r k (registerBasis _ v) =
103 registerBasis _ (fun t => Fin.castAdd k (v t)) := registerEmbedding_basis _ _
104
105end Cloning.TensorLie