Physical quantities
Context quantities
uses builtins/real-numbers
1 Generic quantities
Q × Q : Qℝ
Qnz × Qnz : Qℝnz
Q ÷ Qnz : Qℝ
Qnz ÷ Qnz : Qℝnz
Q ⊆ Qℝ
Qnz ⊆ Qℝnz
ℝ ⊆ Qℝ
ℝnz ⊆ Qℝnz
ℝ × Q : Q
ℝnz × Qnz : Qnz
Q ÷ ℝnz : Q
Qnz ÷ ℝnz : Qnz
The simplification strategy is to reduce quantities to the form f × q, with q a non-reducible quantity, wherever possible.
f1 × (f2 × q) ⇒ f1 × f2 × q
∀ f1 : ℝ
∀ q : Q
∀ f2 : ℝ
f1 × ((f2 × q1) ÷ q2) ⇒ f1 × f2 × (q1 ÷ q2)
∀ q2 : Q
∀ q1 : Q
∀ f1 : ℝ
∀ f2 : ℝ
q ÷ f ⇒ (1 ÷ f) × q ∀ f : ℝnz ∀ q : Q
q1 ÷ (f × q2) ⇒ (1 ÷ f) × (q1 ÷ q2)
∀ q1 : Q
∀ q2 : Qnz
∀ f : ℝnz
q1 + (0 × q2) ⇒ q1 ∀ q2 : Q ∀ q1 : Q
q1 - (0 × q2) ⇒ q1 ∀ q2 : Q ∀ q1 : Q
(0 × q2) + q1 ⇒ q1 ∀ q2 : Q ∀ q1 : Q
(0 × q2) - q1 ⇒ q1 ∀ q2 : Q ∀ q1 : Q
Context template
extends quantities
2 A template for specific quantities
The definitions and rules for specific quantities such as mass or time are essentially the same. We define a template for a fictitious quantity SQ ⊆ Q with SQnz ⊆ Qnz and SQnz ⊆ SQ, and derive the real physical quantities by name substitution.
SQ + SQ : SQ
SQ - SQ : SQ
ℝ × SQ : SQ
ℝnz × SQnz : SQnz
-(SQ) : SQ
SQ ÷ SQnz : ℝ
SQnz ÷ SQnz : ℝnz
SQ ÷ ℝnz : SQ
SQnz ÷ ℝnz : SQnz
SQ < SQ : boolean
SQ > SQ : boolean
SQ ≤ SQ : boolean
SQ ≥ SQ : boolean
In the simplification rules, we use the variables sq:SQ, sq1:SQ, sq2:SQ and f:ℝ, f1:ℝ, f2:ℝ.
(f1 × sq) + (f2 × sq) ⇒ (f1 + f2) × sq
(f1 × sq) - (f2 × sq) ⇒ (f1 - f2) × sq
sq1 ÷ (f × sq2) ⇒ sq1 ÷ f ÷ sq2
(f × sq1) ÷ sq2 ⇒ f × (sq1 ÷ sq2)
sq ÷ sq ⇒ 1
Context template-test
extends template
2.1 Tests
Given two quantities a : SQ and b : SQ whose quotient we define as b ÷ a ⇒ 10, we can test the simplification rules:
2 × (3 × a) ⇒ 6 × a ✓
2 × (a ÷ 3) ⇒ 2/3 × a ✓
(2 × a) ÷ (3 × a) ⇒ 2/3 ✓
(2 × b) ÷ (3 × a) ⇒ 20/3 ✓
(2 × a) + (3 × a) ⇒ 5 × a ✓
(2 × a) - (3 × a) ⇒ -1 × a ✓
Context mass
includes transformed template
3 Mass
Replace SQ by M and SQnz by Mnz in the template:
Subsort relations: Mnz ⊆ Qnz, M ⊆ Q, Mnz ⊆ M
Operators:
-(M) : M
ℝnz × Mnz : Mnz
ℝ × M : M
Mnz ÷ Mnz : ℝnz
M ≥ M : boolean
M > M : boolean
Mnz ÷ ℝnz : Mnz
M - M : M
M ≤ M : boolean
M + M : M
M ÷ ℝnz : M
M ÷ Mnz : ℝ
M < M : boolean
(f1 × sq) + (f2 × sq) ⇒ (f1 + f2) × sq
∀ sq:M
∀ sq2:M
∀ sq1:M
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
(f1 × sq) - (f2 × sq) ⇒ (f1 - f2) × sq
∀ sq:M
∀ sq2:M
∀ sq1:M
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
sq1 ÷ (f × sq2) ⇒ sq1 ÷ f ÷ sq2
∀ sq:M
∀ sq2:M
∀ sq1:M
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
(f × sq1) ÷ sq2 ⇒ f × (sq1 ÷ sq2)
∀ sq:M
∀ sq2:M
∀ sq1:M
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
sq ÷ sq ⇒ 1
∀ sq:M
∀ sq2:M
∀ sq1:M
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
Context length
includes transformed template
4 Length
Replace SQ by L and SQnz by Lnz in the template:
Subsort relations: Lnz ⊆ L, L ⊆ Q, Lnz ⊆ Qnz
Operators:
Lnz ÷ ℝnz : Lnz
L ≤ L : boolean
L + L : L
L ≥ L : boolean
L - L : L
-(L) : L
L < L : boolean
Lnz ÷ Lnz : ℝnz
L > L : boolean
ℝnz × Lnz : Lnz
ℝ × L : L
L ÷ Lnz : ℝ
L ÷ ℝnz : L
(f1 × sq) + (f2 × sq) ⇒ (f1 + f2) × sq
∀ sq:L
∀ sq2:L
∀ sq1:L
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
(f1 × sq) - (f2 × sq) ⇒ (f1 - f2) × sq
∀ sq:L
∀ sq2:L
∀ sq1:L
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
sq1 ÷ (f × sq2) ⇒ sq1 ÷ f ÷ sq2
∀ sq:L
∀ sq2:L
∀ sq1:L
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
(f × sq1) ÷ sq2 ⇒ f × (sq1 ÷ sq2)
∀ sq:L
∀ sq2:L
∀ sq1:L
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
sq ÷ sq ⇒ 1
∀ sq:L
∀ sq2:L
∀ sq1:L
∀ f:ℝ
∀ f1:ℝ
∀ f2:ℝ
Context time
includes transformed template
5 Time
Replace SQ by T and SQnz by Tnz in the template (result now shown).
Context velocity
includes transformed template
6 Velocity
Replace SQ by V and SQnz by Vnz in the template (result not shown).
Context acceleration
includes transformed template
7 Acceleration
Replace SQ by A and SQnz by Anz in the template (result not shown).
Context force
includes transformed template
8 Force
Replace SQ by F and SQnz by Fnz in the template (result not shown).
Context angle
includes transformed template
Context frequency
uses time
includes transformed template
Context angular-frequency
uses time
uses angle
includes transformed template
Context function-template
includes transformed template
includes transformed template
9 A template for functions from one quantity to another
This template defines functions from a domain quantity SQD to an image quantity SQI. The sort for such functions is SQD→SQI ⊆ Q→Q, function application is defined by SQD→SQI[SQD] : SQI.
- Addition and subtraction of functions:
f:SQD→SQI + g:SQD→SQI : SQD→SQI with
(f + g)[x] ⇒ f[x] + g[x] ∀ x : SQDf:SQD→SQI - g:SQD→SQI : SQD→SQI with
(f - g)[x] ⇒ f[x] - g[x] ∀ x : SQD
- Addition and subtraction of constants:
f:SQD→SQI + q:SQI : SQD→SQI with
(f + q)[x] ⇒ f[x] + q ∀ x : SQDf:SQD→SQI - q:SQI : SQD→SQI with
(f - q)[x] ⇒ f[x] + q ∀ x : SQDq:SQI + f:SQD→SQI : SQD→SQI with
(q + f)[x] ⇒ q + f[x] ∀ x : SQDq:SQI - f:SQD→SQI : SQD→SQI with
(q - f)[x] ⇒ q - f[x] ∀ x : SQD
- Multiplication with scalars:
s:ℝ × f:SQD→SQI : SQD→SQI with
(s × f)[x] ⇒ s × f[x] ∀ x : SQD-(f:SQD→SQI) : SQD→SQI with
-(f)[x] ⇒ -(f[x]) ∀ x : SQD
Context function-with-derivative-template
includes transformed function-template
includes transformed function-template
10 A template for functions with derivatives
The derivative of a function is given by 𝒟(SQD→SQI) : SQD→SQID, where SQID ⊆ Qℝ is the quotient of SQI and SQD.
𝒟(f + g) ⇒ 𝒟(f) + 𝒟(g)
𝒟(f - g) ⇒ 𝒟(f) - 𝒟(g)
𝒟(s × f) ⇒ s × 𝒟(f)
Context function-with-finite-difference-template
includes transformed function-with-derivative-template
Δ(f + g, h) ⇒ Δ(f, h) + Δ(g, h)
Δ(f - g, h) ⇒ Δ(f, h) - Δ(g, h)
Δ(s × f, h) ⇒ s × Δ(f, h)