l3lab/ntp-mathlib huggingface dataset:
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
  ⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h => by
    dsimp
    split_ifs with h₁ h₂ h₃ h₄ _ _ h₂ h₃ <;> try 

Proof state:
case neg
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a✝ a b : α
h : a ≤ b
h₁ : ¬0 < a
h₄ : ¬a < 0
h₂ : ¬0 < b
h₃ : ¬b < 0
⊢ 0 ≤ 0

Next tactic:
constructor
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
  ⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h => by
    dsimp
    split_ifs with h₁ h₂ h₃ h₄ _ _ h₂ h₃ <;> try constructor
    · 

Proof state:
case pos
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a✝ a b : α
h : a ≤ b
h₁ : 0 < a
h₂ : ¬0 < b
h₃ : b < 0
⊢ 1 ≤ -1

Next tactic:
cases lt_irrefl 0 (h₁.trans <| h.trans_lt h₃)
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
  ⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h => by
    dsimp
    split_ifs with h₁ h₂ h₃ h₄ _ _ h₂ h₃ <;> try constructor
    · cases lt_irrefl 0 (h₁.trans <| h.trans_lt h₃)
    · 

Proof state:
case neg
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a✝ a b : α
h : a ≤ b
h₁ : 0 < a
h₂ : ¬0 < b
h₃ : ¬b < 0
⊢ 1 ≤ 0

Next tactic:
cases h₂ (h₁.trans_le h)
/-- The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise. -/
def SignType.sign : α →o SignType :=
  ⟨fun a => if 0 < a then 1 else if a < 0 then -1 else 0, fun a b h => by
    dsimp
    split_ifs with h₁ h₂ h₃ h₄ _ _ h₂ h₃ <;> try constructor
    · cases lt_irrefl 0 (h₁.trans <| h.trans_lt h₃)
    · cases h₂ (h₁.trans_le h)
    · 

Proof state:
case pos
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a✝ a b : α
h : a ≤ b
h₁ : ¬0 < a
h₄ : ¬a < 0
h₂ : ¬0 < b
h₃ : b < 0
⊢ 0 ≤ -1

Next tactic:
cases h₄ (h.trans_lt h₃)
@[simp]
theorem sign_zero : sign (0 : α) = 0 := by 

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
⊢ sign 0 = 0

Next tactic:
simp [sign_apply]
@[simp]
theorem sign_pos (ha : 0 < a) : sign a = 1 := by 

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
ha : 0 < a
⊢ sign a = 1

Next tactic:
rwa [sign_apply, if_pos]
@[simp]
theorem sign_neg (ha : a < 0) : sign a = -1 := by 

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
ha : a < 0
⊢ sign a = -1

Next tactic:
rwa [sign_apply, if_neg <| asymm ha, if_pos]
theorem sign_eq_one_iff : sign a = 1 ↔ 0 < a := by
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
⊢ sign a = 1 ↔ 0 < a

Next tactic:
refine' ⟨fun h => _, fun h => sign_pos h⟩
theorem sign_eq_one_iff : sign a = 1 ↔ 0 < a := by
  refine' ⟨fun h => _, fun h => sign_pos h⟩
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
h : sign a = 1
⊢ 0 < a

Next tactic:
by_contra hn
theorem sign_eq_one_iff : sign a = 1 ↔ 0 < a := by
  refine' ⟨fun h => _, fun h => sign_pos h⟩
  by_contra hn
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
h : sign a = 1
hn : ¬0 < a
⊢ False

Next tactic:
rw [sign_apply, if_neg hn] at h
theorem sign_eq_one_iff : sign a = 1 ↔ 0 < a := by
  refine' ⟨fun h => _, fun h => sign_pos h⟩
  by_contra hn
  rw [sign_apply, if_neg hn] at h
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
h : (if a < 0 then -1 else 0) = 1
hn : ¬0 < a
⊢ False

Next tactic:
split_ifs at h
theorem sign_eq_neg_one_iff : sign a = -1 ↔ a < 0 := by
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
⊢ sign a = -1 ↔ a < 0

