Imports
/-
Copyright (c) 2024 Joseph Tooby-Smith. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joseph Tooby-Smith
-/
module
public import Physlib.QFT.PerturbationTheory.Koszul.KoszulSignInsert
public import Physlib.Mathematics.List.InsertionSort
import all Physlib.Mathematics.ListKoszul sign
@[expose] public section
Gives a factor of - 1 for every fermion-fermion (q is 1) crossing that occurs when sorting
a list of based on r.
def koszulSign (q : 𝓕 → FieldStatistic) (le : 𝓕 → 𝓕 → Prop) [DecidableRel le] :
List 𝓕 → ℂ
| [] => 1
| a :: l => koszulSignInsert q le a l * koszulSign q le l@[simp]
lemma koszulSign_singleton (q : 𝓕 → FieldStatistic) (le : 𝓕 → 𝓕 → Prop) [DecidableRel le] (φ : 𝓕) :
koszulSign q le [φ] = 1 := 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕⊢ koszulSign q le [φ] = 1
All goals completed! 🐙All goals completed! 🐙@[simp]
lemma koszulSign_freeMonoid_of (φ : 𝓕) : koszulSign q le (FreeMonoid.of φ) = 1 := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕⊢ koszulSign q le (FreeMonoid.of φ) = 1
change koszulSign q le [φ] = 1 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕⊢ koszulSign q le [φ] = 1
simp only [koszulSign, mul_one] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕⊢ koszulSignInsert q le φ [] = 1
rfl All goals completed! 🐙
lemma koszulSignInsert_erase_boson {𝓕 : Type} (q : 𝓕 → FieldStatistic)
(le : 𝓕 → 𝓕 → Prop) [DecidableRel le] (φ : 𝓕) :
(φs : List 𝓕) → (n : Fin φs.length) → (heq : q (φs.get n) = bosonic) →
koszulSignInsert q le φ (φs.eraseIdx n) = koszulSignInsert q le φ φs
| [], _, _ => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕x✝¹:Fin [].lengthx✝:q ([].get x✝¹) = bosonic⊢ koszulSignInsert q le φ ([].eraseIdx ↑x✝¹) = koszulSignInsert q le φ [] by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕x✝¹:Fin [].lengthx✝:q ([].get x✝¹) = bosonic⊢ koszulSignInsert q le φ ([].eraseIdx ↑x✝¹) = koszulSignInsert q le φ []
simp All goals completed! 🐙
| r1 :: r, ⟨0, h⟩, hr => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨0, h⟩) = bosonic⊢ koszulSignInsert q le φ ((r1 :: r).eraseIdx ↑⟨0, h⟩) = koszulSignInsert q le φ (r1 :: r) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨0, h⟩) = bosonic⊢ koszulSignInsert q le φ ((r1 :: r).eraseIdx ↑⟨0, h⟩) = koszulSignInsert q le φ (r1 :: r)
simp only [List.eraseIdx_zero, List.tail_cons] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨0, h⟩) = bosonic⊢ koszulSignInsert q le φ r = koszulSignInsert q le φ (r1 :: r)
simp only [List.length_cons, Fin.zero_eta, List.get_eq_getElem, Fin.val_zero,
List.getElem_cons_zero] at hr 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q r1 = bosonic⊢ koszulSignInsert q le φ r = koszulSignInsert q le φ (r1 :: r)
rw [koszulSignInsert 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q r1 = bosonic⊢ koszulSignInsert q le φ r =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q r1 = bosonic⊢ koszulSignInsert q le φ r =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕h:0 < (r1 :: r).lengthhr:q r1 = bosonic⊢ koszulSignInsert q le φ r =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r
simp [hr] All goals completed! 🐙
| r1 :: r, ⟨n + 1, h⟩, hr => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ koszulSignInsert q le φ ((r1 :: r).eraseIdx ↑⟨n + 1, h⟩) = koszulSignInsert q le φ (r1 :: r) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ koszulSignInsert q le φ ((r1 :: r).eraseIdx ↑⟨n + 1, h⟩) = koszulSignInsert q le φ (r1 :: r)
simp only [List.eraseIdx_cons_succ] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ koszulSignInsert q le φ (r1 :: r.eraseIdx n) = koszulSignInsert q le φ (r1 :: r)
rw [koszulSignInsert, 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ (if le φ r1 then koszulSignInsert q le φ (r.eraseIdx n)
else
if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ (r.eraseIdx n)
else koszulSignInsert q le φ (r.eraseIdx n)) =
koszulSignInsert q le φ (r1 :: r) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ (if le φ r1 then koszulSignInsert q le φ (r.eraseIdx n)
else
if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ (r.eraseIdx n)
else koszulSignInsert q le φ (r.eraseIdx n)) =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r koszulSignInsert 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ (if le φ r1 then koszulSignInsert q le φ (r.eraseIdx n)
else
if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ (r.eraseIdx n)
else koszulSignInsert q le φ (r.eraseIdx n)) =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ (if le φ r1 then koszulSignInsert q le φ (r.eraseIdx n)
else
if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ (r.eraseIdx n)
else koszulSignInsert q le φ (r.eraseIdx n)) =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ (if le φ r1 then koszulSignInsert q le φ (r.eraseIdx n)
else
if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ (r.eraseIdx n)
else koszulSignInsert q le φ (r.eraseIdx n)) =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r
rw [koszulSignInsert_erase_boson q le φ r ⟨n, Nat.succ_lt_succ_iff.mp h⟩ hr 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕r1:𝓕r:List 𝓕n:ℕh:n + 1 < (r1 :: r).lengthhr:q ((r1 :: r).get ⟨n + 1, h⟩) = bosonic⊢ (if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r) =
if le φ r1 then koszulSignInsert q le φ r
else if q φ = fermionic ∧ q r1 = fermionic then -koszulSignInsert q le φ r else koszulSignInsert q le φ r All goals completed! 🐙] All goals completed! 🐙
lemma koszulSign_erase_boson {𝓕 : Type} (q : 𝓕 → FieldStatistic) (le : 𝓕 → 𝓕 → Prop)
[DecidableRel le] :
(φs : List 𝓕) → (n : Fin φs.length) → (heq : q (φs.get n) = bosonic) →
koszulSign q le (φs.eraseIdx n) = koszulSign q le φs
| [], _ => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel lex✝:Fin [].length⊢ q ([].get x✝) = bosonic → koszulSign q le ([].eraseIdx ↑x✝) = koszulSign q le [] by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel lex✝:Fin [].length⊢ q ([].get x✝) = bosonic → koszulSign q le ([].eraseIdx ↑x✝) = koszulSign q le []
simp All goals completed! 🐙
| φ :: φs, ⟨0, h⟩ => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:0 < (φ :: φs).length⊢ q ((φ :: φs).get ⟨0, h⟩) = bosonic → koszulSign q le ((φ :: φs).eraseIdx ↑⟨0, h⟩) = koszulSign q le (φ :: φs) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:0 < (φ :: φs).length⊢ q ((φ :: φs).get ⟨0, h⟩) = bosonic → koszulSign q le ((φ :: φs).eraseIdx ↑⟨0, h⟩) = koszulSign q le (φ :: φs)
simp only [List.length_cons, Fin.zero_eta, List.get_eq_getElem, Fin.val_zero,
List.getElem_cons_zero, List.eraseIdx_zero, List.tail_cons, koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:0 < (φ :: φs).length⊢ q φ = bosonic → koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs
intro h 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h✝:0 < (φ :: φs).lengthh:q φ = bosonic⊢ koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs
rw [koszulSignInsert_boson _ _ _ h 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h✝:0 < (φ :: φs).lengthh:q φ = bosonic⊢ koszulSign q le φs = 1 * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h✝:0 < (φ :: φs).lengthh:q φ = bosonic⊢ koszulSign q le φs = 1 * koszulSign q le φs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h✝:0 < (φ :: φs).lengthh:q φ = bosonic⊢ koszulSign q le φs = 1 * koszulSign q le φs
simp only [one_mul] All goals completed! 🐙
| φ :: φs, ⟨n + 1, h⟩ => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).length⊢ q ((φ :: φs).get ⟨n + 1, h⟩) = bosonic → koszulSign q le ((φ :: φs).eraseIdx ↑⟨n + 1, h⟩) = koszulSign q le (φ :: φs) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).length⊢ q ((φ :: φs).get ⟨n + 1, h⟩) = bosonic → koszulSign q le ((φ :: φs).eraseIdx ↑⟨n + 1, h⟩) = koszulSign q le (φ :: φs)
simp only [List.length_cons, List.get_eq_getElem, List.getElem_cons_succ,
List.eraseIdx_cons_succ] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).length⊢ q φs[n] = bosonic → koszulSign q le (φ :: φs.eraseIdx n) = koszulSign q le (φ :: φs)
intro h' 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSign q le (φ :: φs.eraseIdx n) = koszulSign q le (φ :: φs)
rw [koszulSign, 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le (φs.eraseIdx n) = koszulSign q le (φ :: φs) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs koszulSign, 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le (φs.eraseIdx n) =
koszulSignInsert q le φ φs * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs koszulSign_erase_boson q le φs ⟨n, Nat.succ_lt_succ_iff.mp h⟩ h' 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) * koszulSign q le φs = koszulSignInsert q le φ φs * koszulSign q le φs
congr 1 e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ (φs.eraseIdx n) = koszulSignInsert q le φ φs
rw [koszulSignInsert_erase_boson q le φ φs ⟨n, Nat.succ_lt_succ_iff.mp h⟩ h' e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕n:ℕh:n + 1 < (φ :: φs).lengthh':q φs[n] = bosonic⊢ koszulSignInsert q le φ φs = koszulSignInsert q le φ φs All goals completed! 🐙] All goals completed! 🐙
set_option backward.isDefEq.respectTransparency false in
lemma koszulSign_insertIdx [Std.Total le] [IsTrans 𝓕 le] (φ : 𝓕) :
(φs : List 𝓕) → (n : ℕ) → (hn : n ≤ φs.length) →
koszulSign q le (List.insertIdx φs n φ) = 𝓢(q φ, ofList q (φs.take n)) * koszulSign q le φs *
𝓢(q φ, ofList q ((List.insertionSort le (List.insertIdx φs n φ)).take
(insertionSortEquiv le (List.insertIdx φs n φ) ⟨n, by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕n:ℕhn:n ≤ φs.length⊢ n < (φs.insertIdx n φ).length
rw [List.length_insertIdx 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕n:ℕhn:n ≤ φs.length⊢ n < if n ≤ φs.length then φs.length + 1 else φs.length 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕n:ℕhn:n ≤ φs.length⊢ n < if n ≤ φs.length then φs.length + 1 else φs.length] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕n:ℕhn:n ≤ φs.length⊢ n < if n ≤ φs.length then φs.length + 1 else φs.length
simp only [hn, ↓reduceIte] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕n:ℕhn:n ≤ φs.length⊢ n < φs.length + 1
omega All goals completed! 🐙⟩)))
| [], 0, h => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕h:0 ≤ [].length⊢ koszulSign q le ([].insertIdx 0 φ) =
(exchangeSign (q φ)) (ofList q (List.take 0 [])) * koszulSign q le [] *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ([].insertIdx 0 φ)) ⟨0, ⋯⟩)) (List.insertionSort le ([].insertIdx 0 φ)))) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕h:0 ≤ [].length⊢ koszulSign q le ([].insertIdx 0 φ) =
(exchangeSign (q φ)) (ofList q (List.take 0 [])) * koszulSign q le [] *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ([].insertIdx 0 φ)) ⟨0, ⋯⟩)) (List.insertionSort le ([].insertIdx 0 φ))))
simp [koszulSign] All goals completed! 🐙
| [], n + 1, h => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕n:ℕh:n + 1 ≤ [].length⊢ koszulSign q le ([].insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) [])) * koszulSign q le [] *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ([].insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ([].insertIdx (n + 1) φ)))) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕n:ℕh:n + 1 ≤ [].length⊢ koszulSign q le ([].insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) [])) * koszulSign q le [] *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ([].insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ([].insertIdx (n + 1) φ))))
simp at h All goals completed! 🐙
| φ1 :: φs, 0, h => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx 0 φ) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx 0 φ)) ⟨0, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx 0 φ)))) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx 0 φ) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx 0 φ)) ⟨0, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx 0 φ))))
simp only [List.insertIdx_zero, List.insertionSort_cons, List.length_cons, Fin.zero_eta] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le (φ :: φ1 :: φs) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φ1 :: φs)) 0))
(List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs)))))
rw [koszulSign 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ (φ1 :: φs) * koszulSign q le (φ1 :: φs) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φ1 :: φs)) 0))
(List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs))))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ (φ1 :: φs) * koszulSign q le (φ1 :: φs) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φ1 :: φs)) 0))
(List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs)))))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ (φ1 :: φs) * koszulSign q le (φ1 :: φs) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φ1 :: φs)) 0))
(List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs)))))
trans koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ (φ1 :: φs) * koszulSign q le (φ1 :: φs) =
koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs)𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φ1 :: φs)) 0))
(List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs)))))
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ (φ1 :: φs) * koszulSign q le (φ1 :: φs) =
koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) ring All goals completed! 🐙
simp only [insertionSortEquiv, List.length_cons, Nat.succ_eq_add_one, orderedInsertEquiv,
Physlib.Fin.equivCons_trans, Equiv.trans_apply, Physlib.Fin.equivCons_zero] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) =
(exchangeSign (q φ)) (ofList q (List.take 0 (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(((Physlib.Fin.finExtractOne 0).trans
((Physlib.Fin.finExtractOne ⟨↑(orderedInsertPos le (List.insertionSort le (φ1 :: φs)) φ), ⋯⟩).symm.trans
(Fin.castOrderIso ⋯).symm))
0))
(List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs)))))
conv_rhs =>
enter [2,2, 2, 2] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length| List.orderedInsert le φ (List.orderedInsert le φ1 (List.insertionSort le φs))
rw [orderedInsert_eq_insertIdx_orderedInsertPos] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length| (List.orderedInsert le φ1 (List.insertionSort le φs)).insertIdx
(↑(orderedInsertPos le (List.orderedInsert le φ1 (List.insertionSort le φs)) φ)) φ
conv_rhs =>
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take
(↑(((Physlib.Fin.finExtractOne 0).trans
((Physlib.Fin.finExtractOne ⟨↑(orderedInsertPos le (List.insertionSort le (φ1 :: φs)) φ), ⋯⟩).symm.trans
(Fin.castOrderIso ⋯).symm))
0))
((List.orderedInsert le φ1 (List.insertionSort le φs)).insertIdx
(↑(orderedInsertPos le (List.orderedInsert le φ1 (List.insertionSort le φs)) φ)) φ)))
erw [← ofList_take_insert] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take
(↑(((Physlib.Fin.finExtractOne 0).trans
((Physlib.Fin.finExtractOne ⟨↑(orderedInsertPos le (List.insertionSort le (φ1 :: φs)) φ), ⋯⟩).symm.trans
(Fin.castOrderIso ⋯).symm))
0))
(List.orderedInsert le φ1 (List.insertionSort le φs))))
change 𝓢(q φ, ofList q ((List.insertionSort le (φ1 :: φs)).take
(↑(orderedInsertPos le ((List.insertionSort le (φ1 :: φs))) φ)))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take (↑(orderedInsertPos le (List.insertionSort le (φ1 :: φs)) φ)) (List.insertionSort le (φ1 :: φs))))
rw [← koszulSignInsert_eq_exchangeSign_take q le] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length| koszulSignInsert q le φ (φ1 :: φs)
rw [ofList_take_zero 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) =
(exchangeSign (q φ)) 1 * koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) =
(exchangeSign (q φ)) 1 * koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕h:0 ≤ (φ1 :: φs).length⊢ koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs) =
(exchangeSign (q φ)) 1 * koszulSign q le (φ1 :: φs) * koszulSignInsert q le φ (φ1 :: φs)
simp All goals completed! 🐙
| φ1 :: φs, n + 1, h => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ)))) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ))))
conv_lhs =>
rw [List.insertIdx_succ_cons] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| koszulSign q le (φ1 :: φs.insertIdx n φ)
rw [koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| koszulSignInsert q le φ1 (φs.insertIdx n φ) * koszulSign q le (φs.insertIdx n φ)
rw [koszulSign_insertIdx _ _ _ (Nat.le_of_lt_succ h) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
((exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩))
(List.insertionSort le (φs.insertIdx n φ))))) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ)))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
((exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩))
(List.insertionSort le (φs.insertIdx n φ))))) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ))))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
((exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩))
(List.insertionSort le (φs.insertIdx n φ))))) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ))))
conv_rhs =>
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ))))
simp only [List.insertIdx_succ_cons] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φ1 :: φs.insertIdx n φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le (φ1 :: φs.insertIdx n φ))))
simp only [List.insertionSort_cons, List.length_cons, insertionSortEquiv, Nat.succ_eq_add_one,
Equiv.trans_apply, Physlib.Fin.equivCons_succ] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take
(↑((orderedInsertEquiv le (List.insertionSort le (φs.insertIdx n φ)) φ1)
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩).succ))
(List.orderedInsert le φ1 (List.insertionSort le (φs.insertIdx n φ)))))
erw [orderedInsertEquiv_fin_succ] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take
(↑(Fin.cast ⋯
(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
⟨↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩), ⋯⟩)))
(List.orderedInsert le φ1 (List.insertionSort le (φs.insertIdx n φ)))))
simp only [Fin.eta, Fin.val_cast] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
(List.orderedInsert le φ1 (List.insertionSort le (φs.insertIdx n φ)))))
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
(List.orderedInsert le φ1 (List.insertionSort le (φs.insertIdx n φ))))
simp [orderedInsert_eq_insertIdx_orderedInsertPos] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))
conv_rhs =>
lhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs)
rw [ofList_take_succ_cons, map_mul, koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take n φs)) *
(koszulSignInsert q le φ1 φs * koszulSign q le φs)
ring_nf 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) * (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs * (exchangeSign (q φ)) (q φ1) *
koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))
conv_lhs =>
lhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| koszulSignInsert q le φ1 (φs.insertIdx n φ) * (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs
rw [mul_assoc, mul_comm] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs * koszulSignInsert q le φ1 (φs.insertIdx n φ)
rw [mul_assoc 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩))
(List.insertionSort le (φs.insertIdx n φ))))) =
(exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs * (exchangeSign (q φ)) (q φ1) *
koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩))
(List.insertionSort le (φs.insertIdx n φ))))) =
(exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs * (exchangeSign (q φ)) (q φ1) *
koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
(koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩))
(List.insertionSort le (φs.insertIdx n φ))))) =
(exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs * (exchangeSign (q φ)) (q φ1) *
koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))
conv_rhs =>
rw [mul_assoc, mul_assoc] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length| (exchangeSign (q φ)) (ofList q (List.take n φs)) * koszulSign q le φs *
((exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))))
congr 1 e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
let rs := (List.insertionSort le (List.insertIdx φs n φ)) e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
have hnsL : n < (List.insertIdx φs n φ).length := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ)))) e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
rw [List.length_insertIdx 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)⊢ n < if n ≤ φs.length then φs.length + 1 else φs.length 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)⊢ n < if n ≤ φs.length then φs.length + 1 else φs.lengthe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)⊢ n < if n ≤ φs.length then φs.length + 1 else φs.lengthe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
simp only [List.length_cons, add_le_add_iff_right] at h 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)h:n ≤ φs.length⊢ n < if n ≤ φs.length then φs.length + 1 else φs.lengthe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
simp only [h, ↓reduceIte] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)h:n ≤ φs.length⊢ n < φs.length + 1e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
omegae_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).length⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
let ni : Fin rs.length := (insertionSortEquiv le (List.insertIdx φs n φ))
⟨n, hnsL⟩ e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
let nro : Fin (rs.length + 1) :=
⟨↑(orderedInsertPos le rs φ1), orderedInsertPos_lt_length le rs φ1⟩ e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 (φs.insertIdx n φ) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
rw [koszulSignInsert_insertIdx _ _ _ _ _ _ (Nat.le_of_lt_succ h), e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 (φ :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))) e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))) koszulSignInsert_cons e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))]e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
trans koszulSignInsert q le φ1 φs * (koszulSignCons q le φ1 φ *
𝓢(q φ, ofList q (rs.take ni))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
koszulSignInsert q le φ1 φs * (koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)))𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs * (koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
koszulSignInsert q le φ1 φs * (koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))) simp only [rs, ni] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)) (List.insertionSort le (φs.insertIdx n φ)))) =
koszulSignInsert q le φ1 φs *
(koszulSignCons q le φ1 φ *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩))
(List.insertionSort le (φs.insertIdx n φ)))))
ring All goals completed! 🐙
trans koszulSignInsert q le φ1 φs * (𝓢(q φ, q φ1) *
𝓢(q φ, ofList q ((List.insertIdx rs nro φ1).take (nro.succAbove ni)))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs * (koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))) =
koszulSignInsert q le φ1 φs *
((exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ)) (ofList q (List.take (↑(nro.succAbove ni)) (rs.insertIdx (↑nro) φ1))))𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs *
((exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ)) (ofList q (List.take (↑(nro.succAbove ni)) (rs.insertIdx (↑nro) φ1)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs *
((exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ)) (ofList q (List.take (↑(nro.succAbove ni)) (rs.insertIdx (↑nro) φ1)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs * (koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))) =
koszulSignInsert q le φ1 φs *
((exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ)) (ofList q (List.take (↑(nro.succAbove ni)) (rs.insertIdx (↑nro) φ1))))
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs *
((exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ)) (ofList q (List.take (↑(nro.succAbove ni)) (rs.insertIdx (↑nro) φ1)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))) simp only [rs, nro, ni] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignInsert q le φ1 φs *
((exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1)))) =
(exchangeSign (q φ)) (q φ1) *
(koszulSignInsert q le φ1 φs *
(exchangeSign (q φ))
(ofList q
(List.take
(↑(⟨↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1), ⋯⟩.succAbove
((insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, ⋯⟩)))
((List.insertionSort le (φs.insertIdx n φ)).insertIdx
(↑(orderedInsertPos le (List.insertionSort le (φs.insertIdx n φ)) φ1)) φ1))))
ring All goals completed! 🐙
congr 1 e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ)) (ofList q (List.take (↑(nro.succAbove ni)) (rs.insertIdx (↑nro) φ1)))
simp only [Fin.succAbove] e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
have hns : rs.get ni = φ := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ)))) e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
simp only [rs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ (List.insertionSort le (φs.insertIdx n φ)).get ni = φe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
rw [← insertionSortEquiv_get 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ ((φs.insertIdx n φ).get ∘ ⇑(insertionSortEquiv le (φs.insertIdx n φ)).symm) ni = φ 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ ((φs.insertIdx n φ).get ∘ ⇑(insertionSortEquiv le (φs.insertIdx n φ)).symm) ni = φe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ ((φs.insertIdx n φ).get ∘ ⇑(insertionSortEquiv le (φs.insertIdx n φ)).symm) ni = φe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
simp only [Function.comp_apply, Equiv.symm_apply_apply, List.get_eq_getElem, ni] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩⊢ (φs.insertIdx n φ)[n] = φe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
simp_all only [List.length_cons, add_le_add_iff_right, List.getElem_insertIdx_self]e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
have hc1 (hninro : ni.castSucc < nro) : ¬ le φ1 φ := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ)))) e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
rw [← hns 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhninro:ni.castSucc < nro⊢ ¬le φ1 (rs.get ni) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhninro:ni.castSucc < nro⊢ ¬le φ1 (rs.get ni)e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhninro:ni.castSucc < nro⊢ ¬le φ1 (rs.get ni)e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
exact lt_orderedInsertPos_rel le φ1 rs ni hninroe_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
have hc2 (hninro : ¬ ni.castSucc < nro) : le φ1 φ := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).length⊢ koszulSign q le ((φ1 :: φs).insertIdx (n + 1) φ) =
(exchangeSign (q φ)) (ofList q (List.take (n + 1) (φ1 :: φs))) * koszulSign q le (φ1 :: φs) *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φ1 :: φs).insertIdx (n + 1) φ)) ⟨n + 1, ⋯⟩))
(List.insertionSort le ((φ1 :: φs).insertIdx (n + 1) φ)))) e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
rw [← hns 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhninro:¬ni.castSucc < nro⊢ le φ1 (rs.get ni) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhninro:¬ni.castSucc < nro⊢ le φ1 (rs.get ni)e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhninro:¬ni.castSucc < nro⊢ le φ1 (rs.get ni)e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
refine gt_orderedInsertPos_rel le φ1 rs ?_ ni hninro 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhninro:¬ni.castSucc < nro⊢ List.Pairwise le rse_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
exact List.pairwise_insertionSort le (List.insertIdx φs n φ)e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φ⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
by_cases hn : ni.castSucc < nro pos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1)))
· pos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1))) simp only [hn, ↓reduceIte, Fin.val_castSucc] pos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) (rs.insertIdx (↑nro) φ1)))
rw [ofList_take_insertIdx_gt pos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))pos.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ ↑ni < ↑nro pos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))pos.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ ↑ni < ↑nro]pos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))pos.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ ↑ni < ↑nro
swap pos.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ ↑ni < ↑nropos 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))
· pos.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ ↑ni < ↑nro exact hn All goals completed! 🐙
congr 1 pos.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ koszulSignCons q le φ1 φ = (exchangeSign (q φ)) (q φ1)
rw [koszulSignCons_eq_exchangeSign pos.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ (if le φ1 φ then 1 else (exchangeSign (q φ1)) (q φ)) = (exchangeSign (q φ)) (q φ1) pos.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ (if le φ1 φ then 1 else (exchangeSign (q φ1)) (q φ)) = (exchangeSign (q φ)) (q φ1)]pos.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ (if le φ1 φ then 1 else (exchangeSign (q φ1)) (q φ)) = (exchangeSign (q φ)) (q φ1)
simp only [hc1 hn, ↓reduceIte] pos.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ (exchangeSign (q φ1)) (q φ) = (exchangeSign (q φ)) (q φ1)
rw [exchangeSign_symm pos.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:ni.castSucc < nro⊢ (exchangeSign (q φ)) (q φ1) = (exchangeSign (q φ)) (q φ1) All goals completed! 🐙] All goals completed! 🐙
· neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) *
(exchangeSign (q φ))
(ofList q (List.take (↑(if ni.castSucc < nro then ni.castSucc else ni.succ)) (rs.insertIdx (↑nro) φ1))) simp only [hn, ↓reduceIte, Fin.val_succ] neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni + 1) (rs.insertIdx (↑nro) φ1)))
rw [ofList_take_insertIdx_le, neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1 * ofList q (List.take (↑ni) rs))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.length neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.length map_mul, neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * ((exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.lengthneg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.length ← mul_assoc neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.lengthneg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.length]neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs))neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑nineg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.length
· neg 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) =
(exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (ofList q (List.take (↑ni) rs)) congr 1 neg.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ = (exchangeSign (q φ)) (q φ1) * (exchangeSign (q φ)) (q φ1)
rw [exchangeSign_mul_self, neg.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ koszulSignCons q le φ1 φ = 1 neg.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ (if le φ1 φ then 1 else if q φ1 = fermionic ∧ q φ = fermionic then -1 else 1) = 1 koszulSignCons neg.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ (if le φ1 φ then 1 else if q φ1 = fermionic ∧ q φ = fermionic then -1 else 1) = 1neg.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ (if le φ1 φ then 1 else if q φ1 = fermionic ∧ q φ = fermionic then -1 else 1) = 1]neg.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ (if le φ1 φ then 1 else if q φ1 = fermionic ∧ q φ = fermionic then -1 else 1) = 1
simp only [hc2 hn, ↓reduceIte] All goals completed! 🐙
· neg.hn 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ ↑ni exact Nat.le_of_not_lt hn All goals completed! 🐙
· neg.hm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs:List 𝓕n:ℕh:n + 1 ≤ (φ1 :: φs).lengthrs:List 𝓕 := List.insertionSort le (φs.insertIdx n φ)hnsL:n < (φs.insertIdx n φ).lengthni:Fin rs.length := (insertionSortEquiv le (φs.insertIdx n φ)) ⟨n, hnsL⟩nro:Fin (rs.length + 1) := ⟨↑(orderedInsertPos le rs φ1), ⋯⟩hns:rs.get ni = φhc1:ni.castSucc < nro → ¬le φ1 φhc2:¬ni.castSucc < nro → le φ1 φhn:¬ni.castSucc < nro⊢ ↑nro ≤ rs.length exact Nat.le_of_lt_succ (orderedInsertPos_lt_length le rs φ1) All goals completed! 🐙lemma insertIdx_eraseIdx {I : Type} : (n : ℕ) → (r : List I) → (hn : n < r.length) →
List.insertIdx (r.eraseIdx n) n (r.get ⟨n, hn⟩) = r
| n, [], hn => I:Typen:ℕhn:n < [].length⊢ ([].eraseIdx n).insertIdx n ([].get ⟨n, hn⟩) = [] by I:Typen:ℕhn:n < [].length⊢ ([].eraseIdx n).insertIdx n ([].get ⟨n, hn⟩) = []
simp at hn All goals completed! 🐙
| 0, r0 :: r, hn => I:Typer0:Ir:List Ihn:0 < (r0 :: r).length⊢ ((r0 :: r).eraseIdx 0).insertIdx 0 ((r0 :: r).get ⟨0, hn⟩) = r0 :: r by I:Typer0:Ir:List Ihn:0 < (r0 :: r).length⊢ ((r0 :: r).eraseIdx 0).insertIdx 0 ((r0 :: r).get ⟨0, hn⟩) = r0 :: r
simp All goals completed! 🐙
| n + 1, r0 :: r, hn => I:Typen:ℕr0:Ir:List Ihn:n + 1 < (r0 :: r).length⊢ ((r0 :: r).eraseIdx (n + 1)).insertIdx (n + 1) ((r0 :: r).get ⟨n + 1, hn⟩) = r0 :: r by I:Typen:ℕr0:Ir:List Ihn:n + 1 < (r0 :: r).length⊢ ((r0 :: r).eraseIdx (n + 1)).insertIdx (n + 1) ((r0 :: r).get ⟨n + 1, hn⟩) = r0 :: r
simp only [List.length_cons, List.get_eq_getElem, List.getElem_cons_succ,
List.eraseIdx_cons_succ, List.insertIdx_succ_cons, List.cons.injEq, true_and] I:Typen:ℕr0:Ir:List Ihn:n + 1 < (r0 :: r).length⊢ (r.eraseIdx n).insertIdx n r[n] = r
exact insertIdx_eraseIdx n r _ All goals completed! 🐙
lemma koszulSign_eraseIdx [Std.Total le] [IsTrans 𝓕 le] (φs : List 𝓕) (n : Fin φs.length) :
koszulSign q le (φs.eraseIdx n) = koszulSign q le φs * 𝓢(q (φs.get n), ofList q (φs.take n)) *
𝓢(q (φs.get n), ofList q (List.take (↑(insertionSortEquiv le φs n))
(List.insertionSort le φs))) := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.length⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le φs * (exchangeSign (q (φs.get n))) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q (φs.get n))) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
let φs' := φs.eraseIdx ↑n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑n⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le φs * (exchangeSign (q (φs.get n))) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q (φs.get n))) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
have hφs : List.insertIdx φs' n (φs.get n) = φs := by
exact insertIdx_eraseIdx n.1 φs n.prop 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le φs * (exchangeSign (q (φs.get n))) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q (φs.get n))) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le φs * (exchangeSign (q (φs.get n))) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q (φs.get n))) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
conv_rhs =>
lhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| koszulSign q le φs * (exchangeSign (q (φs.get n))) (ofList q (List.take (↑n) φs))
lhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| koszulSign q le φs
rw [← hφs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| koszulSign q le (φs'.insertIdx (↑n) (φs.get n))
rw [koszulSign_insertIdx q le (φs.get n) ((φs.eraseIdx ↑n)) n (by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ ↑n ≤ (φs.eraseIdx ↑n).length
rw [List.length_eraseIdx 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ ↑n ≤ if ↑n < φs.length then φs.length - 1 else φs.length 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ ↑n ≤ if ↑n < φs.length then φs.length - 1 else φs.length] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ ↑n ≤ if ↑n < φs.length then φs.length - 1 else φs.length
simp only [Fin.is_lt, ↓reduceIte] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ ↑n ≤ φs.length - 1
omega All goals completed! 🐙)]
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| (exchangeSign (q (φs.get n)))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs.eraseIdx ↑n).insertIdx (↑n) (φs.get n))) ⟨↑n, ⋯⟩))
(List.insertionSort le ((φs.eraseIdx ↑n).insertIdx (↑n) (φs.get n)))))
enter [2, 2, 2] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| List.insertionSort le ((φs.eraseIdx ↑n).insertIdx (↑n) (φs.get n))
rw [hφs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| List.insertionSort le φs
conv_rhs =>
enter [1, 1, 2, 2, 2, 1, 1] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| (insertionSortEquiv le ((φs.eraseIdx ↑n).insertIdx (↑n) (φs.get n))) ⟨↑n, ⋯⟩
rw [insertionSortEquiv_congr _ _ hφs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| ((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)) ⟨↑n, ⋯⟩
simp only [List.get_eq_getElem] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)) ⟨↑n, ⋯⟩))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
trans koszulSign q le (φs.eraseIdx ↑n) *
(𝓢(q φs[↑n], ofList q ((φs.eraseIdx ↑n).take n)) * 𝓢(q φs[↑n], ofList q (List.take (↑n) φs))) *
(𝓢(q φs[↑n], ofList q ((List.insertionSort le φs).take (↑((insertionSortEquiv le φs) n)))) *
𝓢(q φs[↑n], ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))))𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)) ⟨↑n, ⋯⟩))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)) ⟨↑n, ⋯⟩))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))))
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)) ⟨↑n, ⋯⟩))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) simp only [Fin.getElem_fin] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)) ⟨↑n, ⋯⟩))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
rw [Equiv.trans_apply, 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑(((insertionSortEquiv le φs).trans (Fin.castOrderIso ⋯).toEquiv)
((Fin.castOrderIso ⋯).toEquiv ⟨↑n, ⋯⟩)))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑((Fin.castOrderIso ⋯).toEquiv ((insertionSortEquiv le φs) ((Fin.castOrderIso ⋯).toEquiv ⟨↑n, ⋯⟩))))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) Equiv.trans_apply 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑((Fin.castOrderIso ⋯).toEquiv ((insertionSortEquiv le φs) ((Fin.castOrderIso ⋯).toEquiv ⟨↑n, ⋯⟩))))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑((Fin.castOrderIso ⋯).toEquiv ((insertionSortEquiv le φs) ((Fin.castOrderIso ⋯).toEquiv ⟨↑n, ⋯⟩))))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n]))
(ofList q
(List.take
(↑((Fin.castOrderIso ⋯).toEquiv ((insertionSortEquiv le φs) ((Fin.castOrderIso ⋯).toEquiv ⟨↑n, ⋯⟩))))
(List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
simp only [Fin.castOrderIso,
Equiv.coe_fn_mk, Fin.cast_mk, Fin.eta, Fin.val_cast] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))) =
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) * koszulSign q le (φs.eraseIdx ↑n) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
ring All goals completed! 🐙
conv_rhs =>
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| (exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs))) *
(exchangeSign (q φs[n])) (ofList q (List.take (↑((insertionSortEquiv le φs) n)) (List.insertionSort le φs)))
rw [exchangeSign_mul_self] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| 1
simp only [Fin.getElem_fin, mul_one] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs⊢ koszulSign q le (φs.eraseIdx ↑n) =
koszulSign q le (φs.eraseIdx ↑n) *
((exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs)))
conv_rhs =>
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| (exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) (φs.eraseIdx ↑n))) *
(exchangeSign (q φs[↑n])) (ofList q (List.take (↑n) φs))
rw [ofList_take_eraseIdx, exchangeSign_mul_self] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕n:Fin φs.lengthφs':List 𝓕 := φs.eraseIdx ↑nhφs:φs'.insertIdx (↑n) (φs.get n) = φs| 1
simp All goals completed! 🐙
lemma koszulSign_eraseIdx_insertionSortMinPos [Std.Total le] [IsTrans 𝓕 le] (φ : 𝓕) (φs : List 𝓕) :
koszulSign q le ((φ :: φs).eraseIdx (insertionSortMinPos le φ φs)) = koszulSign q le (φ :: φs)
* 𝓢(q (insertionSortMin le φ φs), ofList q ((φ :: φs).take (insertionSortMinPos le φ φs))) := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ koszulSign q le ((φ :: φs).eraseIdx ↑(insertionSortMinPos le φ φs)) =
koszulSign q le (φ :: φs) *
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs)))
rw [koszulSign_eraseIdx 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ koszulSign q le (φ :: φs) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φs)) (insertionSortMinPos le φ φs)))
(List.insertionSort le (φ :: φs)))) =
koszulSign q le (φ :: φs) *
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ koszulSign q le (φ :: φs) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φs)) (insertionSortMinPos le φ φs)))
(List.insertionSort le (φ :: φs)))) =
koszulSign q le (φ :: φs) *
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ koszulSign q le (φ :: φs) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φs)) (insertionSortMinPos le φ φs)))
(List.insertionSort le (φ :: φs)))) =
koszulSign q le (φ :: φs) *
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs)))
conv_lhs =>
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕| (exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q
(List.take (↑((insertionSortEquiv le (φ :: φs)) (insertionSortMinPos le φ φs))) (List.insertionSort le (φ :: φs))))
rhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕| ofList q
(List.take (↑((insertionSortEquiv le (φ :: φs)) (insertionSortMinPos le φ φs))) (List.insertionSort le (φ :: φs)))
lhs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕| q
simp [insertionSortMinPos] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕| q
erw [Equiv.apply_symm_apply 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ koszulSign q le (φ :: φs) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑⟨0, ⋯⟩) (List.insertionSort le (φ :: φs)))) =
koszulSign q le (φ :: φs) *
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs)))] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ koszulSign q le (φ :: φs) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) *
(exchangeSign (q ((φ :: φs).get (insertionSortMinPos le φ φs))))
(ofList q (List.take (↑⟨0, ⋯⟩) (List.insertionSort le (φ :: φs)))) =
koszulSign q le (φ :: φs) *
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs)))
simp only [List.get_eq_getElem, List.length_cons, List.insertionSort,
List.take_zero, ofList_empty, exchangeSign_bosonic, mul_one, mul_eq_mul_left_iff] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ (exchangeSign (q (φ :: φs)[↑(insertionSortMinPos le φ φs)]))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) =
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) ∨
koszulSign q le (φ :: φs) = 0
apply Or.inl 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕⊢ (exchangeSign (q (φ :: φs)[↑(insertionSortMinPos le φ φs)]))
(ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs))) =
(exchangeSign (q (insertionSortMin le φ φs))) (ofList q (List.take (↑(insertionSortMinPos le φ φs)) (φ :: φs)))
rfl All goals completed! 🐙
lemma koszulSign_swap_eq_rel_cons {ψ φ : 𝓕}
(h1 : le φ ψ) (h2 : le ψ φ) (φs' : List 𝓕) :
koszulSign q le (φ :: ψ :: φs') = koszulSign q le (ψ :: φ :: φs') := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSign q le (φ :: ψ :: φs') = koszulSign q le (ψ :: φ :: φs')
simp only [Wick.koszulSign, ← mul_assoc, mul_eq_mul_right_iff] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSignInsert q le φ (ψ :: φs') * koszulSignInsert q le ψ φs' =
koszulSignInsert q le ψ (φ :: φs') * koszulSignInsert q le φ φs' ∨
koszulSign q le φs' = 0
left 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSignInsert q le φ (ψ :: φs') * koszulSignInsert q le ψ φs' =
koszulSignInsert q le ψ (φ :: φs') * koszulSignInsert q le φ φs'
rw [mul_comm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSignInsert q le ψ φs' * koszulSignInsert q le φ (ψ :: φs') =
koszulSignInsert q le ψ (φ :: φs') * koszulSignInsert q le φ φs' 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSignInsert q le ψ φs' * koszulSignInsert q le φ (ψ :: φs') =
koszulSignInsert q le ψ (φ :: φs') * koszulSignInsert q le φ φs'] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSignInsert q le ψ φs' * koszulSignInsert q le φ (ψ :: φs') =
koszulSignInsert q le ψ (φ :: φs') * koszulSignInsert q le φ φs'
simp [Wick.koszulSignInsert, h1, h2] All goals completed! 🐙
lemma koszulSign_swap_eq_rel {ψ φ : 𝓕} (h1 : le φ ψ) (h2 : le ψ φ) : (φs φs' : List 𝓕) →
koszulSign q le (φs ++ φ :: ψ :: φs') = koszulSign q le (φs ++ ψ :: φ :: φs')
| [], φs' => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSign q le ([] ++ φ :: ψ :: φs') = koszulSign q le ([] ++ ψ :: φ :: φs') by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSign q le ([] ++ φ :: ψ :: φs') = koszulSign q le ([] ++ ψ :: φ :: φs')
simp only [List.nil_append] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφs':List 𝓕⊢ koszulSign q le (φ :: ψ :: φs') = koszulSign q le (ψ :: φ :: φs')
exact koszulSign_swap_eq_rel_cons q le h1 h2 φs' All goals completed! 🐙
| φ'' :: φs, φs' => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSign q le (φ'' :: φs ++ φ :: ψ :: φs') = koszulSign q le (φ'' :: φs ++ ψ :: φ :: φs') by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSign q le (φ'' :: φs ++ φ :: ψ :: φs') = koszulSign q le (φ'' :: φs ++ ψ :: φ :: φs')
simp only [List.cons_append, koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs ++ φ :: ψ :: φs') * koszulSign q le (φs ++ φ :: ψ :: φs') =
koszulSignInsert q le φ'' (φs ++ ψ :: φ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs')
rw [koszulSign_swap_eq_rel h1 h2 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs ++ φ :: ψ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs') =
koszulSignInsert q le φ'' (φs ++ ψ :: φ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs') 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs ++ φ :: ψ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs') =
koszulSignInsert q le φ'' (φs ++ ψ :: φ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs')] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs ++ φ :: ψ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs') =
koszulSignInsert q le φ'' (φs ++ ψ :: φ :: φs') * koszulSign q le (φs ++ ψ :: φ :: φs')
congr 1 e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs ++ φ :: ψ :: φs') = koszulSignInsert q le φ'' (φs ++ ψ :: φ :: φs')
apply Wick.koszulSignInsert_eq_perm e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leψ:𝓕φ:𝓕h1:le φ ψh2:le ψ φφ'':𝓕φs:List 𝓕φs':List 𝓕⊢ (φs ++ φ :: ψ :: φs').Perm (φs ++ ψ :: φ :: φs')
exact List.Perm.append_left φs (List.Perm.swap ψ φ φs') All goals completed! 🐙
lemma koszulSign_eq_rel_eq_stat_append {ψ φ : 𝓕} [IsTrans 𝓕 le]
(h1 : le φ ψ) (h2 : le ψ φ) (hq : q ψ = q φ) : (φs : List 𝓕) →
koszulSign q le (φ :: ψ :: φs) = koszulSign q le φs := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φ⊢ ∀ (φs : List 𝓕), koszulSign q le (φ :: ψ :: φs) = koszulSign q le φs
intro φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSign q le (φ :: ψ :: φs) = koszulSign q le φs
simp only [koszulSign, ← mul_assoc] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le φ (ψ :: φs) * koszulSignInsert q le ψ φs * koszulSign q le φs = koszulSign q le φs
trans 1 * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le φ (ψ :: φs) * koszulSignInsert q le ψ φs * koszulSign q le φs = 1 * koszulSign q le φs𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ 1 * koszulSign q le φs = koszulSign q le φs
swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ 1 * koszulSign q le φs = koszulSign q le φs𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le φ (ψ :: φs) * koszulSignInsert q le ψ φs * koszulSign q le φs = 1 * koszulSign q le φs
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ 1 * koszulSign q le φs = koszulSign q le φs simp only [one_mul] All goals completed! 🐙
congr e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le φ (ψ :: φs) * koszulSignInsert q le ψ φs = 1
simp only [koszulSignInsert, ite_mul, neg_mul] e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ (if le φ ψ then koszulSignInsert q le φ φs * koszulSignInsert q le ψ φs
else
if q φ = fermionic ∧ q ψ = fermionic then -(koszulSignInsert q le φ φs * koszulSignInsert q le ψ φs)
else koszulSignInsert q le φ φs * koszulSignInsert q le ψ φs) =
1
simp_all only [and_self, ite_true] e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le φ φs * koszulSignInsert q le ψ φs = 1
rw [koszulSignInsert_eq_rel_eq_stat q le h1 h2 hq e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le ψ φs * koszulSignInsert q le ψ φs = 1 e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le ψ φs * koszulSignInsert q le ψ φs = 1] e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSignInsert q le ψ φs * koszulSignInsert q le ψ φs = 1
simp All goals completed! 🐙
lemma koszulSign_eq_rel_eq_stat {ψ φ : 𝓕} [IsTrans 𝓕 le]
(h1 : le φ ψ) (h2 : le ψ φ) (hq : q ψ = q φ) : (φs' φs : List 𝓕) →
koszulSign q le (φs' ++ φ :: ψ :: φs) = koszulSign q le (φs' ++ φs)
| [], φs => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSign q le ([] ++ φ :: ψ :: φs) = koszulSign q le ([] ++ φs) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSign q le ([] ++ φ :: ψ :: φs) = koszulSign q le ([] ++ φs)
simp only [List.nil_append] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφs:List 𝓕⊢ koszulSign q le (φ :: ψ :: φs) = koszulSign q le φs
exact koszulSign_eq_rel_eq_stat_append q le h1 h2 hq φs All goals completed! 🐙
| φ'' :: φs', φs => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSign q le (φ'' :: φs' ++ φ :: ψ :: φs) = koszulSign q le (φ'' :: φs' ++ φs) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSign q le (φ'' :: φs' ++ φ :: ψ :: φs) = koszulSign q le (φ'' :: φs' ++ φs)
simp only [List.cons_append, koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) * koszulSign q le (φs' ++ φ :: ψ :: φs) =
koszulSignInsert q le φ'' (φs' ++ φs) * koszulSign q le (φs' ++ φs)
rw [koszulSign_eq_rel_eq_stat h1 h2 hq φs' φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) * koszulSign q le (φs' ++ φs) =
koszulSignInsert q le φ'' (φs' ++ φs) * koszulSign q le (φs' ++ φs) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) * koszulSign q le (φs' ++ φs) =
koszulSignInsert q le φ'' (φs' ++ φs) * koszulSign q le (φs' ++ φs)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) * koszulSign q le (φs' ++ φs) =
koszulSignInsert q le φ'' (φs' ++ φs) * koszulSign q le (φs' ++ φs)
simp only [mul_eq_mul_right_iff] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) = koszulSignInsert q le φ'' (φs' ++ φs) ∨
koszulSign q le (φs' ++ φs) = 0
left 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) = koszulSignInsert q le φ'' (φs' ++ φs)
trans koszulSignInsert q le φ'' (φ :: ψ :: (φs' ++ φs)) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) = koszulSignInsert q le φ'' (φ :: ψ :: (φs' ++ φs))𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φ :: ψ :: (φs' ++ φs)) = koszulSignInsert q le φ'' (φs' ++ φs)
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φ :: ψ :: φs) = koszulSignInsert q le φ'' (φ :: ψ :: (φs' ++ φs)) apply koszulSignInsert_eq_perm 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ (φs' ++ φ :: ψ :: φs).Perm (φ :: ψ :: (φs' ++ φs))
exact (List.perm_cons_append_cons φ List.perm_middle.symm).symm All goals completed! 🐙
· 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φ :: ψ :: (φs' ++ φs)) = koszulSignInsert q le φ'' (φs' ++ φs) rw [koszulSignInsert_eq_remove_same_stat_append q le h1 h2 hq 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leψ:𝓕φ:𝓕inst✝:IsTrans 𝓕 leh1:le φ ψh2:le ψ φhq:q ψ = q φφ'':𝓕φs':List 𝓕φs:List 𝓕⊢ koszulSignInsert q le φ'' (φs' ++ φs) = koszulSignInsert q le φ'' (φs' ++ φs) All goals completed! 🐙] All goals completed! 🐙
lemma koszulSign_of_sorted : (φs : List 𝓕)
→ (hs : List.Pairwise le φs) → koszulSign q le φs = 1
| [], _ => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel lex✝:List.Pairwise le []⊢ koszulSign q le [] = 1 by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel lex✝:List.Pairwise le []⊢ koszulSign q le [] = 1
simp [koszulSign] All goals completed! 🐙
| φ :: φs, h => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:List.Pairwise le (φ :: φs)⊢ koszulSign q le (φ :: φs) = 1 by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:List.Pairwise le (φ :: φs)⊢ koszulSign q le (φ :: φs) = 1
simp only [koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:List.Pairwise le (φ :: φs)⊢ koszulSignInsert q le φ φs * koszulSign q le φs = 1
simp only [List.pairwise_cons] at h 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:(∀ a' ∈ φs, le φ a') ∧ List.Pairwise le φs⊢ koszulSignInsert q le φ φs * koszulSign q le φs = 1
rw [koszulSign_of_sorted φs h.2 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:(∀ a' ∈ φs, le φ a') ∧ List.Pairwise le φs⊢ koszulSignInsert q le φ φs * 1 = 1 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:(∀ a' ∈ φs, le φ a') ∧ List.Pairwise le φs⊢ koszulSignInsert q le φ φs * 1 = 1] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:(∀ a' ∈ φs, le φ a') ∧ List.Pairwise le φs⊢ koszulSignInsert q le φ φs * 1 = 1
simp only [mul_one] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝:DecidableRel leφ:𝓕φs:List 𝓕h:(∀ a' ∈ φs, le φ a') ∧ List.Pairwise le φs⊢ koszulSignInsert q le φ φs = 1
exact koszulSignInsert_of_le_mem _ _ _ _ h.1 All goals completed! 🐙@[simp]
lemma koszulSign_of_insertionSort [Std.Total le] [IsTrans 𝓕 le] (φs : List 𝓕) :
koszulSign q le (List.insertionSort le φs) = 1 := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕⊢ koszulSign q le (List.insertionSort le φs) = 1
apply koszulSign_of_sorted 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕⊢ List.Pairwise le (List.insertionSort le φs)
exact List.pairwise_insertionSort le φs All goals completed! 🐙
lemma koszulSign_of_append_eq_insertionSort_left [Std.Total le] [IsTrans 𝓕 le] :
(φs φs' : List 𝓕) → koszulSign q le (φs ++ φs') =
koszulSign q le (List.insertionSort le φs ++ φs') * koszulSign q le φs
| φs, [] => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕⊢ koszulSign q le (φs ++ []) = koszulSign q le (List.insertionSort le φs ++ []) * koszulSign q le φs by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕⊢ koszulSign q le (φs ++ []) = koszulSign q le (List.insertionSort le φs ++ []) * koszulSign q le φs
simp All goals completed! 🐙
| φs, φ :: φs' => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs
have h1 : (φs ++ φ :: φs') = List.insertIdx (φs ++ φs') φs.length φ := by
rw [insertIdx_length_fst_append 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕⊢ φs ++ φ :: φs' = φs ++ φ :: φs' 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φ⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φ⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φ⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs
have h2 : (List.insertionSort le φs ++ φ :: φs') =
List.insertIdx (List.insertionSort le φs ++ φs') (List.insertionSort le φs).length φ := by
rw [insertIdx_length_fst_append 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φ⊢ List.insertionSort le φs ++ φ :: φs' = List.insertionSort le φs ++ φ :: φs' 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs
rw [h1, 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le ((φs ++ φs').insertIdx φs.length φ) =
koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le ((φs ++ φs').insertIdx φs.length φ) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs h2 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le ((φs ++ φs').insertIdx φs.length φ) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le ((φs ++ φs').insertIdx φs.length φ) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le ((φs ++ φs').insertIdx φs.length φ) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs
rw [koszulSign_insertIdx _ _ _ _ _ (by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ φs.length ≤ (φs ++ φs').length 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q (List.take φs.length (φs ++ φs'))) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs simp All goals completed! 🐙 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q (List.take φs.length (φs ++ φs'))) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q (List.take φs.length (φs ++ φs'))) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) * koszulSign q le φs
simp only [List.take_left', List.length_insertionSort] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q φs) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ) * koszulSign q le φs
rw [koszulSign_insertIdx _ _ _ _ _ (by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ φs.length ≤ (List.insertionSort le φs ++ φs').length 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q φs) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ)) (ofList q (List.take φs.length (List.insertionSort le φs ++ φs'))) *
koszulSign q le (List.insertionSort le φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs simp All goals completed! 🐙 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q φs) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ)) (ofList q (List.take φs.length (List.insertionSort le φs ++ φs'))) *
koszulSign q le (List.insertionSort le φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ)) (ofList q φs) * koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ)) (ofList q (List.take φs.length (List.insertionSort le φs ++ φs'))) *
koszulSign q le (List.insertionSort le φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs
simp only [mul_assoc, List.length_insertionSort, List.take_left',
ofList_insertionSort, mul_eq_mul_left_iff] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le (List.insertionSort le φs ++ φs') *
((exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs) ∨
(exchangeSign (q φ)) (ofList q φs) = 0
left 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (φs ++ φs') *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le (List.insertionSort le φs ++ φs') *
((exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs)
rw [koszulSign_of_append_eq_insertionSort_left φs φs' 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (List.insertionSort le φs ++ φs') * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le (List.insertionSort le φs ++ φs') *
((exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (List.insertionSort le φs ++ φs') * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le (List.insertionSort le φs ++ φs') *
((exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le (List.insertionSort le φs ++ φs') * koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
koszulSign q le (List.insertionSort le φs ++ φs') *
((exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs)
simp only [mul_assoc, mul_eq_mul_left_iff] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ))
(ofList q
(List.take
(↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs ∨
koszulSign q le (List.insertionSort le φs ++ φs') = 0
left 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ koszulSign q le φs *
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) *
koszulSign q le φs
simp only [mul_comm, mul_eq_mul_left_iff] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)))) ∨
koszulSign q le φs = 0
left 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((φs ++ φs').insertIdx φs.length φ)))) =
(exchangeSign (q φ))
(ofList q
(List.take (↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩))
(List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ))))
congr 3 e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩)e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le ((φs ++ φs').insertIdx φs.length φ) =
List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)
· e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) have h2 : (List.insertionSort le φs ++ φ :: φs') =
List.insertIdx (List.insertionSort le φs ++ φs') φs.length φ := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩)
rw [← insertIdx_length_fst_append 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ =
(List.insertionSort le φs ++ φs').insertIdx φs.length φ 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ =
(List.insertionSort le φs ++ φs').insertIdx φs.length φe_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ =
(List.insertionSort le φs ++ φs').insertIdx φs.length φe_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩)
simpe_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩)e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩)
rw [insertionSortEquiv_congr _ _ h2.symm e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑(((Fin.castOrderIso ⋯).trans
((insertionSortEquiv le (List.insertionSort le φs ++ φ :: φs')).trans (Fin.castOrderIso ⋯).toEquiv))
⟨φs.length, ⋯⟩) e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑(((Fin.castOrderIso ⋯).trans
((insertionSortEquiv le (List.insertionSort le φs ++ φ :: φs')).trans (Fin.castOrderIso ⋯).toEquiv))
⟨φs.length, ⋯⟩)]e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑(((Fin.castOrderIso ⋯).trans
((insertionSortEquiv le (List.insertionSort le φs ++ φ :: φs')).trans (Fin.castOrderIso ⋯).toEquiv))
⟨φs.length, ⋯⟩)
simp only [Equiv.trans_apply, RelIso.coe_fn_toEquiv, Fin.castOrderIso_apply, Fin.cast_mk,
Fin.val_cast] e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le (List.insertionSort le φs ++ φ :: φs')) ⟨φs.length, ⋯⟩)
rw [insertionSortEquiv_insertionSort_append e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((finCongr ⋯) ((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩)) e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((finCongr ⋯) ((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩))]e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((finCongr ⋯) ((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩))
simp only [finCongr_apply, Fin.val_cast] e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑((insertionSortEquiv le ((φs ++ φs').insertIdx φs.length φ)) ⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩)
rw [insertionSortEquiv_congr _ _ h1.symm e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le (φs ++ φ :: φs')).trans (Fin.castOrderIso ⋯).toEquiv))
⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩) e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le (φs ++ φ :: φs')).trans (Fin.castOrderIso ⋯).toEquiv))
⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩)]e_6.e_φs.e_n 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2✝:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx φs.length φ⊢ ↑(((Fin.castOrderIso ⋯).trans ((insertionSortEquiv le (φs ++ φ :: φs')).trans (Fin.castOrderIso ⋯).toEquiv))
⟨φs.length, ⋯⟩) =
↑((insertionSortEquiv le (φs ++ φ :: φs')) ⟨φs.length, ⋯⟩)
simp All goals completed! 🐙
· e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le ((φs ++ φs').insertIdx φs.length φ) =
List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ) rw [insertIdx_length_fst_append e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') = List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ) e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') = List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)]e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') = List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx φs.length φ)
rw [show φs.length = (List.insertionSort le φs).length by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕⊢ koszulSign q le (φs ++ φ :: φs') = koszulSign q le (List.insertionSort le φs ++ φ :: φs') * koszulSign q le φs e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') =
List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ) simp All goals completed! 🐙e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') =
List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ)]e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') =
List.insertionSort le ((List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ)
rw [insertIdx_length_fst_append e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') = List.insertionSort le (List.insertionSort le φs ++ φ :: φs') e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') = List.insertionSort le (List.insertionSort le φs ++ φ :: φs')]e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (φs ++ φ :: φs') = List.insertionSort le (List.insertionSort le φs ++ φ :: φs')
symm e_6.e_φs.e_xs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φ:𝓕φs':List 𝓕h1:φs ++ φ :: φs' = (φs ++ φs').insertIdx φs.length φh2:List.insertionSort le φs ++ φ :: φs' = (List.insertionSort le φs ++ φs').insertIdx (List.insertionSort le φs).length φ⊢ List.insertionSort le (List.insertionSort le φs ++ φ :: φs') = List.insertionSort le (φs ++ φ :: φs')
apply insertionSort_insertionSort_append All goals completed! 🐙
lemma koszulSign_of_append_eq_insertionSort [Std.Total le] [IsTrans 𝓕 le] : (φs'' φs φs' : List 𝓕) →
koszulSign q le (φs'' ++ φs ++ φs') =
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') * koszulSign q le φs
| [], φs, φs'=> 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φs':List 𝓕⊢ koszulSign q le ([] ++ φs ++ φs') = koszulSign q le ([] ++ List.insertionSort le φs ++ φs') * koszulSign q le φs by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φs':List 𝓕⊢ koszulSign q le ([] ++ φs ++ φs') = koszulSign q le ([] ++ List.insertionSort le φs ++ φs') * koszulSign q le φs
simp only [List.nil_append] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφs:List 𝓕φs':List 𝓕⊢ koszulSign q le (φs ++ φs') = koszulSign q le (List.insertionSort le φs ++ φs') * koszulSign q le φs
exact koszulSign_of_append_eq_insertionSort_left q le φs φs' All goals completed! 🐙
| φ'' :: φs'', φs, φs' => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSign q le (φ'' :: φs'' ++ φs ++ φs') =
koszulSign q le (φ'' :: φs'' ++ List.insertionSort le φs ++ φs') * koszulSign q le φs by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSign q le (φ'' :: φs'' ++ φs ++ φs') =
koszulSign q le (φ'' :: φs'' ++ List.insertionSort le φs ++ φs') * koszulSign q le φs
simp only [List.cons_append, koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') * koszulSign q le (φs'' ++ φs ++ φs') =
koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs
rw [koszulSign_of_append_eq_insertionSort φs'' φs φs', 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') *
(koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') * koszulSign q le φs) =
koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') * koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs =
koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs ← mul_assoc 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') * koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs =
koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') * koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs =
koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') * koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs =
koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le (φs'' ++ List.insertionSort le φs ++ φs') *
koszulSign q le φs
congr 2 e_a.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ koszulSignInsert q le φ'' (φs'' ++ φs ++ φs') = koszulSignInsert q le φ'' (φs'' ++ List.insertionSort le φs ++ φs')
apply koszulSignInsert_eq_perm e_a.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ (φs'' ++ φs ++ φs').Perm (φs'' ++ List.insertionSort le φs ++ φs')
refine (List.perm_append_right_iff φs').mpr ?_ e_a.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ (φs'' ++ φs).Perm (φs'' ++ List.insertionSort le φs)
refine List.Perm.append_left φs'' ?_ e_a.e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝²:DecidableRel leinst✝¹:Std.Total leinst✝:IsTrans 𝓕 leφ'':𝓕φs'':List 𝓕φs:List 𝓕φs':List 𝓕⊢ φs.Perm (List.insertionSort le φs)
exact List.Perm.symm (List.perm_insertionSort le φs) All goals completed! 🐙koszulSign with permutations
lemma koszulSign_perm_eq_append [IsTrans 𝓕 le] (φ : 𝓕) (φs φs' φs2 : List 𝓕)
(hp : φs.Perm φs') : (h : ∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) →
koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2) := by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'⊢ (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)
let motive (φs φs' : List 𝓕) (hp : φs.Perm φs') : Prop :=
(h : ∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) →
koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)
change motive φs φs' hp 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ motive φs φs' hp
apply List.Perm.recOn nil 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ motive [] [] ⋯cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ ∀ (x : 𝓕) {l₁ l₂ : List 𝓕} (a : l₁.Perm l₂), motive l₁ l₂ a → motive (x :: l₁) (x :: l₂) ⋯swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ ∀ (x y : 𝓕) (l : List 𝓕), motive (y :: x :: l) (x :: y :: l) ⋯trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ ∀ {l₁ l₂ l₃ : List 𝓕} (a : l₁.Perm l₂) (a_1 : l₂.Perm l₃), motive l₁ l₂ a → motive l₂ l₃ a_1 → motive l₁ l₃ ⋯
· nil 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ motive [] [] ⋯ simp [motive] All goals completed! 🐙
· cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ ∀ (x : 𝓕) {l₁ l₂ : List 𝓕} (a : l₁.Perm l₂), motive l₁ l₂ a → motive (x :: l₁) (x :: l₂) ⋯ intro x l1 l2 h ih hxφ cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕l1:List 𝓕l2:List 𝓕h:l1.Perm l2ih:motive l1 l2 hhxφ:∀ φ' ∈ x :: l1, le φ φ' ∧ le φ' φ⊢ koszulSign q le (x :: l1 ++ φs2) = koszulSign q le (x :: l2 ++ φs2)
simp_all only [List.mem_cons, or_true, and_self, implies_true, nonempty_prop, forall_const,
forall_eq_or_imp, List.cons_append, motive] cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕l1:List 𝓕l2:List 𝓕h:l1.Perm l2ih:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)hxφ:(le φ x ∧ le x φ) ∧ ∀ a ∈ l1, le φ a ∧ le a φ⊢ koszulSign q le (x :: (l1 ++ φs2)) = koszulSign q le (x :: (l2 ++ φs2))
simp only [koszulSign, ih, mul_eq_mul_right_iff] cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕l1:List 𝓕l2:List 𝓕h:l1.Perm l2ih:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)hxφ:(le φ x ∧ le x φ) ∧ ∀ a ∈ l1, le φ a ∧ le a φ⊢ koszulSignInsert q le x (l1 ++ φs2) = koszulSignInsert q le x (l2 ++ φs2) ∨ koszulSign q le (l2 ++ φs2) = 0
left cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕l1:List 𝓕l2:List 𝓕h:l1.Perm l2ih:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)hxφ:(le φ x ∧ le x φ) ∧ ∀ a ∈ l1, le φ a ∧ le a φ⊢ koszulSignInsert q le x (l1 ++ φs2) = koszulSignInsert q le x (l2 ++ φs2)
apply koszulSignInsert_eq_perm cons 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕l1:List 𝓕l2:List 𝓕h:l1.Perm l2ih:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)hxφ:(le φ x ∧ le x φ) ∧ ∀ a ∈ l1, le φ a ∧ le a φ⊢ (l1 ++ φs2).Perm (l2 ++ φs2)
exact (List.perm_append_right_iff φs2).mpr h All goals completed! 🐙
· swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ ∀ (x y : 𝓕) (l : List 𝓕), motive (y :: x :: l) (x :: y :: l) ⋯ intro x y l h swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕y:𝓕l:List 𝓕h:∀ φ' ∈ y :: x :: l, le φ φ' ∧ le φ' φ⊢ koszulSign q le (y :: x :: l ++ φs2) = koszulSign q le (x :: y :: l ++ φs2)
simp_all only [List.mem_cons, forall_eq_or_imp, List.cons_append] swap 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕y:𝓕l:List 𝓕h:(le φ y ∧ le y φ) ∧ (le φ x ∧ le x φ) ∧ ∀ a ∈ l, le φ a ∧ le a φ⊢ koszulSign q le (y :: x :: (l ++ φs2)) = koszulSign q le (x :: y :: (l ++ φs2))
apply Wick.koszulSign_swap_eq_rel_cons swap.h1 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕y:𝓕l:List 𝓕h:(le φ y ∧ le y φ) ∧ (le φ x ∧ le x φ) ∧ ∀ a ∈ l, le φ a ∧ le a φ⊢ le y xswap.h2 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕y:𝓕l:List 𝓕h:(le φ y ∧ le y φ) ∧ (le φ x ∧ le x φ) ∧ ∀ a ∈ l, le φ a ∧ le a φ⊢ le x y
· swap.h1 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕y:𝓕l:List 𝓕h:(le φ y ∧ le y φ) ∧ (le φ x ∧ le x φ) ∧ ∀ a ∈ l, le φ a ∧ le a φ⊢ le y x exact IsTrans.trans y φ x h.1.2 h.2.1.1 All goals completed! 🐙
· swap.h2 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)x:𝓕y:𝓕l:List 𝓕h:(le φ y ∧ le y φ) ∧ (le φ x ∧ le x φ) ∧ ∀ a ∈ l, le φ a ∧ le a φ⊢ le x y exact IsTrans.trans x φ y h.2.1.2 h.1.1 All goals completed! 🐙
· trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)⊢ ∀ {l₁ l₂ l₃ : List 𝓕} (a : l₁.Perm l₂) (a_1 : l₂.Perm l₃), motive l₁ l₂ a → motive l₂ l₃ a_1 → motive l₁ l₃ ⋯ intro l1 l2 l3 h1 h2 ih1 ih2 h trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)l1:List 𝓕l2:List 𝓕l3:List 𝓕h1:l1.Perm l2h2:l2.Perm l3ih1:motive l1 l2 h1ih2:motive l2 l3 h2h:∀ φ' ∈ l1, le φ φ' ∧ le φ' φ⊢ koszulSign q le (l1 ++ φs2) = koszulSign q le (l3 ++ φs2)
simp_all only [and_self, implies_true, nonempty_prop, forall_const, motive] trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)l1:List 𝓕l2:List 𝓕l3:List 𝓕h1:l1.Perm l2h2:l2.Perm l3ih1:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)ih2:(∀ φ' ∈ l2, le φ φ' ∧ le φ' φ) → koszulSign q le (l2 ++ φs2) = koszulSign q le (l3 ++ φs2)h:∀ φ' ∈ l1, le φ φ' ∧ le φ' φ⊢ koszulSign q le (l2 ++ φs2) = koszulSign q le (l3 ++ φs2)
refine (ih2 ?_) trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)l1:List 𝓕l2:List 𝓕l3:List 𝓕h1:l1.Perm l2h2:l2.Perm l3ih1:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)ih2:(∀ φ' ∈ l2, le φ φ' ∧ le φ' φ) → koszulSign q le (l2 ++ φs2) = koszulSign q le (l3 ++ φs2)h:∀ φ' ∈ l1, le φ φ' ∧ le φ' φ⊢ ∀ φ' ∈ l2, le φ φ' ∧ le φ' φ
intro φ' hφ trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)l1:List 𝓕l2:List 𝓕l3:List 𝓕h1:l1.Perm l2h2:l2.Perm l3ih1:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)ih2:(∀ φ' ∈ l2, le φ φ' ∧ le φ' φ) → koszulSign q le (l2 ++ φs2) = koszulSign q le (l3 ++ φs2)h:∀ φ' ∈ l1, le φ φ' ∧ le φ' φφ':𝓕hφ:φ' ∈ l2⊢ le φ φ' ∧ le φ' φ
refine h φ' ?_ trans 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕hp:φs.Perm φs'motive:(φs φs' : List 𝓕) → φs.Perm φs' → Prop := fun φs φs' hp => (∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)l1:List 𝓕l2:List 𝓕l3:List 𝓕h1:l1.Perm l2h2:l2.Perm l3ih1:koszulSign q le (l1 ++ φs2) = koszulSign q le (l2 ++ φs2)ih2:(∀ φ' ∈ l2, le φ φ' ∧ le φ' φ) → koszulSign q le (l2 ++ φs2) = koszulSign q le (l3 ++ φs2)h:∀ φ' ∈ l1, le φ φ' ∧ le φ' φφ':𝓕hφ:φ' ∈ l2⊢ φ' ∈ l1
exact (List.Perm.mem_iff (id (List.Perm.symm h1))).mp hφ All goals completed! 🐙
lemma koszulSign_perm_eq [IsTrans 𝓕 le] (φ : 𝓕) : (φs1 φs φs' φs2 : List 𝓕) →
(h : ∀ φ' ∈ φs, le φ φ' ∧ le φ' φ) → (hp : φs.Perm φs') →
koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)
| [], φs, φs', φs2, h, hp => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'⊢ koszulSign q le ([] ++ φs ++ φs2) = koszulSign q le ([] ++ φs' ++ φs2) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'⊢ koszulSign q le ([] ++ φs ++ φs2) = koszulSign q le ([] ++ φs' ++ φs2)
simp only [List.nil_append] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'⊢ koszulSign q le (φs ++ φs2) = koszulSign q le (φs' ++ φs2)
exact koszulSign_perm_eq_append q le φ φs φs' φs2 hp h All goals completed! 🐙
| φ1 :: φs1, φs, φs', φs2, h, hp => 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'⊢ koszulSign q le (φ1 :: φs1 ++ φs ++ φs2) = koszulSign q le (φ1 :: φs1 ++ φs' ++ φs2) by 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'⊢ koszulSign q le (φ1 :: φs1 ++ φs ++ φs2) = koszulSign q le (φ1 :: φs1 ++ φs' ++ φs2)
simp only [List.cons_append, koszulSign] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'⊢ koszulSignInsert q le φ1 (φs1 ++ φs ++ φs2) * koszulSign q le (φs1 ++ φs ++ φs2) =
koszulSignInsert q le φ1 (φs1 ++ φs' ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2)
have ih := koszulSign_perm_eq φ φs1 φs φs' φs2 h hp 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ koszulSignInsert q le φ1 (φs1 ++ φs ++ φs2) * koszulSign q le (φs1 ++ φs ++ φs2) =
koszulSignInsert q le φ1 (φs1 ++ φs' ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2)
rw [ih 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ koszulSignInsert q le φ1 (φs1 ++ φs ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2) =
koszulSignInsert q le φ1 (φs1 ++ φs' ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2) 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ koszulSignInsert q le φ1 (φs1 ++ φs ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2) =
koszulSignInsert q le φ1 (φs1 ++ φs' ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2)] 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ koszulSignInsert q le φ1 (φs1 ++ φs ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2) =
koszulSignInsert q le φ1 (φs1 ++ φs' ++ φs2) * koszulSign q le (φs1 ++ φs' ++ φs2)
congr 1 e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ koszulSignInsert q le φ1 (φs1 ++ φs ++ φs2) = koszulSignInsert q le φ1 (φs1 ++ φs' ++ φs2)
apply koszulSignInsert_eq_perm e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ (φs1 ++ φs ++ φs2).Perm (φs1 ++ φs' ++ φs2)
refine (List.perm_append_right_iff φs2).mpr ?_ e_a 𝓕:Typeq:𝓕 → FieldStatisticle:𝓕 → 𝓕 → Propinst✝¹:DecidableRel leinst✝:IsTrans 𝓕 leφ:𝓕φ1:𝓕φs1:List 𝓕φs:List 𝓕φs':List 𝓕φs2:List 𝓕h:∀ φ' ∈ φs, le φ φ' ∧ le φ' φhp:φs.Perm φs'ih:koszulSign q le (φs1 ++ φs ++ φs2) = koszulSign q le (φs1 ++ φs' ++ φs2)⊢ (φs1 ++ φs).Perm (φs1 ++ φs')
exact List.Perm.append_left φs1 hp All goals completed! 🐙