Lennon and McCartney had a deal where they would credit any song written by either of them as Lennon-McCartney. It certainly makes things tricky now when trying to straighten things out.