intros l motive_2 s Hshape Htype
τ : MLIRTy
⊢ ∀ (a : List TensorElem),
    (∀ (s : List ℕ),
        (∀ (x : TensorElem), x ∈ a → hasShape x s = true) →
          ∀ (h : (List.all a fun x => hasType x τ) = true),
            List.length (List.join (mapWithType a flatten (_ : hasType (nested a) τ = true))) =
              List.length a * shapeProd s) →
      ∀ (s : List ℕ),
        hasShape (nested a) s = true →
          ∀ (h : hasType (nested a) τ = true), List.length (flatten (nested a) h) = shapeProd s
τ : MLIRTy
l : List TensorElem
motive_2 :
  ∀ (s : List ℕ),
    (∀ (x : TensorElem), x ∈ l → hasShape x s = true) →
      ∀ (h : (List.all l fun x => hasType x τ) = true),
        List.length (List.join (mapWithType l flatten (_ : hasType (nested l) τ = true))) = List.length l * shapeProd s
s : List ℕ
Hshape : hasShape (nested l) s = true
Htype : hasType (nested l) τ = true
⊢ List.length (flatten (nested l) Htype) = shapeProd s