AFTD Auto-Formalizing Theoretical Domains

ClassicalMechanics.ReferenceFrame.fromReferencePoints

defimported Lean

Build a reference frame from the trajectories of a collection of reference points. At each time, the reference points must form an affine basis: none is redundant, and together they span the whole space. One reference point is chosen as the origin, and the displacements from it to the remaining points form the coordinate basis. The resulting frame need not be inertial or orthonormal.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open ClassicalMechanics in
variable {d : ℕ} in
noncomputable def ClassicalMechanics.ReferenceFrame.fromReferencePoints
    (timeOrigin : Time)
    (referencePoints : Finset (Time → Space d))
    (independence : ∀ t, AffineIndependent ℝ fun point : referencePoints => point.val t)
    (spans_space : ∀ t, affineSpan ℝ {point.val t | point : referencePoints} = ⊤) :
    ReferenceFrame d
Defined in
Physlib, `ClassicalMechanics.ReferenceFrame.fromReferencePoints`
Lean proof
By Raunak Chhatwal, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2026 Raunak Chhatwal. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
10 Oct 2026
Axioms
none listed
Built on 31

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open ClassicalMechanics in
variable {d : ℕ} in
/-- Build a reference frame from the trajectories of a collection of reference points. At each time, the reference points must form an affine basis: none is redundant, and together they span the whole space. One reference point is chosen as the origin, and the displacements from it to the remaining points form the coordinate basis. The resulting frame need not be inertial or orthonormal. -/
noncomputable def ClassicalMechanics.ReferenceFrame.fromReferencePoints
    (timeOrigin : Time)
    (referencePoints : Finset (Time → Space d))
    (independence : ∀ t, AffineIndependent ℝ fun point : referencePoints => point.val t)
    (spans_space : ∀ t, affineSpan ℝ {point.val t | point : referencePoints} = ⊤) :
    ReferenceFrame d :=
  let affineBasis (t : Time) : AffineBasis referencePoints ℝ (Space d) :=
    ⟨fun point => point.val t, independence t, spans_space t⟩
  let reference_points_not_empty := (affineBasis timeOrigin).nonempty
  let origin := Classical.choice reference_points_not_empty
  letI := Fintype.ofFinite {point : referencePoints // point ≠ origin}
  let basis t := (affineBasis t).basisOf origin
  let other_reference_points_size_eq_dim :
      Fintype.card {point : referencePoints // point ≠ origin} = d :=
    by simpa using (Module.finrank_eq_card_basis <| basis timeOrigin).symm
  let basisReindexed t :=
    (basis t).reindex (Fintype.equivFinOfCardEq other_reference_points_size_eq_dim)
  { timeOrigin := timeOrigin, origin := origin, basis := basisReindexed }
See it in the graphDiscuss this resultChallenge it