l3lab/ntp-mathlib huggingface dataset:
/-- `SignType` is equivalent to `Fin 3`. -/
def fin3Equiv : SignType ≃* Fin 3 where
  toFun a :=
    match a with
    | 0 => ⟨0, by simp⟩
    | 1 => ⟨1, by simp⟩
    | -1 => ⟨2, by simp⟩
  invFun a :=
    match a with
    | ⟨0, _⟩ => 0
    | ⟨1, _⟩ => 1
    | ⟨2, _⟩ => -1
    | ⟨n + 3, h⟩ => (h.not_le le_add_self).elim
  left_inv a := by cases a <;> rfl
  right_inv a :=
    match a with
    | ⟨0, _⟩ => by simp
    | ⟨1, _⟩ => by simp
    | ⟨2, _⟩ => by simp
    | ⟨n + 3, h⟩ => by 

Proof state:
a : Fin 3
n : ℕ
h : n + 3 < 3
⊢ (fun a =>
        match a with
        | zero => { val := 0, isLt := (_ : 0 < 3) }
        | pos => { val := 1, isLt := (_ : 1 < Nat.succ (Nat.succ 1)) }
        | neg => { val := 2, isLt := (_ : 2 < Nat.succ 2) })
      ((fun a =>
          match a with
          | { val := 0, isLt := isLt } => 0
          | { val := 1, isLt := isLt } => 1
          | { val := 2, isLt := isLt } => -1
          | { val := Nat.succ (Nat.succ (Nat.succ n)), isLt := h } => (_ : False).elim)
        { val := n + 3, isLt := h }) =
    { val := n + 3, isLt := h }

Next tactic:
simp at h
theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1 := by 

Proof state:
a : SignType
⊢ 0 ≤ a ↔ a = 0 ∨ a = 1

Next tactic:
cases a
theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1 := by cases a <;> 

Proof state:
case zero
⊢ 0 ≤ zero ↔ zero = 0 ∨ zero = 1

Next tactic:
decide
theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1 := by cases a <;> 

Proof state:
case neg
⊢ 0 ≤ neg ↔ neg = 0 ∨ neg = 1

Next tactic:
decide
theorem nonneg_iff {a : SignType} : 0 ≤ a ↔ a = 0 ∨ a = 1 := by cases a <;> 

Proof state:
case pos
⊢ 0 ≤ pos ↔ pos = 0 ∨ pos = 1

Next tactic:
decide
theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by 

Proof state:
a : SignType
⊢ 0 ≤ a ↔ a ≠ -1

Next tactic:
cases a
theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by cases a <;> 

Proof state:
case zero
⊢ 0 ≤ zero ↔ zero ≠ -1

Next tactic:
decide
theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by cases a <;> 

Proof state:
case neg
⊢ 0 ≤ neg ↔ neg ≠ -1

Next tactic:
decide
theorem nonneg_iff_ne_neg_one {a : SignType} : 0 ≤ a ↔ a ≠ -1 := by cases a <;> 

Proof state:
case pos
⊢ 0 ≤ pos ↔ pos ≠ -1

Next tactic:
decide
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by 

Proof state:
a : SignType
⊢ -1 < a ↔ 0 ≤ a

Next tactic:
cases a
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by cases a <;> 

Proof state:
case zero
⊢ -1 < zero ↔ 0 ≤ zero

Next tactic:
decide
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by cases a <;> 

Proof state:
case neg
⊢ -1 < neg ↔ 0 ≤ neg

Next tactic:
decide
theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a := by cases a <;> 

Proof state:
case pos
⊢ -1 < pos ↔ 0 ≤ pos

Next tactic:
decide
theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0 := by 

Proof state:
a : SignType
⊢ a ≤ 0 ↔ a = -1 ∨ a = 0

Next tactic:
cases a
theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0 := by cases a <;> 

Proof state:
case zero
⊢ zero ≤ 0 ↔ zero = -1 ∨ zero = 0

Next tactic:
decide
theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0 := by cases a <;> 

Proof state:
case neg
⊢ neg ≤ 0 ↔ neg = -1 ∨ neg = 0

Next tactic:
decide
theorem nonpos_iff {a : SignType} : a ≤ 0 ↔ a = -1 ∨ a = 0 := by cases a <;> 

Proof state:
case pos
⊢ pos ≤ 0 ↔ pos = -1 ∨ pos = 0

