File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ private
2323min : ℕ → ℕ → ℕ
2424min zero m = zero
2525min (suc n) zero = zero
26- min (suc n) (suc m) with n <ᵇ m
27- ... | false = suc m
28- ... | true = suc n
26+ min (suc n) (suc m) with n <ᵇ m UsingEq
27+ ... | false , _ = suc m
28+ ... | true , _ = suc n
2929
3030minSuc : min (suc n) (suc m) ≡ suc (min n m)
3131minSuc {zero} {zero} = refl
@@ -44,9 +44,9 @@ minComm (suc n) (suc m) = minSuc ∙∙ cong suc (minComm n m) ∙∙ sym minSuc
4444max : ℕ → ℕ → ℕ
4545max zero m = m
4646max (suc n) zero = suc n
47- max (suc n) (suc m) with n <ᵇ m
48- ... | false = suc n
49- ... | true = suc m
47+ max (suc n) (suc m) with n <ᵇ m UsingEq
48+ ... | false , _ = suc n
49+ ... | true , _ = suc m
5050
5151maxSuc : max (suc n) (suc m) ≡ suc (max n m)
5252maxSuc {zero} {zero} = refl
Original file line number Diff line number Diff line change @@ -506,6 +506,9 @@ infixl 0 _i0:>_UsingEqP
506506
507507-- Similar to `inspect`, but more convenient when `a` is not a function
508508-- application, or when the applied function is not relevant
509+ -- Note: when defining a term with `UsingEq`, it's still possible to prove its properties
510+ -- using a with-abstraction without `UsingEq`, but not the other way around.
511+ -- See `min`/`max` and their properties in Data.Nat.Properties for examples of this.
509512_UsingEq : (a : A) → singl a
510513a UsingEq = isContrSingl a .fst
511514
You can’t perform that action at this time.
0 commit comments