Metamath Proof Explorer


Theorem dnival

Description: Value of the "distance to nearest integer" function. (Contributed by Asger C. Ipsen, 4-Apr-2021)

Ref Expression
Hypothesis dnival.1 𝑇 = ( 𝑥 ∈ ℝ ↦ ( abs ‘ ( ( ⌊ ‘ ( 𝑥 + ( 1 / 2 ) ) ) − 𝑥 ) ) )
Assertion dnival ( 𝐴 ∈ ℝ → ( 𝑇𝐴 ) = ( abs ‘ ( ( ⌊ ‘ ( 𝐴 + ( 1 / 2 ) ) ) − 𝐴 ) ) )

Proof

Step Hyp Ref Expression
1 dnival.1 𝑇 = ( 𝑥 ∈ ℝ ↦ ( abs ‘ ( ( ⌊ ‘ ( 𝑥 + ( 1 / 2 ) ) ) − 𝑥 ) ) )
2 fvoveq1 ( 𝑥 = 𝐴 → ( ⌊ ‘ ( 𝑥 + ( 1 / 2 ) ) ) = ( ⌊ ‘ ( 𝐴 + ( 1 / 2 ) ) ) )
3 id ( 𝑥 = 𝐴𝑥 = 𝐴 )
4 2 3 oveq12d ( 𝑥 = 𝐴 → ( ( ⌊ ‘ ( 𝑥 + ( 1 / 2 ) ) ) − 𝑥 ) = ( ( ⌊ ‘ ( 𝐴 + ( 1 / 2 ) ) ) − 𝐴 ) )
5 4 fveq2d ( 𝑥 = 𝐴 → ( abs ‘ ( ( ⌊ ‘ ( 𝑥 + ( 1 / 2 ) ) ) − 𝑥 ) ) = ( abs ‘ ( ( ⌊ ‘ ( 𝐴 + ( 1 / 2 ) ) ) − 𝐴 ) ) )
6 fvex ( abs ‘ ( ( ⌊ ‘ ( 𝐴 + ( 1 / 2 ) ) ) − 𝐴 ) ) ∈ V
7 5 1 6 fvmpt ( 𝐴 ∈ ℝ → ( 𝑇𝐴 ) = ( abs ‘ ( ( ⌊ ‘ ( 𝐴 + ( 1 / 2 ) ) ) − 𝐴 ) ) )