Isomerisation of alkanes under Lewis acidic conditions

My textbook says:



> 
> n-Alkanes on heating in the presence of anhydrous aluminium chloride and hydrogen chloride gas isomerise to branched chain alkanes.
> 
> 
> 


But no mechanism is given. After a little research, I found this: <https://goenkanscienceblog.wordpress.com/2015/01/29/suggested-mechanism-of-isomerisation-of-alkanes/>


However, it doesn't explain the role of the HCl gas. Is the mechanism correct and if so, what is the role of HCl?




The mechanism for **butane** is shown here, instead of a general n-alkane.


Initiation
==========


[![initiation](https://i.stack.imgur.com/3017b.png)](https://i.stack.imgur.com/3017b.png)


As the comments have mentioned, it probably begins by the protonation of butene impurities.


The Lewis acid, $\ce{AlCl3}$, stabilizes the chloride ion from $\ce{HCl}$ when the $\ce{H}$ is used to protonate the butene.


A secondary carbocation is formed, which undergoes methyl shift to form a primary carbocation. I have no idea why a primary carbocation can be formed.


Propagation
===========


[![propagation](https://i.stack.imgur.com/llpDk.png)](https://i.stack.imgur.com/llpDk.png)


An alkane attacks the carbocation, and supplies a "hydride" to the carbocation to complete the carbocation.


Meanwhile, another carbocation is formed which also undergoes methyl shift to regenerate the carbocation at the beginning of this step.


Termination
===========


[![termation](https://i.stack.imgur.com/75cCx.png)](https://i.stack.imgur.com/75cCx.png)


I am going out of my way here to suggest a isobutyl chloride (1-chloro-2-methylpropane) termination product. I can't find other Lewis bases to complete the carbocation for the termination step.


 5