Here is a simple calculation
Let's assume your RRSP contribution is P and your maginal tax rate is t1, you mortgage rate is i1. You withdraw your RRSP after n years and at that time your marginal tax rate is t2. Also, the rate of return for your RRSP is i2.
Let's see you pay your morgtage instead of contributing to RRSP, then after n years the value would be
P*( 1 + i1)^n
If you put your money in RRSP and you put your tax refund back to mortgage. The tax refund would be worthing
t1*P*(1+i1)^n
The money in your RRSO would be P*(1+i2)^n
If you withdraw this money, you get (1-t2)*P*(1+i2)^n
The total amount would be P(t1*(1+i1)^n +(1-t2)(1+i2))^n)
RRSP would outperform mortgate if
(1-t2)(1+i2)^n > (1-t1)(1+i1)^n
If we can assume t2<t1 ( that is not always the case), we would see that RRSP if a good choice if your rate of rate is greater than your mortgate interest rate. However, no one can gurantee your rate of return
Let's assume your RRSP contribution is P and your maginal tax rate is t1, you mortgage rate is i1. You withdraw your RRSP after n years and at that time your marginal tax rate is t2. Also, the rate of return for your RRSP is i2.
Let's see you pay your morgtage instead of contributing to RRSP, then after n years the value would be
P*( 1 + i1)^n
If you put your money in RRSP and you put your tax refund back to mortgage. The tax refund would be worthing
t1*P*(1+i1)^n
The money in your RRSO would be P*(1+i2)^n
If you withdraw this money, you get (1-t2)*P*(1+i2)^n
The total amount would be P(t1*(1+i1)^n +(1-t2)(1+i2))^n)
RRSP would outperform mortgate if
(1-t2)(1+i2)^n > (1-t1)(1+i1)^n
If we can assume t2<t1 ( that is not always the case), we would see that RRSP if a good choice if your rate of rate is greater than your mortgate interest rate. However, no one can gurantee your rate of return