In short yes they will fit. Read on.
I have a stock 02 P5 and just put a set of these on the other day (I assume they are Mazda3 17"s you are talking about). In brief, here is what I found:
The wheels fit. You will need to get new lugnuts as the stock P5 ones do not work so well - the cone needs to have more meat to it. I bought the McGard's from CDN Tire. The tires clear all obstructions inside the wheel wells. After installing, I took the car around a bit and did some "normal" driving. No problems. I even went over the speed bumps at CDN Tire - no problems again.
One issue to consider - the base of the shock towers (the thing that cups the based of the springs). With my stock P5 tires - there was about 1" clearance there. With these wheels - 0.5" - close - but considering that the shocks move with the tires, I am not worried... BTW - the clearance issue is between the top of the tire rubber and the base of the tower (not the inside wall of the tire - clearance is fine there).
In summary - I am happy with the fit, but that's just my opionion. I would recommend you try them on to be sure you are comfortable with the fit. I think that to maintain consistency with car speed and clearance with the shock bases - you would need 40's or 45's on there... With these ones, I have to watch the speedo - when the speedo says 120, the car is doing 130...
Plan on posting pics later.
Dave