Well, I don't think they did anything illegal. Immoral, maybe, but what do you expect from a car salesman. Edmunds offering you 2.9% is inconsequential to what the dealer offered you. Edmudns could be using a different bank. Who knows? However, 3.9% is still a very good rate. I don't know that I'd complain about that rate.
You have a point: the dealer did the 'ol "bait and switch" trick on you, which is wrong... but not illegal. 3.9 is a great rate. Forget about it, and enjoy your ride! It's a great car. Congrats, and post some pics. Oh yeah, welcome to the board, by the way.
Juan