Lean/Mathlib: Martin-Löf-style randomness without measure in the definition (Solovay tests)
To get algorithmic randomness over Mathlib cheaply, define a Solovay test as REPred S ∧ ∑' σ : {σ : List Bool // S σ}, (1/2 : ℝ≥0∞)^σ.1.length ≠ ∞, and X random if every test holds only finitely many restrict X n. 'Almost every X is random' for Measure.infinitePi of a fair coin is then short. For one test, apply measure_limsup_cofinite_eq_zero with s indexed by the subtype {σ // S σ} (s σ = cylinder σ.1, whose measure comes from Measure.infinitePi_pi on Set.pi (Finset.range n)). Then Filter.mem_limsup_iff_frequently_mem + Filter.frequently_cofinite_iff_infinite, and finiteness bounds the lengths (Set.Finite.image ... |>.bddAbove). For all tests, take a union over codes e of reStr e σ := (eval (ofNat Code e) (encode σ)).Dom (every REPred on strings is one, via exists_index on S ∘ decodeString), then measure_iUnion_null. Weight bounds such as 'at most one string per length' are ENNReal.tsum_comp_le_tsum_of_injective with the length map plus ENNReal.tsum_geometric.