feat: make informal_definition and informal_lemma commands (#300)

* make informal_definition and informal_lemma commands
* drop the fields "math", "physics", and "proof" from InformalDefinition/InformalLemma and use docstrings instead
* render informal docstring in dependency graph
This commit is contained in:
KUO-TSAN HSU (Gordon) 2025-02-02 03:17:17 +08:00 committed by GitHub
parent 6aab0ba3cd
commit f8f94979ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 666 additions and 1089 deletions

View file

@ -48,17 +48,19 @@ lemma contractSelfField_equivariant {S : TensorSpecies} {c : S.C} {g : S.G}
simpa using congrFun (congrArg (fun x => x.hom.toFun)
((S.contractSelfHom c).comm g)) (ψ ⊗ₜ[S.k] φ)
informal_lemma contractSelfField_non_degenerate where
math :≈ "The contraction of two vectors of the same color is non-degenerate.
I.e. ⟪ψ, φ⟫ₜₛ = 0 for all φ implies ψ = 0."
proof :≈ "The basic idea is that being degenerate contradicts the assumption of having a unit
in the tensor species."
deps :≈ [``contractSelfField]
/-- The contraction of two vectors of the same color is non-degenerate, i.e., `⟪ψ, φ⟫ₜₛ = 0` for all
`φ` implies `ψ = 0`.
Proof: the basic idea is that being degenerate contradicts the assumption of having a
unit in the tensor species.
-/
informal_lemma contractSelfField_non_degenerate where
deps := [``contractSelfField]
/-- The contraction `⟪ψ, φ⟫ₜₛ` is related to the tensor tree
`{ψ | μ ⊗ (S.dualRepIsoDiscrete c).hom φ | μ}ᵀ`. -/
informal_lemma contractSelfField_tensorTree where
math :≈ "The contraction ⟪ψ, φ⟫ₜₛ is related to the tensor tree
{ψ | μ ⊗ (S.dualRepIsoDiscrete c).hom φ | μ}ᵀ "
deps :≈ [``contractSelfField, ``TensorTree]
deps := [``contractSelfField, ``TensorTree]
/-!

View file

@ -241,27 +241,28 @@ def dualRepIsoDiscrete (c : S.C) : S.FD.obj (Discrete.mk c) ≅ S.FD.obj (Discre
ext x
exact S.fromDualRep_toDualRep_eq_self c x
/-- Given a `i : Fin n` the isomorphism between `S.F.obj (OverColor.mk c)` and
`S.F.obj (OverColor.mk (Function.update c i (S.τ (c i))))` induced by `dualRepIsoDiscrete` acting on
the `i`-th component of the color.
-/
informal_definition dualRepIso where
math :≈ "Given a `i : Fin n` the isomorphism between `S.F.obj (OverColor.mk c)` and
`S.F.obj (OverColor.mk (Function.update c i (S.τ (c i))))` induced by `dualRepIsoDiscrete`
acting on the `i`-th component of the color."
deps :≈ [``dualRepIsoDiscrete]
deps := [``dualRepIsoDiscrete]
/-- Acting with `dualRepIso` on the fst component of a `unitTensor` returns a metric. -/
informal_lemma dualRepIso_unitTensor_fst where
math :≈ "Acting with `dualRepIso` on the fst component of a `unitTensor` returns a metric."
deps :≈ [``dualRepIso, ``unitTensor, ``metricTensor]
deps := [``dualRepIso, ``unitTensor, ``metricTensor]
/-- Acting with `dualRepIso` on the snd component of a `unitTensor` returns a metric. -/
informal_lemma dualRepIso_unitTensor_snd where
math :≈ "Acting with `dualRepIso` on the snd component of a `unitTensor` returns a metric."
deps :≈ [``dualRepIso, ``unitTensor, ``metricTensor]
deps := [``dualRepIso, ``unitTensor, ``metricTensor]
/-- Acting with `dualRepIso` on the fst component of a `metricTensor` returns a unitTensor. -/
informal_lemma dualRepIso_metricTensor_fst where
math :≈ "Acting with `dualRepIso` on the fst component of a `metricTensor` returns a unitTensor."
deps :≈ [``dualRepIso, ``unitTensor, ``metricTensor]
deps := [``dualRepIso, ``unitTensor, ``metricTensor]
/-- Acting with `dualRepIso` on the snd component of a `metricTensor` returns a unitTensor. -/
informal_lemma dualRepIso_metricTensor_snd where
math :≈ "Acting with `dualRepIso` on the snd component of a `metricTensor` returns a unitTensor."
deps :≈ [``dualRepIso, ``unitTensor, ``metricTensor]
deps := [``dualRepIso, ``unitTensor, ``metricTensor]
end TensorSpecies