. apply Or.inl ∘ Finset.mem_fold_union_iff.mpr
  refine' ⟨stmt (.mk x') (.mk y) n, ⟨_, _⟩⟩
  rw [Nat.succ_add, Nat.succ_add, Nat.succ_eq_add_one]
  apply ofLen_stmt_complete _ h_stmt
  cases' h_stmt with h h <;> rw [h] <;> simp [extendLenOne]
case succ
y n : ℕ
stmt : Variable → Variable → ℕ → LoopProgram
h_stmt : stmt = add ∨ stmt = sub
x' : ℕ
⊢ stmt { index := Nat.succ x' } { index := y } n ∈
      Finset.fold (fun a b => a ∪ b) ∅ extendLenOne (ofLen (Nat.succ x' + y + n)) ∨
    stmt { index := Nat.succ x' } { index := y } n ∈
        Finset.fold (fun x x_1 => x ∪ x_1) ∅
          (fun x =>
            Finset.image (fun x => concat x.1 x.2) (Finset.product (ofLen ↑x) (ofLen (Nat.succ x' + y + n - ↑x))))
          (Finset.attach (Finset.range (Nat.succ x' + y + n))) ∨
      stmt { index := Nat.succ x' } { index := y } n ∈ baseProgram (Nat.succ x' + y + n + 1)
no goals