From 8cc273fe383283c6a59b1d780fe75533e3a9fa90 Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Thu, 6 Feb 2025 10:06:05 +0000 Subject: [PATCH] docs: Field specification docs --- .../PerturbationTheory/CreateAnnihilate.lean | 4 +- .../FieldOpAlgebra/Basic.lean | 12 +- .../FieldOpFreeAlgebra/Basic.lean | 12 +- .../FieldSpecification/Basic.lean | 117 +++++++----- .../FieldSpecification/CrAnFieldOp.lean | 47 +++-- .../FieldSpecification/TimeOrder.lean | 4 +- .../FieldStatistics/Basic.lean | 9 +- .../FieldStatistics/ExchangeSign.lean | 11 +- .../WickContraction/Sign/Join.lean | 2 +- .../WickContraction/StaticContract.lean | 2 +- .../WickContraction/TimeContract.lean | 4 +- docs/CuratedNotes/PerturbationTheory.html | 4 +- scripts/MetaPrograms/notes.lean | 172 ++++++++++-------- 13 files changed, 234 insertions(+), 166 deletions(-) diff --git a/HepLean/PerturbationTheory/CreateAnnihilate.lean b/HepLean/PerturbationTheory/CreateAnnihilate.lean index 1947847..77db790 100644 --- a/HepLean/PerturbationTheory/CreateAnnihilate.lean +++ b/HepLean/PerturbationTheory/CreateAnnihilate.lean @@ -10,7 +10,9 @@ import Mathlib.Algebra.BigOperators.Group.Finset -/ -/-- The type specifing whether an operator is a creation or annihilation operator. -/ +/-- The type `CreateAnnihilate` is the type containing two elements `create` and `annihilate`. + This type is used to specify if an operator is a creation or annihilation operator + or the sum thereof or intergral thereover etc. -/ inductive CreateAnnihilate where | create : CreateAnnihilate | annihilate : CreateAnnihilate diff --git a/HepLean/PerturbationTheory/FieldOpAlgebra/Basic.lean b/HepLean/PerturbationTheory/FieldOpAlgebra/Basic.lean index dbd052f..cb5208a 100644 --- a/HepLean/PerturbationTheory/FieldOpAlgebra/Basic.lean +++ b/HepLean/PerturbationTheory/FieldOpAlgebra/Basic.lean @@ -512,18 +512,18 @@ def anPart (Ο : π.FieldOp) : π.FieldOpAlgebra := ΞΉ (anPartF Ο) lemma anPart_eq_ΞΉ_anPartF (Ο : π.FieldOp) : anPart Ο = ΞΉ (anPartF Ο) := rfl @[simp] -lemma anPart_negAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma anPart_negAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : anPart (FieldOp.inAsymp Ο) = 0 := by simp [anPart, anPartF] @[simp] -lemma anPart_position (Ο : π.positionDOF Γ SpaceTime) : +lemma anPart_position (Ο : (Ξ£ f, π.PositionLabel f) Γ SpaceTime) : anPart (FieldOp.position Ο) = ofCrAnFieldOp β¨FieldOp.position Ο, CreateAnnihilate.annihilateβ© := by simp [anPart, ofCrAnFieldOp] @[simp] -lemma anPart_posAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma anPart_posAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : anPart (FieldOp.outAsymp Ο) = ofCrAnFieldOp β¨FieldOp.outAsymp Ο, ()β© := by simp [anPart, ofCrAnFieldOp] @@ -533,18 +533,18 @@ def crPart (Ο : π.FieldOp) : π.FieldOpAlgebra := ΞΉ (crPartF Ο) lemma crPart_eq_ΞΉ_crPartF (Ο : π.FieldOp) : crPart Ο = ΞΉ (crPartF Ο) := rfl @[simp] -lemma crPart_negAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma crPart_negAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : crPart (FieldOp.inAsymp Ο) = ofCrAnFieldOp β¨FieldOp.inAsymp Ο, ()β© := by simp [crPart, ofCrAnFieldOp] @[simp] -lemma crPart_position (Ο : π.positionDOF Γ SpaceTime) : +lemma crPart_position (Ο : (Ξ£ f, π.PositionLabel f) Γ SpaceTime) : crPart (FieldOp.position Ο) = ofCrAnFieldOp β¨FieldOp.position Ο, CreateAnnihilate.createβ© := by simp [crPart, ofCrAnFieldOp] @[simp] -lemma crPart_posAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma crPart_posAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : crPart (FieldOp.outAsymp Ο) = 0 := by simp [crPart] diff --git a/HepLean/PerturbationTheory/FieldOpFreeAlgebra/Basic.lean b/HepLean/PerturbationTheory/FieldOpFreeAlgebra/Basic.lean index 3aa932c..0aff85d 100644 --- a/HepLean/PerturbationTheory/FieldOpFreeAlgebra/Basic.lean +++ b/HepLean/PerturbationTheory/FieldOpFreeAlgebra/Basic.lean @@ -131,18 +131,18 @@ def crPartF : π.FieldOp β π.FieldOpFreeAlgebra := fun Ο => | FieldOp.outAsymp _ => 0 @[simp] -lemma crPartF_negAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma crPartF_negAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : crPartF (FieldOp.inAsymp Ο) = ofCrAnOpF β¨FieldOp.inAsymp Ο, ()β© := by simp [crPartF] @[simp] -lemma crPartF_position (Ο : π.positionDOF Γ SpaceTime) : +lemma crPartF_position (Ο : (Ξ£ f, π.PositionLabel f) Γ SpaceTime) : crPartF (FieldOp.position Ο) = ofCrAnOpF β¨FieldOp.position Ο, CreateAnnihilate.createβ© := by simp [crPartF] @[simp] -lemma crPartF_posAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma crPartF_posAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : crPartF (FieldOp.outAsymp Ο) = 0 := by simp [crPartF] @@ -156,18 +156,18 @@ def anPartF : π.FieldOp β π.FieldOpFreeAlgebra := fun Ο => | FieldOp.outAsymp Ο => ofCrAnOpF β¨FieldOp.outAsymp Ο, ()β© @[simp] -lemma anPartF_negAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma anPartF_negAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : anPartF (FieldOp.inAsymp Ο) = 0 := by simp [anPartF] @[simp] -lemma anPartF_position (Ο : π.positionDOF Γ SpaceTime) : +lemma anPartF_position (Ο : (Ξ£ f, π.PositionLabel f) Γ SpaceTime) : anPartF (FieldOp.position Ο) = ofCrAnOpF β¨FieldOp.position Ο, CreateAnnihilate.annihilateβ© := by simp [anPartF] @[simp] -lemma anPartF_posAsymp (Ο : π.asymptoticDOF Γ (Fin 3 β β)) : +lemma anPartF_posAsymp (Ο : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β)) : anPartF (FieldOp.outAsymp Ο) = ofCrAnOpF β¨FieldOp.outAsymp Ο, ()β© := by simp [anPartF] diff --git a/HepLean/PerturbationTheory/FieldSpecification/Basic.lean b/HepLean/PerturbationTheory/FieldSpecification/Basic.lean index f64df63..f6e9dd4 100644 --- a/HepLean/PerturbationTheory/FieldSpecification/Basic.lean +++ b/HepLean/PerturbationTheory/FieldSpecification/Basic.lean @@ -29,50 +29,63 @@ These states carry the same field statistic as the field they are derived from. -/ -/-- A field specification is defined as a structure containing the basic data needed to write down - position and asymptotic field operators for a theory. It contains: - - A type `positionDOF` containing the degree-of-freedom in position-based field - operators (excluding space-time position). Thus a sutible (but not unique) choice - - Real-scalar fields correspond to a single element of `positionDOF`. - - Complex-scalar fields correspond to two elements of `positionDOF`, one for the field and one - for its conjugate. - - Dirac fermions correspond to eight elements of `positionDOF`. One for each Lorentz index of - the field and its conjugate. (These are not all independent) - - Weyl fermions correspond to four elements of `positionDOF`. One for each Lorentz index of the - field. (These are not all independent) - - A type `asymptoticDOF` containing the degree-of-freedom in asymptotic field operators. Thus a - sutible (but not unique) choice is - - Real-scalar fields correspond to a single element of `asymptoticDOF`. - - Complex-scalar fields correspond to two elements of `asymptoticDOF`, one for the field and one - for its conjugate. - - Dirac fermions correspond to four elements of `asymptoticDOF`, two for each type of spin. - - Weyl fermions correspond to two elements of `asymptoticDOF`, one for each spin. - - A specification `statisticsPos` on a `positionDOF` is Fermionic or Bosonic. - - A specification `statisticsAsym` on a `asymptoticDOF` is Fermionic or Bosonic. +/-- +The structure `FieldSpecification` is defined to have the following content: + - A type `Field` whose elements are the constituent fields of the theory. + - For every field `f` in `Field`, a type `PositionLabel f` whose elements label the different + position operators associated with the field `f`. For example, + - For `f` a *real-scalar field*, `PositionLabel f` will have a unique element. + - For `f` a *complex-scalar field*, `PositionLabel f` will have two elements, one for the field + operator and one for its conjugate. + - For `f` a *Dirac fermion*, `PositionLabel f` will have eight elements, one for each Lorentz + index of the field and its conjugate. + - For `f` a *Weyl fermion*, `PositionLabel f` will have four elements, one for each Lorentz + index of the field and its conjugate. + - For every field `f` in `Field`, a type `AsymptoticLabel f` whose elements label the different + asymptotic based field operators associated with the field `f`. For example, + - For `f` a *real-scalar field*, `AsymptoticLabel f` will have a unique element. + - For `f` a *complex-scalar field*, `AsymptoticLabel f` will have two elements, one for the + field operator and one for its conjugate. + - For `f` a *Dirac fermion*, `AsymptoticLabel f` will have four elements, two for each spin. + - For `f` a *Weyl fermion*, `AsymptoticLabel f` will have two elements, one for each spin. + - For each field `f` in `Field`, a field statistic `statistic f` which classifying `f` as either + `bosonic` or `fermionic`. -/ structure FieldSpecification where - /-- Degrees of freedom for position based field operators. -/ - positionDOF : Type - /-- Degrees of freedom for asymptotic based field operators. -/ - asymptoticDOF : Type - /-- The specification if the `positionDOF` are Fermionic or Bosonic. -/ - statisticsPos : positionDOF β FieldStatistic - /-- The specification if the `asymptoticDOF` are Fermionic or Bosonic. -/ - statisticsAsym : asymptoticDOF β FieldStatistic + /-- A type whose elements are the constituent fields of the theory. -/ + Field : Type + /-- For every field `f` in `Field`, the type `PositionLabel f` has elements that label the + different position operators associated with the field `f`. -/ + PositionLabel : Field β Type + /-- For every field `f` in `Field`, the type `AsymptoticLabel f` has elements that label + the different asymptotic based field operators associated with the field `f`. -/ + AsymptoticLabel : Field β Type + /-- For every field `f` in `Field`, the field statistic `statistic f` classifies `f` as either + `bosonic` or `fermionic`. -/ + statistic : Field β FieldStatistic namespace FieldSpecification variable (π : FieldSpecification) /-- For a field specification `π`, the type `π.FieldOp` is defined such that every element of `FieldOp` corresponds either to: -- an incoming asymptotic field operator `.inAsymp` specified by a field and a `3`-momentum. -- an position operator `.position` specified by a field and a point in spacetime. -- an outgoing asymptotic field operator `.outAsymp` specified by a field and a `3`-momentum. +- an incoming asymptotic field operator `.inAsymp` which is specified by + a field `f` in `π.Field`, an element of `AsymptoticLabel f` (which specifies exactly + which asymptotic field operator associated with `f`) and a `3`-momentum. +- an position operator `.position` which is specified by + a field `f` in `π.Field`, an element of `PositionLabel f` (which specifies exactly + which position field operator associated with `f`) and a element of `SpaceTime`. +- an outgoing asymptotic field operator `.outAsymp` which is specified by + a field `f` in `π.Field`, an element of `AsymptoticLabel f` (which specifies exactly + which asymptotic field operator associated with `f`) and a `3`-momentum. + +Note the use of `3`-momentum here rather then `4`-momentum. This is because the asymptotic states +have on-shell momenta. -/ inductive FieldOp (π : FieldSpecification) where - | inAsymp : π.asymptoticDOF Γ (Fin 3 β β) β π.FieldOp - | position : π.positionDOF Γ SpaceTime β π.FieldOp - | outAsymp : π.asymptoticDOF Γ (Fin 3 β β) β π.FieldOp + | inAsymp : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β) β π.FieldOp + | position : (Ξ£ f, π.PositionLabel f) Γ SpaceTime β π.FieldOp + | outAsymp : (Ξ£ f, π.AsymptoticLabel f) Γ (Fin 3 β β) β π.FieldOp /-- The bool on `FieldOp` which is true only for position field operator. -/ @@ -80,22 +93,34 @@ def statesIsPosition : π.FieldOp β Bool | FieldOp.position _ => true | _ => false -/-- The statistics associated to a field operator. -/ -def statesStatistic : π.FieldOp β FieldStatistic := fun f => - match f with - | FieldOp.inAsymp (a, _) => π.statisticsAsym a - | FieldOp.position (a, _) => π.statisticsPos a - | FieldOp.outAsymp (a, _) => π.statisticsAsym a +/-- For a field specification `π`, `π.fieldOpToField` is defined to take field operators + to their underlying field. -/ +def fieldOpToField : π.FieldOp β π.Field + | FieldOp.inAsymp (f, _) => f.1 + | FieldOp.position (f, _) => f.1 + | FieldOp.outAsymp (f, _) => f.1 -/-- The field statistics associated with a field operator. -/ -scoped[FieldSpecification] notation π "|>β" Ο => statesStatistic π Ο +/-- For a field specification `π`, and an element `Ο` of `π.FieldOp`. + The field statistic `fieldOpStatistic Ο` is defined to be the statistic associated with + the field underlying `Ο`. -/-- The field statistics associated with a list field operators. -/ + The following notation is used in relation to `fieldOpStatistic`: +- For `Ο` an element of `π.FieldOp`, `π |>β Ο` is `fieldOpStatistic Ο`. +- For `Οs` a list of `π.FieldOp`, `π |>β Οs` is the product of `fieldOpStatistic Ο` over + the list `Οs`. +- For a function `f : Fin n β π.FieldOp` and a finset `a` of `Fin n`, `π |>β β¨f, aβ©` is the + product of `fieldOpStatistic (f i)` for all `i β a`. -/ +def fieldOpStatistic : π.FieldOp β FieldStatistic := π.statistic β π.fieldOpToField + +@[inherit_doc fieldOpStatistic] +scoped[FieldSpecification] notation π "|>β" Ο => fieldOpStatistic π Ο + +@[inherit_doc fieldOpStatistic] scoped[FieldSpecification] notation π "|>β" Ο => FieldStatistic.ofList - (statesStatistic π) Ο + (fieldOpStatistic π) Ο -/-- The field statistic associated with a finite set-/ +@[inherit_doc fieldOpStatistic] scoped[FieldSpecification] notation π "|>β" "β¨" f ","a "β©"=> FieldStatistic.ofFinset - (statesStatistic π) f a + (fieldOpStatistic π) f a end FieldSpecification diff --git a/HepLean/PerturbationTheory/FieldSpecification/CrAnFieldOp.lean b/HepLean/PerturbationTheory/FieldSpecification/CrAnFieldOp.lean index 713af0a..603f263 100644 --- a/HepLean/PerturbationTheory/FieldSpecification/CrAnFieldOp.lean +++ b/HepLean/PerturbationTheory/FieldSpecification/CrAnFieldOp.lean @@ -63,14 +63,15 @@ def fieldOpToCreateAnnihilateTypeCongr : {i j : π.FieldOp} β i = j β | _, _, rfl => Equiv.refl _ /-- -For a field specification `π`, the type `π.CrAnFieldOp` is defined such that every element -corresponds to -- an incoming asymptotic field operator `.inAsymp` and the unique element of `Unit`, - corresponding to the statement that an `inAsymp` state is a creation operator. -- a position operator `.position` and an element of `CreateAnnihilate`, - corresponding to either the creation part or the annihilation part of a position operator. -- an outgoing asymptotic field operator `.outAsymp` and the unique element of `Unit`, - corresponding to the statement that an `outAsymp` state is an annihilation operator. +For a field specification `π`, elements in `π.CrAnFieldOp`, the type +of creation and annihilation field operators, corresponds to +- an incoming asymptotic field operator `.inAsymp` in `π.FieldOp`. +- a position operator `.position` in `π.FieldOp` and an element of + `CreateAnnihilate` specifying the creation or annihilation part of that position operator. +- an outgoing asymptotic field operator `.outAsymp` in `π.FieldOp`. + +Note that the incoming and outgoing asymptotic field operators are implicitly creation and +annihilation operators respectively. -/ def CrAnFieldOp : Type := Ξ£ (s : π.FieldOp), π.fieldOpToCrAnType s @@ -89,15 +90,23 @@ def crAnFieldOpToCreateAnnihilate : π.CrAnFieldOp β CreateAnnihilate | β¨FieldOp.position _, CreateAnnihilate.annihilateβ© => CreateAnnihilate.annihilate | β¨FieldOp.outAsymp _, _β© => CreateAnnihilate.annihilate -/-- Takes a `CrAnFieldOp` state to its corresponding fields statistic (bosonic or fermionic). -/ -def crAnStatistics : π.CrAnFieldOp β FieldStatistic := - π.statesStatistic β π.crAnFieldOpToFieldOp +/-- For a field specification `π`, and an element `Ο` in `π.CrAnFieldOp`, the field + statistic `crAnStatistics Ο` is defined to be the statistic associated with the field `π.Field` + (or equivalently `π.FieldOp`) underlying `Ο`. -/-- The field statistic of a `CrAnFieldOp`. -/ + The following notation is used in relation to `crAnStatistics`: + - For `Ο` an element of `π.CrAnFieldOp`, `π |>β Ο` is `crAnStatistics Ο`. + - For `Οs` a list of `π.CrAnFieldOp`, `π |>β Οs` is the product of `crAnStatistics Ο` over + the list `Οs`. +-/ +def crAnStatistics : π.CrAnFieldOp β FieldStatistic := + π.fieldOpStatistic β π.crAnFieldOpToFieldOp + +@[inherit_doc crAnStatistics] scoped[FieldSpecification] notation π "|>β" Ο => (crAnStatistics π) Ο -/-- The field statistic of a list of `CrAnFieldOp`s. -/ +@[inherit_doc crAnStatistics] scoped[FieldSpecification] notation π "|>β" Ο => FieldStatistic.ofList (crAnStatistics π) Ο @@ -108,8 +117,14 @@ scoped[FieldSpecification] infixl:80 "|>αΆ" => remark notation_remark := "When working with a field specification `π` we will use some notation within doc-strings and in code. The main notation used is: -- In docstrings when field statistics occur in exchange signs we may drop the `π |>β`. -- In docstrings we will often write lists of `FieldOp` or `CrAnFieldOp` `Οs` as e.g. `Οββ¦Οβ`, - which should be interpreted within the context in which it appears." +- In doc-strings when field statistics occur in exchange signs we may drop the `π |>β _`. +- In doc-strings we will often write lists of `FieldOp` or `CrAnFieldOp` `Οs` as e.g. `Οββ¦Οβ`, + which should be interpreted within the context in which it appears. + +Some examples: +- `π’(Ο, Οs)` corresponds to `π’(π |>β Ο, π |>β Οs)` +- `Οββ¦Οα΅’ββΟα΅’βββ¦Οβ` corresponds to a (given) list `Οs = Οββ¦Οβ` with the element at the `i`th position + removed. +" end FieldSpecification diff --git a/HepLean/PerturbationTheory/FieldSpecification/TimeOrder.lean b/HepLean/PerturbationTheory/FieldSpecification/TimeOrder.lean index b52f3cb..c6a7f6f 100644 --- a/HepLean/PerturbationTheory/FieldSpecification/TimeOrder.lean +++ b/HepLean/PerturbationTheory/FieldSpecification/TimeOrder.lean @@ -126,7 +126,7 @@ lemma timeOrder_maxTimeField (Ο : π.FieldOp) (Οs : List π.FieldOp) the state of greatest time to the left). We pick up a minus sign for every fermion paired crossed. -/ def timeOrderSign (Οs : List π.FieldOp) : β := - Wick.koszulSign π.statesStatistic π.timeOrderRel Οs + Wick.koszulSign π.fieldOpStatistic π.timeOrderRel Οs @[simp] lemma timeOrderSign_nil : timeOrderSign (π := π) [] = 1 := by @@ -354,7 +354,7 @@ lemma crAnTimeOrderList_swap_eq_time {Ο Ο : π.CrAnFieldOp} lemma koszulSignInsert_crAnTimeOrderRel_crAnSection {Ο : π.FieldOp} {Ο : π.CrAnFieldOp} (h : Ο.1 = Ο) : {Οs : List π.FieldOp} β (Οs : CrAnSection Οs) β Wick.koszulSignInsert π.crAnStatistics π.crAnTimeOrderRel Ο Οs.1 = - Wick.koszulSignInsert π.statesStatistic π.timeOrderRel Ο Οs + Wick.koszulSignInsert π.fieldOpStatistic π.timeOrderRel Ο Οs | [], β¨[], hβ© => by simp [Wick.koszulSignInsert] | Ο' :: Οs, β¨Ο' :: Οs, h1β© => by diff --git a/HepLean/PerturbationTheory/FieldStatistics/Basic.lean b/HepLean/PerturbationTheory/FieldStatistics/Basic.lean index c8d28eb..f71449c 100644 --- a/HepLean/PerturbationTheory/FieldStatistics/Basic.lean +++ b/HepLean/PerturbationTheory/FieldStatistics/Basic.lean @@ -26,8 +26,13 @@ namespace FieldStatistic variable {π : Type} -/-- Field statistics form a commuative group isomorphic to `β€β` in which `bosonic` is the identity - and `fermionic` is the non-trivial element. -/ +/-- The type `FieldStatistic` carries an instance of a commuative 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 diff --git a/HepLean/PerturbationTheory/FieldStatistics/ExchangeSign.lean b/HepLean/PerturbationTheory/FieldStatistics/ExchangeSign.lean index e394972..8b1b3cf 100644 --- a/HepLean/PerturbationTheory/FieldStatistics/ExchangeSign.lean +++ b/HepLean/PerturbationTheory/FieldStatistics/ExchangeSign.lean @@ -24,11 +24,12 @@ namespace FieldStatistic variable {π : Type} -/-- The exchange sign is the group homomorphism `FieldStatistic β* FieldStatistic β* β`, - which on two field statistics `a` and `b` is defined to be - `-1` if both `a` and `b` are `fermionic` and `1` otherwise. - It corresponds to the sign that one picks up when swapping fields `ΟβΟβ β ΟβΟβ` with - `Οβ` and `Οβ` of statistics `a` and `b` respectively. +/-- The exchange sign, `exchangeSign`, is defined as the group homomorphism + `FieldStatistic β* FieldStatistic β* β`, + for which `exchangeSign a b` is `-1` if both `a` and `b` are `fermionic` and `1` otherwise. + The exchange sign is sign one picks up on exchanging an operator or field `Οβ` of statistic `a` + with one `Οβ` of statistic `b`, i.e. `ΟβΟβ β ΟβΟβ`. + The notation `π’(a, b)` is used for the exchange sign of `a` and `b`. -/ def exchangeSign : FieldStatistic β* FieldStatistic β* β where toFun a := diff --git a/HepLean/PerturbationTheory/WickContraction/Sign/Join.lean b/HepLean/PerturbationTheory/WickContraction/Sign/Join.lean index 08f51f0..094660a 100644 --- a/HepLean/PerturbationTheory/WickContraction/Sign/Join.lean +++ b/HepLean/PerturbationTheory/WickContraction/Sign/Join.lean @@ -162,7 +162,7 @@ lemma join_singleton_left_signFinset_eq_filter {Οs : List π.FieldOp} left rw [join_singleton_signFinset_eq_filter] rw [mul_comm] - exact (ofFinset_filter_mul_neg π.statesStatistic _ _ _).symm + exact (ofFinset_filter_mul_neg π.fieldOpStatistic _ _ _).symm /-- The difference in sign between `ΟsucΞ.sign` and the direct contribution of `ΟsucΞ` to `(join (singleton h) ΟsucΞ)`. -/ diff --git a/HepLean/PerturbationTheory/WickContraction/StaticContract.lean b/HepLean/PerturbationTheory/WickContraction/StaticContract.lean index acfd884..887b80b 100644 --- a/HepLean/PerturbationTheory/WickContraction/StaticContract.lean +++ b/HepLean/PerturbationTheory/WickContraction/StaticContract.lean @@ -85,7 +85,7 @@ lemma staticContract_insert_some_of_lt Β· simp simp only [smul_smul] congr 1 - have h1 : ofList π.statesStatistic (List.take (β(ΟsΞ.uncontractedIndexEquiv.symm k)) + have h1 : ofList π.fieldOpStatistic (List.take (β(ΟsΞ.uncontractedIndexEquiv.symm k)) (List.map Οs.get ΟsΞ.uncontractedList)) = (π |>β β¨Οs.get, (Finset.filter (fun x => x < k) ΟsΞ.uncontracted)β©) := by simp only [ofFinset] diff --git a/HepLean/PerturbationTheory/WickContraction/TimeContract.lean b/HepLean/PerturbationTheory/WickContraction/TimeContract.lean index 00e0088..f8b3196 100644 --- a/HepLean/PerturbationTheory/WickContraction/TimeContract.lean +++ b/HepLean/PerturbationTheory/WickContraction/TimeContract.lean @@ -97,7 +97,7 @@ lemma timeContract_insert_some_of_lt Β· simp simp only [smul_smul] congr 1 - have h1 : ofList π.statesStatistic (List.take (β(ΟsΞ.uncontractedIndexEquiv.symm k)) + have h1 : ofList π.fieldOpStatistic (List.take (β(ΟsΞ.uncontractedIndexEquiv.symm k)) (List.map Οs.get ΟsΞ.uncontractedList)) = (π |>β β¨Οs.get, (Finset.filter (fun x => x < k) ΟsΞ.uncontracted)β©) := by simp only [ofFinset] @@ -128,7 +128,7 @@ lemma timeContract_insert_some_of_not_lt rw [timeContract_of_not_timeOrderRel, timeContract_of_timeOrderRel] simp only [instCommGroup.eq_1, Algebra.smul_mul_assoc, smul_smul] congr - have h1 : ofList π.statesStatistic (List.take (β(ΟsΞ.uncontractedIndexEquiv.symm k)) + have h1 : ofList π.fieldOpStatistic (List.take (β(ΟsΞ.uncontractedIndexEquiv.symm k)) (List.map Οs.get ΟsΞ.uncontractedList)) = (π |>β β¨Οs.get, (Finset.filter (fun x => x < k) ΟsΞ.uncontracted)β©) := by simp only [ofFinset] diff --git a/docs/CuratedNotes/PerturbationTheory.html b/docs/CuratedNotes/PerturbationTheory.html index 10fa1b0..47b74a5 100644 --- a/docs/CuratedNotes/PerturbationTheory.html +++ b/docs/CuratedNotes/PerturbationTheory.html @@ -65,7 +65,9 @@ layout: default {% if entry.type == "name" %}
{{ entry.name }}: {{ entry.docString | markdownify}}
+{{ entry.name }}: + {% if entry.status == "incomplete" %}π§{% endif %} + {{ entry.docString | markdownify}}
{{ entry.declString }}
diff --git a/scripts/MetaPrograms/notes.lean b/scripts/MetaPrograms/notes.lean
index 1be3757..e3a29d2 100644
--- a/scripts/MetaPrograms/notes.lean
+++ b/scripts/MetaPrograms/notes.lean
@@ -7,6 +7,7 @@ import HepLean.Meta.Basic
import HepLean.Meta.Remark.Properties
import HepLean.Meta.Notes.ToHTML
import Mathlib.Lean.CoreM
+import HepLean
/-!
# Extracting notes from Lean files
@@ -15,21 +16,31 @@ import Mathlib.Lean.CoreM
open Lean System Meta HepLean
+inductive NameStatus
+ | complete : NameStatus
+ | incomplete : NameStatus
+
+instance : ToString NameStatus where
+ toString
+ | NameStatus.complete => "complete"
+ | NameStatus.incomplete => "incomplete"
+
inductive NotePart
| h1 : String β NotePart
| h2 : String β NotePart
| p : String β NotePart
- | name : Name β NotePart
+ | name : Name β NameStatus β NotePart
| warning : String β NotePart
structure DeclInfo where
line : Nat
fileName : Name
name : Name
+ status : NameStatus
declString : String
docString : String
-def DeclInfo.ofName (n : Name) : MetaM DeclInfo := do
+def DeclInfo.ofName (n : Name) (ns : NameStatus): MetaM DeclInfo := do
let line β Name.lineNumber n
let fileName β Name.fileName n
let declString β Name.getDeclString n
@@ -38,6 +49,7 @@ def DeclInfo.ofName (n : Name) : MetaM DeclInfo := do
line := line,
fileName := fileName,
name := n,
+ status := ns,
declString := declString,
docString := docString}
@@ -50,6 +62,7 @@ def DeclInfo.toYML (d : DeclInfo) : MetaM String := do
name: {d.name}
line: {d.line}
fileName: {d.fileName}
+ status: \"{d.status}\"
link: \"{link}\"
docString: |
{docStringIndent}
@@ -79,7 +92,7 @@ def NotePart.toYMLM : ((List String) Γ Nat Γ Nat) β NotePart β MetaM ((Li
- type: warning
content: \"{s}\""
return β¨x.1 ++ [newString], x.2β©
- | x, NotePart.name n => do
+ | x, NotePart.name n s => do
match (β RemarkInfo.IsRemark n) with
| true =>
let remarkInfo β RemarkInfo.getRemarkInfo n
@@ -89,12 +102,13 @@ def NotePart.toYMLM : ((List String) Γ Nat Γ Nat) β NotePart β MetaM ((Li
let newString := s!"
- type: remark
name: \"{shortName}\"
+ status : \"{s}\"
link: \"{Name.toGitHubLink remarkInfo.fileName remarkInfo.line}\"
content: |
{contentIndent}"
return β¨x.1 ++ [newString], x.2β©
| false =>
- let newString β (β DeclInfo.ofName n).toYML
+ let newString β (β DeclInfo.ofName n s).toYML
return β¨x.1 ++ [newString], x.2β©
structure Note where
@@ -120,104 +134,108 @@ def perturbationTheory : Note where
.warning "This note is a work in progress and is not finished. Use with caution.
(5th Feb 2025)",
.h1 "Introduction",
- .name `FieldSpecification.wicks_theorem_context,
+ .name `FieldSpecification.wicks_theorem_context .incomplete,
.p "In this note we walk through the important parts of the proof of Wick's theorem
for both fermions and bosons,
as it appears in HepLean. We start with some basic definitions.",
.h1 "Field operators",
.h2 "Field statistics",
- .name `FieldStatistic,
- .name `FieldStatistic.instCommGroup,
- .name `FieldStatistic.exchangeSign,
+ .name ``FieldStatistic .complete,
+ .name ``FieldStatistic.instCommGroup .complete,
+ .name ``FieldStatistic.exchangeSign .complete,
.h2 "Field specifications",
- .name `FieldSpecification,
+ .name ``FieldSpecification .complete,
.h2 "Field operators",
- .name `FieldSpecification.FieldOp,
- .name `FieldSpecification.statesStatistic,
- .name `FieldSpecification.CrAnFieldOp,
- .name `FieldSpecification.crAnStatistics,
- .name `FieldSpecification.notation_remark,
+ .name ``FieldSpecification.FieldOp .complete,
+ .name ``FieldSpecification.fieldOpStatistic .complete,
+ .name ``CreateAnnihilate .complete,
+ .name ``FieldSpecification.CrAnFieldOp .complete,
+ .name ``FieldSpecification.crAnStatistics .complete,
+ .name `FieldSpecification.notation_remark .complete,
.h2 "Field-operator free algebra",
- .name `FieldSpecification.FieldOpFreeAlgebra,
- .name `FieldSpecification.FieldOpFreeAlgebra.naming_convention,
- .name `FieldSpecification.FieldOpFreeAlgebra.ofCrAnOpF,
- .name `FieldSpecification.FieldOpFreeAlgebra.ofCrAnListF,
- .name `FieldSpecification.FieldOpFreeAlgebra.ofFieldOpF,
- .name `FieldSpecification.FieldOpFreeAlgebra.ofFieldOpListF,
- .name `FieldSpecification.FieldOpFreeAlgebra.fieldOpFreeAlgebraGrade,
- .name `FieldSpecification.FieldOpFreeAlgebra.superCommuteF,
- .name `FieldSpecification.FieldOpFreeAlgebra.superCommuteF_ofCrAnListF_ofFieldOpListF_eq_sum,
+ .name ``FieldSpecification.FieldOpFreeAlgebra .incomplete,
+ .name `FieldSpecification.FieldOpFreeAlgebra.naming_convention .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.ofCrAnOpF .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.ofCrAnListF .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.ofFieldOpF .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.ofFieldOpListF .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.fieldOpFreeAlgebraGrade .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.superCommuteF .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.superCommuteF_ofCrAnListF_ofFieldOpListF_eq_sum .incomplete,
.h2 "Field-operator algebra",
- .name `FieldSpecification.FieldOpAlgebra,
- .name `FieldSpecification.FieldOpAlgebra.ofCrAnFieldOp,
- .name `FieldSpecification.FieldOpAlgebra.ofCrAnFieldOpList,
- .name `FieldSpecification.FieldOpAlgebra.ofFieldOp,
- .name `FieldSpecification.FieldOpAlgebra.ofCrAnFieldOpList,
- .name `FieldSpecification.FieldOpAlgebra.fieldOpAlgebraGrade,
- .name `FieldSpecification.FieldOpAlgebra.superCommute,
+ .name ``FieldSpecification.FieldOpAlgebra .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofCrAnFieldOp .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofCrAnFieldOpList .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofFieldOp .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofCrAnFieldOpList .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.anPart .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.crPart .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofFieldOp_eq_crPart_add_anPart .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.fieldOpAlgebraGrade .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.superCommute .incomplete,
.h1 "Time ordering",
- .name `FieldSpecification.crAnTimeOrderRel,
- .name `FieldSpecification.crAnTimeOrderSign,
- .name `FieldSpecification.FieldOpFreeAlgebra.timeOrderF,
- .name `FieldSpecification.FieldOpAlgebra.timeOrder,
- .name `FieldSpecification.FieldOpAlgebra.timeOrder_eq_maxTimeField_mul_finset,
+ .name ``FieldSpecification.crAnTimeOrderRel .incomplete,
+ .name ``FieldSpecification.crAnTimeOrderSign .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.timeOrderF .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.timeOrder .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.timeOrder_eq_maxTimeField_mul_finset .incomplete,
.h1 "Normal ordering",
- .name `FieldSpecification.normalOrderRel,
- .name `FieldSpecification.normalOrderSign,
- .name `FieldSpecification.FieldOpFreeAlgebra.normalOrderF,
- .name `FieldSpecification.FieldOpAlgebra.normalOrder,
+ .name ``FieldSpecification.normalOrderRel .incomplete,
+ .name ``FieldSpecification.normalOrderSign .incomplete,
+ .name ``FieldSpecification.FieldOpFreeAlgebra.normalOrderF .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.normalOrder .incomplete,
.h2 "Some lemmas",
- .name `FieldSpecification.normalOrderSign_eraseIdx,
- .name `FieldSpecification.FieldOpAlgebra.ofCrAnFieldOp_superCommute_normalOrder_ofCrAnFieldOpList_sum,
- .name `FieldSpecification.FieldOpAlgebra.ofFieldOp_mul_normalOrder_ofFieldOpList_eq_sum,
+ .name ``FieldSpecification.normalOrderSign_eraseIdx .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofCrAnFieldOp_superCommute_normalOrder_ofCrAnFieldOpList_sum .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.ofFieldOp_mul_normalOrder_ofFieldOpList_eq_sum .incomplete,
.h1 "Wick Contractions",
.h2 "Definition",
- .name `WickContraction,
- .name `WickContraction.GradingCompliant,
+ .name ``WickContraction .incomplete,
+ .name ``WickContraction.GradingCompliant .incomplete,
.h2 "Aside: Cardinality",
- .name `WickContraction.card_eq_cardFun,
+ .name ``WickContraction.card_eq_cardFun .incomplete,
.h2 "Constructors",
.p "There are a number of ways to construct a Wick contraction from
other Wick contractions or single contractions.",
- .name `WickContraction.insertAndContract,
- .name `WickContraction.join,
+ .name ``WickContraction.insertAndContract .incomplete,
+ .name ``WickContraction.join .incomplete,
.h2 "Sign",
- .name `WickContraction.sign,
- .name `WickContraction.join_sign,
- .name `WickContraction.sign_insert_none,
- .name `WickContraction.sign_insert_none_zero,
- .name `WickContraction.sign_insert_some_of_not_lt,
- .name `WickContraction.sign_insert_some_of_lt,
- .name `WickContraction.sign_insert_some_zero,
+ .name ``WickContraction.sign .incomplete,
+ .name ``WickContraction.join_sign .incomplete,
+ .name ``WickContraction.sign_insert_none .incomplete,
+ .name ``WickContraction.sign_insert_none_zero .incomplete,
+ .name ``WickContraction.sign_insert_some_of_not_lt .incomplete,
+ .name ``WickContraction.sign_insert_some_of_lt .incomplete,
+ .name ``WickContraction.sign_insert_some_zero .incomplete,
.h2 "Normal order",
- .name `FieldSpecification.FieldOpAlgebra.normalOrder_uncontracted_none,
- .name `FieldSpecification.FieldOpAlgebra.normalOrder_uncontracted_some,
+ .name ``FieldSpecification.FieldOpAlgebra.normalOrder_uncontracted_none .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.normalOrder_uncontracted_some .incomplete,
.h1 "Static contractions",
- .name `WickContraction.staticContract,
- .name `WickContraction.staticContract_insert_some_of_lt,
- .name `WickContraction.staticContract_insert_none,
+ .name ``WickContraction.staticContract .incomplete,
+ .name ``WickContraction.staticContract_insert_some_of_lt .incomplete,
+ .name ``WickContraction.staticContract_insert_none .incomplete,
.h1 "Time contractions",
- .name `FieldSpecification.FieldOpAlgebra.timeContract,
- .name `WickContraction.timeContract,
- .name `WickContraction.timeContract_insert_none,
- .name `WickContraction.timeContract_insert_some_of_not_lt,
- .name `WickContraction.timeContract_insert_some_of_lt,
+ .name ``FieldSpecification.FieldOpAlgebra.timeContract .incomplete,
+ .name ``WickContraction.timeContract .incomplete,
+ .name ``WickContraction.timeContract_insert_none .incomplete,
+ .name ``WickContraction.timeContract_insert_some_of_not_lt .incomplete,
+ .name ``WickContraction.timeContract_insert_some_of_lt .incomplete,
.h1 "Wick terms",
- .name `WickContraction.wickTerm,
- .name `WickContraction.wickTerm_empty_nil,
- .name `WickContraction.wickTerm_insert_none,
- .name `WickContraction.wickTerm_insert_some,
- .name `WickContraction.mul_wickTerm_eq_sum,
+ .name ``WickContraction.wickTerm .incomplete,
+ .name ``WickContraction.wickTerm_empty_nil .incomplete,
+ .name ``WickContraction.wickTerm_insert_none .incomplete,
+ .name ``WickContraction.wickTerm_insert_some .incomplete,
+ .name ``WickContraction.mul_wickTerm_eq_sum .incomplete,
.h1 "Static wick terms",
- .name `WickContraction.staticWickTerm,
- .name `WickContraction.staticWickTerm_empty_nil,
- .name `WickContraction.staticWickTerm_insert_zero_none,
- .name `WickContraction.staticWickTerm_insert_zero_some,
- .name `WickContraction.mul_staticWickTerm_eq_sum,
+ .name ``WickContraction.staticWickTerm .incomplete,
+ .name ``WickContraction.staticWickTerm_empty_nil .incomplete,
+ .name ``WickContraction.staticWickTerm_insert_zero_none .incomplete,
+ .name ``WickContraction.staticWickTerm_insert_zero_some .incomplete,
+ .name ``WickContraction.mul_staticWickTerm_eq_sum .incomplete,
.h1 "The three Wick's theorems",
- .name `FieldSpecification.wicks_theorem,
- .name `FieldSpecification.FieldOpAlgebra.static_wick_theorem,
- .name `FieldSpecification.FieldOpAlgebra.wicks_theorem_normal_order
+ .name ``FieldSpecification.wicks_theorem .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.static_wick_theorem .incomplete,
+ .name ``FieldSpecification.FieldOpAlgebra.wicks_theorem_normal_order .incomplete
]
unsafe def main (_ : List String) : IO UInt32 := do