- val : α
Instances For
def
Units.instInhabitedQuantity.default
{a✝ : Type}
{a✝¹ : a✝}
{a✝² : Type}
[Inhabited a✝²]
{a✝³ : AddCommGroup a✝}
:
Quantity a✝¹ a✝²
Equations
Instances For
instance
Units.instInhabitedQuantity
{a✝ : Type}
{a✝¹ : a✝}
{a✝² : Type}
[Inhabited a✝²]
{a✝³ : AddCommGroup a✝}
:
Equations
instance
Units.instBEqQuantity
{δ✝ : Type}
{dim✝ : δ✝}
{α✝ : Type}
{inst✝ : AddCommGroup δ✝}
[BEq δ✝]
[BEq α✝]
:
Equations
def
Units.instBEqQuantity.beq
{δ✝ : Type}
{dim✝ : δ✝}
{α✝ : Type}
{inst✝ : AddCommGroup δ✝}
[BEq δ✝]
[BEq α✝]
:
Equations
- Units.instBEqQuantity.beq { val := a } { val := b } = (a == b)
- Units.instBEqQuantity.beq x✝¹ x✝ = false
Instances For
def
Units.instDecidableEqQuantity.decEq
{δ✝ : Type}
{dim✝ : δ✝}
{α✝ : Type}
{inst✝ : AddCommGroup δ✝}
[DecidableEq δ✝]
[DecidableEq α✝]
(x✝ x✝¹ : Quantity dim✝ α✝)
:
Equations
Instances For
instance
Units.instDecidableEqQuantity
{δ✝ : Type}
{dim✝ : δ✝}
{α✝ : Type}
{inst✝ : AddCommGroup δ✝}
[DecidableEq δ✝]
[DecidableEq α✝]
:
DecidableEq (Quantity dim✝ α✝)
Equations
- Units.Quantity.instRepr = { reprPrec := fun (q : Units.Quantity d α) (x : ℕ) => Std.Format.text (toString (repr q.val) ++ toString " • " ++ toString (repr d)) }
instance
Units.Quantity.instToStringOfRepr
{α δ : Type}
[AddCommGroup δ]
[Repr δ]
{d : δ}
[Repr α]
:
Equations
- Units.Quantity.instToStringOfRepr = { toString := fun (q : Units.Quantity d α) => reprStr q }
Equations
- Units.Quantity.instAdd = { add := Units.Quantity.add }
Equations
- Units.Quantity.instSub = { sub := Units.Quantity.sub }
Equations
- Units.Quantity.instNeg = { neg := Units.Quantity.neg }
Equations
Equations
def
Units.Quantity.smul
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[SMul α α]
(s : α)
(q : Quantity d α)
:
Quantity d α
Instances For
def
Units.Quantity.nsmul
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[SMul ℕ α]
(n : ℕ)
(q : Quantity d α)
:
Quantity d α
Instances For
def
Units.Quantity.zsmul
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[SMul ℤ α]
(n : ℤ)
(q : Quantity d α)
:
Quantity d α
Instances For
def
Units.Quantity.qsmul
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[SMul ℚ α]
(n : ℚ)
(q : Quantity d α)
:
Quantity d α
Instances For
Equations
- Units.Quantity.instSMul = { smul := Units.Quantity.smul }
Equations
Equations
Equations
Equations
Equations
instance
Units.Quantity.instDPowRatHSMulOfPow
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[Pow α ℚ]
[SMul ℚ δ]
:
Equations
def
Units.Quantity.fun_to_val
{α δ : Type}
[AddCommGroup δ]
{d₁ d₂ : δ}
(f : Quantity d₁ α → Quantity d₂ α)
:
α → α
Equations
- Units.Quantity.fun_to_val f x = (f { val := x }).val
Instances For
noncomputable def
Units.Quantity.deriv
{α δ : Type}
[AddCommGroup δ]
{d₁ d₂ : δ}
[NontriviallyNormedField α]
(f : Quantity d₁ α → Quantity d₂ α)
(x : Quantity d₁ α)
:
Equations
- Units.Quantity.deriv f x = { val := deriv (Units.Quantity.fun_to_val f) x.val }
Instances For
noncomputable def
Units.Quantity.integral
{α δ : Type}
[AddCommGroup δ]
{d₁ d₂ : δ}
[NormedAddCommGroup α]
[NormedSpace ℝ α]
[MeasurableSpace α]
(f : Quantity d₁ α → Quantity d₂ α)
(μ : MeasureTheory.Measure α)
:
Equations
- Units.Quantity.integral f μ = { val := MeasureTheory.integral μ (Units.Quantity.fun_to_val f) }
Instances For
Equations
Equations
Instances For
def
Units.Quantity.conversion
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[HasConversion δ]
:
Quantity d α → Conversion
Equations
- x✝.conversion = Units.𝒞 d
Instances For
Instances For
instance
Units.Quantity.instHasDimension
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[HasDimension δ]
:
HasDimension (Quantity d α)
Equations
- Units.Quantity.instHasDimension = { dimension := Units.Quantity.dimension }
instance
Units.Quantity.instHasConversion
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[HasConversion δ]
:
HasConversion (Quantity d α)
Equations
- Units.Quantity.instHasConversion = { conversion := Units.Quantity.conversion }
def
Units.Quantity.cast
{α δ : Type}
[AddCommGroup δ]
{d₁ d₂ : δ}
[HasEquiv δ]
(q : Quantity d₁ α)
:
Preferred notation for casting: write ↑x instead of cast x.
- Purpose:
↑xis equivalent tocast xand is the idiomatic, preferred syntax throughout this library. Please use this notation in new code and docs. - Precedence: the operator has high priority and binds tightly; use parentheses
when needed, e.g.
↑(f x)or(↑x).field. - Typing the symbol: in Lean/VSCode, type
\uparrowthen space to get↑.
Examples:
Instances For
def
Units.Quantity.convert
{α δ : Type}
[AddCommGroup δ]
{d₁ d₂ : δ}
[RatCast α]
[Mul α]
[Add α]
[HasDimension δ]
[HasConversion δ]
(q : Quantity d₁ α)
:
convert from one quantity to another of the same dimension
Preferred notation for convert: write q → instead of convert q.
- Purpose:
q →is equivalent toconvert qand is the idiomatic, preferred syntax throughout this library. Please use this notation in new code and docs.
Examples:
Instances For
def
Units.Quantity.into
{α δ : Type}
[AddCommGroup δ]
{d : δ}
[RatCast α]
[Mul α]
[Add α]
[HasDimension δ]
[HasConversion δ]
(q : Quantity d α)
(target : δ)
:
convert and cast in one step from one quantity to another of the same dimension the target is a unit
Examples: convert constant c from natural unit to meter per second: c.into (Unit.meter-Unit.second)
Instances For
def
Units.Quantity.as
{α δ : Type}
[AddCommGroup δ]
{d₁ d₂ : δ}
[RatCast α]
[Mul α]
[Add α]
[HasDimension δ]
[HasConversion δ]
(q : Quantity d₁ α)
:
convert and cast in one step from one quantity to another of the same dimension the target is another quantity
Examples:
Instances For
Preferred notation for casting: write ↑x instead of cast x.
- Purpose:
↑xis equivalent tocast xand is the idiomatic, preferred syntax throughout this library. Please use this notation in new code and docs. - Precedence: the operator has high priority and binds tightly; use parentheses
when needed, e.g.
↑(f x)or(↑x).field. - Typing the symbol: in Lean/VSCode, type
\uparrowthen space to get↑.
Examples:
Equations
- Units.Quantity.«term↑_» = Lean.ParserDescr.node `Units.Quantity.«term↑_» 100 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "↑") (Lean.ParserDescr.cat `term 100))
Instances For
convert from one quantity to another of the same dimension
Preferred notation for convert: write q → instead of convert q.
- Purpose:
q →is equivalent toconvert qand is the idiomatic, preferred syntax throughout this library. Please use this notation in new code and docs.
Examples:
Equations
- Units.Quantity.«term_→» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_→» 100 100 (Lean.ParserDescr.symbol "→")
Instances For
Equations
- Units.Quantity.«term_²» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_²» 1024 1024 (Lean.ParserDescr.symbol "²")
Instances For
Equations
- Units.Quantity.«term_³» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_³» 1024 1024 (Lean.ParserDescr.symbol "³")
Instances For
Equations
- Units.Quantity.«term_⁴» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁴» 1024 1024 (Lean.ParserDescr.symbol "⁴")
Instances For
Equations
- Units.Quantity.«term_⁵» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁵» 1024 1024 (Lean.ParserDescr.symbol "⁵")
Instances For
Equations
- Units.Quantity.«term_⁶» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁶» 1024 1024 (Lean.ParserDescr.symbol "⁶")
Instances For
Equations
- Units.Quantity.«term_⁷» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁷» 1024 1024 (Lean.ParserDescr.symbol "⁷")
Instances For
Equations
- Units.Quantity.«term_⁸» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁸» 1024 1024 (Lean.ParserDescr.symbol "⁸")
Instances For
Equations
- Units.Quantity.«term_⁹» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁹» 1024 1024 (Lean.ParserDescr.symbol "⁹")
Instances For
Equations
- Units.Quantity.«term_⁻²» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻²» 1024 1024 (Lean.ParserDescr.symbol "⁻²")
Instances For
Equations
- Units.Quantity.«term_⁻³» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻³» 1024 1024 (Lean.ParserDescr.symbol "⁻³")
Instances For
Equations
- Units.Quantity.«term_⁻⁴» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻⁴» 1024 1024 (Lean.ParserDescr.symbol "⁻⁴")
Instances For
Equations
- Units.Quantity.«term_⁻⁵» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻⁵» 1024 1024 (Lean.ParserDescr.symbol "⁻⁵")
Instances For
Equations
- Units.Quantity.«term_⁻⁶» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻⁶» 1024 1024 (Lean.ParserDescr.symbol "⁻⁶")
Instances For
Equations
- Units.Quantity.«term_⁻⁷» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻⁷» 1024 1024 (Lean.ParserDescr.symbol "⁻⁷")
Instances For
Equations
- Units.Quantity.«term_⁻⁸» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻⁸» 1024 1024 (Lean.ParserDescr.symbol "⁻⁸")
Instances For
Equations
- Units.Quantity.«term_⁻⁹» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻⁹» 1024 1024 (Lean.ParserDescr.symbol "⁻⁹")
Instances For
Equations
- Units.Quantity.«term_⁻¹» = Lean.ParserDescr.trailingNode `Units.Quantity.«term_⁻¹» 1024 1024 (Lean.ParserDescr.symbol "⁻¹")