File size: 3,351 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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | import OAI.Combinatorics.ContingencyTables.Transport.TranslatedCompletionChain
namespace OAI
/-! # Exact edge flow of the completion-translation chain -/
namespace ContingencyTables.CompletionTranslation
open scoped BigOperators Classical
open CommonBasesFPRAS
variable {X I J : Type*} [Fintype X] [Nonempty X] [Fintype I] [Fintype J]
omit [Nonempty X] in
lemma completionMove_flow (R : X β Option I β β) (P : X β Option J β β)
(htotal : β x,(β i,R x i)=β j,P x j)
(Adj : X β X β Prop) (Ξ² : β) (x y : X) :
((blockCount R P x:β)/MetropolisChain.normalizer (fun z => (blockCount R P z:β)))*
completionMove R P Adj Ξ² x y =
if Adj x y then Ξ²*(acceptedCount R P x y:β)/
MetropolisChain.normalizer (fun z => (blockCount R P z:β)) else 0 := by
have hx : (blockCount R P x:β)β 0 := ne_of_gt (by exact_mod_cast blockCount_pos R P htotal x)
unfold completionMove
split_ifs
Β· exact div_mul_div_cancelβ' hx _ _
Β· exact mul_zero _
/-- The flow formula includes the holding terms: those contribute zero
energy. The numerator counts literal acceptable completion translations. -/
theorem completionChain_energy (R : X β Option I β β) (P : X β Option J β β)
(htotal : β x,(β i,R x i)=β j,P x j)
(Adj : X β X β Prop) (hsym : β x y,Adj x y β Adj y x)
(Ξ² : β) (hΞ² : 0 β€ Ξ²) (D : β)
(hdegree : β x,(Finset.univ.filter (Adj x)).card β€ D)
(hproposal : (D:β)*Ξ² β€ 1/2) (H : X β β) :
(completionChain R P htotal Adj hsym Ξ² hΞ² D hdegree hproposal).energy H=
(β x,β y,if Adj x y then
Ξ²*(acceptedCount R P x y:β)*(H x-H y)^2 else 0)/
(2*MetropolisChain.normalizer (fun z => (blockCount R P z:β))) := by
unfold completionChain
rw [FiniteChain.ofMoves_energy]
simp_rw [completionMove_flow R P htotal Adj Ξ²]
have hterm (x y : X) :
(if Adj x y then Ξ²*(acceptedCount R P x y:β)/
MetropolisChain.normalizer (fun z => (blockCount R P z:β)) else 0)*(H x-H y)^2 =
(if Adj x y then Ξ²*(acceptedCount R P x y:β)*(H x-H y)^2 else 0)/
MetropolisChain.normalizer (fun z => (blockCount R P z:β)) := by
split_ifs <;> ring
simp_rw [hterm,β Finset.sum_div]
ring
omit [Fintype X] [Nonempty X] in
/-- A half-acceptance estimate yields the min-weight comparison on every
actual edge, with no request for completion-count evaluation. -/
lemma completionMove_lower (R : X β Option I β β) (P : X β Option J β β)
(htotal : β x,(β i,R x i)=β j,P x j)
(Adj : X β X β Prop) (Ξ² : β) (hΞ² : 0 β€ Ξ²) (x y : X)
(hxy : Adj x y)
(haccept : (blockCount R P x:β)/2 β€ acceptedCount R P x y) :
Ξ²/2*min 1 ((blockCount R P y:β)/blockCount R P x) β€ completionMove R P Adj Ξ² x y := by
have hx : (0:β)<blockCount R P x := by exact_mod_cast blockCount_pos R P htotal x
have hm : Ξ²/2*min 1 ((blockCount R P y:β)/blockCount R P x) β€ Ξ²/2 := by
simpa only [mul_one] using mul_le_mul_of_nonneg_left
(min_le_left (1:β) ((blockCount R P y:β)/blockCount R P x)) (by positivity : 0 β€ Ξ²/2)
apply hm.trans
unfold completionMove
rw [ite_eq_left hxy]
apply (le_div_iffβ hx).mpr
nlinarith [mul_nonneg hΞ² (sub_nonneg.mpr haccept)]
end ContingencyTables.CompletionTranslation
end OAI
|