File size: 4,635 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import OAI.Probability.MatroidProphet.Density.Basic
import Mathlib.Algebra.Order.BigOperators.Group.Finset

namespace OAI

namespace MatroidProphet

open Set Finset

variable {Ξ± : Type*} [Fintype Ξ±]

noncomputable def conditionalRank (M : Matroid Ξ±) (S P : Set Ξ±) : β„• :=
  natRank M (S βˆͺ P) - natRank M P

lemma conditionalRank_add_base (M : Matroid Ξ±) (S P : Set Ξ±) :
    conditionalRank M S P + natRank M P = natRank M (S βˆͺ P) := by
  exact Nat.sub_add_cancel (natRank_mono M subset_union_right)

lemma conditionalRank_antitone (M : Matroid Ξ±) (S : Set Ξ±)
    {P Q : Set Ξ±} (hPQ : P βŠ† Q) :
    conditionalRank M S Q ≀ conditionalRank M S P := by
  have hsub := natRank_submod M (S βˆͺ P) Q
  have hi := natRank_mono M (show P βŠ† (S βˆͺ P) ∩ Q from
    fun x hx => ⟨Or.inr hx, hPQ hx⟩)
  have hu : (S βˆͺ P) βˆͺ Q = S βˆͺ Q := by
    ext x
    simp only [mem_union]
    constructor
    Β· rintro ((h | h) | h)
      Β· exact Or.inl h
      Β· exact Or.inr (hPQ h)
      Β· exact Or.inr h
    Β· rintro (h | h)
      Β· exact Or.inl (Or.inl h)
      Β· exact Or.inr h
  rw [hu] at hsub
  have hP := conditionalRank_add_base M S P
  have hQ := conditionalRank_add_base M S Q
  omega

lemma conditionalRank_exchange (M : Matroid Ξ±) (S J A : Set Ξ±) :
    conditionalRank M S A + conditionalRank M J (A βˆͺ S) =
      conditionalRank M J A + conditionalRank M S (A βˆͺ J) := by
  have hSA := conditionalRank_add_base M S A
  have hJA := conditionalRank_add_base M J A
  have hJAS := conditionalRank_add_base M J (A βˆͺ S)
  have hSAJ := conditionalRank_add_base M S (A βˆͺ J)
  have hUS : S βˆͺ A = A βˆͺ S := union_comm _ _
  have hUJ : J βˆͺ A = A βˆͺ J := union_comm _ _
  have hU : J βˆͺ (A βˆͺ S) = S βˆͺ (A βˆͺ J) := by
    ext x
    simp only [mem_union]
    tauto
  rw [hUS] at hSA
  rw [hUJ] at hJA
  rw [hU] at hJAS
  omega

omit [Fintype Ξ±] in
lemma conditionalRank_closure (M : Matroid Ξ±) (S P : Set Ξ±) :
    conditionalRank M S (M.closure P) = conditionalRank M S P := by
  simp only [conditionalRank, natRank, M.eRk_union_closure_right_eq,
    M.eRk_closure_eq]

lemma conditionalRank_le_rank (M : Matroid Ξ±) (J A : Set Ξ±) :
    conditionalRank M J A ≀ natRank M J := by
  have h := conditionalRank_antitone M J (empty_subset A)
  simpa [conditionalRank] using h

lemma rankCost_step (M : Matroid Ξ±) (J S A B X Y : Set Ξ±)
    (hXA : X βŠ† A) (hAB : A βŠ† B)
    (hB : B βŠ† M.closure (A βˆͺ J)) (hY : A βˆͺ S βŠ† Y) :
    conditionalRank M S A - conditionalRank M S B ≀
      conditionalRank M J X - conditionalRank M J Y := by
  have hSJ := conditionalRank_antitone M S hB
  rw [conditionalRank_closure] at hSJ
  have hSA := conditionalRank_antitone M S hAB
  have hJA := conditionalRank_antitone M J hXA
  have hJY := conditionalRank_antitone M J hY
  have heq := conditionalRank_exchange M S J A
  omega

lemma sum_potential_drop_le (p : β„• β†’ β„•) (m : β„•)
    (hp : βˆ€ k < m, p (k + 1) ≀ p k) :
    (βˆ‘ k ∈ range m, (p k - p (k + 1))) ≀ p 0 := by
  suffices h : (βˆ‘ k ∈ range m, (p k - p (k + 1))) + p m = p 0 by omega
  induction m with
  | zero => simp
  | succ m ih =>
    rw [sum_range_succ]
    have hprev := ih (fun k hk => hp k (Nat.lt_trans hk (Nat.lt_succ_self m)))
    have hlast := hp m (Nat.lt_succ_self m)
    omega

lemma rankCost_chain (M : Matroid Ξ±) (J : Set Ξ±) (m : β„•)
    (X A B S : β„• β†’ Set Ξ±)
    (hXA : βˆ€ k < m, X k βŠ† A k)
    (hAB : βˆ€ k < m, A k βŠ† B k)
    (hB : βˆ€ k < m, B k βŠ† M.closure (A k βˆͺ J))
    (hY : βˆ€ k < m, A k βˆͺ S k βŠ† X (k + 1)) :
    (βˆ‘ k ∈ range m, conditionalRank M (S k) (A k)) ≀
      (βˆ‘ k ∈ range m, conditionalRank M (S k) (B k)) + natRank M J := by
  have hmono : βˆ€ k < m, X k βŠ† X (k + 1) := by
    intro k hk
    exact (hXA k hk).trans (subset_union_left.trans (hY k hk))
  have hp : βˆ€ k < m, conditionalRank M J (X (k + 1)) ≀
      conditionalRank M J (X k) := fun k hk => conditionalRank_antitone M J (hmono k hk)
  have hdrop := sum_potential_drop_le (fun k => conditionalRank M J (X k)) m hp
  have hsum : (βˆ‘ k ∈ range m, conditionalRank M (S k) (A k)) ≀
      βˆ‘ k ∈ range m, (conditionalRank M (S k) (B k) +
        (conditionalRank M J (X k) - conditionalRank M J (X (k + 1)))) := by
    apply sum_le_sum
    intro k hk
    have hk' := mem_range.1 hk
    have hs := rankCost_step M J (S k) (A k) (B k) (X k) (X (k + 1))
      (hXA k hk') (hAB k hk') (hB k hk') (hY k hk')
    have ha := conditionalRank_antitone M (S k) (hAB k hk')
    omega
  rw [sum_add_distrib] at hsum
  have hbound := conditionalRank_le_rank M J (X 0)
  omega

end MatroidProphet

end OAI