math / data /lean /OAI /Combinatorics /ContingencyTables /Transport /CompletionEnergyComparison.lean
Download data/lean/OAI/Combinatorics/ContingencyTables/Transport/CompletionEnergyComparison.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ContingencyTables/Transport/CompletionEnergyComparison.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/ContingencyTables/Transport/CompletionEnergyComparison.lean
-
curl -L -o CompletionEnergyComparison.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/ContingencyTables/Transport/CompletionEnergyComparison.lean
2.5 kB
| import OAI.Combinatorics.ContingencyTables.Transport.CompletionChainFlow | |
| namespace OAI | |
| /-! # From literal acceptance counts to weighted graph energy -/ | |
| namespace ContingencyTables.CompletionTranslation | |
| open scoped BigOperators Classical | |
| open CommonBasesFPRAS | |
| variable {X I J : Type*} [Fintype X] [Nonempty X] [Fintype I] [Fintype J] | |
| /-- This is the actual chain energy comparison. The half-acceptance | |
| premise is supplied by the proved reference-star small-entry estimate. -/ | |
| theorem completionChain_energy_lower | |
| (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) | |
| (haccept : β x y,Adj x y β (blockCount R P x:β)/2 β€ acceptedCount R P x y) | |
| (H : X β β) : | |
| Ξ²/(2*MetropolisChain.normalizer (fun z => (blockCount R P z:β)))* | |
| ((β x,β y,if Adj x y then min (blockCount R P x:β) (blockCount R P y:β)* | |
| (H x-H y)^2 else 0)/2) β€ | |
| (completionChain R P htotal Adj hsym Ξ² hΞ² D hdegree hproposal).energy H := by | |
| let Z := MetropolisChain.normalizer (fun z => (blockCount R P z:β)) | |
| have hZ : 0 < Z := MetropolisChain.normalizer_pos _ | |
| (fun z => by exact_mod_cast blockCount_pos R P htotal z) | |
| have hterm (x y : X) : | |
| Ξ²/2*(if Adj x y then min (blockCount R P x:β) (blockCount R P y:β)*(H x-H y)^2 else 0) β€ | |
| if Adj x y then Ξ²*(acceptedCount R P x y:β)*(H x-H y)^2 else 0 := by | |
| by_cases hxy : Adj x y | |
| Β· rw [ite_eq_left hxy,ite_eq_left hxy] | |
| have hm : min (blockCount R P x:β) (blockCount R P y:β)/2 β€ acceptedCount R P x y := | |
| (div_le_div_of_nonneg_right (min_le_left _ _) (by norm_num)).trans (haccept x y hxy) | |
| have hs := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hm hΞ²) (sq_nonneg (H x-H y)) | |
| convert hs using 1 | |
| all_goals ring | |
| Β· rw [ite_eq_right hxy,ite_eq_right hxy,mul_zero] | |
| have hsum := Finset.sum_le_sum (fun x (_ : x β (Finset.univ : Finset X)) => | |
| Finset.sum_le_sum (fun y (_ : y β (Finset.univ : Finset X)) => hterm x y)) | |
| simp_rw [β Finset.mul_sum] at hsum | |
| rw [completionChain_energy] | |
| have hb := div_le_div_of_nonneg_right hsum (show 0 β€ 2*Z by positivity) | |
| convert hb using 1 | |
| all_goals | |
| dsimp only [Z] | |
| ring | |
| end ContingencyTables.CompletionTranslation | |
| end OAI | |