Next tactic:
decide
theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by 

Proof state:
a : SignType
⊢ a ≤ 0 ↔ a ≠ 1

Next tactic:
cases a
theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by cases a <;> 

Proof state:
case zero
⊢ zero ≤ 0 ↔ zero ≠ 1

Next tactic:
decide
theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by cases a <;> 

Proof state:
case neg
⊢ neg ≤ 0 ↔ neg ≠ 1

Next tactic:
decide
theorem nonpos_iff_ne_one {a : SignType} : a ≤ 0 ↔ a ≠ 1 := by cases a <;> 

Proof state:
case pos
⊢ pos ≤ 0 ↔ pos ≠ 1

Next tactic:
decide
theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by 

Proof state:
a : SignType
⊢ a < 1 ↔ a ≤ 0

Next tactic:
cases a
theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by cases a <;> 

Proof state:
case zero
⊢ zero < 1 ↔ zero ≤ 0

Next tactic:
decide
theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by cases a <;> 

Proof state:
case neg
⊢ neg < 1 ↔ neg ≤ 0

Next tactic:
decide
theorem lt_one_iff {a : SignType} : a < 1 ↔ a ≤ 0 := by cases a <;> 

Proof state:
case pos
⊢ pos < 1 ↔ pos ≤ 0

Next tactic:
decide
@[simp]
theorem neg_iff {a : SignType} : a < 0 ↔ a = -1 := by 

Proof state:
a : SignType
⊢ a < 0 ↔ a = -1

Next tactic:
cases a
@[simp]
theorem neg_iff {a : SignType} : a < 0 ↔ a = -1 := by cases a <;> 

Proof state:
case zero
⊢ zero < 0 ↔ zero = -1

Next tactic:
decide
@[simp]
theorem neg_iff {a : SignType} : a < 0 ↔ a = -1 := by cases a <;> 

Proof state:
case neg
⊢ neg < 0 ↔ neg = -1

Next tactic:
decide
@[simp]
theorem neg_iff {a : SignType} : a < 0 ↔ a = -1 := by cases a <;> 

Proof state:
case pos
⊢ pos < 0 ↔ pos = -1

Next tactic:
decide
@[simp]
theorem pos_iff {a : SignType} : 0 < a ↔ a = 1 := by 

Proof state:
a : SignType
⊢ 0 < a ↔ a = 1

Next tactic:
cases a
@[simp]
theorem pos_iff {a : SignType} : 0 < a ↔ a = 1 := by cases a <;> 

Proof state:
case zero
⊢ 0 < zero ↔ zero = 1

Next tactic:
decide
@[simp]
theorem pos_iff {a : SignType} : 0 < a ↔ a = 1 := by cases a <;> 

Proof state:
case neg
⊢ 0 < neg ↔ neg = 1

Next tactic:
decide
@[simp]
theorem pos_iff {a : SignType} : 0 < a ↔ a = 1 := by cases a <;> 

Proof state:
case pos
⊢ 0 < pos ↔ pos = 1

Next tactic:
decide
@[simp]
theorem self_eq_neg_iff (a : SignType) : a = -a ↔ a = 0 := by 

Proof state:
a : SignType
⊢ a = -a ↔ a = 0

Next tactic:
cases a
@[simp]
theorem self_eq_neg_iff (a : SignType) : a = -a ↔ a = 0 := by cases a <;> 

Proof state:
case zero
⊢ zero = -zero ↔ zero = 0

Next tactic:
decide
@[simp]
theorem self_eq_neg_iff (a : SignType) : a = -a ↔ a = 0 := by cases a <;> 

Proof state:
case neg
⊢ neg = -neg ↔ neg = 0

Next tactic:
decide
@[simp]
theorem self_eq_neg_iff (a : SignType) : a = -a ↔ a = 0 := by cases a <;> 

Proof state:
case pos
⊢ pos = -pos ↔ pos = 0

Next tactic:
decide
@[simp]
theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by 

Proof state:
a : SignType
⊢ -a = a ↔ a = 0

Next tactic:
cases a
@[simp]
theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by cases a <;> 

Proof state:
case zero
⊢ -zero = zero ↔ zero = 0

Next tactic:
decide
@[simp]
theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by cases a <;> 

Proof state:
case neg
⊢ -neg = neg ↔ neg = 0

