Theorem: ℤω.re_sub_nearest (Mordell4/Eisenstein.lean)

State before:
a b c : ℤω
z : ℂ
⊢ (z - OneHom.toFun (↑↑inclusion) (nearestℤω z)).re ^ 2 ≤ 2⁻¹ ^ 2
Tactic:
rw [sq_le_sq]
State after:
a b c : ℤω
z : ℂ
⊢ |(z - OneHom.toFun (↑↑inclusion) (nearestℤω z)).re| ≤ |2⁻¹|

State before:
a b c : ℤω
z : ℂ
⊢ |(z - OneHom.toFun (↑↑inclusion) (nearestℤω z)).re| ≤ |2⁻¹|
Tactic:
cases' z with x y
State after:
case mk
a b c : ℤω
x y : ℝ
⊢ |({ re := x, im := y } - OneHom.toFun (↑↑inclusion) (nearestℤω { re := x, im := y })).re| ≤ |2⁻¹|

State before:
case mk
a b c : ℤω
x y : ℝ
⊢ |({ re := x, im := y } - OneHom.toFun (↑↑inclusion) (nearestℤω { re := x, im := y })).re| ≤ |2⁻¹|
Tactic:
unfold nearestℤω
State after:
case mk
a b c : ℤω
x y : ℝ
⊢ |({ re := x, im := y } -
          OneHom.toFun (↑↑inclusion)
            (let y_1 := round (2 * rt3⁻¹ * { re := x, im := y }.im);
            { x := round ({ re := x, im := y }.re + 2⁻¹ * ↑y_1), y := y_1 })).re| ≤
    |2⁻¹|

State before:
case mk
a b c : ℤω
x y : ℝ
⊢ |({ re := x, im := y } -
          OneHom.toFun (↑↑inclusion)
            (let y_1 := round (2 * rt3⁻¹ * { re := x, im := y }.im);
            { x := round ({ re := x, im := y }.re + 2⁻¹ * ↑y_1), y := y_1 })).re| ≤
    |2⁻¹|
Tactic:
dsimp
State after:
case mk
a b c : ℤω
x y : ℝ
⊢ |x - (↑inclusion { x := round (x + 2⁻¹ * ↑(round (2 * rt3⁻¹ * y))), y := round (2 * rt3⁻¹ * y) }).re| ≤ |2⁻¹|