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.Mathematics.List.InsertIdx
public import Mathlib.Tactic.FinCases
public import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise
public import Mathlib.Data.Fintype.Card
public import Mathlib.Algebra.FreeMonoid.Basic
public import Mathlib.Data.List.SortField statistics
Basic properties related to whether a field, or list of fields, is bosonic or fermionic.
@[expose] public section
The type FieldStatistic is the type containing two elements bosonic and fermionic.
This type is used to specify if a field or operator obeys bosonic or fermionic statistics.
inductive FieldStatistic : Type where
| bosonic : FieldStatistic
| fermionic : FieldStatistic
deriving DecidableEq
The type FieldStatistic carries an instance of a commutative group in which
bosonic * bosonic = bosonic
bosonic * fermionic = fermionic
fermionic * bosonic = fermionic
fermionic * fermionic = bosonic
This group is isomorphic to ℤ₂.
@[simp]
instance : CommGroup FieldStatistic where
one := bosonic
mul a b :=
match a, b with
| bosonic, bosonic => bosonic
| bosonic, fermionic => fermionic
| fermionic, bosonic => fermionic
| fermionic, fermionic => bosonic
inv a := a
mul_assoc a b c := 𝓕:Typea:FieldStatisticb:FieldStatisticc:FieldStatistic⊢ a * b * c = a * (b * c)
𝓕:Typeb:FieldStatisticc:FieldStatistic⊢ bosonic * b * c = bosonic * (b * c)𝓕:Typeb:FieldStatisticc:FieldStatistic⊢ fermionic * b * c = fermionic * (b * c) 𝓕:Typeb:FieldStatisticc:FieldStatistic⊢ bosonic * b * c = bosonic * (b * c)𝓕:Typeb:FieldStatisticc:FieldStatistic⊢ fermionic * b * c = fermionic * (b * c) 𝓕:Typec:FieldStatistic⊢ fermionic * bosonic * c = fermionic * (bosonic * c)𝓕:Typec:FieldStatistic⊢ fermionic * fermionic * c = fermionic * (fermionic * c) 𝓕:Typec:FieldStatistic⊢ bosonic * bosonic * c = bosonic * (bosonic * c)𝓕:Typec:FieldStatistic⊢ bosonic * fermionic * c = bosonic * (fermionic * c)𝓕:Typec:FieldStatistic⊢ fermionic * bosonic * c = fermionic * (bosonic * c)𝓕:Typec:FieldStatistic⊢ fermionic * fermionic * c = fermionic * (fermionic * c) 𝓕:Type⊢ fermionic * fermionic * bosonic = fermionic * (fermionic * bosonic)𝓕:Type⊢ fermionic * fermionic * fermionic = fermionic * (fermionic * fermionic) 𝓕:Type⊢ bosonic * bosonic * bosonic = bosonic * (bosonic * bosonic)𝓕:Type⊢ bosonic * bosonic * fermionic = bosonic * (bosonic * fermionic)𝓕:Type⊢ bosonic * fermionic * bosonic = bosonic * (fermionic * bosonic)𝓕:Type⊢ bosonic * fermionic * fermionic = bosonic * (fermionic * fermionic)𝓕:Type⊢ fermionic * bosonic * bosonic = fermionic * (bosonic * bosonic)𝓕:Type⊢ fermionic * bosonic * fermionic = fermionic * (bosonic * fermionic)𝓕:Type⊢ fermionic * fermionic * bosonic = fermionic * (fermionic * bosonic)𝓕:Type⊢ fermionic * fermionic * fermionic = fermionic * (fermionic * fermionic)
All goals completed! 🐙
one_mul a := 𝓕:Typea:FieldStatistic⊢ 1 * a = a
𝓕:Type⊢ 1 * bosonic = bosonic𝓕:Type⊢ 1 * fermionic = fermionic 𝓕:Type⊢ 1 * bosonic = bosonic𝓕:Type⊢ 1 * fermionic = fermionic All goals completed! 🐙
mul_one a := 𝓕:Typea:FieldStatistic⊢ a * 1 = a
𝓕:Type⊢ bosonic * 1 = bosonic𝓕:Type⊢ fermionic * 1 = fermionic 𝓕:Type⊢ bosonic * 1 = bosonic𝓕:Type⊢ fermionic * 1 = fermionic All goals completed! 🐙
inv_mul_cancel a := 𝓕:Typea:FieldStatistic⊢ a * a = 1
𝓕:Type⊢ bosonic * bosonic = 1𝓕:Type⊢ fermionic * fermionic = 1 𝓕:Type⊢ bosonic * bosonic = 1𝓕:Type⊢ fermionic * fermionic = 1 𝓕:Type⊢ bosonic = 1 𝓕:Type⊢ bosonic = 1𝓕:Type⊢ bosonic = 1 All goals completed! 🐙
mul_comm a b := 𝓕:Typea:FieldStatisticb:FieldStatistic⊢ a * b = b * a
𝓕:Typeb:FieldStatistic⊢ bosonic * b = b * bosonic𝓕:Typeb:FieldStatistic⊢ fermionic * b = b * fermionic 𝓕:Typeb:FieldStatistic⊢ bosonic * b = b * bosonic𝓕:Typeb:FieldStatistic⊢ fermionic * b = b * fermionic 𝓕:Type⊢ fermionic * bosonic = bosonic * fermionic𝓕:Type⊢ fermionic * fermionic = fermionic * fermionic 𝓕:Type⊢ bosonic * bosonic = bosonic * bosonic𝓕:Type⊢ bosonic * fermionic = fermionic * bosonic𝓕:Type⊢ fermionic * bosonic = bosonic * fermionic𝓕:Type⊢ fermionic * fermionic = fermionic * fermionic All goals completed! 🐙@[simp]
lemma bosonic_mul_bosonic : bosonic * bosonic = bosonic := rfl@[simp]
lemma bosonic_mul_fermionic : bosonic * fermionic = fermionic := rfl@[simp]
lemma fermionic_mul_bosonic : fermionic * bosonic = fermionic := rfl@[simp]
lemma fermionic_mul_fermionic : fermionic * fermionic = bosonic := rfl@[simp]
lemma mul_bosonic (a : FieldStatistic) : a * bosonic = a := a:FieldStatistic⊢ a * bosonic = a
⊢ bosonic * bosonic = bosonic⊢ fermionic * bosonic = fermionic ⊢ bosonic * bosonic = bosonic⊢ fermionic * bosonic = fermionic All goals completed! 🐙@[simp]
lemma mul_self (a : FieldStatistic) : a * a = 1 := a:FieldStatistic⊢ a * a = 1
⊢ bosonic * bosonic = 1⊢ fermionic * fermionic = 1 ⊢ bosonic * bosonic = 1⊢ fermionic * fermionic = 1 All goals completed! 🐙Field statics form a finite type.
instance : Fintype FieldStatistic where
elems := {bosonic, fermionic}
complete := 𝓕:Type⊢ ∀ (x : FieldStatistic), x ∈ {bosonic, fermionic}
𝓕:Typec:FieldStatistic⊢ c ∈ {bosonic, fermionic}
𝓕:Type⊢ bosonic ∈ {bosonic, fermionic}𝓕:Type⊢ fermionic ∈ {bosonic, fermionic}
𝓕:Type⊢ bosonic ∈ {bosonic, fermionic} All goals completed! 🐙
𝓕:Type⊢ fermionic ∈ {bosonic, fermionic} 𝓕:Type⊢ {fermionic, bosonic, fermionic} = {bosonic, fermionic}
All goals completed! 🐙@[simp]
lemma fermionic_not_eq_bonsic : ¬ fermionic = bosonic := ⊢ ¬fermionic = bosonic
h:fermionic = bosonic⊢ False
All goals completed! 🐙lemma bonsic_eq_fermionic_false : bosonic = fermionic ↔ false := ⊢ bosonic = fermionic ↔ false = true
All goals completed! 🐙@[simp]
lemma neq_fermionic_iff_eq_bosonic (a : FieldStatistic) : ¬ a = fermionic ↔ a = bosonic := a:FieldStatistic⊢ ¬a = fermionic ↔ a = bosonic
⊢ ¬bosonic = fermionic ↔ bosonic = bosonic⊢ ¬fermionic = fermionic ↔ fermionic = bosonic
⊢ ¬bosonic = fermionic ↔ bosonic = bosonic All goals completed! 🐙
⊢ ¬fermionic = fermionic ↔ fermionic = bosonic All goals completed! 🐙@[simp]
lemma neq_bosonic_iff_eq_fermionic (a : FieldStatistic) : ¬ a = bosonic ↔ a = fermionic := a:FieldStatistic⊢ ¬a = bosonic ↔ a = fermionic
⊢ ¬bosonic = bosonic ↔ bosonic = fermionic⊢ ¬fermionic = bosonic ↔ fermionic = fermionic
⊢ ¬bosonic = bosonic ↔ bosonic = fermionic All goals completed! 🐙
⊢ ¬fermionic = bosonic ↔ fermionic = fermionic All goals completed! 🐙@[simp]
lemma bosonic_ne_iff_fermionic_eq (a : FieldStatistic) : ¬ bosonic = a ↔ fermionic = a := a:FieldStatistic⊢ ¬bosonic = a ↔ fermionic = a
⊢ ¬bosonic = bosonic ↔ fermionic = bosonic⊢ ¬bosonic = fermionic ↔ fermionic = fermionic
⊢ ¬bosonic = bosonic ↔ fermionic = bosonic All goals completed! 🐙
⊢ ¬bosonic = fermionic ↔ fermionic = fermionic All goals completed! 🐙@[simp]
lemma fermionic_ne_iff_bosonic_eq (a : FieldStatistic) : ¬ fermionic = a ↔ bosonic = a := a:FieldStatistic⊢ ¬fermionic = a ↔ bosonic = a
⊢ ¬fermionic = bosonic ↔ bosonic = bosonic⊢ ¬fermionic = fermionic ↔ bosonic = fermionic
⊢ ¬fermionic = bosonic ↔ bosonic = bosonic All goals completed! 🐙
⊢ ¬fermionic = fermionic ↔ bosonic = fermionic All goals completed! 🐙lemma eq_self_if_eq_bosonic {a : FieldStatistic} :
(if a = bosonic then bosonic else fermionic) = a := a:FieldStatistic⊢ (if a = bosonic then bosonic else fermionic) = a
⊢ (if bosonic = bosonic then bosonic else fermionic) = bosonic⊢ (if fermionic = bosonic then bosonic else fermionic) = fermionic ⊢ (if bosonic = bosonic then bosonic else fermionic) = bosonic⊢ (if fermionic = bosonic then bosonic else fermionic) = fermionic All goals completed! 🐙lemma eq_self_if_bosonic_eq {a : FieldStatistic} :
(if bosonic = a then bosonic else fermionic) = a := a:FieldStatistic⊢ (if bosonic = a then bosonic else fermionic) = a
⊢ (if bosonic = bosonic then bosonic else fermionic) = bosonic⊢ (if bosonic = fermionic then bosonic else fermionic) = fermionic ⊢ (if bosonic = bosonic then bosonic else fermionic) = bosonic⊢ (if bosonic = fermionic then bosonic else fermionic) = fermionic All goals completed! 🐙lemma mul_eq_one_iff (a b : FieldStatistic) : a * b = 1 ↔ a = b := a:FieldStatisticb:FieldStatistic⊢ a * b = 1 ↔ a = b
b:FieldStatistic⊢ bosonic * b = 1 ↔ bosonic = bb:FieldStatistic⊢ fermionic * b = 1 ↔ fermionic = b b:FieldStatistic⊢ bosonic * b = 1 ↔ bosonic = bb:FieldStatistic⊢ fermionic * b = 1 ↔ fermionic = b ⊢ fermionic * bosonic = 1 ↔ fermionic = bosonic⊢ fermionic * fermionic = 1 ↔ fermionic = fermionic ⊢ bosonic * bosonic = 1 ↔ bosonic = bosonic⊢ bosonic * fermionic = 1 ↔ bosonic = fermionic⊢ fermionic * bosonic = 1 ↔ fermionic = bosonic⊢ fermionic * fermionic = 1 ↔ fermionic = fermionic All goals completed! 🐙lemma one_eq_mul_iff (a b : FieldStatistic) : 1 = a * b ↔ a = b := a:FieldStatisticb:FieldStatistic⊢ 1 = a * b ↔ a = b
b:FieldStatistic⊢ 1 = bosonic * b ↔ bosonic = bb:FieldStatistic⊢ 1 = fermionic * b ↔ fermionic = b b:FieldStatistic⊢ 1 = bosonic * b ↔ bosonic = bb:FieldStatistic⊢ 1 = fermionic * b ↔ fermionic = b ⊢ 1 = fermionic * bosonic ↔ fermionic = bosonic⊢ 1 = fermionic * fermionic ↔ fermionic = fermionic ⊢ 1 = bosonic * bosonic ↔ bosonic = bosonic⊢ 1 = bosonic * fermionic ↔ bosonic = fermionic⊢ 1 = fermionic * bosonic ↔ fermionic = bosonic⊢ 1 = fermionic * fermionic ↔ fermionic = fermionic All goals completed! 🐙lemma mul_eq_iff_eq_mul (a b c : FieldStatistic) : a * b = c ↔ a = b * c := a:FieldStatisticb:FieldStatisticc:FieldStatistic⊢ a * b = c ↔ a = b * c
b:FieldStatisticc:FieldStatistic⊢ bosonic * b = c ↔ bosonic = b * cb:FieldStatisticc:FieldStatistic⊢ fermionic * b = c ↔ fermionic = b * c b:FieldStatisticc:FieldStatistic⊢ bosonic * b = c ↔ bosonic = b * cb:FieldStatisticc:FieldStatistic⊢ fermionic * b = c ↔ fermionic = b * c c:FieldStatistic⊢ fermionic * bosonic = c ↔ fermionic = bosonic * cc:FieldStatistic⊢ fermionic * fermionic = c ↔ fermionic = fermionic * c c:FieldStatistic⊢ bosonic * bosonic = c ↔ bosonic = bosonic * cc:FieldStatistic⊢ bosonic * fermionic = c ↔ bosonic = fermionic * cc:FieldStatistic⊢ fermionic * bosonic = c ↔ fermionic = bosonic * cc:FieldStatistic⊢ fermionic * fermionic = c ↔ fermionic = fermionic * c ⊢ fermionic * fermionic = bosonic ↔ fermionic = fermionic * bosonic⊢ fermionic * fermionic = fermionic ↔ fermionic = fermionic * fermionic ⊢ bosonic * bosonic = bosonic ↔ bosonic = bosonic * bosonic⊢ bosonic * bosonic = fermionic ↔ bosonic = bosonic * fermionic⊢ bosonic * fermionic = bosonic ↔ bosonic = fermionic * bosonic⊢ bosonic * fermionic = fermionic ↔ bosonic = fermionic * fermionic⊢ fermionic * bosonic = bosonic ↔ fermionic = bosonic * bosonic⊢ fermionic * bosonic = fermionic ↔ fermionic = bosonic * fermionic⊢ fermionic * fermionic = bosonic ↔ fermionic = fermionic * bosonic⊢ fermionic * fermionic = fermionic ↔ fermionic = fermionic * fermionic
All goals completed! 🐙
all_goals All goals completed! 🐙lemma mul_eq_iff_eq_mul' (a b c : FieldStatistic) : a * b = c ↔ b = a * c := a:FieldStatisticb:FieldStatisticc:FieldStatistic⊢ a * b = c ↔ b = a * c
b:FieldStatisticc:FieldStatistic⊢ bosonic * b = c ↔ b = bosonic * cb:FieldStatisticc:FieldStatistic⊢ fermionic * b = c ↔ b = fermionic * c b:FieldStatisticc:FieldStatistic⊢ bosonic * b = c ↔ b = bosonic * cb:FieldStatisticc:FieldStatistic⊢ fermionic * b = c ↔ b = fermionic * c c:FieldStatistic⊢ fermionic * bosonic = c ↔ bosonic = fermionic * cc:FieldStatistic⊢ fermionic * fermionic = c ↔ fermionic = fermionic * c c:FieldStatistic⊢ bosonic * bosonic = c ↔ bosonic = bosonic * cc:FieldStatistic⊢ bosonic * fermionic = c ↔ fermionic = bosonic * cc:FieldStatistic⊢ fermionic * bosonic = c ↔ bosonic = fermionic * cc:FieldStatistic⊢ fermionic * fermionic = c ↔ fermionic = fermionic * c ⊢ fermionic * fermionic = bosonic ↔ fermionic = fermionic * bosonic⊢ fermionic * fermionic = fermionic ↔ fermionic = fermionic * fermionic ⊢ bosonic * bosonic = bosonic ↔ bosonic = bosonic * bosonic⊢ bosonic * bosonic = fermionic ↔ bosonic = bosonic * fermionic⊢ bosonic * fermionic = bosonic ↔ fermionic = bosonic * bosonic⊢ bosonic * fermionic = fermionic ↔ fermionic = bosonic * fermionic⊢ fermionic * bosonic = bosonic ↔ bosonic = fermionic * bosonic⊢ fermionic * bosonic = fermionic ↔ bosonic = fermionic * fermionic⊢ fermionic * fermionic = bosonic ↔ fermionic = fermionic * bosonic⊢ fermionic * fermionic = fermionic ↔ fermionic = fermionic * fermionic
All goals completed! 🐙
all_goals All goals completed! 🐙The field statistics of a list of fields is fermionic if there is an odd number of fermions, otherwise it is bosonic.
def ofList (s : 𝓕 → FieldStatistic) : (φs : List 𝓕) → FieldStatistic
| [] => bosonic
| φ :: φs => if s φ = ofList s φs then bosonic else fermionic𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ ofList s (φ :: φs) = s φ * ofList s φs
exact ha (s φ) (ofList s φs) All goals completed! 🐙
lemma ofList_eq_prod (s : 𝓕 → FieldStatistic) : (φs : List 𝓕) →
ofList s φs = (List.map s φs).prod
| [] => rfl
| φ :: φs => 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕⊢ ofList s (φ :: φs) = (List.map s (φ :: φs)).prod by 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕⊢ ofList s (φ :: φs) = (List.map s (φ :: φs)).prod
rw [ofList_cons_eq_mul, 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕⊢ s φ * ofList s φs = (List.map s (φ :: φs)).prod All goals completed! 🐙 List.map_cons, 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕⊢ s φ * ofList s φs = (s φ :: List.map s φs).prod All goals completed! 🐙 List.prod_cons, 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕⊢ s φ * ofList s φs = s φ * (List.map s φs).prod All goals completed! 🐙 ofList_eq_prod 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕⊢ s φ * (List.map s φs).prod = s φ * (List.map s φs).prod All goals completed! 🐙] All goals completed! 🐙
set_option backward.isDefEq.respectTransparency false in
@[simp]
lemma ofList_singleton (s : 𝓕 → FieldStatistic) (φ : 𝓕) : ofList s [φ] = s φ := by 𝓕:Types:𝓕 → FieldStatisticφ:𝓕⊢ ofList s [φ] = s φ
simp only [ofList] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕⊢ (if s φ = bosonic then bosonic else fermionic) = s φ
rw [eq_self_if_eq_bosonic 𝓕:Types:𝓕 → FieldStatisticφ:𝓕⊢ s φ = s φ All goals completed! 🐙] All goals completed! 🐙@[simp]
lemma ofList_freeMonoid (s : 𝓕 → FieldStatistic) (φ : 𝓕) : ofList s (FreeMonoid.of φ) = s φ :=
ofList_singleton s φ@[simp]
lemma ofList_empty (s : 𝓕 → FieldStatistic) : ofList s [] = bosonic := rfl
set_option backward.isDefEq.respectTransparency false in
@[simp]
lemma ofList_append (s : 𝓕 → FieldStatistic) (φs φs' : List 𝓕) :
ofList s (φs ++ φs') = if ofList s φs = ofList s φs' then bosonic else fermionic := by 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ ofList s (φs ++ φs') = if ofList s φs = ofList s φs' then bosonic else fermionic
induction φs with
| nil => nil 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕⊢ ofList s ([] ++ φs') = if ofList s [] = ofList s φs' then bosonic else fermionic
simp only [List.nil_append, ofList_empty, eq_self_if_bosonic_eq] All goals completed! 🐙
| cons a l ih => cons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic
have hab (a b c : FieldStatistic) :
(if a = (if b = c then bosonic else fermionic) then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic := by 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ ofList s (φs ++ φs') = if ofList s φs = ofList s φs' then bosonic else fermionic cons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic
fin_cases a «0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicb:FieldStatisticc:FieldStatistic⊢ (if bosonic = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = b then bosonic else fermionic) = c then bosonic else fermionic«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicb:FieldStatisticc:FieldStatistic⊢ (if fermionic = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = b then bosonic else fermionic) = c then bosonic else fermionic cons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic <;> «0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicb:FieldStatisticc:FieldStatistic⊢ (if bosonic = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = b then bosonic else fermionic) = c then bosonic else fermionic«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicb:FieldStatisticc:FieldStatistic⊢ (if fermionic = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = b then bosonic else fermionic) = c then bosonic else fermioniccons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic fin_cases b «1».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicc:FieldStatistic⊢ (if fermionic = if bosonic = c then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = bosonic then bosonic else fermionic) = c then bosonic else fermionic«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicc:FieldStatistic⊢ (if fermionic = if fermionic = c then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = fermionic then bosonic else fermionic) = c then bosonic else fermioniccons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic <;> «0».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicc:FieldStatistic⊢ (if bosonic = if bosonic = c then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = bosonic then bosonic else fermionic) = c then bosonic else fermionic«0».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicc:FieldStatistic⊢ (if bosonic = if fermionic = c then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = fermionic then bosonic else fermionic) = c then bosonic else fermionic«1».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicc:FieldStatistic⊢ (if fermionic = if bosonic = c then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = bosonic then bosonic else fermionic) = c then bosonic else fermionic«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionicc:FieldStatistic⊢ (if fermionic = if fermionic = c then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = fermionic then bosonic else fermionic) = c then bosonic else fermioniccons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic fin_cases c «1».«1».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if fermionic = if fermionic = bosonic then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = fermionic then bosonic else fermionic) = bosonic then bosonic else fermionic«1».«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if fermionic = if fermionic = fermionic then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = fermionic then bosonic else fermionic) = fermionic then bosonic else fermioniccons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic <;> «0».«0».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if bosonic = if bosonic = bosonic then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = bosonic then bosonic else fermionic) = bosonic then bosonic else fermionic«0».«0».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if bosonic = if bosonic = fermionic then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = bosonic then bosonic else fermionic) = fermionic then bosonic else fermionic«0».«1».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if bosonic = if fermionic = bosonic then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = fermionic then bosonic else fermionic) = bosonic then bosonic else fermionic«0».«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if bosonic = if fermionic = fermionic then bosonic else fermionic then bosonic else fermionic) =
if (if bosonic = fermionic then bosonic else fermionic) = fermionic then bosonic else fermionic«1».«0».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if fermionic = if bosonic = bosonic then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = bosonic then bosonic else fermionic) = bosonic then bosonic else fermionic«1».«0».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if fermionic = if bosonic = fermionic then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = bosonic then bosonic else fermionic) = fermionic then bosonic else fermionic«1».«1».«0» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if fermionic = if fermionic = bosonic then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = fermionic then bosonic else fermionic) = bosonic then bosonic else fermionic«1».«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionic⊢ (if fermionic = if fermionic = fermionic then bosonic else fermionic then bosonic else fermionic) =
if (if fermionic = fermionic then bosonic else fermionic) = fermionic then bosonic else fermioniccons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic rflcons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermioniccons 𝓕:Types:𝓕 → FieldStatisticφs':List 𝓕a:𝓕l:List 𝓕ih:ofList s (l ++ φs') = if ofList s l = ofList s φs' then bosonic else fermionichab:∀ (a b c : FieldStatistic),
(if a = if b = c then bosonic else fermionic then bosonic else fermionic) =
if (if a = b then bosonic else fermionic) = c then bosonic else fermionic⊢ ofList s (a :: l ++ φs') = if ofList s (a :: l) = ofList s φs' then bosonic else fermionic
simp only [List.cons_append, ofList, ih, hab] All goals completed! 🐙
lemma ofList_append_eq_mul (s : 𝓕 → FieldStatistic) (φs φs' : List 𝓕) :
ofList s (φs ++ φs') = ofList s φs * ofList s φs' := by 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ ofList s (φs ++ φs') = ofList s φs * ofList s φs'
rw [ofList_append 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs' 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs'] 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs'
have ha (a b : FieldStatistic) : (if a = b then bosonic else fermionic) = a * b := by 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ ofList s (φs ++ φs') = ofList s φs * ofList s φs' 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs'
fin_cases a «0» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕b:FieldStatistic⊢ (if bosonic = b then bosonic else fermionic) = bosonic * b«1» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕b:FieldStatistic⊢ (if fermionic = b then bosonic else fermionic) = fermionic * b 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs' <;> «0» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕b:FieldStatistic⊢ (if bosonic = b then bosonic else fermionic) = bosonic * b«1» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕b:FieldStatistic⊢ (if fermionic = b then bosonic else fermionic) = fermionic * b 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs' fin_cases b «1».«0» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if fermionic = bosonic then bosonic else fermionic) = fermionic * bosonic«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if fermionic = fermionic then bosonic else fermionic) = fermionic * fermionic 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs' <;> «0».«0» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if bosonic = bosonic then bosonic else fermionic) = bosonic * bosonic«0».«1» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if bosonic = fermionic then bosonic else fermionic) = bosonic * fermionic«1».«0» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if fermionic = bosonic then bosonic else fermionic) = fermionic * bosonic«1».«1» 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕⊢ (if fermionic = fermionic then bosonic else fermionic) = fermionic * fermionic 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs' rfl 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs' 𝓕:Types:𝓕 → FieldStatisticφs:List 𝓕φs':List 𝓕ha:∀ (a b : FieldStatistic), (if a = b then bosonic else fermionic) = a * b⊢ (if ofList s φs = ofList s φs' then bosonic else fermionic) = ofList s φs * ofList s φs'
exact ha _ _ All goals completed! 🐙
lemma ofList_perm (s : 𝓕 → FieldStatistic) {l l' : List 𝓕} (h : l.Perm l') :
ofList s l = ofList s l' := by 𝓕:Types:𝓕 → FieldStatisticl:List 𝓕l':List 𝓕h:l.Perm l'⊢ ofList s l = ofList s l'
rw [ofList_eq_prod, 𝓕:Types:𝓕 → FieldStatisticl:List 𝓕l':List 𝓕h:l.Perm l'⊢ (List.map s l).prod = ofList s l' 𝓕:Types:𝓕 → FieldStatisticl:List 𝓕l':List 𝓕h:l.Perm l'⊢ (List.map s l).prod = (List.map s l').prod ofList_eq_prod 𝓕:Types:𝓕 → FieldStatisticl:List 𝓕l':List 𝓕h:l.Perm l'⊢ (List.map s l).prod = (List.map s l').prod 𝓕:Types:𝓕 → FieldStatisticl:List 𝓕l':List 𝓕h:l.Perm l'⊢ (List.map s l).prod = (List.map s l').prod] 𝓕:Types:𝓕 → FieldStatisticl:List 𝓕l':List 𝓕h:l.Perm l'⊢ (List.map s l).prod = (List.map s l').prod
exact List.Perm.prod_eq (List.Perm.map s h) All goals completed! 🐙lemma ofList_orderedInsert (s : 𝓕 → FieldStatistic) (le1 : 𝓕 → 𝓕 → Prop) [DecidableRel le1]
(φs : List 𝓕) (φ : 𝓕) : ofList s (List.orderedInsert le1 φ φs) = ofList s (φ :: φs) :=
ofList_perm s (List.perm_orderedInsert le1 φ φs)@[simp]
lemma ofList_insertionSort (s : 𝓕 → FieldStatistic) (le1 : 𝓕 → 𝓕 → Prop) [DecidableRel le1]
(φs : List 𝓕) : ofList s (List.insertionSort le1 φs) = ofList s φs :=
ofList_perm s (List.perm_insertionSort le1 φs)
lemma ofList_map_eq_finset_prod (s : 𝓕 → FieldStatistic) :
(φs : List 𝓕) → (l : List (Fin φs.length)) → (hl : l.Nodup) →
ofList s (l.map φs.get) = ∏ (i : Fin φs.length), if i ∈ l then s φs[i] else 1
| [], [], _ => rfl
| [], i :: l, hl => Fin.elim0 i
| φ :: φs, [], hl => 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕hl:[].Nodup⊢ ofList s (List.map (φ :: φs).get []) = ∏ i, if i ∈ [] then s (φ :: φs)[i] else 1 by 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕hl:[].Nodup⊢ ofList s (List.map (φ :: φs).get []) = ∏ i, if i ∈ [] then s (φ :: φs)[i] else 1
simp only [List.length_cons, List.map_nil, ofList_empty, List.not_mem_nil, ↓reduceIte,
Finset.prod_const_one] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕hl:[].Nodup⊢ bosonic = 1
rfl All goals completed! 🐙
| φ :: φs, i :: l, hl => 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ ofList s (List.map (φ :: φs).get (i :: l)) = ∏ i_1, if i_1 ∈ i :: l then s (φ :: φs)[i_1] else 1 by 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ ofList s (List.map (φ :: φs).get (i :: l)) = ∏ i_1, if i_1 ∈ i :: l then s (φ :: φs)[i_1] else 1
simp only [List.length_cons, List.map_cons, List.get_eq_getElem, List.mem_cons, Fin.getElem_fin] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ ofList s ((φ :: φs)[↑i] :: List.map (φ :: φs).get l) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1
rw [ofList_cons_eq_mul 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ s (φ :: φs)[↑i] * ofList s (List.map (φ :: φs).get l) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ s (φ :: φs)[↑i] * ofList s (List.map (φ :: φs).get l) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ s (φ :: φs)[↑i] * ofList s (List.map (φ :: φs).get l) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1
rw [ofList_map_eq_finset_prod s (φ :: φs) l 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
have h1 : s (φ :: φs)[↑i] = ∏ (j : Fin (φ :: φs).length),
if j = i then s (φ :: φs)[↑i] else 1 := by 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ ofList s (List.map (φ :: φs).get (i :: l)) = ∏ i_1, if i_1 ∈ i :: l then s (φ :: φs)[i_1] else 1 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
rw [Fintype.prod_ite_eq' 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ s (φ :: φs)[i] = s (φ :: φs)[i] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (s (φ :: φs)[↑i] * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) = ∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
erw [h1 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ ((∏ j, if j = i then s (φ :: φs)[i] else 1) * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) =
∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ ((∏ j, if j = i then s (φ :: φs)[i] else 1) * ∏ i, if i ∈ l then s (φ :: φs)[i] else 1) =
∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
rw [← Finset.prod_mul_distrib 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (∏ x, (if x = i then s (φ :: φs)[i] else 1) * if x ∈ l then s (φ :: φs)[x] else 1) =
∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (∏ x, (if x = i then s (φ :: φs)[i] else 1) * if x ∈ l then s (φ :: φs)[x] else 1) =
∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup] 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (∏ x, (if x = i then s (φ :: φs)[i] else 1) * if x ∈ l then s (φ :: φs)[x] else 1) =
∏ x, if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
congr e_f 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1⊢ (fun x => (if x = i then s (φ :: φs)[i] else 1) * if x ∈ l then s (φ :: φs)[x] else 1) = fun x =>
if x = i ∨ x ∈ l then s (φ :: φs)[↑x] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
funext a e_f 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).length⊢ ((if a = i then s (φ :: φs)[i] else 1) * if a ∈ l then s (φ :: φs)[a] else 1) =
if a = i ∨ a ∈ l then s (φ :: φs)[↑a] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
simp only [List.length_cons, mul_ite, ite_mul, one_mul, mul_one] e_f 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).length⊢ (if a ∈ l then if a = i then s (φ :: φs)[i] * s (φ :: φs)[a] else s (φ :: φs)[a]
else if a = i then s (φ :: φs)[i] else 1) =
if a = i ∨ a ∈ l then s (φ :: φs)[↑a] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
by_cases ha : a = i pos 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ (if a ∈ l then if a = i then s (φ :: φs)[i] * s (φ :: φs)[a] else s (φ :: φs)[a]
else if a = i then s (φ :: φs)[i] else 1) =
if a = i ∨ a ∈ l then s (φ :: φs)[↑a] else 1neg 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:¬a = i⊢ (if a ∈ l then if a = i then s (φ :: φs)[i] * s (φ :: φs)[a] else s (φ :: φs)[a]
else if a = i then s (φ :: φs)[i] else 1) =
if a = i ∨ a ∈ l then s (φ :: φs)[↑a] else 1𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Nodup⊢ l.Nodup
· pos 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ (if a ∈ l then if a = i then s (φ :: φs)[i] * s (φ :: φs)[a] else s (φ :: φs)[a]
else if a = i then s (φ :: φs)[i] else 1) =
if a = i ∨ a ∈ l then s (φ :: φs)[↑a] else 1 simp only [ha, ↓reduceIte, mul_self, true_or] pos 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ (if i ∈ l then 1 else s (φ :: φs)[i]) = s (φ :: φs)[↑i]
rw [if_neg pos 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ s (φ :: φs)[i] = s (φ :: φs)[↑i]pos.hnc 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ i ∉ l pos 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ s (φ :: φs)[i] = s (φ :: φs)[↑i]pos.hnc 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ i ∉ l]pos 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ s (φ :: φs)[i] = s (φ :: φs)[↑i]pos.hnc 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ i ∉ l
rfl pos.hnc 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = i⊢ i ∉ l
simp only [List.length_cons, List.nodup_cons] at hl pos.hnc 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)h1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:a = ihl:i ∉ l ∧ l.Nodup⊢ i ∉ l
exact hl.1 All goals completed! 🐙
· neg 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:¬a = i⊢ (if a ∈ l then if a = i then s (φ :: φs)[i] * s (φ :: φs)[a] else s (φ :: φs)[a]
else if a = i then s (φ :: φs)[i] else 1) =
if a = i ∨ a ∈ l then s (φ :: φs)[↑a] else 1 simp only [ha, ↓reduceIte, false_or] neg 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:(i :: l).Noduph1:s (φ :: φs)[i] = ∏ j, if j = i then s (φ :: φs)[i] else 1a:Fin (φ :: φs).lengthha:¬a = i⊢ (if a ∈ l then s (φ :: φs)[a] else 1) = if a ∈ l then s (φ :: φs)[↑a] else 1
rfl All goals completed! 🐙
simp only [List.length_cons, List.nodup_cons] at hl 𝓕:Types:𝓕 → FieldStatisticφ:𝓕φs:List 𝓕i:Fin (φ :: φs).lengthl:List (Fin (φ :: φs).length)hl:i ∉ l ∧ l.Nodup⊢ l.Nodup
exact hl.2 All goals completed! 🐙
lemma ofList_pair (s : 𝓕 → FieldStatistic) (φ1 φ2 : 𝓕) :
ofList s [φ1, φ2] = s φ1 * s φ2 := by 𝓕:Types:𝓕 → FieldStatisticφ1:𝓕φ2:𝓕⊢ ofList s [φ1, φ2] = s φ1 * s φ2
rw [ofList_cons_eq_mul, 𝓕:Types:𝓕 → FieldStatisticφ1:𝓕φ2:𝓕⊢ s φ1 * ofList s [φ2] = s φ1 * s φ2 All goals completed! 🐙 ofList_singleton 𝓕:Types:𝓕 → FieldStatisticφ1:𝓕φ2:𝓕⊢ s φ1 * s φ2 = s φ1 * s φ2 All goals completed! 🐙] All goals completed! 🐙ofList and take
lemma ofList_take_insert (n : ℕ) (φ : 𝓕) (φs : List 𝓕) :
ofList q (List.take n φs) = ofList q (List.take n (List.insertIdx φs n φ)) := by 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφ:𝓕φs:List 𝓕⊢ ofList q (List.take n φs) = ofList q (List.take n (φs.insertIdx n φ))
congr 1 e_φs 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφ:𝓕φs:List 𝓕⊢ List.take n φs = List.take n (φs.insertIdx n φ)
rw [take_insert_same e_φs 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφ:𝓕φs:List 𝓕⊢ List.take n φs = List.take n φs All goals completed! 🐙] All goals completed! 🐙
lemma ofList_take_eraseIdx (n : ℕ) (φs : List 𝓕) :
ofList q (List.take n (φs.eraseIdx n)) = ofList q (List.take n φs) := by 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφs:List 𝓕⊢ ofList q (List.take n (φs.eraseIdx n)) = ofList q (List.take n φs)
congr 1 e_φs 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφs:List 𝓕⊢ List.take n (φs.eraseIdx n) = List.take n φs
rw [take_eraseIdx_same e_φs 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφs:List 𝓕⊢ List.take n φs = List.take n φs All goals completed! 🐙] All goals completed! 🐙lemma ofList_take_zero (φs : List 𝓕) :
ofList q (List.take 0 φs) = 1 := by 𝓕:Typeq:𝓕 → FieldStatisticφs:List 𝓕⊢ ofList q (List.take 0 φs) = 1
simp only [List.take_zero, ofList_empty] 𝓕:Typeq:𝓕 → FieldStatisticφs:List 𝓕⊢ bosonic = 1
rfl All goals completed! 🐙
lemma ofList_take_succ_cons (n : ℕ) (φ1 : 𝓕) (φs : List 𝓕) :
ofList q ((φ1 :: φs).take (n + 1)) = q φ1 * ofList q (φs.take n) := by 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφ1:𝓕φs:List 𝓕⊢ ofList q (List.take (n + 1) (φ1 :: φs)) = q φ1 * ofList q (List.take n φs)
simp only [List.take_succ_cons] 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφ1:𝓕φs:List 𝓕⊢ ofList q (φ1 :: List.take n φs) = q φ1 * ofList q (List.take n φs)
rw [ofList_cons_eq_mul 𝓕:Typeq:𝓕 → FieldStatisticn:ℕφ1:𝓕φs:List 𝓕⊢ q φ1 * ofList q (List.take n φs) = q φ1 * ofList q (List.take n φs) All goals completed! 🐙] All goals completed! 🐙
lemma ofList_take_insertIdx_gt (n m : ℕ) (φ1 : 𝓕) (φs : List 𝓕) (hn : n < m) :
ofList q ((List.insertIdx φs m φ1).take n) = ofList q (φs.take n) := by 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:n < m⊢ ofList q (List.take n (φs.insertIdx m φ1)) = ofList q (List.take n φs)
rw [take_insert_gt φ1 n m hn φs 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:n < m⊢ ofList q (List.take n φs) = ofList q (List.take n φs) All goals completed! 🐙] All goals completed! 🐙lemma ofList_insert_lt_eq (n m : ℕ) (φ1 : 𝓕) (φs : List 𝓕) (hn : m ≤ n)
(hm : m ≤ φs.length) :
ofList q ((List.insertIdx φs m φ1).take (n + 1)) =
ofList q ((φ1 :: φs).take (n + 1)) := by 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ ofList q (List.take (n + 1) (φs.insertIdx m φ1)) = ofList q (List.take (n + 1) (φ1 :: φs))
apply ofList_perm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ (List.take (n + 1) (φs.insertIdx m φ1)).Perm (List.take (n + 1) (φ1 :: φs))
simp only [List.take_succ_cons] 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ (List.take (n + 1) (φs.insertIdx m φ1)).Perm (φ1 :: List.take n φs)
refine take_insert_let φ1 n m hn φs hm All goals completed! 🐙
lemma ofList_take_insertIdx_le (n m : ℕ) (φ1 : 𝓕) (φs : List 𝓕) (hn : m ≤ n) (hm : m ≤ φs.length) :
ofList q ((List.insertIdx φs m φ1).take (n + 1)) = q φ1 * ofList q (φs.take n) := by 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ ofList q (List.take (n + 1) (φs.insertIdx m φ1)) = q φ1 * ofList q (List.take n φs)
rw [ofList_insert_lt_eq, 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ ofList q (List.take (n + 1) (φ1 :: φs)) = q φ1 * ofList q (List.take n φs)hn 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ nhm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ φs.length hn 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ nhm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ φs.length ofList_take_succ_cons 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ q φ1 * ofList q (List.take n φs) = q φ1 * ofList q (List.take n φs)hn 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ nhm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ φs.length hn 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ nhm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ φs.length]hn 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ nhm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ φs.length
· hn 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ n exact hn All goals completed! 🐙
· hm 𝓕:Typeq:𝓕 → FieldStatisticn:ℕm:ℕφ1:𝓕φs:List 𝓕hn:m ≤ nhm:m ≤ φs.length⊢ m ≤ φs.length exact hm All goals completed! 🐙
The instance of an additive monoid on FieldStatistic.
instance : AddMonoid FieldStatistic where
zero := bosonic
add a b := a * b
nsmul n a := ∏ (i : Fin n), a
zero_add a := by 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ 0 + a = a
cases a bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ 0 + bosonic = bosonicfermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ 0 + fermionic = fermionic <;> bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ 0 + bosonic = bosonicfermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ 0 + fermionic = fermionic rfl All goals completed! 🐙
add_zero a := by 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ a + 0 = a
cases a bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ bosonic + 0 = bosonicfermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + 0 = fermionic <;> bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ bosonic + 0 = bosonicfermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + 0 = fermionic rfl All goals completed! 🐙
add_assoc a b c := by 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatisticb:FieldStatisticc:FieldStatistic⊢ a + b + c = a + (b + c)
cases a bosonic 𝓕:Typeq:𝓕 → FieldStatisticb:FieldStatisticc:FieldStatistic⊢ bosonic + b + c = bosonic + (b + c)fermionic 𝓕:Typeq:𝓕 → FieldStatisticb:FieldStatisticc:FieldStatistic⊢ fermionic + b + c = fermionic + (b + c) <;> bosonic 𝓕:Typeq:𝓕 → FieldStatisticb:FieldStatisticc:FieldStatistic⊢ bosonic + b + c = bosonic + (b + c)fermionic 𝓕:Typeq:𝓕 → FieldStatisticb:FieldStatisticc:FieldStatistic⊢ fermionic + b + c = fermionic + (b + c) cases b fermionic.bosonic 𝓕:Typeq:𝓕 → FieldStatisticc:FieldStatistic⊢ fermionic + bosonic + c = fermionic + (bosonic + c)fermionic.fermionic 𝓕:Typeq:𝓕 → FieldStatisticc:FieldStatistic⊢ fermionic + fermionic + c = fermionic + (fermionic + c) <;> bosonic.bosonic 𝓕:Typeq:𝓕 → FieldStatisticc:FieldStatistic⊢ bosonic + bosonic + c = bosonic + (bosonic + c)bosonic.fermionic 𝓕:Typeq:𝓕 → FieldStatisticc:FieldStatistic⊢ bosonic + fermionic + c = bosonic + (fermionic + c)fermionic.bosonic 𝓕:Typeq:𝓕 → FieldStatisticc:FieldStatistic⊢ fermionic + bosonic + c = fermionic + (bosonic + c)fermionic.fermionic 𝓕:Typeq:𝓕 → FieldStatisticc:FieldStatistic⊢ fermionic + fermionic + c = fermionic + (fermionic + c) cases c fermionic.fermionic.bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + fermionic + bosonic = fermionic + (fermionic + bosonic)fermionic.fermionic.fermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + fermionic + fermionic = fermionic + (fermionic + fermionic) <;> bosonic.bosonic.bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ bosonic + bosonic + bosonic = bosonic + (bosonic + bosonic)bosonic.bosonic.fermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ bosonic + bosonic + fermionic = bosonic + (bosonic + fermionic)bosonic.fermionic.bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ bosonic + fermionic + bosonic = bosonic + (fermionic + bosonic)bosonic.fermionic.fermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ bosonic + fermionic + fermionic = bosonic + (fermionic + fermionic)fermionic.bosonic.bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + bosonic + bosonic = fermionic + (bosonic + bosonic)fermionic.bosonic.fermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + bosonic + fermionic = fermionic + (bosonic + fermionic)fermionic.fermionic.bosonic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + fermionic + bosonic = fermionic + (fermionic + bosonic)fermionic.fermionic.fermionic 𝓕:Typeq:𝓕 → FieldStatistic⊢ fermionic + fermionic + fermionic = fermionic + (fermionic + fermionic) rfl All goals completed! 🐙
nsmul_zero a := by 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ 0 • a = 0
show (∏ _i : Fin 0, a) = (1 : FieldStatistic) 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ ∏ _i, a = 1
rw [Finset.prod_const, 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ a ^ Finset.univ.card = 1 All goals completed! 🐙 Finset.card_univ, 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ a ^ Fintype.card (Fin 0) = 1 All goals completed! 🐙 Fintype.card_fin, 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ a ^ 0 = 1 All goals completed! 🐙 pow_zero 𝓕:Typeq:𝓕 → FieldStatistica:FieldStatistic⊢ 1 = 1 All goals completed! 🐙] All goals completed! 🐙
nsmul_succ a n := by 𝓕:Typeq:𝓕 → FieldStatistica:ℕn:FieldStatistic⊢ (a + 1) • n = a • n + n
show (∏ _i : Fin (a + 1), n) = (∏ _i : Fin a, n) * n 𝓕:Typeq:𝓕 → FieldStatistica:ℕn:FieldStatistic⊢ ∏ _i, n = (∏ _i, n) * n
simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin, pow_succ] All goals completed! 🐙@[simp]
lemma add_eq_mul (a b : FieldStatistic) : a + b = a * b := rfl