The followup question then is whether a community and a user can have the same name, because to other AP software they both just become @name@instance. How does that get resolved?
Yes, lemmy allows communities and users to have the same name. Other software may not be able to handle this, e.g. mastodon. This causes compatibility issues with mastodon if you search for a user and a community with the same name. I think mastodon will just ignore the community because the name is already reserved on that instance. But if you search for a community that doesn't overlap with a user, mastodon will resolve it correclty