Question
Implement ordinary linear regression trained with full-batch gradient descent and mean squared error.
```python
def fit_linear(
features: list,
targets: list,
learning_rate: float,
steps: int,
) -> list: ...
```
## Assumptions
`features` is an `n x d` matrix with `n >= 1` and `d >= 1`, without a bias column. Return `[intercept, coefficient_1, ..., coefficient_d]`. Initialize all weights to zero and round final values to six decimal places. Feature and target values and the learning rate must be finite numbers, not booleans; `steps` must be a nonnegative integer, not a boolean. Reject invalid shapes or parameters with `ValueError`. Do not mutate the supplied matrix or targets. The provided `run_case` owns fixture dispatch, not candidate work.
## Requirements
- Add an intercept column internally.
- For augmented matrix `X`, use gradient `(2/n) X^T(Xw-y)`.
- Perform exactly `steps` simultaneous parameter updates using `w := w - learning_rate * gradient`.
- Validate non-empty, rectangular features, matching target length, positive learning rate, and non-negative step count.
- State time and space complexity and explain conditions under which training may diverge.
## Follow-ups
1. Add feature scaling and an early-stopping tolerance.
2. Implement stochastic or mini-batch gradient descent.
3. Compare with a closed-form solution and discuss numerical stability.
4. Train when the dataset does not fit in memory.