weighted_harmonic_ratio_le_one_iff
For any finite nonempty set of components with positive weights W_j > 0 and ratios r_j in (0, 1], the ratio α* = (∑_j W_j) / (∑_j W_j / r_j) satisfies α* ≤ 1, with equality if and only if r_j = 1 for all j.
Statement
theorem weighted_harmonic_ratio_le_one_iff {M : Type*} [Fintype M] [Nonempty M] (W : M → ℝ) (r : M → ℝ) (hW : ∀ j, 0 < W j) (hr_pos : ∀ j, 0 < r j) (hr_le : ∀ j, r j ≤ 1) : let W_bar := Finset.univ.sum W let α_star := W_bar / Finset.univ.sum (fun j => W j / r j) α_star ≤ 1 ∧ (α_star = 1 ↔ ∀ j, r j = 1)
- Source
- arXiv:2610.29731 Lemma 4 proof
- Verified
- 23 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext
Read back from the Lean
For any nonempty finite type $M$ and any functions $W, r : M \to \mathbb{R}$, if $W(j) > 0$, $r(j) > 0$, and $r(j) \le 1$ for all $j \in M$, then defining $\overline{W} = \sum_{j \in M} W(j)$ and $\alpha^* = \frac{\overline{W}}{\sum_{j \in M} (W(j) / r(j))}$, it holds that $\alpha^* \le 1$, and $\alpha^* = 1$ if and only if $r(j) = 1$ for all $j \in M$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
Because each multiplier satisfies 0 < r_j ≤ 1, each term satisfies W_j ≤ W_j / r_j, so summing across components gives W_bar ≤ ∑_j (W_j / r_j), which implies α* ≤ 1. Equality α* = 1 holds if and only if the sum of the nonnegative differences (W_j / r_j - W_j) is zero. Since a sum of nonnegative terms is zero if and only if each term is zero, this forces W_j / r_j = W_j, which simplifies to r_j = 1 for all j because the weights W_j are strictly positive.
The denominator ∑_j (W_j / r_j) is strictly positive.
After bringing the local definitions of W_bar and α_star into scope, we observe that each component satisfies W_j > 0 and r_j > 0, so each quotient W_j / r_j is strictly positive by div_pos. Since M is a nonempty finite type, its universal finset is nonempty (Finset.univ_nonempty), and therefore the sum of these positive quotients is strictly positive by Finset.sum_pos.
uses
Finset.sum_pos,div_pos,Finset.univ_nonemptyintro W_bar α_star have h_denom_pos : 0 < ∑ j, W j / r j := Finset.sum_pos (fun j _ => div_pos (hW j) (hr_pos j)) Finset.univ_nonempty
For each component j, W_j ≤ W_j / r_j.
Because r_j > 0, the inequality W_j ≤ W_j / r_j is equivalent by le_div_iff₀ to W_j * r_j ≤ W_j. This product inequality holds because W_j > 0 and r_j ≤ 1, as verified by nonlinear arithmetic (nlinarith).
uses
le_div_iff₀have h_le_term : ∀ j, W j ≤ W j / r j := by intro j exact (le_div_iff₀ (hr_pos j)).mpr (by nlinarith [hW j, hr_le j])
The ratio satisfies α* ≤ 1, reducing the remaining goal to the equality characterization α* = 1 ↔ ∀ j, r_j = 1.
Summing the termwise inequalities W_j ≤ W_j / r_j across all j via Finset.sum_le_sum shows that W_bar ≤ ∑_j (W_j / r_j). Since the denominator is strictly positive, div_le_one₀ implies α* ≤ 1. The goal then splits into proving both directions of the equivalence for the equality condition.
uses
Finset.sum_le_sum,div_le_one₀have h_le_sum : W_bar ≤ ∑ j, W j / r j := Finset.sum_le_sum (fun j _ => h_le_term j) have h_le_one : α_star ≤ 1 := (div_le_one₀ h_denom_pos).mpr h_le_sum refine ⟨h_le_one, ⟨?_, ?_⟩⟩
Assuming α* = 1, the numerator equals the denominator: W_bar = ∑_j (W_j / r_j).
Since the denominator is strictly positive (and hence nonzero by ne_of_gt), div_eq_one_iff_eq implies that α* = 1 if and only if W_bar = ∑_j (W_j / r_j).
uses
div_eq_one_iff_eq,ne_of_gt· intro hα have h_sum_eq : W_bar = ∑ j, W j / r j := (div_eq_one_iff_eq (ne_of_gt h_denom_pos)).mp hα
For each component j, the difference W_j / r_j - W_j equals 0.
Distributing the sum over the difference via Finset.sum_sub_distrib shows that ∑_j (W_j / r_j - W_j) = (∑_j W_j / r_j) - W_bar, which vanishes by sub_self since the two sums are equal. Because each individual difference is nonnegative (from W_j ≤ W_j / r_j), Finset.sum_eq_zero_iff_of_nonneg implies that every single term W_j / r_j - W_j must be zero.
uses
Finset.sum_sub_distrib,sub_self,Finset.sum_eq_zero_iff_of_nonneghave h_diff_zero : ∑ j, (W j / r j - W j) = 0 := by rw [Finset.sum_sub_distrib] change (∑ j, W j / r j) - W_bar = 0 rw [← h_sum_eq, sub_self] have h_term_nonneg : ∀ j ∈ (Finset.univ : Finset M), 0 ≤ W j / r j - W j := by intro j _ have := h_le_term j linarith have h_each_zero := (Finset.sum_eq_zero_iff_of_nonneg h_term_nonneg).mp h_diff_zero
Every multiplier satisfies r_j = 1.
From W_j / r_j - W_j = 0, we have W_j / r_j = W_j. Multiplying both sides by r_j and simplifying using div_mul_cancel₀ (valid because r_j > 0) gives W_j = W_j * r_j, which can be rewritten as W_j * r_j = W_j * 1 via mul_one. Cancelling the factor W_j ≠ 0 (from W_j > 0) using mul_left_cancel₀ concludes that r_j = 1 for all j.
uses
Finset.mem_univ,div_mul_cancel₀,mul_one,mul_left_cancel₀,ne_of_gtintro j have hj_zero : W j / r j - W j = 0 := h_each_zero j (Finset.mem_univ j) have hj_eq : W j / r j = W j := by linarith have h1 : (W j / r j) * r j = W j * r j := by rw [hj_eq] rw [div_mul_cancel₀ (W j) (ne_of_gt (hr_pos j))] at h1 have h2 : W j * r j = W j * 1 := by rw [← h1, mul_one] exact mul_left_cancel₀ (ne_of_gt (hW j)) h2
If r_j = 1 for all j, the denominator ∑_j (W_j / r_j) equals W_bar.
Assuming r_j = 1 for all j, each term W_j / r_j simplifies to W_j / 1 = W_j by div_one. The sum over all j is therefore ∑_j W_j, which is by definition W_bar.
uses
div_one· intro hr_one have h_eq : (∑ j, W j / r j) = W_bar := by dsimp [W_bar] simp_rw [hr_one, div_one]
The ratio α* equals 1.
Substituting the simplified denominator into α* gives W_bar / W_bar. Since each W_j > 0 and the index set is nonempty (Finset.univ_nonempty), the sum W_bar is strictly positive by Finset.sum_pos, hence nonzero (ne_of_gt). By div_self, W_bar / W_bar = 1.
uses
Finset.sum_pos,Finset.univ_nonempty,div_self,ne_of_gtdsimp [α_star] rw [h_eq] have hW_bar_pos : 0 < W_bar := Finset.sum_pos (fun j _ => hW j) Finset.univ_nonempty exact div_self (ne_of_gt hW_bar_pos)
Finset.sum_pos- A sum of strictly positive terms over a nonempty finite set is strictly positive.
div_pos- The quotient of two strictly positive numbers is strictly positive.
Finset.univ_nonempty- The universal finset of a nonempty finite type is nonempty.
le_div_iff₀- For a strictly positive denominator c, a ≤ b / c holds if and only if a * c ≤ b.
Finset.sum_le_sum- If f(i) ≤ g(i) for all elements in a finite set, then ∑ i, f(i) ≤ ∑ i, g(i).
div_le_one₀- For a strictly positive denominator b, a / b ≤ 1 if and only if a ≤ b.
div_eq_one_iff_eq- For a nonzero denominator b, a / b = 1 if and only if a = b.
ne_of_gt- If a > b, then a ≠ b.
Finset.sum_sub_distrib- A sum of differences over a finite set equals the difference of the sums.
sub_self- Subtracting any element from itself gives zero.
Finset.sum_eq_zero_iff_of_nonneg- A sum of nonnegative terms over a finite set is zero if and only if each term is zero.
Finset.mem_univ- Every element of a finite type belongs to its universal set.
div_mul_cancel₀- Multiplying a / b by a nonzero b yields a.
mul_one- Multiplying any element by 1 leaves it unchanged.
mul_left_cancel₀- A nonzero factor on the left can be cancelled from an equality of products.
div_one- Dividing any element by 1 leaves it unchanged.
div_self- Dividing any nonzero element by itself equals 1.
- Intermediate algebraic steps, such as obtaining W j * r j ≤ W j from r j ≤ 1 and W j > 0, and deducing W j / r j = W j from W j / r j - W j = 0, are discharged by linear and nonlinear arithmetic automation (linarith and nlinarith).
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- A weighted harmonic-type ratio with positive weights W_j and multipliers r_j in (0, 1] is at most 1, with equality iff all r_j = 1. -/theorem weighted_harmonic_ratio_le_one_iff {M : Type*} [Fintype M] [Nonempty M] (W : M → ℝ) (r : M → ℝ) (hW : ∀ j, 0 < W j) (hr_pos : ∀ j, 0 < r j) (hr_le : ∀ j, r j ≤ 1) : let W_bar := Finset.univ.sum W let α_star := W_bar / Finset.univ.sum (fun j => W j / r j) α_star ≤ 1 ∧ (α_star = 1 ↔ ∀ j, r j = 1) := by intro W_bar α_star have h_denom_pos : 0 < ∑ j, W j / r j := Finset.sum_pos (fun j _ => div_pos (hW j) (hr_pos j)) Finset.univ_nonempty have h_le_term : ∀ j, W j ≤ W j / r j := by intro j exact (le_div_iff₀ (hr_pos j)).mpr (by nlinarith [hW j, hr_le j]) have h_le_sum : W_bar ≤ ∑ j, W j / r j := Finset.sum_le_sum (fun j _ => h_le_term j) have h_le_one : α_star ≤ 1 := (div_le_one₀ h_denom_pos).mpr h_le_sum refine ⟨h_le_one, ⟨?_, ?_⟩⟩ · intro hα have h_sum_eq : W_bar = ∑ j, W j / r j := (div_eq_one_iff_eq (ne_of_gt h_denom_pos)).mp hα have h_diff_zero : ∑ j, (W j / r j - W j) = 0 := by rw [Finset.sum_sub_distrib] change (∑ j, W j / r j) - W_bar = 0 rw [← h_sum_eq, sub_self] have h_term_nonneg : ∀ j ∈ (Finset.univ : Finset M), 0 ≤ W j / r j - W j := by intro j _ have := h_le_term j linarith have h_each_zero := (Finset.sum_eq_zero_iff_of_nonneg h_term_nonneg).mp h_diff_zero intro j have hj_zero : W j / r j - W j = 0 := h_each_zero j (Finset.mem_univ j) have hj_eq : W j / r j = W j := by linarith have h1 : (W j / r j) * r j = W j * r j := by rw [hj_eq] rw [div_mul_cancel₀ (W j) (ne_of_gt (hr_pos j))] at h1 have h2 : W j * r j = W j * 1 := by rw [← h1, mul_one] exact mul_left_cancel₀ (ne_of_gt (hW j)) h2 · intro hr_one have h_eq : (∑ j, W j / r j) = W_bar := by dsimp [W_bar] simp_rw [hr_one, div_one] dsimp [α_star] rw [h_eq] have hW_bar_pos : 0 < W_bar := Finset.sum_pos (fun j _ => hW j) Finset.univ_nonempty exact div_self (ne_of_gt hW_bar_pos)