by_cases h : ∃ j, w.E < w j ∧ 0 < a.1 j
n d : ℕ
inst✝ : NeZero d
w : Weight n d
a : ↑(testvecs n d)
⊢ E w - pair (trunc w) ↑a ≤ E w - pair w ↑a
case pos
n d : ℕ
inst✝ : NeZero d
w : Weight n d
a : ↑(testvecs n d)
h : ∃ j, E w < w j ∧ 0 < ↑a j
⊢ E w - pair (trunc w) ↑a ≤ E w - pair w ↑a

case neg
n d : ℕ
inst✝ : NeZero d
w : Weight n d
a : ↑(testvecs n d)
h : ¬∃ j, E w < w j ∧ 0 < ↑a j
⊢ E w - pair (trunc w) ↑a ≤ E w - pair w ↑a