Buckets:
| import OAI.Combinatorics.ContingencyTables.Rooted.RootedTreeExteriorMass | |
| import OAI.Combinatorics.ContingencyTables.Rooted.RootedFarMass | |
| import OAI.Combinatorics.ContingencyTables.Counting.CompanionNearMass | |
| namespace OAI | |
| /-! # Selected-root mass in the actual narrow exterior tree region -/ | |
| namespace ContingencyTables.RootedNearMass | |
| open scoped BigOperators Classical | |
| open CompanionFactorialApplication RootedPhysicalNormalizer RootedFarMass | |
| open RootedTreeMarginal TreeExteriorPositions BalancedCellFibres | |
| open TreeMarginalSignature (cellWidth) | |
| open CompanionNearMass (cellPositions) | |
| variable {I J : Type*} [Fintype I] [Fintype J] | |
| noncomputable def nearMass (A : Instance I J) (R : RootedCompletion.Selection A.T) (alpha : ℝ) (t : I×J) (gamma : ℝ) : ℝ := | |
| ∑ a : Profiles (cellWidth A),if a t ∈ cellPositions A t gamma then actualWeight A R alpha a else 0 | |
| lemma nearMass_eq_fibres (A : Instance I J) (R : RootedCompletion.Selection A.T) (alpha : ℝ) (t : I×J) (gamma : ℝ) : | |
| nearMass A R alpha t gamma=∑ k ∈ cellPositions A t gamma,scalarExact A R alpha t k.val := by | |
| have hh := weighted_fibre_sum (cellWidth A) | |
| (RootedPenalty.physicalWeight A R alpha) t | |
| (fun k => if k ∈ cellPositions A t gamma then 1 else 0) | |
| have hs : (∑ k : Fin (cellWidth A t+1), | |
| if k ∈ cellPositions A t gamma then scalarExact A R alpha t k.val else 0)=nearMass A R alpha t gamma := by | |
| simp_rw [exact_eq_fibre] | |
| simpa only [nearMass,actualWeight,mul_ite,mul_one,mul_zero] using hh | |
| rw [← hs] | |
| simpa only [Finset.filter_mem_eq_inter,Finset.univ_inter] using | |
| (Finset.sum_filter (s := Finset.univ) (fun k => k ∈ cellPositions A t gamma) | |
| (fun k => scalarExact A R alpha t k.val)).symm | |
| /-- This uses actual feasible endpoint tables, the proved raw marginal | |
| signature and equality limit, and the exact count normalizer. -/ | |
| theorem near_mass_bound (A : Instance I J) (R : RootedCompletion.Selection A.T) (alpha gamma : ℝ) (t : I×J) | |
| (ht : A.T.Adj (.inl t.1) (.inr t.2)) (ha : 0 ≤ alpha) (hg : 0 < gamma) | |
| (hW : 20*A.d ≤ A.W) (B K : ℕ) | |
| (hB : (∏ a : I×J,(A.b a.1 a.2+1)) ≤ 2^B) (hBK : 2*B ≤ K) (hK : 0 < K) | |
| (Y0 Y1 : I → J → ℤ) | |
| (hY0 : ∀ i j,0 ≤ Y0 i j ∧ Y0 i j ≤ A.b i j) | |
| (hY1 : ∀ i j,0 ≤ Y1 i j ∧ Y1 i j ≤ A.b i j) | |
| (hr0 : ∀ i,(∑ j,Y0 i j)=A.r i) (hc0 : ∀ j,(∑ i,Y0 i j)=A.c j) | |
| (hr1 : ∀ i,(∑ j,Y1 i j)=A.r i) (hc1 : ∀ j,(∑ i,Y1 i j)=A.c j) | |
| (hy0 : Y0 t.1 t.2=0) (hy1 : Y1 t.1 t.2=(A.b t.1 t.2:ℤ)) : | |
| nearMass A R alpha t gamma/physicalMass A R alpha ≤ 4*gamma*K := by | |
| have hb : 0 < A.b t.1 t.2 := by have h := (A.hlarge _ _ (A.hTG ht)).2; omega | |
| have hbR : (0:ℝ) < A.b t.1 t.2 := by exact_mod_cast hb | |
| have hpoint (k : Fin (cellWidth A t+1)) (hk : k ∈ cellPositions A t gamma) : | |
| scalarExact A R alpha t k.val/physicalMass A R alpha ≤ (2*K:ℝ)/A.b t.1 t.2 := by | |
| have hh := (Finset.mem_filter.mp hk).2 | |
| change (((ForestLiteralCount.lower A.T A.d A.b t.1 t.2+(k.val:ℤ)<0) ∧ _) ∨ | |
| (((A.b t.1 t.2:ℤ)<ForestLiteralCount.lower A.T A.d A.b t.1 t.2+(k.val:ℤ)) ∧ _)) at hh | |
| simp only [ForestLiteralCount.lower,ht,ite_true] at hh | |
| rcases hh with hh|hh | |
| · apply lower_exterior_point A R alpha t ht ha hW B K hB hBK hK Y1 hY1 hr1 hc1 hy1 | |
| exact_mod_cast (show (k.val:ℤ) < (10*A.d*A.b t.1 t.2:ℕ) by omega) | |
| · apply upper_exterior_point A R alpha t ht ha hW B K hB hBK hK Y0 hY0 hr0 hc0 hy0 | |
| · exact_mod_cast (show (10*A.d*A.b t.1 t.2+A.b t.1 t.2:ℕ) < (k.val:ℤ) by omega) | |
| · exact Nat.le_of_lt_succ k.isLt | |
| have hcard := card_positions_le (ForestLiteralCount.lower A.T A.d A.b t.1 t.2) | |
| (A.b t.1 t.2) (cellWidth A t) (gamma*A.b t.1 t.2) (mul_pos hg hbR) | |
| calc | |
| _ = ∑ k ∈ cellPositions A t gamma,scalarExact A R alpha t k.val/physicalMass A R alpha := by | |
| rw [nearMass_eq_fibres,Finset.sum_div] | |
| _ ≤ ∑ _k ∈ cellPositions A t gamma,(2*K:ℝ)/A.b t.1 t.2 := | |
| Finset.sum_le_sum (fun k hk => hpoint k hk) | |
| _ = ((cellPositions A t gamma).card:ℝ)*((2*K:ℝ)/A.b t.1 t.2) := by simp | |
| _ ≤ (2*(gamma*A.b t.1 t.2))*((2*K:ℝ)/A.b t.1 t.2) := | |
| mul_le_mul_of_nonneg_right hcard (by positivity) | |
| _ = _ := by field_simp [hbR.ne']; ring | |
| end ContingencyTables.RootedNearMass | |
| end OAI | |
Xet Storage Details
- Size:
- 4.32 kB
- Xet hash:
- e8008155046cf1a8f6d2eec77cd9c1ff53ecfef915c44bad4239daafc659e6ed
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.