Next tactic:
refine' ⟨fun h => _, fun h => sign_neg h⟩
theorem sign_eq_neg_one_iff : sign a = -1 ↔ a < 0 := by
  refine' ⟨fun h => _, fun h => sign_neg h⟩
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
h : sign a = -1
⊢ a < 0

Next tactic:
rw [sign_apply] at h
theorem sign_eq_neg_one_iff : sign a = -1 ↔ a < 0 := by
  refine' ⟨fun h => _, fun h => sign_neg h⟩
  rw [sign_apply] at h
  

Proof state:
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
h : (if 0 < a then 1 else if a < 0 then -1 else 0) = -1
⊢ a < 0

Next tactic:
split_ifs at h
theorem sign_eq_neg_one_iff : sign a = -1 ↔ a < 0 := by
  refine' ⟨fun h => _, fun h => sign_neg h⟩
  rw [sign_apply] at h
  split_ifs at h
  · 

Proof state:
case pos
α : Type u_1
inst✝² : Zero α
inst✝¹ : Preorder α
inst✝ : DecidableRel fun x x_1 => x < x_1
a : α
h✝¹ : ¬0 < a
h✝ : a < 0
h : -1 = -1
⊢ a < 0

Next tactic:
assumption
@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0 := by
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
⊢ sign a = 0 ↔ a = 0

Next tactic:
refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0 := by
  refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : sign a = 0
⊢ a = 0

Next tactic:
rw [sign_apply] at h
@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0 := by
  refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
  rw [sign_apply] at h
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : (if 0 < a then 1 else if a < 0 then -1 else 0) = 0
⊢ a = 0

Next tactic:
split_ifs at h with h_1 h_2
@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0 := by
  refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
  rw [sign_apply] at h
  split_ifs at h with h_1 h_2
  

Proof state:
case neg
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h_1 : ¬0 < a
h_2 : ¬a < 0
h : 0 = 0
⊢ a = 0

Next tactic:
cases' h
@[simp]
theorem sign_eq_zero_iff : sign a = 0 ↔ a = 0 := by
  refine' ⟨fun h => _, fun h => h.symm ▸ sign_zero⟩
  rw [sign_apply] at h
  split_ifs at h with h_1 h_2
  cases' h
  

Proof state:
case neg.refl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h_1 : ¬0 < a
h_2 : ¬a < 0
⊢ a = 0

Next tactic:
exact (le_of_not_lt h_1).eq_of_not_lt h_2
@[simp]
theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a := by
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
⊢ 0 ≤ sign a ↔ 0 ≤ a

Next tactic:
rcases lt_trichotomy 0 a with (h | h | h)
@[simp]
theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a := by
  rcases lt_trichotomy 0 a with (h | h | h)
  · 

Proof state:
case inl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : 0 < a
⊢ 0 ≤ sign a ↔ 0 ≤ a

Next tactic:
simp [h, h.le]
@[simp]
theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a := by
  rcases lt_trichotomy 0 a with (h | h | h)
  · simp [h, h.le]
  · 

Proof state:
case inr.inl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : 0 = a
⊢ 0 ≤ sign a ↔ 0 ≤ a

Next tactic:
simp [← h]
@[simp]
theorem sign_nonneg_iff : 0 ≤ sign a ↔ 0 ≤ a := by
  rcases lt_trichotomy 0 a with (h | h | h)
  · simp [h, h.le]
  · simp [← h]
  · 

Proof state:
case inr.inr
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : a < 0
⊢ 0 ≤ sign a ↔ 0 ≤ a

Next tactic:
simp [h, h.not_le]
@[simp]
theorem sign_nonpos_iff : sign a ≤ 0 ↔ a ≤ 0 := by
  

Proof state:
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
⊢ sign a ≤ 0 ↔ a ≤ 0

Next tactic:
rcases lt_trichotomy 0 a with (h | h | h)
@[simp]
theorem sign_nonpos_iff : sign a ≤ 0 ↔ a ≤ 0 := by
  rcases lt_trichotomy 0 a with (h | h | h)
  · 

Proof state:
case inl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : 0 < a
⊢ sign a ≤ 0 ↔ a ≤ 0

