induction l <;> simp
l : List TensorElem
⊢ ∀ {head : ℕ} {tail : List ℕ},
    inferredShape (nested l) = some (head :: tail) →
      head = List.length l ∧ (List.all l fun x => decide (inferredShape x = some tail)) = true
case nil

⊢ ∀ {head : ℕ} {tail : List ℕ}, inferredShape (nested []) = some (head :: tail) → head = 0

case cons
head✝ : TensorElem
tail✝ : List TensorElem
tail_ih✝ :
  ∀ {head : ℕ} {tail : List ℕ},
    inferredShape (nested tail✝) = some (head :: tail) →
      head = List.length tail✝ ∧ (List.all tail✝ fun x => decide (inferredShape x = some tail)) = true
⊢ ∀ {head : ℕ} {tail : List ℕ},
    inferredShape (nested (head✝ :: tail✝)) = some (head :: tail) →
      head = Nat.succ (List.length tail✝) ∧
        inferredShape head✝ = some tail ∧ ∀ (x : TensorElem), x ∈ tail✝ → inferredShape x = some tail