apply Finset.mem_image_of_mem
case h
p✝ p : LoopProgram
h : len p = 1
⊢ loop { index := 0 } p ∈
    match 1 + 1 with
    | 0 => ∅
    | 1 => lenOne
    | 2 => Finset.image (loop { index := 0 }) lenOne
    | x => ∅
case h.h
p✝ p : LoopProgram
h : len p = 1
⊢ p ∈ lenOne