diff --git a/doc/style-guide.md b/doc/style-guide.md index cfecfbd699..36d70af28c 100644 --- a/doc/style-guide.md +++ b/doc/style-guide.md @@ -721,4 +721,5 @@ systematic for `Nary` relations in PR Where possible use `contradiction` between two explicit arguments rather than appealing to the lower-level `Data.Empty.⊥-elim`. This provides -clearer documentation for readers of the code. +clearer documentation for readers of the code, but also permits a wider +range of application, thanks to its arguments being made proof-irrelevant. diff --git a/src/Algebra/Module/Properties/Semimodule.agda b/src/Algebra/Module/Properties/Semimodule.agda index d7686b25ef..6a95cc5d81 100644 --- a/src/Algebra/Module/Properties/Semimodule.agda +++ b/src/Algebra/Module/Properties/Semimodule.agda @@ -16,10 +16,13 @@ module Algebra.Module.Properties.Semimodule (semimod : Semimodule semiring m ℓm) where +open import Relation.Nullary.Negation using (contraposition) + open CommutativeSemiring semiring open Semimodule semimod open import Relation.Binary.Reasoning.Setoid ≈ᴹ-setoid -open import Relation.Nullary.Negation using (contraposition) + +------------------------------------------------------------------------ x≈0⇒x*y≈0 : ∀ {x y} → x ≈ 0# → x *ₗ y ≈ᴹ 0ᴹ x≈0⇒x*y≈0 {x} {y} x≈0 = begin diff --git a/src/Data/Fin/Properties.agda b/src/Data/Fin/Properties.agda index 1fdbfac508..0bc17e2f0b 100644 --- a/src/Data/Fin/Properties.agda +++ b/src/Data/Fin/Properties.agda @@ -1071,7 +1071,8 @@ search-least⟨¬_⟩ {P = P} P? = ¬∀⇒∃¬-smallest : ∀ n {p} (P : Pred (Fin n) p) → Decidable P → ¬ (∀ i → P i) → ∃ λ i → ¬ P i × ((j : Fin′ i) → P (inject j)) -¬∀⇒∃¬-smallest n P P? ¬∀P = [ contradiction′ ¬∀P , lemma ] $ search-least⟨¬ P? ⟩ +¬∀⇒∃¬-smallest n P P? ¬∀P = + [ (λ ∀P → contradiction′ ¬∀P ∀P) , lemma ] $ search-least⟨¬ P? ⟩ where lemma : Least⟨ ∁ P ⟩ → ∃ λ i → ¬ P i × ((j : Fin′ i) → P (inject j)) lemma (least i ¬pᵢ ∀[j (P? q₀ ×? ih) ------------------------------------------------------------------------ @@ -1155,7 +1156,7 @@ injective⇒existsPivot {f = f} f-injective i fj