במצות עשה כגון שאומרין לו עשה סוכה ואינו עושה לולב ואינו עושה מכין אותו עד שתצא נפשו
With regard to positive mitzvot, for example, if the court says to someone: Perform the mitzva of the sukka, and he does not do so, or: Perform the mitzva of the palm branch, and he does not do so, the court strikes him an unlimited number of times, even until his soul departs, in order to force him to perform the mitzva.
The Gemarra doesn't bring a source for this idea. What is it? I've seen many sources in Rishonim that take it for granted that בית דין כופין על המצוות, but didn't see any of them explain where this idea comes from. There's a concept that Beis Din (and potentially everyone) has an obligation to remove prohibited activities from people, but this seems different.
I saw the Avnei Miluim (42:1) suggests its from the sugya in Bava Basra 48a that a coerced sale is effective. I'm not sure if this is his insight, or others preceded him with it, or if there are any other explanations offered