Ted believes it is true, so therefore he is technically not lying. And technically not lying is the best kind of not lying.