Affine extractor MAC: authentication and classical/quantum extraction
OpenQAlgorithms.Papers.Independent.Intakenext100.P14.affine_extractor_macLet , choose fixed binary coordinates on , and let project to the first bits. Let be independent and uniform, with and . Define . Impersonation succeeds with probability . After seeing the tag of a fixed message, any substitution strategy that selects a different message and a forged tag as functions of that observed tag also succeeds with probability .
Let have any finite joint distribution, let , and let be a normalized -qubit state depending only on . The key is independent of . For every ,
Here is a fresh independent uniform tag, entropy uses average guessing probability and event deletion without renormalization, and is half the trace norm. The Lean bounds use and with ; this includes and entropy . This single result supplies both authentication and extraction; replay is excluded.
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P14
noncomputable section
namespace QAlgorithms.Papers.Independent.Intakenext100.P14
open scoped Matrix ComplexConjugate
open QAlgorithms.Papers.Independent.Dependency50.P47 (Law)
open QAlgorithms.Papers.Independent.Gap48.P11 (blockMatrix cqDistance)
open QAlgorithms.Papers.Independent.Claimed50.P31 (bb84Vector)
open QAlgorithms.Papers.Independent.Advance50.P05 (RectangularInstrument)
attribute [local instance] Classical.propDecidable
attribute [local instance] Classical.decEq
/-- Positive list length and inhabited fibers supply the tagged union's inhabitant.
This derived instance adds no hypothesis to Lemma 2.2. -/
local instance {m : ℕ} [NeZero m] {A : Fin m → Type*}
[∀ i, Nonempty (A i)] : Nonempty (Sigma A) :=
⟨⟨0, Classical.choice (inferInstance : Nonempty (A 0))⟩⟩
/-- PDF p.15, the concrete affine extractor-MAC example. The authentication
probabilities include impersonation and adaptive DIFFERENT-message substitution.
The square-root bounds are exactly the displayed exponential bounds, expressed
via the retained guessing probability (zero means entropy +infinity). -/
theorem affine_extractor_mac
{K : Type*} {S : Type} {Z : Type*} [Field K] [Fintype K] [Algebra (ZMod 2) K]
[Fintype S] [Nonempty S] [Fintype Z] [Nonempty Z]
{N ell q : ℕ} (hpositive : 1 ≤ ell) (hell : ell ≤ N)
(coordinates : K ≃ₗ[ZMod 2] (Fin N → ZMod 2))
(p : Law S) (X : S → K) (z : S → Z)
(rho : K → Z → Matrix (QAlgorithms.Qubits q) (QAlgorithms.Qubits q) ℂ)
(hrho : ∀ x z, QAlgorithms.IsDensityMatrix (rho x z))
(epsilon : ℝ) (hepsilon : 0 ≤ epsilon) :
(∀ x : K, ∀ t : Fin ell → ZMod 2,
keyMass (K := K) ell * ∑ key : K × (Fin ell → ZMod 2),
(if affineTag coordinates hell key x = t then 1 else 0) = ((2 : ℝ) ^ ell)⁻¹) ∧
(∀ x : K, ∀ change : (Fin ell → ZMod 2) → K,
∀ forge : (Fin ell → ZMod 2) → (Fin ell → ZMod 2),
(∀ t, change t ≠ x) →
keyMass (K := K) ell * ∑ key : K × (Fin ell → ZMod 2),
(if affineTag coordinates hell key (change (affineTag coordinates hell key x)) =
forge (affineTag coordinates hell key x) then 1 else 0) = ((2 : ℝ) ^ ell)⁻¹) ∧
QAlgorithms.tvDist (classicalTagLaw coordinates hell p X z)
(classicalIdealTagLaw (K := K) ell p z) ≤
(1 / 2) * Real.sqrt ((2 : ℝ) ^ ell * smoothGuess p.prob X z epsilon) + 2 * epsilon ∧
cqDistance (quantumTagLaw coordinates hell p X z rho)
(quantumIdealTagLaw ell p X z rho) ≤
(1 / 2) * Real.sqrt ((2 : ℝ) ^ (q + ell) * smoothGuess p.prob X z epsilon) +
2 * epsilon := by sorry
end QAlgorithms.Papers.Independent.Intakenext100.P14
end
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
Let be a finite field equipped with an algebra structure over , let be finite nonempty types, and let be natural numbers with , allowing . Let be an -linear equivalence, let satisfy and , let and , and suppose every matrix , indexed by , is positive semidefinite with trace . Let , define for , and put . Then all four following assertions hold. First, for every and ,
Second, for every , every function , and every function , if for every , then
For the remaining assertions, define
where the retained weights are not renormalized. For , define the scalar functions and matrix families
The third and fourth assertions are
where places the matrices into diagonal blocks indexed by , and . Individual may be zero, and no upper bound on is assumed; when , the zero retained family is admissible and .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.