"If you make a theme that does not use any existing wordpress code, it wouldn't be considered a derivative work."
I personally would consider that to be impossible, however, you are basically correct.
In this specific case though, that does not apply. Thesis makes heavy use of WordPress code.