Next tactic:
simp [h, h.not_le]
@[simp]
theorem sign_nonpos_iff : sign a ≤ 0 ↔ a ≤ 0 := by
  rcases lt_trichotomy 0 a with (h | h | h)
  · simp [h, h.not_le]
  · 

Proof state:
case inr.inl
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : 0 = a
⊢ sign a ≤ 0 ↔ a ≤ 0

Next tactic:
simp [← h]
@[simp]
theorem sign_nonpos_iff : sign a ≤ 0 ↔ a ≤ 0 := by
  rcases lt_trichotomy 0 a with (h | h | h)
  · simp [h, h.not_le]
  · simp [← h]
  · 

Proof state:
case inr.inr
α : Type u_1
inst✝¹ : Zero α
inst✝ : LinearOrder α
a : α
h : a < 0
⊢ sign a ≤ 0 ↔ a ≤ 0

Next tactic:
simp [h, h.le]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
⊢ sign (x * y) = sign x * sign y

Next tactic:
rcases lt_trichotomy x 0 with (hx | hx | hx)
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> 

Proof state:
case inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x < 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
rcases lt_trichotomy y 0 with (hy | hy | hy)
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> 

Proof state:
case inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x = 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
rcases lt_trichotomy y 0 with (hy | hy | hy)
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> 

Proof state:
case inr.inr
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : 0 < x
⊢ sign (x * y) = sign x * sign y

Next tactic:
rcases lt_trichotomy y 0 with (hy | hy | hy)
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inl.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x < 0
hy : y < 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inl.inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x < 0
hy : y = 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inl.inr.inr
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x < 0
hy : 0 < y
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inr.inl.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x = 0
hy : y < 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inr.inl.inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x = 0
hy : y = 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inr.inl.inr.inr
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : x = 0
hy : 0 < y
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inr.inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : 0 < x
hy : y < 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inr.inr.inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : 0 < x
hy : y = 0
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
theorem sign_mul (x y : α) : sign (x * y) = sign x * sign y := by
  rcases lt_trichotomy x 0 with (hx | hx | hx) <;> rcases lt_trichotomy y 0 with (hy | hy | hy) <;>
    

Proof state:
case inr.inr.inr.inr
α : Type u_1
inst✝ : LinearOrderedRing α
a b x y : α
hx : 0 < x
hy : 0 < y
⊢ sign (x * y) = sign x * sign y

Next tactic:
simp [hx, hy, mul_pos_of_neg_of_neg, mul_neg_of_neg_of_pos, mul_neg_of_pos_of_neg]
@[simp] theorem sign_mul_abs (x : α) : (sign x * |x| : α) = x := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedRing α
a b x : α
⊢ ↑(sign x) * |x| = x

Next tactic:
rcases lt_trichotomy x 0 with (hx | rfl | hx)
@[simp] theorem sign_mul_abs (x : α) : (sign x * |x| : α) = x := by
  rcases lt_trichotomy x 0 with (hx | rfl | hx)
  · 

Proof state:
case inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x : α
hx : x < 0
⊢ ↑(sign x) * |x| = x

Next tactic:
rw [sign_neg hx, abs_of_neg hx, coe_neg_one, neg_one_mul, neg_neg]
@[simp] theorem sign_mul_abs (x : α) : (sign x * |x| : α) = x := by
  rcases lt_trichotomy x 0 with (hx | rfl | hx)
  · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, neg_one_mul, neg_neg]
  · 

Proof state:
case inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b : α
⊢ ↑(sign 0) * |0| = 0

Next tactic:
rw [abs_zero, mul_zero]
@[simp] theorem sign_mul_abs (x : α) : (sign x * |x| : α) = x := by
  rcases lt_trichotomy x 0 with (hx | rfl | hx)
  · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, neg_one_mul, neg_neg]
  · rw [abs_zero, mul_zero]
  · 

Proof state:
case inr.inr
α : Type u_1
inst✝ : LinearOrderedRing α
a b x : α
hx : 0 < x
⊢ ↑(sign x) * |x| = x

Next tactic:
rw [sign_pos hx, abs_of_pos hx, coe_one, one_mul]
@[simp] theorem abs_mul_sign (x : α) : (|x| * sign x : α) = x := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedRing α
a b x : α
⊢ |x| * ↑(sign x) = x

