I hear you. My DS9 was exactly like that a couple of years ago: math was incredibly boring, finished assignment before teacher finished instruction, but was careless and made very simple mistakes, just didn't want to do school work because it was beneath him. He got so much trouble at school. The teacher was amazingly indifferent to his needs and tried to put him down all the time. I was inexperienced at the time. I asked DS to try the best he could to follow teacher's instructions, without giving him much real help. After a while I realized that it was the teacher's problem, so I started telling DS that I understood him. We had lots of conversations, on what he needed, what the school environment is like, why he is bored at school, why the teacher had to focus on the lowest common denominator... And about how I coped when I was a kid (my school had nothing for me, but my teachers all allowed me to read books while others worked on math assignments). I think once DS realized that I was on his side, and he was not a trouble maker as his second grade teacher told him, he felt more confident and was willing to work hard on the situation. Things got better later on, we've got better teachers, DS is willing to do school assignments well (he is the best with Everyday Math assignments and he is the best in math competitions), and then the teacher is willing to leave him alone so he can read a book or do some math problems that he brings to school himself. And I think I'm also more assertive when I interact with the teachers.

So basically I think the key is to tell your DS that you understand him and you are on his side. And let him understand that he needs to be mature about his school situation and try to change it to his own benefit, instead of simply being defiant, which makes him feel good maybe but really doesn't get him anywhere. It's tough for little kids, they really shouldn't be arranging for their own learning environment, it says so much about a school or a district's failure. But if a kid can do this, I think it will be a good character building experience.