Provable And Efficient Algorithms For Federated, Batch And Reinforcement Learning