cfahlgren1's picture
download
raw
3.71 kB
import OAI.Combinatorics.ContingencyTables.Transport.ListedOutputSemantics
import OAI.Combinatorics.ContingencyTables.Sampling.AllSmallInitialization
namespace OAI
/-! # Reconstructing the original table when every cell is small -/
namespace ContingencyTables.SmallGraphProfiles
open ProfilePrograms DensePrograms PhysicalCompletionFibres FirstPaperPhysicalMarginal
open FirstPaperProfiles PaddedCompletions CompletionCounts SmallContextCoordinates
open scoped BigOperators Classical
noncomputable section
variable {m n q : ℕ} (r : Fin m → ℕ) (c : Fin n → ℕ)
variable (e : Fin q ≃ Cells (paperSmall r c))
local notation "d" => dimensionAllowance (I := Fin m) (J := Fin n)
local notation "U" => d^20
local notation "L" => d^12
def unitOutputData (x : PaperStates r c) : OuterTableData :=
outputData ((stateCodeData r c e x,L),[])
lemma unitOutputEntry (hsmall : ∀ i j,paperSmall r c i j=true)
(x : PaperStates r c) (i : Fin m) (j : Fin n) :
outputEntry (unitOutputData r c e x,(i.val,j.val))=
(allSmallFibre r c hsmall x).val.val.1 i j := by
have he := outputEntry_small (paperSmall r c) e
(physicalProfile (paperSmall r c) (stateCapacity r c) r c L x)
(largeIndices (U,List.ofFn r)) (largeIndices (U,List.ofFn c)) U L [] i j (hsmall i j)
apply he.trans
simpa only [smallView,hsmall i j,dite_true] using
((allSmallFibre r c hsmall x).property.2.2.1 i j (hsmall i j)).1.symm
lemma unitOutputSuccess (hsmall : ∀ i j,paperSmall r c i j=true) (x : PaperStates r c) :
outerSuccess (unitOutputData r c e x)=true ↔
StateJointSuccess r c ⟨x,allSmallFibre r c hsmall x⟩ := by
change (balancedTest (stateCode r c e x,U) && paddingTest (L,[]))=true ↔ _
simp only [paddingTest,List.all_nil,Bool.and_true]
rw [balancedTest_stateCode]
constructor
· intro h
refine ⟨h,?_⟩
intro i j hij
rw [hsmall i j] at hij
contradiction
· exact And.left
lemma unitOutputMatrix (hsmall : ∀ i j,paperSmall r c i j=true) (x : PaperStates r c)
(hx : StateJointSuccess r c ⟨x,allSmallFibre r c hsmall x⟩) :
outputMatrix (prepareOutput ((stateCodeData r c e x,L),[]))=
matrixCode ((originalStateSuccessEquiv r c).symm ⟨⟨x,allSmallFibre r c hsmall x⟩,hx⟩).val := by
change outputMatrix ((List.ofFn r,List.ofFn c),unitOutputData r c e x)=_
rw [outputMatrix_code]
apply congrArg matrixCode
funext i j
rw [unitOutputEntry r c e hsmall,originalStateSuccessEquiv_symm_entry]
simp only [paperLarge,largePadding,Finset.mem_filter,Finset.mem_univ,true_and,hsmall i j,
Bool.true_eq_false,ite_false,Nat.sub_zero]
lemma unitOuterTrial (hsmall : ∀ i j,paperSmall r c i j=true) (x : PaperStates r c) :
outerTrial ((stateCodeData r c e x,L),[])=
(stateTrial r c ⟨x,allSmallFibre r c hsmall x⟩).map (fun T => matrixCode T.val) := by
by_cases h : StateJointSuccess r c ⟨x,allSmallFibre r c hsmall x⟩
· have hp := (unitOutputSuccess r c e hsmall x).mpr h
calc
_ = some (outputMatrix (prepareOutput ((stateCodeData r c e x,L),[]))) := ite_eq_left hp
_ = some (matrixCode ((originalStateSuccessEquiv r c).symm
⟨⟨x,allSmallFibre r c hsmall x⟩,h⟩).val) :=
congrArg some (unitOutputMatrix r c e hsmall x h)
_ = _ := by
simp only [stateTrial,FirstSuccess.partialEquivDraw,dite_eq_left h,Option.map_some]
· have hp : outerSuccess (unitOutputData r c e x)≠true :=
fun hp => h ((unitOutputSuccess r c e hsmall x).mp hp)
calc
_ = none := ite_eq_right hp
_ = _ := by
simp only [stateTrial,FirstSuccess.partialEquivDraw,dite_eq_right h,Option.map_none]
end
end ContingencyTables.SmallGraphProfiles
end OAI

Xet Storage Details

Size:
3.71 kB
·
Xet hash:
0e81311771b6e4969e0800a9ba94c100defbf4eb05e3863b151ba08741887c0a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.