 Unbeknownst to Bill and Sally, Sally is the person waving at Bill. The that-clauses in (39) and (40) are the same. Their difference resides in the different terms designating Sally, both of which occur outside the scope of ‘believes’. Even if we accept that co-designating terms are not intersubstitutable inside the scope of propositional attitude verbs, surely they are outside the scope of an attitude verb. So (40), together with the fact that Sally is the person waving at Bill, entails that (41) is true as spoken by Sally.