Next tactic:
rcases lt_trichotomy x 0 with (hx | rfl | hx)
@[simp] theorem abs_mul_sign (x : α) : (|x| * sign x : α) = x := by
  rcases lt_trichotomy x 0 with (hx | rfl | hx)
  · 

Proof state:
case inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b x : α
hx : x < 0
⊢ |x| * ↑(sign x) = x

Next tactic:
rw [sign_neg hx, abs_of_neg hx, coe_neg_one, mul_neg_one, neg_neg]
@[simp] theorem abs_mul_sign (x : α) : (|x| * sign x : α) = x := by
  rcases lt_trichotomy x 0 with (hx | rfl | hx)
  · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, mul_neg_one, neg_neg]
  · 

Proof state:
case inr.inl
α : Type u_1
inst✝ : LinearOrderedRing α
a b : α
⊢ |0| * ↑(sign 0) = 0

Next tactic:
rw [abs_zero, zero_mul]
@[simp] theorem abs_mul_sign (x : α) : (|x| * sign x : α) = x := by
  rcases lt_trichotomy x 0 with (hx | rfl | hx)
  · rw [sign_neg hx, abs_of_neg hx, coe_neg_one, mul_neg_one, neg_neg]
  · rw [abs_zero, zero_mul]
  · 

Proof state:
case inr.inr
α : Type u_1
inst✝ : LinearOrderedRing α
a b x : α
hx : 0 < x
⊢ |x| * ↑(sign x) = x

Next tactic:
rw [sign_pos hx, abs_of_pos hx, coe_one, mul_one]
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) : sign (-a) = -sign a := by
  

Proof state:
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
⊢ sign (-a) = -sign a

Next tactic:
simp_rw [sign_apply, Left.neg_pos_iff, Left.neg_neg_iff]
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) : sign (-a) = -sign a := by
  simp_rw [sign_apply, Left.neg_pos_iff, Left.neg_neg_iff]
  

Proof state:
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
⊢ (if a < 0 then 1 else if 0 < a then -1 else 0) = -if 0 < a then 1 else if a < 0 then -1 else 0

Next tactic:
split_ifs with h h'
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) : sign (-a) = -sign a := by
  simp_rw [sign_apply, Left.neg_pos_iff, Left.neg_neg_iff]
  split_ifs with h h'
  · 

Proof state:
case pos
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : a < 0
h' : 0 < a
⊢ False

