l3lab/ntp-mathlib huggingface dataset:
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
  cases a <;> cases b <;> cases c <;> first | 

Proof state:
case pos.pos.zero
x✝¹ : pos ≤ pos
x✝ : pos ≤ zero
⊢ pos ≤ zero

Next tactic:
tauto
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
  cases a <;> cases b <;> cases c <;> 

Proof state:
case pos.pos.neg
x✝¹ : pos ≤ pos
x✝ : pos ≤ neg
⊢ pos ≤ neg

Next tactic:
first | tauto | constructor
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
  cases a <;> cases b <;> cases c <;> first | 

Proof state:
case pos.pos.neg
x✝¹ : pos ≤ pos
x✝ : pos ≤ neg
⊢ pos ≤ neg

Next tactic:
tauto
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
  cases a <;> cases b <;> cases c <;> 

Proof state:
case pos.pos.pos
x✝¹ x✝ : pos ≤ pos
⊢ pos ≤ pos

Next tactic:
first | tauto | constructor
private lemma le_trans (a b c : SignType) (_ : a ≤ b) (_: b ≤ c) : a ≤ c := by
  cases a <;> cases b <;> cases c <;> first | 

Proof state:
case pos.pos.pos
x✝¹ x✝ : pos ≤ pos
⊢ pos ≤ pos

Next tactic:
tauto
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by 

Proof state:
a : SignType
⊢ a ≤ a

Next tactic:
cases a
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> 

Proof state:
case zero
⊢ zero ≤ zero

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> 

Proof state:
case neg
⊢ neg ≤ neg

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> 

Proof state:
case pos
⊢ pos ≤ pos

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by 

Proof state:
a b : SignType
⊢ a ≤ b ∨ b ≤ a

Next tactic:
cases a
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> 

Proof state:
case zero
b : SignType
⊢ zero ≤ b ∨ b ≤ zero

Next tactic:
cases b
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> 

Proof state:
case neg
b : SignType
⊢ neg ≤ b ∨ b ≤ neg

Next tactic:
cases b
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> 

Proof state:
case pos
b : SignType
⊢ pos ≤ b ∨ b ≤ pos

Next tactic:
cases b
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case zero.zero
⊢ zero ≤ zero ∨ zero ≤ zero

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case zero.zero
⊢ zero ≤ zero ∨ zero ≤ zero

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case zero.zero.h
⊢ zero ≤ zero

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case zero.neg
⊢ zero ≤ neg ∨ neg ≤ zero

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case zero.neg
⊢ zero ≤ neg ∨ neg ≤ zero

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case zero.neg.h
⊢ zero ≤ neg

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; constructor | 

Proof state:
case zero.neg
⊢ zero ≤ neg ∨ neg ≤ zero

Next tactic:
right
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; constructor | right; 

Proof state:
case zero.neg.h
⊢ neg ≤ zero

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case zero.pos
⊢ zero ≤ pos ∨ pos ≤ zero

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case zero.pos
⊢ zero ≤ pos ∨ pos ≤ zero

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case zero.pos.h
⊢ zero ≤ pos

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case neg.zero
⊢ neg ≤ zero ∨ zero ≤ neg

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case neg.zero
⊢ neg ≤ zero ∨ zero ≤ neg

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case neg.zero.h
⊢ neg ≤ zero

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case neg.neg
⊢ neg ≤ neg ∨ neg ≤ neg

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case neg.neg
⊢ neg ≤ neg ∨ neg ≤ neg

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case neg.neg.h
⊢ neg ≤ neg

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case neg.pos
⊢ neg ≤ pos ∨ pos ≤ neg

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case neg.pos
⊢ neg ≤ pos ∨ pos ≤ neg

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case neg.pos.h
⊢ neg ≤ pos

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case pos.zero
⊢ pos ≤ zero ∨ zero ≤ pos

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case pos.zero
⊢ pos ≤ zero ∨ zero ≤ pos

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case pos.zero.h
⊢ pos ≤ zero

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; constructor | 

Proof state:
case pos.zero
⊢ pos ≤ zero ∨ zero ≤ pos

Next tactic:
right
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; constructor | right; 

Proof state:
case pos.zero.h
⊢ zero ≤ pos

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case pos.neg
⊢ pos ≤ neg ∨ neg ≤ pos

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case pos.neg
⊢ pos ≤ neg ∨ neg ≤ pos

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case pos.neg.h
⊢ pos ≤ neg

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; constructor | 

Proof state:
case pos.neg
⊢ pos ≤ neg ∨ neg ≤ pos

Next tactic:
right
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; constructor | right; 

Proof state:
case pos.neg.h
⊢ neg ≤ pos

Next tactic:
constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> 

Proof state:
case pos.pos
⊢ pos ≤ pos ∨ pos ≤ pos

Next tactic:
first | left; constructor | right; constructor
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | 

