i had a similar problem, now, i dont know if yours is stuck moreso than mine was, but what worked for me was a combination of some things mentioned above:
1) penetrating oil soaked for many hours
2) heat application (let soak outside in summer heat, then blow dryer on highest setting)
3) impact method: hit the end of the cog tool hard with a rubber mallet while friend holds wheel