induction n with
| zero => change Fintype.card Unit = 1; exact Fintype.card_unique
| succ n ih =>
change Fintype.card (Bool×KeyWord n) = _
rw [Fintype.card_prod,Fintype.card_bool,ih,pow_succ,mul_comm]
lemmaof_implementation (p : KeyImplementation a b ell messages)
(hAC : p.discussion.transcriptLaw ≪ ν) :
IsCompletedKeyOutputR hR P hP messages ν (p.output R hR P hP ν hAC) :=by
proof · 4
lines
apply (isCompletedKeyOutput_iff_original R hR P hP messages ν _).2
refine ⟨fun _ => p,fun _ => hAC,?_⟩
simpa only [KeyDensity.distance_self] using
(tendsto_const_nhds : Tendsto (fun_ : ℕ=> (0 : ℝ)) atTop (nhds 0))
lemmaouter_groupVector {a b c d : ℕ} (u : Fin a ×Fin b →ℂ) (v : Fin c ×Fin d →ℂ) :
outer (groupVector u v) (groupVector u v) = groupTensor (outer u u) (outer v v) :=by
proof · 3
lines
ext i j
simp only [outer,groupVector,groupTensor,Matrix.submatrix_apply,Matrix.kroneckerMap_apply,star_mul]
ring
lemmatensorMap_kronecker {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(A : Mat a) (B : Mat c) : tensorMap LM (A ⊗ₖ B) = LA ⊗ₖ MB:=by
proof · 12
lines
ext ⟨i,k⟩ ⟨j,l⟩
simp only [tensorMap,Matrix.kronecker_apply]
have hL := linearMap_matrix_units_apply LA i j
have hM := linearMap_matrix_units_apply MB k l
rw [hL,hM]
simp only [Finset.sum_mul]
simp only [Finset.mul_sum]
apply Finset.sum_congr rfl; intro x _
apply Finset.sum_congr rfl; intro y _
apply Finset.sum_congr rfl; intro z _
apply Finset.sum_congr rfl; intro w _
ring
lemmatensorLinear_unit {a b c d : ℕ} (L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(x y : Fin (a*c)) (i j : Fin (b*d)) :
tensorLinear LM (matrixUnit x y) i j =
L (matrixUnit (finProdFinEquiv.symm x).1 (finProdFinEquiv.symm y).1)
(finProdFinEquiv.symm i).1 (finProdFinEquiv.symm j).1 *
M (matrixUnit (finProdFinEquiv.symm x).2 (finProdFinEquiv.symm y).2)
(finProdFinEquiv.symm i).2 (finProdFinEquiv.symm j).2:=by
lemmatensorMap_groupTensor {a b c d e f g h : ℕ}
(L : Mat a →ₗ[ℂ] Mat b) (M : Mat c →ₗ[ℂ] Mat d)
(N : Mat e →ₗ[ℂ] Mat f) (P : Mat g →ₗ[ℂ] Mat h)
(U : Matrix (Fin a ×Fin c) (Fin a ×Fin c) ℂ)
(V : Matrix (Fin e ×Fin g) (Fin e ×Fin g) ℂ) :
tensorMap (tensorLinear LN) (tensorLinear MP) (groupTensor UV) =
groupTensor (tensorMap LMU) (tensorMap NPV) :=by
proof · 23
lines
ext ⟨i,k⟩ ⟨j,l⟩
simp only [tensorMap, tensorLinear_unit,groupTensor,Matrix.submatrix_apply,
Matrix.kronecker_apply,groupIndex,Equiv.coe_fn_mk]
simp_rw [←Equiv.sum_comp (finProdFinEquiv : Fin a ×Fin e ≃ _)]
simp_rw [←Equiv.sum_comp (finProdFinEquiv : Fin c ×Fin g ≃ _)]
simp only [Equiv.symm_apply_apply,Fintype.sum_prod_type]
simp only [Finset.sum_mul]
simp only [Finset.mul_sum]
apply Finset.sum_congr rfl; intro x _
rw [Finset.sum_comm]
apply Finset.sum_congr rfl; intro y _
conv_lhs => arg 2; ext xv; rw [Finset.sum_comm]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl; intro z _
conv_lhs => arg 2; ext xv; arg 2; ext yv; rw [Finset.sum_comm]
conv_lhs => arg 2; ext xv; rw [Finset.sum_comm]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl; intro w _
apply Finset.sum_congr rfl; intro xv _
apply Finset.sum_congr rfl; intro yv _
apply Finset.sum_congr rfl; intro zv _
apply Finset.sum_congr rfl; intro wv _
ring
lemmaInClass.groupTensor {a b c d : ℕ}
{R : Matrix (Fin a ×Fin b) (Fin a ×Fin b) ℂ}
{S : Matrix (Fin c ×Fin d) (Fin c ×Fin d) ℂ}
(hR : InClassR) (hS : InClassS) : InClass (groupTensor RS) :=by
lemmaeventually_length_zero (hc : InClassR) (hs : s.Secure) :
∀ᶠ k in atTop, s.length k = 0:=by
proof · 5
lines
havehe : ∀ᶠ k in atTop, s.error k < 1/5:= (tendsto_order.mp hs).2 _ (by norm_num)
filter_upwards [he] with k hk
by_contra hn
exact (not_lt_of_ge ((s.trial k).uniform_error (hc.positiveCopies k)
(Nat.pos_of_ne_zero hn))) hk