fact: Fixpoint eq_positive_dec (n m:positive){struct m} : {n = m}+{n <> m} := match n return {n = m}+{n <> m} with | xI p => match m return {xI p = m}+{xI p <> m} with | xI q => match eq_positive_dec p q with | left heq => left _ (eq_xI p q heq) | right hneq => right _ (not_eq_xI p q hneq) end | xO q => right _ (xI_xO p q) | xH => right _ (sym_not_equal (xH_xI p)) end | xO p => match m return {xO p = m}+{xO p <> m} with | xI q => right _ (sym_not_equal (xI_xO q p)) | xO q => match eq_positive_dec p q with | left heq => left _ (eq_xO p q heq) | right hneq => right _ (not_eq_xO p q hneq) end | xH => right _ (sym_not_equal (xH_xO p)) end | xH => match m return {xH = m}+{xH <> m} with | xI q => right _ (xH_xI q) | xO q => right _ (xH_xO q) | xH => left _ (refl_equal xH) end end.
imports: ZArith List Arith Lia Zwf Inverse_Image Extraction