Minimization of amount in the change coins problem using the dynamic programing approach I'm learning the dynamic programming approach to solve the coins change problem, I don't understand the substitution part

Given: amount=9, coins = [6,5,1], 

the instructor simplified it with this function:

minCoins = min {(9-6)+1 , (9-5)+1, (9-1) +1} = min{4, 5, 9} = 4

I don't understand the logic of this min method: why we say that to change amount of 9 coins, we can simply, take the minimum of: 9  - {all coins} +1 ?

here's a Gif that visualizes the instructor's approach: https://i.stack.imgur.com/Zx2cG.gif

(*taken from the Algorithmic Toolbox course/ instructor: Prof. Pavel A. Pevzner)
Your formula is wrong (I would like to see where exactly this formula appears in the course, it is not in the gif you linked).

The correct formula is the following:
Let $n$ be your amount. Let minCoins be an array of $n+1$ elements indexed from $0$ to $n$, where minCoins$[i]$ is the minimum amount of coins needed to give change for the amount $i$. Let $c_1, \dots, c_k$ be the denominations of coins you have available.

Then minCoins$[0]=0$ and, for $i&gt;0$:
$
\text{minCoins}[i] = \min_{\substack{j=1,\dots,k\\c_j \le i}} \{1 + \text{minCoins}[i-c_j] \}.
$

In your specific example:

$$
\begin{align*}
\text{minCoins}[9] &amp;= \min \{\text{minCoins}[9-6]+1 , \text{minCoins}[9-5]+1, \text{minCoins}[9-1] +1\} \\
&amp;= \min \{\text{minCoins}[3]+1 , \text{minCoins}[4]+1, \text{minCoins}[8] +1\} \\
&amp;= \min\{ 3+1, 4+1, 3+1\} \\
&amp;=  \min\{ 4, 5, 4\} = 4.
\end{align*}
$$