Skip to content

Commit 7cee6a2

Browse files
committed
refactor(Analysis): golf Mathlib/Analysis/Convex/Birkhoff (#39893)
- refactors `Convex/Birkhoff` by removing the `Linarith` import and shortening the support-shrinking argument in `doublyStochastic_sum_perm_aux` Extracted from #37968 [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
1 parent 4b5956c commit 7cee6a2

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

Mathlib/Analysis/Convex/Birkhoff.lean

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public import Mathlib.Analysis.Convex.Jensen
1111
public import Mathlib.Analysis.Normed.Module.Convex
1212
public import Mathlib.Combinatorics.Hall.Basic
1313
public import Mathlib.Analysis.Convex.DoublyStochasticMatrix
14-
public import Mathlib.Tactic.Linarith
1514

1615
/-!
1716
# Birkhoff's theorem
@@ -126,15 +125,11 @@ private lemma doublyStochastic_sum_perm_aux (M : Matrix n n R)
126125
gcongr
127126
rw [ssubset_iff_of_subset (monotone_filter_right _ _)]
128127
· simp_rw [mem_filter_univ, not_not, Prod.exists]
129-
refine ⟨i, σ i, hMi'.ne', ?_⟩
130-
simp [N, Equiv.toPEquiv_apply]
128+
exact ⟨i, σ i, hMi'.ne', by simp [N, Equiv.toPEquiv_apply]⟩
131129
· rintro ⟨i', j'⟩ _ hN' hM'
132-
dsimp at hN' hM'
133-
simp only [sub_apply, hM', smul_apply, PEquiv.toMatrix_apply, Equiv.toPEquiv_apply,
134-
Option.mem_def, Option.some.injEq, smul_eq_mul, mul_ite, mul_one, mul_zero, zero_sub,
135-
neg_eq_zero, ite_eq_right_iff, Classical.not_imp, N] at hN'
136-
obtain ⟨rfl, _⟩ := hN'
137-
linarith [hi' i' (by simp)]
130+
have hσ' : σ i' ≠ j' := by
131+
simpa [Equiv.toPEquiv_apply] using hσ i' j' hM'
132+
exact hN' <| by simp [N, hM', hσ', Equiv.toPEquiv_apply]
138133
obtain ⟨w, hw, hw'⟩ := ih _ hd' _ s' hs' this rfl
139134
refine ⟨w + fun σ' => if σ' = σ then M i (σ i) else 0, ?_⟩
140135
simp only [Pi.add_apply, add_smul, sum_add_distrib, hw', ite_smul, zero_smul,

0 commit comments

Comments
 (0)