OAI/Combinatorics/ContingencyTables/Sampling/SmallContextFibres.lean
18 declarations, 0 contain sorry, 0 declared as axioms
Actual small-prefix fibres and conditional repair
Only small cells in the row-major prefix are fixed. Large completions remain free and retain their full counting multiplicity.
- abbrev
OAI.ContingencyTables.SmallContextFibres.BoundedProfileline 19 - def
OAI.ContingencyTables.SmallContextFibres.naturalProfileline 22 - lemma
OAI.ContingencyTables.SmallContextFibres.naturalProfile_injectiveline 26 - lemma
OAI.ContingencyTables.SmallContextFibres.naturalProfile_boundedline 33 - def
OAI.ContingencyTables.SmallContextFibres.smallQline 37 - def
OAI.ContingencyTables.SmallContextFibres.SmallPrefixline 41 - def
OAI.ContingencyTables.SmallContextFibres.BalancedProfilesline 45 - def
OAI.ContingencyTables.SmallContextFibres.DefectProfilesline 52 - def
OAI.ContingencyTables.SmallContextFibres.SmallResidualChildline 59 - def
OAI.ContingencyTables.SmallContextFibres.SmallJointDefectContextline 65 - instance
OAI.ContingencyTables.SmallContextFibres.balancedProfilesFintypeline 71 - instance
OAI.ContingencyTables.SmallContextFibres.defectProfilesFintypeline 75 - instance
OAI.ContingencyTables.SmallContextFibres.smallResidualChildFintypeline 79 - instance
OAI.ContingencyTables.SmallContextFibres.smallJointDefectContextFintypeline 86 - theorem
OAI.ContingencyTables.SmallContextFibres.smallContext_card_leline 94Source documentation
The contextual injection fixes only earlier small entries.
theorem smallContext_card_le [LinearOrder I] [LinearOrder J] (small : I → J → Bool) (r rbar : I → ℕ) (c cbar : J → ℕ) (s t : I×J) (σ : I×J → ℕ) (l : ℕ) (hs : small s.1 s.2=true) (ht : small t.1 t.2=true) (hst : RowMajorBefore s t) : Fintype.card (SmallJointDefectContext small r rbar c cbar s t σ l) ≤ Fintype.card (SmallResidualChild small r rbar c cbar s σ (l-1+if t.1=s.1 then 1 else 0)) := by …Mentions: OAI.ContingencyTables.RowMajorBefore, OAI.ContingencyTables.SmallContextFibres.SmallJointDefectContext, OAI.ContingencyTables.SmallContextFibres.SmallResidualChild
- lemma
OAI.ContingencyTables.SmallContextFibres.balanced_fibre_viewsline 117Source documentation
A balanced small profile is balanced as a full pair of views.
lemma balanced_fibre_views {small : I → J → Bool} {B : I → J → ℕ} {r rbar : I → ℕ} {c cbar : J → ℕ} {z : SmallProfile small} (Z : CompletionFibre small B r rbar c cbar z) (hb : ∀ i j, smallView small z false i j=smallQ small B z i j) : Z.val.val.1=Z.val.val.2 := by … - lemma
OAI.ContingencyTables.SmallContextFibres.defect_fibre_viewsline 130Source documentation
The defect equation extends over the unchanged large completion.
lemma defect_fibre_views {small : I → J → Bool} {B : I → J → ℕ} {r rbar : I → ℕ} {c cbar : J → ℕ} {z : SmallProfile small} {s t : I×J} (Z : CompletionFibre small B r rbar c cbar z) (hs : small s.1 s.2=true) (ht : small t.1 t.2=true) (hd : IsDefect (smallView small z false) (smallQ small B z) s t) : IsDefect Z.val.val.1 Z.val.val.2 s t := by …Mentions: OAI.ContingencyTables.IsDefect, OAI.ContingencyTables.SmallContextFibres.smallQ
- theorem
OAI.ContingencyTables.SmallContextFibres.sum_hard_eq_sigma_cardline 151Source documentation
Summing the literal hard weights is exactly counting the dependent union of completion fibres.
theorem sum_hard_eq_sigma_card {S : Type*} [Fintype S] (small : I → J → Bool) (B : I → J → ℕ) (r : I → ℕ) (c : J → ℕ) (L : ℕ) (p : S → SmallProfile small) (hbox : ∀ s u, p s u ≤ B u.1.val.1 u.1.val.2) : (∑ s, hardMarginal small B r c L (p s))= (Fintype.card ((s : S) × CompletionFibre small B r (fun i => r i+rowLargeCount small i*L) c (fun j => c j+columnLargeCount small j*L) (p s)):ℝ) := by …