fact: Definition forall_enumerable_by_beq_aggregate : R := let all := List.map (@proj1_sig _ _) (enumerate { x : A | is_true (P x) }) in let possibilities := uniquize eq_R_enum (List.map f all) in List.fold_right (fun y else_case => If (List.fold_right orb false (List.map (fun z => if beq (f z) y then beq x z else false) all)) Then g y Else else_case) base possibilities.
imports: Fiat.Common Fiat.Common.List.Operations Fiat.Common.List.ListFacts Fiat.Common.Enumerable Fiat.Common.Enumerable.ReflectiveForall Fiat.Common.Equality