l3lab/ntp-mathlib huggingface dataset:
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · 

Proof state:
case pos
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : b < a
h : g b < g a
h₁ : ¬f (g a) ≤ f (g b)
h₃ : a ≤ b
⊢ 1 = -1

Next tactic:
exact absurd hab (not_lt_of_ge h₃)
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · 

Proof state:
case neg
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
⊢ (if f (g a) ≤ f (g b) then -1 else 1) =
    (if
          f (if x : g b < g a then { fst := g a, snd := g b } else { fst := g b, snd := g a }).fst ≤
            f (if x : g b < g a then { fst := g a, snd := g b } else { fst := g b, snd := g a }).snd then
        -1
      else 1) *
      if
          g⁻¹ (if x : g b < g a then { fst := g a, snd := g b } else { fst := g b, snd := g a }).fst ≤
            g⁻¹ (if x : g b < g a then { fst := g a, snd := g b } else { fst := g b, snd := g a }).snd then
        -1
      else 1

Next tactic:
rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    

Proof state:
case neg
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
⊢ (if f (g a) ≤ f (g b) then -1 else 1) =
    (if f { fst := g b, snd := g a }.fst ≤ f { fst := g b, snd := g a }.snd then -1 else 1) * -1

Next tactic:
by_cases h₁ : f (g b) ≤ f (g a)
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · 

Proof state:
case pos
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : f (g b) ≤ f (g a)
⊢ (if f (g a) ≤ f (g b) then -1 else 1) =
    (if f { fst := g b, snd := g a }.fst ≤ f { fst := g b, snd := g a }.snd then -1 else 1) * -1

Next tactic:
have : f (g b) ≠ f (g a) := by
        rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
        exact ne_of_lt hab
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · have : f (g b) ≠ f (g a) := by
        

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : f (g b) ≤ f (g a)
⊢ f (g b) ≠ f (g a)

Next tactic:
rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · have : f (g b) ≠ f (g a) := by
        rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
        

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : f (g b) ≤ f (g a)
⊢ ¬b = a

Next tactic:
exact ne_of_lt hab
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · have : f (g b) ≠ f (g a) := by
        rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
        exact ne_of_lt hab
      

Proof state:
case pos
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : f (g b) ≤ f (g a)
this : f (g b) ≠ f (g a)
⊢ (if f (g a) ≤ f (g b) then -1 else 1) =
    (if f { fst := g b, snd := g a }.fst ≤ f { fst := g b, snd := g a }.snd then -1 else 1) * -1

Next tactic:
rw [if_pos h₁, if_neg (h₁.lt_of_ne this).not_le]
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · have : f (g b) ≠ f (g a) := by
        rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
        exact ne_of_lt hab
      rw [if_pos h₁, if_neg (h₁.lt_of_ne this).not_le]
      

Proof state:
case pos
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : f (g b) ≤ f (g a)
this : f (g b) ≠ f (g a)
⊢ 1 = -1 * -1

Next tactic:
rfl
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · have : f (g b) ≠ f (g a) := by
        rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
        exact ne_of_lt hab
      rw [if_pos h₁, if_neg (h₁.lt_of_ne this).not_le]
      rfl
    · 

Proof state:
case neg
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : ¬f (g b) ≤ f (g a)
⊢ (if f (g a) ≤ f (g b) then -1 else 1) =
    (if f { fst := g b, snd := g a }.fst ≤ f { fst := g b, snd := g a }.snd then -1 else 1) * -1

Next tactic:
rw [if_neg h₁, if_pos (lt_of_not_ge h₁).le]
theorem signAux_mul {n : ℕ} (f g : Perm (Fin n)) : signAux (f * g) = signAux f * signAux g := by
  rw [← signAux_inv g]
  unfold signAux
  rw [← prod_mul_distrib]
  refine'
    prod_bij (fun a _ => signBijAux g a) signBijAux_mem _ signBijAux_inj
    (by simpa using signBijAux_surj)
  rintro ⟨a, b⟩ hab
  dsimp only [signBijAux]
  rw [mul_apply, mul_apply]
  rw [mem_finPairsLT] at hab
  by_cases h : g b < g a
  · rw [dif_pos h]
    simp only [not_le_of_gt hab, mul_one, mul_ite, mul_neg, Perm.inv_apply_self, if_false]
    split_ifs with h₁ h₂ h₃ <;> dsimp at *
    · exact absurd hab (not_lt_of_ge h₂)
    · exact absurd hab (not_lt_of_ge h₃)
  · rw [dif_neg h, inv_apply_self, inv_apply_self, if_pos hab.le]
    by_cases h₁ : f (g b) ≤ f (g a)
    · have : f (g b) ≠ f (g a) := by
        rw [Ne.def, f.injective.eq_iff, g.injective.eq_iff]
        exact ne_of_lt hab
      rw [if_pos h₁, if_neg (h₁.lt_of_ne this).not_le]
      rfl
    · rw [if_neg h₁, if_pos (lt_of_not_ge h₁).le]
      

