diff --git a/Everything/Safe.agda b/Everything/Safe.agda index 9f952f1..41d1b88 100644 --- a/Everything/Safe.agda +++ b/Everything/Safe.agda @@ -6,6 +6,7 @@ open import Numbers.Naturals.Naturals open import Numbers.BinaryNaturals.Definition open import Numbers.BinaryNaturals.Multiplication open import Numbers.BinaryNaturals.Order +open import Numbers.BinaryNaturals.Subtraction open import Numbers.Integers.Integers diff --git a/Maybe.agda b/Maybe.agda index 0452905..5daa33d 100644 --- a/Maybe.agda +++ b/Maybe.agda @@ -35,5 +35,5 @@ module Maybe where noNotYes : {a : _} {A : Set a} {b : A} → (no ≡ yes b) → False noNotYes () - mapMaybePreservesNo : {a b : _} {A : Set a} {B : Set b} (f : A → B) (x : Maybe A) → mapMaybe f x ≡ no → x ≡ no - mapMaybePreservesNo f no pr = refl + mapMaybePreservesNo : {a b : _} {A : Set a} {B : Set b} {f : A → B} {x : Maybe A} → mapMaybe f x ≡ no → x ≡ no + mapMaybePreservesNo {f = f} {no} pr = refl diff --git a/Numbers/BinaryNaturals/Definition.agda b/Numbers/BinaryNaturals/Definition.agda index 624da8e..fa50f69 100644 --- a/Numbers/BinaryNaturals/Definition.agda +++ b/Numbers/BinaryNaturals/Definition.agda @@ -86,6 +86,12 @@ module Numbers.BinaryNaturals.Definition where binNatToNZero : (x : BinNat) → binNatToN x ≡ 0 → canonical x ≡ [] binNatToNZero' : (x : BinNat) → canonical x ≡ [] → binNatToN x ≡ 0 + NToBinNatZero : (n : ℕ) → NToBinNat n ≡ [] → n ≡ 0 + NToBinNatZero zero pr = refl + NToBinNatZero (succ n) pr with NToBinNat n + NToBinNatZero (succ n) pr | zero :: bl = exFalso (nonEmptyNotEmpty pr) + NToBinNatZero (succ n) pr | one :: bl = exFalso (nonEmptyNotEmpty pr) + canonicalAscends : {i : Bit} → (a : BinNat) → 0