Theorem: EReal.le_iff_sign
File: Mathlib/Data/Real/EReal.lean

tactic: constructor
state_before: x y : EReal
⊢ x ≤ y ↔
    ↑sign x < ↑sign y ∨
      ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
        ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero ∨
          ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: intro h
state_before: case mp
x y : EReal
⊢ x ≤ y →
    ↑sign x < ↑sign y ∨
      ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
        ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero ∨
          ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: refine (sign.monotone h).lt_or_eq.imp_right (fun hs => ?_)
state_before: case mp
x y : EReal
h : x ≤ y
⊢ ↑sign x < ↑sign y ∨
    ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
      ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero ∨
        ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: rw [← x.sign_mul_abs, ← y.sign_mul_abs] at h
state_before: case mp
x y : EReal
h : x ≤ y
hs : ↑sign x = ↑sign y
⊢ ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
    ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero ∨
      ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: cases hy : sign y <;> rw [hs, hy] at h ⊢
state_before: case mp
x y : EReal
h : ↑(↑sign x) * ↑(EReal.abs x) ≤ ↑(↑sign y) * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
⊢ ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
    ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero ∨
      ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: simp
state_before: case mp.zero
x y : EReal
h : ↑SignType.zero * ↑(EReal.abs x) ≤ ↑SignType.zero * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
hy : ↑sign y = SignType.zero
⊢ SignType.zero = SignType.neg ∧ SignType.zero = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
    SignType.zero = SignType.zero ∧ SignType.zero = SignType.zero ∨
      SignType.zero = SignType.pos ∧ SignType.zero = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: left
state_before: case mp.neg
x y : EReal
h : ↑SignType.neg * ↑(EReal.abs x) ≤ ↑SignType.neg * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
hy : ↑sign y = SignType.neg
⊢ SignType.neg = SignType.neg ∧ SignType.neg = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
    SignType.neg = SignType.zero ∧ SignType.neg = SignType.zero ∨
      SignType.neg = SignType.pos ∧ SignType.neg = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: simpa using h
state_before: case mp.neg.h
x y : EReal
h : ↑SignType.neg * ↑(EReal.abs x) ≤ ↑SignType.neg * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
hy : ↑sign y = SignType.neg
⊢ SignType.neg = SignType.neg ∧ SignType.neg = SignType.neg ∧ EReal.abs y ≤ EReal.abs x

tactic: right
state_before: case mp.pos
x y : EReal
h : ↑SignType.pos * ↑(EReal.abs x) ≤ ↑SignType.pos * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
hy : ↑sign y = SignType.pos
⊢ SignType.pos = SignType.neg ∧ SignType.pos = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
    SignType.pos = SignType.zero ∧ SignType.pos = SignType.zero ∨
      SignType.pos = SignType.pos ∧ SignType.pos = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: right
state_before: case mp.pos.h
x y : EReal
h : ↑SignType.pos * ↑(EReal.abs x) ≤ ↑SignType.pos * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
hy : ↑sign y = SignType.pos
⊢ SignType.pos = SignType.zero ∧ SignType.pos = SignType.zero ∨
    SignType.pos = SignType.pos ∧ SignType.pos = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: simpa using h
state_before: case mp.pos.h.h
x y : EReal
h : ↑SignType.pos * ↑(EReal.abs x) ≤ ↑SignType.pos * ↑(EReal.abs y)
hs : ↑sign x = ↑sign y
hy : ↑sign y = SignType.pos
⊢ SignType.pos = SignType.pos ∧ SignType.pos = SignType.pos ∧ EReal.abs x ≤ EReal.abs y

tactic: rintro (h | h | h | h)
state_before: case mpr
x y : EReal
⊢ ↑sign x < ↑sign y ∨
      ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x ∨
        ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero ∨
          ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y →
    x ≤ y

tactic: all_goals rw [← x.sign_mul_abs, ← y.sign_mul_abs]; simp [h]
state_before: case mpr.inr.inl
x y : EReal
h : ↑sign x = SignType.neg ∧ ↑sign y = SignType.neg ∧ EReal.abs y ≤ EReal.abs x
⊢ x ≤ y

case mpr.inr.inr.inl
x y : EReal
h : ↑sign x = SignType.zero ∧ ↑sign y = SignType.zero
⊢ x ≤ y

case mpr.inr.inr.inr
x y : EReal
h : ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y
⊢ x ≤ y

tactic: exact (sign.monotone.reflect_lt h).le
state_before: case mpr.inl
x y : EReal
h : ↑sign x < ↑sign y
⊢ x ≤ y

tactic: rw [← x.sign_mul_abs, ← y.sign_mul_abs]
state_before: case mpr.inr.inr.inr
x y : EReal
h : ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y
⊢ x ≤ y

tactic: simp [h]
state_before: case mpr.inr.inr.inr
x y : EReal
h : ↑sign x = SignType.pos ∧ ↑sign y = SignType.pos ∧ EReal.abs x ≤ EReal.abs y
⊢ ↑(↑sign x) * ↑(EReal.abs x) ≤ ↑(↑sign y) * ↑(EReal.abs y)