Optimal Weights #
This module constructs the truly multidimensional optimal weights $\lambda$ for the Krafft Sieve and explores the properties of the resulting polynomial $P(x)$ and weight $W_\lambda(x)$.
Define the basis function for a subset of prime indices $S \subseteq \{1, \dots, w\}$. The basis function is the product of the 3rd harmonic cosines for each prime in $S$. $$ B_S(x) = \prod_{i \in S} \cos\left( \frac{6\pi x}{p_i} \right) $$
Equations
- KrafftSieve.basisCos n S x = ∏ i ∈ S, Real.cos (2 * Real.pi * 3 * ↑x.val / ↑(KrafftSieve.p n i))
Instances For
Define the multidimensional polynomial $P(x)$ as a linear combination of the basis functions $B_S(x)$ with coefficients $\lambda_S$. $$ P(x) = \sum_{S \subseteq \{1, \dots, w\}} \lambda_S B_S(x) $$
Equations
- KrafftSieve.pMulti n lambda x = ∑ S ∈ Finset.univ.powerset, lambda S * KrafftSieve.basisCos n S x
Instances For
Define the truly multidimensional weight function $W_{\lambda}(x)$ as the square of the polynomial $P(x)$ restricted to the interval $\mathcal{A}_n$. $$ W_{\lambda}(x) = \begin{cases} (P(x))^2 & \text{if } x \in \mathcal{A}_n \\ 0 & \text{otherwise} \end{cases} $$
Equations
- KrafftSieve.wTrulyMulti n lambda x = if x.val ∈ KrafftSieve.evalInterval n then KrafftSieve.pMulti n lambda x ^ 2 else 0
Instances For
Define the matrix $M_1$ corresponding to the first moment $sum1$. $M_1(S, T) = \sum_{x \in \mathcal{A}_n} B_S(x) B_T(x)$
Equations
- KrafftSieve.matrix1 n S T = ∑ x ∈ KrafftSieve.evalInterval n, KrafftSieve.basisCos n S ↑x * KrafftSieve.basisCos n T ↑x
Instances For
Define the matrix $M_2$ corresponding to the second moment $sum2$. $M_2(S, T) = \sum_{x \in \mathcal{A}_n} c(x) B_S(x) B_T(x)$
Equations
- KrafftSieve.matrix2 n S T = ∑ x ∈ KrafftSieve.evalInterval n, KrafftSieve.c n ↑x * KrafftSieve.basisCos n S ↑x * KrafftSieve.basisCos n T ↑x
Instances For
Define the quadratic form $q1(\lambda) = \lambda^T M_1 \lambda$.
Equations
- KrafftSieve.q1 n lambda = ∑ S ∈ Finset.univ.powerset, ∑ T ∈ Finset.univ.powerset, lambda S * KrafftSieve.matrix1 n S T * lambda T
Instances For
Define the quadratic form $q2(\lambda) = \lambda^T M_2 \lambda$.
Equations
- KrafftSieve.q2 n lambda = ∑ S ∈ Finset.univ.powerset, ∑ T ∈ Finset.univ.powerset, lambda S * KrafftSieve.matrix2 n S T * lambda T
Instances For
Define the Rayleigh quotient $R(\lambda) = \frac{q2(\lambda)}{q1(\lambda)}$. Defined to be $\infty$ if $q1(\lambda) = 0$ (though $q1$ is positive definite on non-zero $\lambda$ if the basis is linearly independent on $evalInterval$).
Equations
- KrafftSieve.Ratio n lambda = if KrafftSieve.q1 n lambda = 0 then 0 else KrafftSieve.q2 n lambda / KrafftSieve.q1 n lambda
Instances For
The truly multidimensional weight function is supported on $\mathcal{A}_n$.
Define the set of attainable ratios.
Equations
- KrafftSieve.attainableRatios n = {r : ℝ | ∃ (lambda : Finset (Fin (KrafftSieve.w n)) → ℝ), KrafftSieve.q1 n lambda > 0 ∧ r = KrafftSieve.Ratio n lambda}
Instances For
Define $\mu_{min}(n)$ as the infimum of the attainable ratios.
Equations
Instances For
Theorem: If the minimum attainable ratio $\mu_{min}(n)$ is strictly less than 1, then the Krafft Sufficiency condition holds.
Abbreviation for the index set of the coefficients, which is the power set of prime indices.
Equations
- KrafftSieve.Idx n = Finset (Fin (KrafftSieve.w n))
Instances For
The kernel of the quadratic form $q1$.
Equations
- KrafftSieve.kernelQ1 n = { carrier := {lambda : KrafftSieve.Idx n → ℝ | KrafftSieve.q1 n lambda = 0}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
Instances For
Define the standard dot product on the space of coefficients.
Equations
- KrafftSieve.dotProduct n u v = ∑ S : KrafftSieve.Idx n, u S * v S
Instances For
The orthogonal complement of the kernel of $q1$ with respect to the standard dot product.
Equations
- KrafftSieve.kernelQ1Perp n = { carrier := {v : KrafftSieve.Idx n → ℝ | ∀ u ∈ KrafftSieve.kernelQ1 n, KrafftSieve.dotProduct n u v = 0}, add_mem' := ⋯, zero_mem' := ⋯, smul_mem' := ⋯ }
Instances For
The unit sphere in the orthogonal complement of the kernel of $q1$.
Equations
- KrafftSieve.spherePerp n = {lambda : KrafftSieve.Idx n → ℝ | lambda ∈ KrafftSieve.kernelQ1Perp n ∧ KrafftSieve.dotProduct n lambda lambda = 1}
Instances For
Lemma: $q1$ is strictly positive on the unit sphere of the orthogonal complement.
Lemma: For any vector $v$, the square of any component is bounded by the dot product.
Lemma: Any vector can be decomposed into a component in the kernel of $q1$ and a component in the orthogonal complement.
Lemma: The unit sphere in the orthogonal complement is compact.
Lemma: For any $\lambda$ with $q1(\lambda) > 0$, there exists $v \in \text{sphere\_perp}(n)$ such that $\text{Ratio}(n, \lambda) = \text{Ratio}(n, v)$.
Lemma: The set of attainable ratios is the image of the unit sphere in the orthogonal complement under the Rayleigh quotient map.
Lemma: The set of attainable ratios is compact.
Define the optimal coefficient vector $\lambda_{opt}$ which attains the minimum ratio.
Equations
Instances For
Define the optimal truly multidimensional weight function $W_{opt}$.