Skip to content

Commit bc2e4d8

Browse files
LionSRtexra-ai
andauthored
refactor(Channel/Determinant): use Fintype sum zero criterion (#3276)
Co-authored-by: Sirui Lu <texra-ai@outlook.com>
1 parent 4fd890f commit bc2e4d8

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

TNLean/Channel/Determinant/HilbertSchmidt.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,8 @@ theorem sum_stdBasis_mul_conjTranspose :
138138
lemma eq_zero_of_nonneg_of_sum_le_zero {ι : Type*} [Fintype ι]
139139
(f : ι → ℝ) (hf : ∀ i, 0 ≤ f i) (hsum : ∑ i, f i ≤ 0) :
140140
∀ i, f i = 0 := by
141-
intro i
142-
have h1 : ∑ i, f i ≥ 0 := Finset.sum_nonneg (fun i _ => hf i)
143-
have h2 : ∑ i, f i = 0 := le_antisymm hsum h1
144-
have h3 := Finset.sum_eq_zero_iff_of_nonneg (fun i _ => hf i) |>.mp h2
145-
exact h3 i (Finset.mem_univ i)
141+
have hsum_zero : ∑ i, f i = 0 := le_antisymm hsum (Fintype.sum_nonneg hf)
142+
exact fun i => congrFun ((Fintype.sum_eq_zero_iff_of_nonneg hf).mp hsum_zero) i
146143

147144
private lemma matrix_det_norm_one_trace_conjTranspose_mul_self_ge [NeZero d]
148145
(A : Matrix (Fin d × Fin d) (Fin d × Fin d) ℂ) (hdet : ‖A.det‖ = 1) :

0 commit comments

Comments
 (0)