Proof state:
case pos.pos
⊢ pos ≤ pos ∨ pos ≤ pos

Next tactic:
left
instance : LinearOrder SignType where
  le := (· ≤ ·)
  le_refl a := by cases a <;> constructor
  le_total a b := by cases a <;> cases b <;> first | left; 

Proof state:
case pos.pos.h
⊢ pos ≤ pos

Next tactic:
constructor
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by 

Proof state:
x : SignType
⊢ - -x = x

Next tactic:
cases x
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> 

Proof state:
case zero
⊢ - -zero = zero

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> 

Proof state:
case neg
⊢ - -neg = neg

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> 

Proof state:
case pos
⊢ - -pos = pos

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by 

Proof state:
x y : SignType
⊢ -x * y = -(x * y)

Next tactic:
cases x
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> 

Proof state:
case zero
y : SignType
⊢ -zero * y = -(zero * y)

Next tactic:
cases y
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> 

Proof state:
case neg
y : SignType
⊢ -neg * y = -(neg * y)

Next tactic:
cases y
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> 

Proof state:
case pos
y : SignType
⊢ -pos * y = -(pos * y)

Next tactic:
cases y
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case zero.zero
⊢ -zero * zero = -(zero * zero)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case zero.neg
⊢ -zero * neg = -(zero * neg)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case zero.pos
⊢ -zero * pos = -(zero * pos)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case neg.zero
⊢ -neg * zero = -(neg * zero)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case neg.neg
⊢ -neg * neg = -(neg * neg)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case neg.pos
⊢ -neg * pos = -(neg * pos)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case pos.zero
⊢ -pos * zero = -(pos * zero)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case pos.neg
⊢ -pos * neg = -(pos * neg)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> 

Proof state:
case pos.pos
⊢ -pos * pos = -(pos * pos)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by 

Proof state:
x y : SignType
⊢ x * -y = -(x * y)

Next tactic:
cases x
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> 

Proof state:
case zero
y : SignType
⊢ zero * -y = -(zero * y)

Next tactic:
cases y
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> 

Proof state:
case neg
y : SignType
⊢ neg * -y = -(neg * y)

Next tactic:
cases y
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> 

Proof state:
case pos
y : SignType
⊢ pos * -y = -(pos * y)

Next tactic:
cases y
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case zero.zero
⊢ zero * -zero = -(zero * zero)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case zero.neg
⊢ zero * -neg = -(zero * neg)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case zero.pos
⊢ zero * -pos = -(zero * pos)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case neg.zero
⊢ neg * -zero = -(neg * zero)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case neg.neg
⊢ neg * -neg = -(neg * neg)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case neg.pos
⊢ neg * -pos = -(neg * pos)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case pos.zero
⊢ pos * -zero = -(pos * zero)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case pos.neg
⊢ pos * -neg = -(pos * neg)

Next tactic:
rfl
instance : HasDistribNeg SignType :=
  { neg_neg := fun x => by cases x <;> rfl
    neg_mul := fun x y => by cases x <;> cases y <;> rfl
    mul_neg := fun x y => by cases x <;> cases y <;> 

Proof state:
case pos.pos
⊢ pos * -pos = -(pos * pos)

Next tactic:
rfl
/-- `SignType` is equivalent to `Fin 3`. -/
def fin3Equiv : SignType ≃* Fin 3 where
  toFun a :=
    match a with
    | 0 => ⟨0, by 

Proof state:
a : SignType
⊢ 0 < 3

Next tactic:
simp
/-- `SignType` is equivalent to `Fin 3`. -/
def fin3Equiv : SignType ≃* Fin 3 where
  toFun a :=
    match a with
    | 0 => ⟨0, by simp⟩
    | 1 => ⟨1, by 

Proof state:
a : SignType
⊢ 1 < 3

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

Proof state:
a : SignType
⊢ 2 < 3

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

Proof state:
a : SignType
⊢ (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)
      ((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) })
        a) =
    a

Next tactic:
cases a
/-- `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 <;> 

Proof state:
case zero
⊢ (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)
      ((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) })
        zero) =
    zero

Next tactic:
rfl
/-- `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 <;> 

Proof state:
case neg
⊢ (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)
      ((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) })
        neg) =
    neg

Next tactic:
rfl
/-- `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 <;> 

Proof state:
case pos
⊢ (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)
      ((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) })
        pos) =
    pos

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

Proof state:
a : Fin 3
isLt✝ : 0 < 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 := 0, isLt := isLt✝ }) =
    { val := 0, isLt := isLt✝ }

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

Proof state:
a : Fin 3
isLt✝ : 1 < 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 := 1, isLt := isLt✝ }) =
    { val := 1, isLt := isLt✝ }

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

Proof state:
a : Fin 3
isLt✝ : 2 < 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 := 2, isLt := isLt✝ }) =
    { val := 2, isLt := isLt✝ }

Next tactic:
simp