Proof state:
case neg
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
f g : Perm (Fin n)
a b : Fin n
hab : { fst := a, snd := b }.snd < { fst := a, snd := b }.fst
h : ¬g b < g a
h₁ : ¬f (g b) ≤ f (g a)
⊢ -1 = 1 * -1

Next tactic:
rfl
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
⊢ signAux (swap 0 1) = ∏ x in {{ fst := 1, snd := 0 }}, if (swap 0 1) x.fst ≤ (swap 0 1) x.snd then -1 else 1

Next tactic:
refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
x✝ : (_ : Fin (n + 2)) × Fin (n + 2)
x₁ x₂ : Fin (n + 2)
⊢ { fst := x₁, snd := x₂ } ∈ {{ fst := 1, snd := 0 }} → { fst := x₁, snd := x₂ } ∈ finPairsLT (n + 2)

Next tactic:
simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a : (_ : Fin (n + 2)) × Fin (n + 2)
ha₁ : a ∈ finPairsLT (n + 2)
ha₂ : a ∉ {{ fst := 1, snd := 0 }}
⊢ (if (swap 0 1) a.fst ≤ (swap 0 1) a.snd then -1 else 1) = 1

Next tactic:
rcases a with ⟨a₁, a₂⟩
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    

Proof state:
case mk
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ a₂ : Fin (n + 2)
ha₁ : { fst := a₁, snd := a₂ } ∈ finPairsLT (n + 2)
ha₂ : { fst := a₁, snd := a₂ } ∉ {{ fst := 1, snd := 0 }}
⊢ (if (swap 0 1) { fst := a₁, snd := a₂ }.fst ≤ (swap 0 1) { fst := a₁, snd := a₂ }.snd then -1 else 1) = 1

Next tactic:
replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    

Proof state:
case mk
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ a₂ : Fin (n + 2)
ha₂ : { fst := a₁, snd := a₂ } ∉ {{ fst := 1, snd := 0 }}
ha₁ : a₂ < a₁
⊢ (if (swap 0 1) { fst := a₁, snd := a₂ }.fst ≤ (swap 0 1) { fst := a₁, snd := a₂ }.snd then -1 else 1) = 1

Next tactic:
dsimp only
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    

Proof state:
case mk
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ a₂ : Fin (n + 2)
ha₂ : { fst := a₁, snd := a₂ } ∉ {{ fst := 1, snd := 0 }}
ha₁ : a₂ < a₁
⊢ (if (swap 0 1) a₁ ≤ (swap 0 1) a₂ then -1 else 1) = 1

Next tactic:
rcases a₁.zero_le.eq_or_lt with (rfl | H)
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · 

Proof state:
case mk.inl
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₂ : Fin (n + 2)
ha₂ : { fst := 0, snd := a₂ } ∉ {{ fst := 1, snd := 0 }}
ha₁ : a₂ < 0
⊢ (if (swap 0 1) 0 ≤ (swap 0 1) a₂ then -1 else 1) = 1

Next tactic:
exact absurd a₂.zero_le ha₁.not_le
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    

Proof state:
case mk.inr
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ a₂ : Fin (n + 2)
ha₂ : { fst := a₁, snd := a₂ } ∉ {{ fst := 1, snd := 0 }}
ha₁ : a₂ < a₁
H : 0 < a₁
⊢ (if (swap 0 1) a₁ ≤ (swap 0 1) a₂ then -1 else 1) = 1

