File size: 1,909 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | import Mathlib
namespace OAI
/-!
# Deficit charges in the finite-tree separation induction
The exact deficit charges are those of `prop:finite-separation`.
-/
namespace TreeEdit.BinaryLower.FiniteTree
/-- At least half the children each charge `q` unmatched symbols. -/
theorem row_deficit_charge {m : β} (bad : Finset (Fin m))
(Ξ΄ : Fin m β β) (q : β) (hq : 0 β€ q)
(hnonneg : β i, 0 β€ Ξ΄ i) (hbad : β i β bad, q β€ Ξ΄ i)
(hhalf : m β€ 2 * bad.card) :
(m : β) * q / 2 β€ β i, Ξ΄ i := by
classical
have hpoint (i : Fin m) : (if i β bad then q else 0) β€ Ξ΄ i := by
split_ifs with hi
Β· exact hbad i hi
Β· exact hnonneg i
have hsum := Finset.sum_le_sum (fun i (_ : i β Finset.univ) => hpoint i)
have hcalc : (β i : Fin m, if i β bad then q else 0) = (bad.card : β) * q := by
simp
rw [hcalc] at hsum
have hmR : (m : β) β€ 2 * (bad.card : β) := by exact_mod_cast hhalf
nlinarith [mul_le_mul_of_nonneg_right hmR hq]
/-- The chosen row charge is no larger than the tagged transition gap. -/
theorem finite_charge_le_gap (m h : β) (hm : 2 β€ m) (B : β) (hB : 0 β€ B) :
(m : β) * (B / (4 : β) ^ h) / 2 β€ ((m : β) - 1) * B := by
have hp : (1 : β) β€ (4 : β) ^ h := one_le_powβ (by norm_num)
have hp0 : 0 < (4 : β) ^ h := by positivity
have hq : B / (4 : β) ^ h β€ B := by
apply (div_le_iffβ hp0).2
nlinarith
have hmR : (2 : β) β€ m := by exact_mod_cast hm
have hm0 : (0 : β) β€ m := Nat.cast_nonneg _
nlinarith [mul_le_mul_of_nonneg_left hq hm0]
/-- Half the total row charge is exactly the next `4β»Κ°` separation scale. -/
theorem finite_charge_identity (m T h : β) (B : β) :
(T : β) * ((m : β) * (B / (4 : β) ^ h) / 2) / 2 =
((m : β) * T * B) / (4 : β) ^ (h + 1) := by
rw [pow_succ]
ring
end TreeEdit.BinaryLower.FiniteTree
end OAI
|