@@ -5,8 +5,6 @@ Authors: Bhavik Mehta
55-/
66module
77
8- public import Mathlib.Analysis.Convex.Basic
9- public import Mathlib.LinearAlgebra.Matrix.Permutation
108public import Mathlib.LinearAlgebra.Matrix.Stochastic
119
1210/-!
@@ -23,11 +21,6 @@ public import Mathlib.LinearAlgebra.Matrix.Stochastic
2321* `convex_doublyStochastic`: The set of doubly stochastic matrices is convex.
2422* `permMatrix_mem_doublyStochastic`: Any permutation matrix is doubly stochastic.
2523
26- ## TODO
27-
28- Define the submonoids of row-stochastic and column-stochastic matrices.
29- Show that the submonoid of doubly stochastic matrices is the meet of them, or redefine it as such.
30-
3124 ## Tags
3225
3326Doubly stochastic, Birkhoff's theorem, Birkhoff-von Neumann theorem
@@ -67,7 +60,7 @@ lemma mem_doublyStochastic_iff_sum :
6760
6861/-- A matrix is doubly stochastic if and only if it is both row and
6962column stochastic. -/
70- @ [grind =]
63+ @ [local grind =]
7164lemma doublyStochastic_eq_rowStochastic_inf_colStochastic :
7265 doublyStochastic R n = rowStochastic R n ⊓ colStochastic R n := by
7366 ext M
@@ -112,17 +105,32 @@ lemma convex_doublyStochastic : Convex R (doublyStochastic R n : Set (Matrix n n
112105 simp [add_nonneg, ha, hb, mul_nonneg, hx, hy, sum_add_distrib, ← mul_sum, h]
113106
114107/-- Any permutation matrix is doubly stochastic. -/
108+ @ [simp, grind ←]
115109lemma permMatrix_mem_doublyStochastic {σ : Equiv.Perm n} :
116- σ.permMatrix R ∈ doublyStochastic R n := by
117- grind only [= doublyStochastic_eq_rowStochastic_inf_colStochastic, = Submonoid.mem_inf,
118- ← permMatrix_mem_rowStochastic, ← permMatrix_mem_colStochastic]
110+ σ.permMatrix R ∈ doublyStochastic R n := by grind
119111
120112/-- A matrix is doubly stochastic iff its transpose is doubly stochastic -/
113+ @ [grind =]
121114lemma transpose_mem_doublyStochastic_iff :
122- M.transpose ∈ doublyStochastic R n ↔ M ∈ doublyStochastic R n := by
123- grind only [= doublyStochastic_eq_rowStochastic_inf_colStochastic, = Submonoid.mem_inf,
124- = transpose_mem_rowStochastic_iff_mem_colStochastic, = mem_rowStochastic,
125- = transpose_mem_colStochastic_iff_mem_rowStochastic, = mem_colStochastic]
115+ Mᵀ ∈ doublyStochastic R n ↔ M ∈ doublyStochastic R n := by grind
116+
117+ /-- Reindexing a matrix preserves double stochasticity. -/
118+ @ [aesop safe apply]
119+ lemma reindex_mem_doublyStochastic {m : Type *} [Fintype m] [DecidableEq m] {M : Matrix n n R}
120+ {e₁ e₂ : n ≃ m} (hM : M ∈ doublyStochastic R n) : M.reindex e₁ e₂ ∈ doublyStochastic R m := by
121+ grind
122+
123+ /-- Reindexing a matrix preserves double stochasticity. -/
124+ @ [grind =]
125+ lemma reindex_mem_doublyStochastic_iff {m : Type *} [Fintype m] [DecidableEq m] {M : Matrix n n R}
126+ {e₁ e₂ : n ≃ m} : M.reindex e₁ e₂ ∈ doublyStochastic R m ↔ M ∈ doublyStochastic R n := by
127+ grind
128+
129+ /-- Applying a doubly stochastic matrix to a vector preserves its sum. -/
130+ lemma sum_mulVec_of_mem_doublyStochastic {M : Matrix n n R} {x : n → R}
131+ (hA : M ∈ doublyStochastic R n) : ∑ i, (M *ᵥ x) i = ∑ i, x i := by
132+ apply sum_mulVec_of_mem_colStochastic
133+ grind
126134
127135end OrderedSemiring
128136
0 commit comments