File size: 1,882 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 | import OAI.Combinatorics.ContingencyTables.Transport.FiniteObservableTransport
import OAI.Combinatorics.ContingencyTables.Machines.FiniteWordDependent
namespace OAI
/-! # Composing exact laws through a noninjective state encoding -/
namespace ContingencyTables.FiniteObservableTransport
open CommonBasesFPRAS FairBits
open scoped Classical
noncomputable section
theorem encoded_bind {A B U V C Z W : Type*}
[Fintype A] [Fintype B] [Fintype U] [Fintype V]
(f : A β C) (g : B β Z) (e : Z β C) (F : C β U β W) (G : Z β V β W)
(hinit : SameLaw f (fun b => e (g b))) (hstep : β z,SameLaw (F (e z)) (G z)) :
SameLaw (fun p : AΓU => F (f p.1) p.2) (fun p : BΓV => G (g p.1) p.2) := by
intro phi
rw [uniformAverage_prod,uniformAverage_prod]
have hi := hinit (fun c => uniformAverage (fun u : U => phi (F c u)))
refine hi.trans ?_
apply congrArg uniformAverage
funext b
exact hstep (g b) phi
theorem flat_encoded_bind {C Z W : Type*} (a b c d : β)
(f : (Fin a β Bool) β C) (g : (Fin c β Bool) β Z) (e : Z β C)
(F : C β (Fin b β Bool) β W) (G : Z β (Fin d β Bool) β W)
(hinit : SameLaw f (fun bits => e (g bits))) (hstep : β z,SameLaw (F (e z)) (G z)) :
SameLaw (fun bits : Fin (a+b) β Bool =>
F (f (splitWordEquiv a b bits).1) (splitWordEquiv a b bits).2)
(fun bits : Fin (c+d) β Bool =>
G (g (splitWordEquiv c d bits).1) (splitWordEquiv c d bits).2) := by
have h := encoded_bind f g e F G hinit hstep
intro phi
have hl := uniformAverage_equiv (splitWordEquiv a b)
(fun p : (Fin a β Bool)Γ(Fin b β Bool) => phi (F (f p.1) p.2))
have hr := uniformAverage_equiv (splitWordEquiv c d)
(fun p : (Fin c β Bool)Γ(Fin d β Bool) => phi (G (g p.1) p.2))
exact hl.trans ((h phi).trans hr.symm)
end
end ContingencyTables.FiniteObservableTransport
end OAI
|