Will my tub drain properly if I create a P-trap by running it under a 4 inch floor joist?
If the drain is sloped correctly per your local building codes (mine state for  drain pipes under 2 inches the slope be 1/4 inch per foot) and it is connected to a stack of the proper size (usually no smaller than 1 1/4 inch pipe) then your drain and trap should operate trouble-free. Also be sure the distance from the trap to the vent or stack is correct (in my county any run over 40 feet will need a larger diameter vent).  As far as running pipe through framing members and joists you must be selective on the location to drill a hole through. This depends one the size of the joist and if it has existing openings already drilled into it. If you plan to use a non-drilled joist one opening (again, depending on the size of the joist)is safe. Be sure not to deviate from the starting slope.