Formalising the Foundations of Discrete Reinforcement Learning in Isabelle/HOL