Assuming that the students were using generative AI when told not to...
The way you leverage AI for learning is to do the work yourself and ask it to review and provide feedback, or to ask it to explain some concept, ask it questions to check your understanding, ask it to generate questions for you to answer, etc. If the entire point of the exercise is the exercise, then generating the answer... misses the point.
Like I can easily find online how to encode if statements in the lambda calculus, or how to make a half-adder out of logic gates, or how to prove that bijections are invertible. It's always been cheating to not do it yourself. School intentionally gives you easy problems with known solutions, not open research problems where you should use any and all tools and information you can find.