File size: 2,788 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 | import Mathlib
import OAI.Combinatorics.IndependentSets.Repetition.Basic
import OAI.Combinatorics.IndependentSets.Repetition.ProfileCorrection
import OAI.Combinatorics.IndependentSets.Repetition.Value
namespace OAI
namespace IndependentSetsGames.Foundations.Repetition
open scoped BigOperators
open Games
noncomputable section
variable {X Y : Type*} [Fintype X] [Fintype Y]
def normalizeOr (w : X β β) (hw : β x, 0 β€ w x)
(fallback : FiniteDistribution X) : FiniteDistribution X :=
if h : 0 < β x, w x then
{ weight := normalizedWeight w
nonnegative := (normalizedWeight_isProbability w hw h).1
normalized := (normalizedWeight_isProbability w hw h).2 }
else fallback
theorem sum_mul_normalizeOr (w : X β β) (hw : β x, 0 β€ w x)
(fallback : FiniteDistribution X) (x : X) :
(β z, w z) * (normalizeOr w hw fallback).weight x = w x := by
classical
have hs : 0 β€ β z, w z := Finset.sum_nonneg (fun z _ => hw z)
by_cases h : 0 < β z, w z
Β· simp only [normalizeOr, dite_eq_left h, normalizedWeight]
field_simp
Β· have hz : β z, w z = 0 := le_antisymm (le_of_not_gt h) hs
have hx : w x = 0 := by
apply le_antisymm _ (hw x)
have hl := Finset.single_le_sum (fun z _ => hw z) (Finset.mem_univ x)
simpa only [hz] using hl
simp [normalizeOr, hz, hx]
theorem local_completion_recombination
(left : X β β) (right : Y β β)
(hl : β x, 0 β€ left x) (hr : β y, 0 β€ right y)
(defaultLeft : FiniteDistribution X) (defaultRight : FiniteDistribution Y)
(c : β) (x : X) (y : Y) :
(c * (β z, left z) * (β z, right z)) *
((normalizeOr left hl defaultLeft).weight x *
(normalizeOr right hr defaultRight).weight y) = c * left x * right y := by
calc
_ = c * ((β z, left z) * (normalizeOr left hl defaultLeft).weight x) *
((β z, right z) * (normalizeOr right hr defaultRight).weight y) := by ring
_ = _ := by rw [sum_mul_normalizeOr, sum_mul_normalizeOr]
theorem factorized_completion_row
(left : X β β) (right : Y β β)
(hl : β x, 0 β€ left x) (hr : β y, 0 β€ right y)
(defaultLeft : FiniteDistribution X) (defaultRight : FiniteDistribution Y)
(c : β) (xy : X Γ Y) :
(β z : X Γ Y, c * left z.1 * right z.2) *
((normalizeOr left hl defaultLeft).product
(normalizeOr right hr defaultRight)).weight xy = c * left xy.1 * right xy.2 := by
have hm : (β z : X Γ Y, c * left z.1 * right z.2) =
c * (β z, left z) * (β z, right z) := by
simp_rw [mul_assoc, β Finset.mul_sum]
rw [productWeight_mass]
rw [hm]
exact local_completion_recombination left right hl hr defaultLeft defaultRight c xy.1 xy.2
end
end IndependentSetsGames.Foundations.Repetition
end OAI
|