Next tactic:
exact False.elim (lt_asymm h h')
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) : sign (-a) = -sign a := by
  simp_rw [sign_apply, Left.neg_pos_iff, Left.neg_neg_iff]
  split_ifs with h h'
  · exact False.elim (lt_asymm h h')
  · 

Proof state:
case neg
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : a < 0
h' : ¬0 < a
⊢ 1 = - -1

Next tactic:
simp
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) : sign (-a) = -sign a := by
  simp_rw [sign_apply, Left.neg_pos_iff, Left.neg_neg_iff]
  split_ifs with h h'
  · exact False.elim (lt_asymm h h')
  · simp
  · 

Proof state:
case pos
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : ¬a < 0
h✝ : 0 < a
⊢ -1 = -1

Next tactic:
simp
theorem Left.sign_neg [CovariantClass α α (· + ·) (· < ·)] (a : α) : sign (-a) = -sign a := by
  simp_rw [sign_apply, Left.neg_pos_iff, Left.neg_neg_iff]
  split_ifs with h h'
  · exact False.elim (lt_asymm h h')
  · simp
  · simp
  · 

Proof state:
case neg
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : ¬a < 0
h✝ : ¬0 < a
⊢ 0 = -0

Next tactic:
simp
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
    sign (-a) = -sign a := by
  

Proof state:
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
⊢ sign (-a) = -sign a

Next tactic:
simp_rw [sign_apply, Right.neg_pos_iff, Right.neg_neg_iff]
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
    sign (-a) = -sign a := by
  simp_rw [sign_apply, Right.neg_pos_iff, Right.neg_neg_iff]
  

Proof state:
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
⊢ (if a < 0 then 1 else if 0 < a then -1 else 0) = -if 0 < a then 1 else if a < 0 then -1 else 0

Next tactic:
split_ifs with h h'
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
    sign (-a) = -sign a := by
  simp_rw [sign_apply, Right.neg_pos_iff, Right.neg_neg_iff]
  split_ifs with h h'
  · 

Proof state:
case pos
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : a < 0
h' : 0 < a
⊢ False

Next tactic:
exact False.elim (lt_asymm h h')
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
    sign (-a) = -sign a := by
  simp_rw [sign_apply, Right.neg_pos_iff, Right.neg_neg_iff]
  split_ifs with h h'
  · exact False.elim (lt_asymm h h')
  · 

Proof state:
case neg
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : a < 0
h' : ¬0 < a
⊢ 1 = - -1

Next tactic:
simp
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
    sign (-a) = -sign a := by
  simp_rw [sign_apply, Right.neg_pos_iff, Right.neg_neg_iff]
  split_ifs with h h'
  · exact False.elim (lt_asymm h h')
  · simp
  · 

Proof state:
case pos
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : ¬a < 0
h✝ : 0 < a
⊢ -1 = -1

Next tactic:
simp
theorem Right.sign_neg [CovariantClass α α (Function.swap (· + ·)) (· < ·)] (a : α) :
    sign (-a) = -sign a := by
  simp_rw [sign_apply, Right.neg_pos_iff, Right.neg_neg_iff]
  split_ifs with h h'
  · exact False.elim (lt_asymm h h')
  · simp
  · simp
  · 

Proof state:
case neg
α : Type u_1
inst✝³ : AddGroup α
inst✝² : Preorder α
inst✝¹ : DecidableRel fun x x_1 => x < x_1
inst✝ : CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1
a : α
h : ¬a < 0
h✝ : ¬0 < a
⊢ 0 = -0

Next tactic:
simp
theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
    (h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
  

Proof state:
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
ι : Type u_2
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
t : SignType
h : ∀ i ∈ s, sign (f i) = t
⊢ sign (∑ i in s, f i) = t

Next tactic:
cases t
theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
    (h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
  cases t
  · 

Proof state:
case zero
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
ι : Type u_2
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
h : ∀ i ∈ s, sign (f i) = zero
⊢ sign (∑ i in s, f i) = zero

Next tactic:
simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
    (h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
  cases t
  · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
    

Proof state:
case zero
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
ι : Type u_2
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
h : ∀ i ∈ s, f i = 0
⊢ ∑ i in s, f i = 0

Next tactic:
exact Finset.sum_eq_zero h
theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
    (h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
  cases t
  · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
    exact Finset.sum_eq_zero h
  · 

Proof state:
case neg
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
ι : Type u_2
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
h : ∀ i ∈ s, sign (f i) = neg
⊢ sign (∑ i in s, f i) = neg

Next tactic:
simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h ⊢
theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
    (h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
  cases t
  · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
    exact Finset.sum_eq_zero h
  · simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h ⊢
    

Proof state:
case neg
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
ι : Type u_2
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
h : ∀ i ∈ s, f i < 0
⊢ ∑ i in s, f i < 0

Next tactic:
exact Finset.sum_neg h hs
theorem sign_sum {ι : Type*} {s : Finset ι} {f : ι → α} (hs : s.Nonempty) (t : SignType)
    (h : ∀ i ∈ s, sign (f i) = t) : sign (∑ i in s, f i) = t := by
  cases t
  · simp_rw [zero_eq_zero, sign_eq_zero_iff] at h ⊢
    exact Finset.sum_eq_zero h
  · simp_rw [neg_eq_neg_one, sign_eq_neg_one_iff] at h ⊢
    exact Finset.sum_neg h hs
  · 

Proof state:
case pos
α : Type u_1
inst✝ : LinearOrderedAddCommGroup α
ι : Type u_2
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
h : ∀ i ∈ s, sign (f i) = pos
⊢ sign (∑ i in s, f i) = pos

Next tactic:
simp_rw [pos_eq_one, sign_eq_one_iff] at h ⊢