Ramanujan's Lost Notebook Part IV, Ch. 2: floorHalf
DefinitionRamanujanLostNotebook_PartIV_ch02_floorHalfnumber-theoryramanujan-lost-notebook
The function F of equation (2.1.4) (Ramanujan's nonstandard [x]):
F x = ⌊x⌋ when x is not an integer and F x = x - 1/2 when x is an integer.
In particular F x = 0 for 0 < x < 1, so that the sums ∑_{n ≥ 1} F (x / n) … of the
chapter are finite: only the n ≤ x contribute. They are written below as sums over
Finset.Icc 1 ⌊x⌋₊.
Definition code
import Mathlib
namespace RamanujanLostNotebook.PartIV
/-- The function `F` of equation (2.1.4) (Ramanujan's nonstandard `[x]`):
`F x = ⌊x⌋` when `x` is not an integer and `F x = x - 1/2` when `x` is an integer.
In particular `F x = 0` for `0 < x < 1`, so that the sums `∑_{n ≥ 1} F (x / n) …` of the
chapter are finite: only the `n ≤ x` contribute. They are written below as sums over
`Finset.Icc 1 ⌊x⌋₊`. -/
noncomputable def floorHalf (x : ℝ) : ℝ :=
if (⌊x⌋ : ℝ) = x then x - 1 / 2 else (⌊x⌋ : ℝ)
end RamanujanLostNotebook.PartIV
Source
G. E. Andrews and B. C. Berndt, Ramanujan's Lost Notebook, Part IV, Springer 2013, Chapter 2.