Next tactic:
decide
@[simp]
theorem neg_eq_self_iff (a : SignType) : -a = a ↔ a = 0 := by cases a <;> 

Proof state:
case pos
⊢ -pos = pos ↔ pos = 0

Next tactic:
decide
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by 

Proof state:
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
x y : SignType
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (x * y) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } x *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } y

Next tactic:
cases x
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> 

Proof state:
case zero
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
y : SignType
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (zero * y) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } y

Next tactic:
cases y
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> 

Proof state:
case neg
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
y : SignType
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (neg * y) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } y

Next tactic:
cases y
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> 

Proof state:
case pos
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
y : SignType
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (pos * y) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } y

Next tactic:
cases y
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case zero.zero
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (zero * zero) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case zero.neg
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (zero * neg) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case zero.pos
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (zero * pos) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case neg.zero
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (neg * zero) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case neg.neg
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (neg * neg) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case neg.pos
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (neg * pos) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case pos.zero
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (pos * zero) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } zero

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case pos.neg
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (pos * neg) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } neg

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
/-- `SignType.cast` as a `MulWithZeroHom`. -/
@[simps]
def castHom {α} [MulZeroOneClass α] [HasDistribNeg α] : SignType →*₀ α where
  toFun := cast
  map_zero' := rfl
  map_one' := rfl
  map_mul' x y := by cases x <;> cases y <;> 

Proof state:
case pos.pos
α : Type ?u.57353
inst✝¹ : MulZeroOneClass α
inst✝ : HasDistribNeg α
⊢ ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } (pos * pos) =
    ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos *
      ZeroHom.toFun { toFun := cast, map_zero' := (_ : ↑0 = ↑0) } pos

Next tactic:
simp [zero_eq_zero, pos_eq_one, neg_eq_neg_one]
theorem univ_eq : (Finset.univ : Finset SignType) = {0, -1, 1} := by
  

Proof state:
⊢ Finset.univ = {0, -1, 1}

Next tactic:
decide
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
  

Proof state:
α : Type u_1
f : SignType → α
⊢ Set.range f = {f zero, f neg, f pos}

Next tactic:
classical rw [← Fintype.coe_image_univ, univ_eq]
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
  classical 

Proof state:
α : Type u_1
f : SignType → α
⊢ Set.range f = {f zero, f neg, f pos}

Next tactic:
rw [← Fintype.coe_image_univ, univ_eq]
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
  classical rw [← Fintype.coe_image_univ, univ_eq]
  

Proof state:
α : Type u_1
f : SignType → α
⊢ ↑(Finset.image f {0, -1, 1}) = {f zero, f neg, f pos}

Next tactic:
classical simp [Finset.coe_insert]
theorem range_eq {α} (f : SignType → α) : Set.range f = {f zero, f neg, f pos} := by
  classical rw [← Fintype.coe_image_univ, univ_eq]
  classical 

Proof state:
α : Type u_1
f : SignType → α
⊢ ↑(Finset.image f {0, -1, 1}) = {f zero, f neg, f pos}

Next tactic:
simp [Finset.coe_insert]
/-- 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
    

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

Next tactic:
dsimp
/-- 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
    

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

Next tactic:
split_ifs with h₁ h₂ h₃ h₄ _ _ h₂ 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₃ <;> 

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
⊢ 1 ≤ 1

Next tactic:
try 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 

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
⊢ 1 ≤ 1

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₃ <;> 

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:
try 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 

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:
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₃ <;> 

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:
try 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 

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:
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₃ <;> 

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
_ : 0 < b
⊢ -1 ≤ 1

Next tactic:
try 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 

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
_ : 0 < b
⊢ -1 ≤ 1

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₃ <;> 

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
_✝ : ¬0 < b
_ : b < 0
⊢ -1 ≤ -1

Next tactic:
try 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 

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
_✝ : ¬0 < b
_ : b < 0
⊢ -1 ≤ -1

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₃ <;> 

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
_✝ : ¬0 < b
_ : ¬b < 0
⊢ -1 ≤ 0

Next tactic:
try 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 

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
_✝ : ¬0 < b
_ : ¬b < 0
⊢ -1 ≤ 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₃ <;> 

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
⊢ 0 ≤ 1

Next tactic:
try 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 

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
⊢ 0 ≤ 1

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₃ <;> 

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:
try 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 

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:
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₃ <;> 

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:
try constructor