fact: Fixpoint list_replace l n b := match l with | nil => make_last n b false | cons a l => Pos.peano_rect _ (cons b l) (fun n _ => cons a (list_replace l n b)) n end.
imports: Bool DecidableClass Algebra Ring PArith Lia