Question: I was trying to understand how the following reaction occurs (taken from a synthesis of homopipecolic acid[1]):

![Reduction of hemiaminal by triethylsilane-boron trifluoride diethyl etherate](https://i.stack.imgur.com/c4KaC.png)
I thought that triethylsilane, $\ce{Et3SiH}$, would reduce the ester to an aldehyde. However, it turns out that the hemiaminal carbon has also been reduced with cleavage of the $\ce{C-N}$ bond. How does this happen?

### References:

1. Chiou, W.; Chen, G.; Kao, C.; Gao, Y. Syntheses of (−)-pelletierine and (−)-homopipecolic acid. *Org. Biomol. Chem.* **2012,** *10* (13), 2518. [DOI: 10.1039/C2OB06984A](https://doi.org/10.1039/C2OB06984A).

Answer: 
My organic chemistry is rusty by now, but the full mechanism for the reduction itself is likely something along these lines:

[![Proposed mechanism for hemiaminal reduction](https://i.stack.imgur.com/LcoaW.png)](https://i.stack.imgur.com/LcoaW.png)

In a "typical" lactone / ester, the alkyl oxygen can't be lost so easily, but in this case there's a nitrogen lone pair that can assist in that. The resulting iminium ion is reduced by the silane. The acid at the end will remove the remaining boron trifluoride.
This is what I came up with.

The starting material first reacts with the Lewis acid - $\ce{BF\_3}$-etherate. There are two sites which can attack the acid - the carbonyl of the ester, or the carbonyl of the amide in the protecting group. Considering the first step to be kinetically controlled (which it generally is), the sterically less hindered carbonyl of the ester group will react.

Now, the lone pair of the nitrogen plays its part, breaking the $\ce{C-O}$ bond, relieving the positive charge on the oxygen.

The iminium formed will be converted to the corresponding amine by the action of the triethylsilane.

Hydrolysis will lead to the carboxylic acid.
You can see the stereochemistry in the images.

Justification: Intramolecular rearrangement is faster than intermolecular encounters.