pith. machine review for the scientific record. sign in
def

eval

definition
show as:
view math explainer →
module
IndisputableMonolith.Relativity.Fields.Scalar
domain
Relativity
line
15 · github
papers citing
none yet

open explainer

Read the cached plain-language explainer.

open lean source

IndisputableMonolith.Relativity.Fields.Scalar on GitHub at line 15.

browse module

All declarations in this module, on Recognition.

explainer page

A cached Ask Recognition explainer exists for this declaration.

open explainer

depends on

used by

formal source

  12  ψ : (Fin 4 → ℝ) → ℝ
  13
  14/-- Evaluate scalar field at a point. -/
  15noncomputable def eval (φ : ScalarField) (x : Fin 4 → ℝ) : ℝ := φ.ψ x
  16
  17/-- Constant scalar field. -/
  18def constant (c : ℝ) : ScalarField := { ψ := fun _ => c }
  19
  20theorem constant_eval (c : ℝ) (x : Fin 4 → ℝ) :
  21  eval (constant c) x = c := rfl
  22
  23/-- Zero scalar field. -/
  24def zero : ScalarField := constant 0
  25
  26theorem zero_eval (x : Fin 4 → ℝ) : eval zero x = 0 := rfl
  27
  28/-- Scalar field addition. -/
  29def add (φ₁ φ₂ : ScalarField) : ScalarField :=
  30  { ψ := fun x => φ₁.ψ x + φ₂.ψ x }
  31
  32/-- Scalar multiplication. -/
  33def smul (c : ℝ) (φ : ScalarField) : ScalarField :=
  34  { ψ := fun x => c * φ.ψ x }
  35
  36theorem add_comm (φ₁ φ₂ : ScalarField) :
  37  ∀ x, eval (add φ₁ φ₂) x = eval (add φ₂ φ₁) x := by
  38  intro x
  39  simp [eval, add]
  40  ring
  41
  42theorem smul_zero (φ : ScalarField) :
  43  ∀ x, eval (smul 0 φ) x = 0 := by
  44  intro x
  45  simp [eval, smul]