fact: Fixpoint update (s:state) (n:nat) (x:Z) {struct n} : option state := match s, n with | a :: tl, O => Some (x :: tl) | a :: tl, S p => match update tl p x with | Some tl' => Some (a :: tl') | _ => None (A:=state) end | _, _ => None (A:=state) end.
imports: ZArith Zwf Inverse_Image Wellfounded Extraction List Arith Compare_dec Lia