Next tactic:
rcases a₂.zero_le.eq_or_lt with (rfl | H')
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    rcases a₂.zero_le.eq_or_lt with (rfl | H')
    · 

Proof state:
case mk.inr.inl
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ : Fin (n + 2)
H : 0 < a₁
ha₂ : { fst := a₁, snd := 0 } ∉ {{ fst := 1, snd := 0 }}
ha₁ : 0 < a₁
⊢ (if (swap 0 1) a₁ ≤ (swap 0 1) 0 then -1 else 1) = 1

Next tactic:
simp only [and_true_iff, eq_self_iff_true, heq_iff_eq, mem_singleton, Sigma.mk.inj_iff] at ha₂
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    rcases a₂.zero_le.eq_or_lt with (rfl | H')
    · simp only [and_true_iff, eq_self_iff_true, heq_iff_eq, mem_singleton, Sigma.mk.inj_iff] at ha₂
      

Proof state:
case mk.inr.inl
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ : Fin (n + 2)
H : 0 < a₁
ha₁ : 0 < a₁
ha₂ : ¬a₁ = 1
⊢ (if (swap 0 1) a₁ ≤ (swap 0 1) 0 then -1 else 1) = 1

Next tactic:
have : 1 < a₁ := lt_of_le_of_ne (Nat.succ_le_of_lt ha₁)
        (Ne.symm (by intro h; apply ha₂; simp [h]))
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    rcases a₂.zero_le.eq_or_lt with (rfl | H')
    · simp only [and_true_iff, eq_self_iff_true, heq_iff_eq, mem_singleton, Sigma.mk.inj_iff] at ha₂
      have : 1 < a₁ := lt_of_le_of_ne (Nat.succ_le_of_lt ha₁)
        (Ne.symm (by 

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ : Fin (n + 2)
H : 0 < a₁
ha₁ : 0 < a₁
ha₂ : ¬a₁ = 1
⊢ a₁ ≠ 1

Next tactic:
intro h
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    rcases a₂.zero_le.eq_or_lt with (rfl | H')
    · simp only [and_true_iff, eq_self_iff_true, heq_iff_eq, mem_singleton, Sigma.mk.inj_iff] at ha₂
      have : 1 < a₁ := lt_of_le_of_ne (Nat.succ_le_of_lt ha₁)
        (Ne.symm (by intro h; 

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ : Fin (n + 2)
H : 0 < a₁
ha₁ : 0 < a₁
ha₂ : ¬a₁ = 1
h : a₁ = 1
⊢ False

Next tactic:
apply ha₂
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    rcases a₂.zero_le.eq_or_lt with (rfl | H')
    · simp only [and_true_iff, eq_self_iff_true, heq_iff_eq, mem_singleton, Sigma.mk.inj_iff] at ha₂
      have : 1 < a₁ := lt_of_le_of_ne (Nat.succ_le_of_lt ha₁)
        (Ne.symm (by intro h; apply ha₂; 

Proof state:
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ : Fin (n + 2)
H : 0 < a₁
ha₁ : 0 < a₁
ha₂ : ¬a₁ = 1
h : a₁ = 1
⊢ a₁ = 1

Next tactic:
simp [h]
private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1 :=
  show _ = ∏ x : Σ_a : Fin (n + 2), Fin (n + 2) in {(⟨1, 0⟩ : Σa : Fin (n + 2), Fin (n + 2))},
      if (Equiv.swap 0 1) x.1 ≤ swap 0 1 x.2 then (-1 : ℤˣ) else 1 by
    refine' Eq.symm (prod_subset (fun ⟨x₁, x₂⟩ => by
      simp (config := { contextual := true }) [mem_finPairsLT, Fin.one_pos]) fun a ha₁ ha₂ => _)
    rcases a with ⟨a₁, a₂⟩
    replace ha₁ : a₂ < a₁ := mem_finPairsLT.1 ha₁
    dsimp only
    rcases a₁.zero_le.eq_or_lt with (rfl | H)
    · exact absurd a₂.zero_le ha₁.not_le
    rcases a₂.zero_le.eq_or_lt with (rfl | H')
    · simp only [and_true_iff, eq_self_iff_true, heq_iff_eq, mem_singleton, Sigma.mk.inj_iff] at ha₂
      have : 1 < a₁ := lt_of_le_of_ne (Nat.succ_le_of_lt ha₁)
        (Ne.symm (by intro h; apply ha₂; simp [h]))
      

Proof state:
case mk.inr.inl
α : Type u
β : Type v
inst✝ : DecidableEq α
n : ℕ
a₁ : Fin (n + 2)
H : 0 < a₁
ha₁ : 0 < a₁
ha₂ : ¬a₁ = 1
this : 1 < a₁
⊢ (if (swap 0 1) a₁ ≤ (swap 0 1) 0 then -1 else 1) = 1

Next tactic:
have h01 : Equiv.swap (0 : Fin (n + 2)) 1 0 = 1 := by simp