Download data/lean/OAI/Combinatorics/BinaryEdit/FiniteSeparationArithmetic.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/BinaryEdit/FiniteSeparationArithmetic.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/BinaryEdit/FiniteSeparationArithmetic.lean
-
curl -L -o FiniteSeparationArithmetic.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/BinaryEdit/FiniteSeparationArithmetic.lean
1.91 kB
| 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 | |