Offline · exact source
Exact Lean source

TensorFlatProjectorSupport

formalization/Cloning/TensorFlatProjectorSupport.lean

Source hash: 671dd1c059ab98ff29464fd5901c9e0918af973edb5b12c8cd845cc06dbaf6f2

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
1import Cloning.TensorFlatProjectorNaturality
2 
3/-! Literal physical support projection for the first `r` one-particle coordinates. -/
4noncomputable section
5open scoped BigOperators InnerProductSpace
6namespace Cloning.TensorLie
7open Cloning.PCT
8set_option maxHeartbeats 1000000
9set_option backward.isDefEq.respectTransparency false
10variable {n r k : ℕ}
11 
12def coordinateSupportMatrix (r k : ℕ) : Matrix (Fin (r+k)) (Fin (r+k)) ℂ :=
13  Matrix.diagonal (fun a => if a.val < r then 1 else 0)
14 
15def coordinateTensorProjection (n r k : ℕ) :
16    TensorRegister n (Fin (r+k)) →L[ℂ] TensorRegister n (Fin (r+k)) :=
17  (coordinateTensorEmbedding n r k).toContinuousLinearMap.comp
18    (coordinateTensorEmbedding n r k).toContinuousLinearMap.adjoint
19 
20theorem coordinateWordEmbedding_range (w : Fin n → Fin (r+k)) :
21    w ∈ Set.range (coordinateWordEmbedding n r k) ↔ ∀ t, (w t).val < r := by
22  constructor
23  · rintro ⟨v,rfl⟩ t
24    exact (v t).isLt
25  · intro hw
26    exact ⟨fun t => ⟨(w t).val,hw t⟩, funext (fun t => Fin.ext rfl)⟩
27 
28/-- The projection keeps precisely the words whose letters lie in the support. -/
29theorem coordinateTensorProjection_apply (y : TensorRegister n (Fin (r+k)))
30    (w : Fin n → Fin (r+k)) :
31    coordinateTensorProjection n r k y w = if ∀ t, (w t).val < r then y w else 0 := by
32  by_cases hw : ∀ t, (w t).val < r
33  · rw [if_pos hw]
34    obtain ⟨v,rfl⟩ := coordinateWordEmbedding_range w |>.mpr hw
35    simp only [coordinateTensorProjection, ContinuousLinearMap.comp_apply,
36      coordinateTensorEmbedding, LinearIsometry.coe_toContinuousLinearMap, registerEmbedding_apply_image, registerEmbedding_adjoint_apply]
37  · rw [if_neg hw]
38    exact registerEmbedding_apply_not_mem _ _ w
39      (fun he => hw (coordinateWordEmbedding_range w |>.mp he))
40 
41/-- The coordinate projection is the literal tensor power of the rank-r matrix. -/
42theorem coordinateTensorProjection_eq_tensorOperator :
43    coordinateTensorProjection n r k = tensorOperator n (coordinateSupportMatrix r k) := by
44  ext y w
45  rw [coordinateTensorProjection_apply]
46  change _ = tensorOperator n (Matrix.diagonal _) y w
47  rw [tensorOperator_diagonal_apply]
48  by_cases hw : ∀ t, (w t).val < r
49  · simp [hw]
50  · rw [if_neg hw]
51    push_neg at hw
52    obtain ⟨t,ht⟩ := hw
53    have hp : (∏ s : Fin n, if (w s).val < r then (1:ℂ) else 0) = 0 := by
54      exact Finset.prod_eq_zero (Finset.mem_univ t) (if_neg (not_lt.mpr ht))
55    rw [hp, zero_mul]
56 
57@[simp] theorem coordinateTensorProjection_embedding (x : TensorRegister n (Fin r)) :
58    coordinateTensorProjection n r k (coordinateTensorEmbedding n r k x) =
59      coordinateTensorEmbedding n r k x := by
60  ext w
61  rw [coordinateTensorProjection_apply]
62  split_ifs with hw
63  · rfl
64  · exact (registerEmbedding_apply_not_mem _ x w
65      (fun he => hw (coordinateWordEmbedding_range w |>.mp he))).symm
66 
67/-- The adjoint inclusion reads off supported tensor coefficients. -/
68theorem coordinateTensorEmbedding_adjoint_collective
69    (y : TensorRegister n (Fin (r+k))) (a b : Fin r) :
70    (coordinateTensorEmbedding n r k).toContinuousLinearMap.adjoint
71      (collectiveGenerator n (Fin.castAdd k a) (Fin.castAdd k b) y) =
72      collectiveGenerator n a b ((coordinateTensorEmbedding n r k).toContinuousLinearMap.adjoint y) := by
73  let I := (coordinateTensorEmbedding n r k).toContinuousLinearMap
74  have he : I.comp (collectiveGenerator n b a) =
75      (collectiveGenerator n (Fin.castAdd k b) (Fin.castAdd k a)).comp I := by
76    apply ContinuousLinearMap.ext
77    intro x
78    exact coordinateTensorEmbedding_collective x b a
79  have hh := congrArg ContinuousLinearMap.adjoint he
80  simp only [ContinuousLinearMap.adjoint_comp, collectiveGenerator_adjoint] at hh
81  exact (congrArg (fun T => T y) hh).symm
82 
83theorem coordinateTensorProjection_collective
84    (y : TensorRegister n (Fin (r+k))) (a b : Fin r) :
85    coordinateTensorProjection n r k
86      (collectiveGenerator n (Fin.castAdd k a) (Fin.castAdd k b) y) =
87      collectiveGenerator n (Fin.castAdd k a) (Fin.castAdd k b)
88        (coordinateTensorProjection n r k y) := by
89  change coordinateTensorEmbedding n r k
90    ((coordinateTensorEmbedding n r k).toContinuousLinearMap.adjoint
91      (collectiveGenerator n (Fin.castAdd k a) (Fin.castAdd k b) y)) = _
92  rw [coordinateTensorEmbedding_adjoint_collective, coordinateTensorEmbedding_collective]
93  rfl
94 
95/-- A lowering step into an unsupported letter has zero supported compression. -/
96theorem coordinateTensorProjection_collective_outside
97    (y : TensorRegister n (Fin (r+k))) (a : Fin k) (b : Fin (r+k)) :
98    coordinateTensorProjection n r k (collectiveGenerator n (Fin.natAdd r a) b y) = 0 := by
99  ext w
100  rw [coordinateTensorProjection_apply]
101  by_cases hw : ∀ t, (w t).val < r
102  · rw [if_pos hw, collectiveGenerator_apply]
103    apply Finset.sum_eq_zero
104    intro t _
105    have hne : w t ≠ Fin.natAdd r a := by
106      intro he
107      have hh := congrArg Fin.val he
108      have ht := hw t
109      change (w t).val = r+a.val at hh
110      omega
111    simp [hne]
112  · simp [hw]
113 
114end Cloning.TensorLie