From 0070b748ef23c3b3ac380b76520f7a00974cd4fa Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 5 Jun 2024 16:40:21 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20agda/agd?= =?UTF-8?q?a-stdlib@b13a032851a99c0abd9ebc55748ad0cbd1e0060d=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ess.Properties.HeytingCommutativeRing.html | 4 +- master/Algebra.Apartness.Structures.html | 6 +- master/Algebra.Bundles.Raw.html | 4 +- master/Algebra.Consequences.Base.html | 4 +- .../Algebra.Consequences.Propositional.html | 12 +- master/Algebra.Consequences.Setoid.html | 14 +- master/Algebra.Construct.Add.Identity.html | 2 +- master/Algebra.Construct.Flip.Op.html | 4 +- master/Algebra.Construct.Initial.html | 8 +- master/Algebra.Construct.LexProduct.Base.html | 8 +- .../Algebra.Construct.LexProduct.Inner.html | 98 ++-- master/Algebra.Construct.LexProduct.html | 16 +- master/Algebra.Construct.LiftedChoice.html | 6 +- ...Algebra.Construct.NaturalChoice.MinOp.html | 18 +- master/Algebra.Definitions.RawMagma.html | 10 +- master/Algebra.Definitions.html | 6 +- ...attice.Morphism.Construct.Composition.html | 4 +- ...a.Lattice.Morphism.Construct.Identity.html | 4 +- master/Algebra.Module.Bundles.Raw.html | 2 +- master/Algebra.Module.Bundles.html | 2 +- ...Module.Morphism.Construct.Composition.html | 18 +- ...ra.Module.Morphism.Construct.Identity.html | 18 +- ...ra.Module.Morphism.ModuleHomomorphism.html | 8 +- .../Algebra.Module.Properties.Semimodule.html | 6 +- ...lgebra.Morphism.Construct.Composition.html | 22 +- .../Algebra.Morphism.Construct.Identity.html | 22 +- ...rties.CancellativeCommutativeSemiring.html | 16 +- ...ebra.Properties.CommutativeMonoid.Sum.html | 6 +- ...Algebra.Properties.Magma.Divisibility.html | 14 +- ...lgebra.Properties.Monoid.Divisibility.html | 6 +- ...bra.Properties.Semigroup.Divisibility.html | 6 +- ...Algebra.Properties.Semiring.Primality.html | 4 +- master/Algebra.Solver.CommutativeMonoid.html | 6 +- ...ra.Solver.IdempotentCommutativeMonoid.html | 6 +- master/Algebra.Solver.Monoid.html | 6 +- master/Algebra.Solver.Ring.Simple.html | 4 +- master/Algebra.Solver.Ring.html | 10 +- master/Axiom.DoubleNegationElimination.html | 6 +- master/Axiom.ExcludedMiddle.html | 2 +- ...xiom.UniquenessOfIdentityProofs.WithK.html | 2 +- master/Axiom.UniquenessOfIdentityProofs.html | 133 +++--- ...rded.Stream.Relation.Binary.Pointwise.html | 16 +- ...ata.Guarded.Stream.Relation.Unary.All.html | 10 +- ...ata.Guarded.Stream.Relation.Unary.Any.html | 12 +- .../Codata.Musical.Colist.Bisimilarity.html | 8 +- .../Codata.Musical.Colist.Infinite-merge.html | 4 +- ....Colist.Relation.Unary.All.Properties.html | 4 +- ...ata.Musical.Colist.Relation.Unary.All.html | 6 +- ....Colist.Relation.Unary.Any.Properties.html | 6 +- ...ata.Musical.Colist.Relation.Unary.Any.html | 6 +- master/Codata.Musical.Colist.html | 32 +- master/Codata.Musical.Conat.html | 8 +- master/Codata.Musical.Covec.html | 12 +- master/Codata.Musical.M.Indexed.html | 6 +- master/Codata.Musical.Stream.html | 8 +- master/Codata.Sized.Cofin.Literals.html | 4 +- master/Codata.Sized.Colist.Bisimilarity.html | 14 +- master/Codata.Sized.Conat.Properties.html | 12 +- master/Codata.Sized.Conat.html | 2 +- master/Codata.Sized.Covec.Bisimilarity.html | 14 +- .../Codata.Sized.Cowriter.Bisimilarity.html | 20 +- master/Codata.Sized.Delay.Bisimilarity.html | 14 +- master/Codata.Sized.Delay.html | 2 +- master/Codata.Sized.M.Bisimilarity.html | 8 +- master/Codata.Sized.Stream.Bisimilarity.html | 14 +- master/Data.Bool.Properties.html | 76 ++-- master/Data.Bool.html | 2 +- master/Data.Char.Properties.html | 44 +- master/Data.Container.Core.html | 2 +- master/Data.Container.Indexed.Combinator.html | 78 ++-- master/Data.Container.Indexed.Core.html | 10 +- ...a.Container.Indexed.Fixpoints.Guarded.html | 4 +- master/Data.Container.Indexed.FreeMonad.html | 14 +- ...dexed.Relation.Binary.Equality.Setoid.html | 6 +- ....Relation.Binary.Pointwise.Properties.html | 8 +- master/Data.Container.Indexed.WithK.html | 18 +- master/Data.Container.Indexed.html | 24 +- master/Data.Container.Membership.html | 4 +- ...ainer.Relation.Binary.Equality.Setoid.html | 8 +- ....Relation.Binary.Pointwise.Properties.html | 8 +- master/Data.Container.Relation.Unary.All.html | 16 +- ...ntainer.Relation.Unary.Any.Properties.html | 26 +- master/Data.Container.Relation.Unary.Any.html | 16 +- master/Data.Digit.Properties.html | 8 +- master/Data.Digit.html | 14 +- master/Data.Empty.html | 3 + master/Data.Fin.Base.html | 6 +- master/Data.Fin.Induction.html | 30 +- master/Data.Fin.Literals.html | 4 +- master/Data.Fin.Permutation.Components.html | 26 +- master/Data.Fin.Permutation.html | 52 +-- master/Data.Fin.Properties.html | 184 ++++---- master/Data.Fin.Show.html | 10 +- master/Data.Fin.Subset.Properties.html | 116 ++--- master/Data.Fin.Subset.html | 8 +- master/Data.Fin.Substitution.Lemmas.html | 16 +- master/Data.Fin.Substitution.html | 20 +- master/Data.Fin.html | 4 +- master/Data.Float.Properties.html | 18 +- master/Data.Integer.Base.html | 16 +- master/Data.Integer.Coprimality.html | 6 +- master/Data.Integer.Divisibility.Signed.html | 16 +- master/Data.Integer.Properties.html | 134 +++--- master/Data.List.Base.html | 86 ++-- master/Data.List.Countdown.html | 58 +-- master/Data.List.Extrema.Core.html | 6 +- master/Data.List.Extrema.html | 6 +- ...st.Fresh.Membership.Setoid.Properties.html | 8 +- master/Data.List.Fresh.Membership.Setoid.html | 2 +- master/Data.List.Fresh.Properties.html | 20 +- ...t.Fresh.Relation.Unary.All.Properties.html | 2 +- .../Data.List.Fresh.Relation.Unary.All.html | 22 +- ...t.Fresh.Relation.Unary.Any.Properties.html | 30 +- .../Data.List.Fresh.Relation.Unary.Any.html | 26 +- master/Data.List.Fresh.html | 18 +- ...Data.List.Membership.DecPropositional.html | 4 +- master/Data.List.Membership.DecSetoid.html | 10 +- ...bership.Propositional.Properties.Core.html | 16 +- ...ership.Propositional.Properties.WithK.html | 4 +- ...t.Membership.Propositional.Properties.html | 50 +-- ...ata.List.Membership.Setoid.Properties.html | 56 +-- master/Data.List.Membership.Setoid.html | 12 +- master/Data.List.NonEmpty.Base.html | 12 +- master/Data.List.NonEmpty.Properties.html | 22 +- ...Data.List.NonEmpty.Relation.Unary.All.html | 6 +- master/Data.List.Properties.html | 104 ++--- ...ist.Relation.Binary.BagAndSetEquality.html | 8 +- ...tion.Binary.Disjoint.DecPropositional.html | 4 +- ...st.Relation.Binary.Disjoint.DecSetoid.html | 12 +- ...ion.Binary.Disjoint.Setoid.Properties.html | 8 +- ....List.Relation.Binary.Disjoint.Setoid.html | 4 +- ...tion.Binary.Equality.DecPropositional.html | 6 +- ...st.Relation.Binary.Equality.DecSetoid.html | 6 +- ....List.Relation.Binary.Equality.Setoid.html | 14 +- ...Binary.Infix.Heterogeneous.Properties.html | 38 +- .../Data.List.Relation.Binary.Lex.Core.html | 2 +- ...ta.List.Relation.Binary.Lex.NonStrict.html | 44 +- .../Data.List.Relation.Binary.Lex.Strict.html | 98 ++-- master/Data.List.Relation.Binary.Lex.html | 44 +- ...lation.Binary.Permutation.Homogeneous.html | 8 +- ....Permutation.Propositional.Properties.html | 18 +- ...tion.Binary.Permutation.Propositional.html | 6 +- ....Binary.Permutation.Setoid.Properties.html | 72 +-- ...st.Relation.Binary.Permutation.Setoid.html | 8 +- ....Relation.Binary.Pointwise.Properties.html | 34 +- .../Data.List.Relation.Binary.Pointwise.html | 36 +- ...inary.Prefix.Heterogeneous.Properties.html | 34 +- ...inary.Sublist.DecPropositional.Solver.html | 4 +- ...ation.Binary.Sublist.DecPropositional.html | 4 +- ...ist.Relation.Binary.Sublist.DecSetoid.html | 4 +- ...nary.Sublist.Heterogeneous.Properties.html | 116 ++--- ...n.Binary.Sublist.Heterogeneous.Solver.html | 4 +- ...Relation.Binary.Sublist.Heterogeneous.html | 8 +- ...nary.Sublist.Propositional.Properties.html | 18 +- ...Relation.Binary.Sublist.Propositional.html | 8 +- ...tion.Binary.Sublist.Setoid.Properties.html | 36 +- ...a.List.Relation.Binary.Sublist.Setoid.html | 12 +- ...lation.Binary.Subset.DecPropositional.html | 4 +- ...List.Relation.Binary.Subset.DecSetoid.html | 16 +- ...inary.Subset.Propositional.Properties.html | 22 +- ...ation.Binary.Subset.Setoid.Properties.html | 32 +- ...ta.List.Relation.Binary.Subset.Setoid.html | 6 +- ...inary.Suffix.Heterogeneous.Properties.html | 34 +- ...Relation.Ternary.Appending.Properties.html | 8 +- ...ernary.Interleaving.Setoid.Properties.html | 12 +- ...ta.List.Relation.Unary.All.Properties.html | 130 +++--- master/Data.List.Relation.Unary.All.html | 64 +-- ...st.Relation.Unary.AllPairs.Properties.html | 8 +- master/Data.List.Relation.Unary.AllPairs.html | 24 +- ...ta.List.Relation.Unary.Any.Properties.html | 70 +-- master/Data.List.Relation.Unary.Any.html | 32 +- ....List.Relation.Unary.First.Properties.html | 44 +- master/Data.List.Relation.Unary.First.html | 36 +- ...ist.Relation.Unary.Grouped.Properties.html | 18 +- master/Data.List.Relation.Unary.Grouped.html | 22 +- ...List.Relation.Unary.Linked.Properties.html | 20 +- master/Data.List.Relation.Unary.Linked.html | 26 +- ...on.Unary.Sorted.TotalOrder.Properties.html | 14 +- ...List.Relation.Unary.Sorted.TotalOrder.html | 10 +- ...ry.Unique.DecPropositional.Properties.html | 4 +- ...elation.Unary.Unique.DecPropositional.html | 4 +- ....List.Relation.Unary.Unique.DecSetoid.html | 8 +- ...Unary.Unique.Propositional.Properties.html | 6 +- ...lation.Unary.Unique.Setoid.Properties.html | 10 +- ...ata.List.Relation.Unary.Unique.Setoid.html | 4 +- master/Data.List.Sort.MergeSort.html | 4 +- master/Data.Maybe.Base.html | 10 +- master/Data.Maybe.Properties.html | 16 +- .../Data.Maybe.Relation.Binary.Connected.html | 16 +- .../Data.Maybe.Relation.Binary.Pointwise.html | 22 +- ...a.Maybe.Relation.Unary.All.Properties.html | 6 +- master/Data.Maybe.Relation.Unary.All.html | 52 +-- master/Data.Maybe.Relation.Unary.Any.html | 32 +- master/Data.Nat.Base.html | 14 +- master/Data.Nat.Binary.Base.html | 10 +- master/Data.Nat.Binary.Properties.html | 138 +++--- master/Data.Nat.Binary.Subtraction.html | 26 +- .../Data.Nat.Combinatorics.Specification.html | 16 +- master/Data.Nat.Combinatorics.html | 8 +- master/Data.Nat.Coprimality.html | 18 +- master/Data.Nat.DivMod.Core.html | 16 +- master/Data.Nat.DivMod.html | 6 +- master/Data.Nat.Divisibility.Core.html | 4 +- master/Data.Nat.Divisibility.html | 22 +- master/Data.Nat.GCD.html | 42 +- master/Data.Nat.InfinitelyOften.html | 32 +- master/Data.Nat.LCM.html | 2 +- master/Data.Nat.Primality.Factorisation.html | 14 +- master/Data.Nat.Primality.html | 114 ++--- master/Data.Nat.Properties.html | 212 ++++----- master/Data.Nat.Show.Properties.html | 4 +- master/Data.Nat.Show.html | 12 +- master/Data.Parity.Properties.html | 20 +- master/Data.Product.Nary.NonDependent.html | 14 +- master/Data.Product.Properties.html | 18 +- ...Product.Relation.Binary.Lex.NonStrict.html | 38 +- ...ta.Product.Relation.Binary.Lex.Strict.html | 98 ++-- ...t.Relation.Binary.Pointwise.Dependent.html | 6 +- ...elation.Binary.Pointwise.NonDependent.html | 42 +- master/Data.Product.html | 4 +- master/Data.Rational.Base.html | 30 +- master/Data.Rational.Properties.html | 92 ++-- master/Data.Rational.Unnormalised.Base.html | 28 +- ...Data.Rational.Unnormalised.Properties.html | 98 ++-- master/Data.Record.html | 32 +- master/Data.Refinement.html | 6 +- master/Data.Sign.Properties.html | 20 +- master/Data.Star.Decoration.html | 14 +- master/Data.Star.Pointer.html | 12 +- master/Data.String.Base.html | 12 +- master/Data.String.Properties.html | 24 +- master/Data.String.html | 4 +- master/Data.Sum.Properties.html | 18 +- .../Data.Sum.Relation.Binary.LeftOrder.html | 70 +-- .../Data.Sum.Relation.Binary.Pointwise.html | 48 +- master/Data.Sum.Relation.Unary.All.html | 8 +- master/Data.Sum.html | 16 +- master/Data.These.Properties.html | 24 +- ...a.Tree.AVL.Indexed.Relation.Unary.All.html | 26 +- ...Indexed.Relation.Unary.Any.Properties.html | 94 ++-- ...a.Tree.AVL.Indexed.Relation.Unary.Any.html | 22 +- master/Data.Tree.AVL.Indexed.html | 22 +- master/Data.Tree.AVL.Key.html | 8 +- ...p.Membership.Propositional.Properties.html | 26 +- ...Tree.AVL.Map.Membership.Propositional.html | 8 +- .../Data.Tree.AVL.Map.Relation.Unary.Any.html | 12 +- master/Data.Tree.AVL.NonEmpty.html | 4 +- master/Data.Tree.AVL.Relation.Unary.Any.html | 16 +- ...a.Tree.AVL.Sets.Membership.Properties.html | 14 +- master/Data.Tree.AVL.Sets.Membership.html | 6 +- master/Data.Tree.AVL.Value.html | 4 +- master/Data.Tree.AVL.html | 4 +- ....Binary.Relation.Unary.All.Properties.html | 6 +- .../Data.Tree.Binary.Relation.Unary.All.html | 6 +- master/Data.Trie.NonEmpty.html | 4 +- master/Data.Trie.html | 4 +- master/Data.Unit.Polymorphic.Properties.html | 12 +- master/Data.Unit.Properties.html | 14 +- master/Data.Vec.Base.html | 10 +- master/Data.Vec.Bounded.Base.html | 8 +- master/Data.Vec.Bounded.html | 4 +- master/Data.Vec.Functional.Properties.html | 16 +- ...ional.Relation.Binary.Equality.Setoid.html | 8 +- ....Relation.Binary.Pointwise.Properties.html | 10 +- ...ctional.Relation.Unary.All.Properties.html | 14 +- ...ata.Vec.Functional.Relation.Unary.All.html | 14 +- ...ata.Vec.Functional.Relation.Unary.Any.html | 12 +- .../Data.Vec.Membership.DecPropositional.html | 4 +- master/Data.Vec.Membership.DecSetoid.html | 4 +- ...c.Membership.Propositional.Properties.html | 4 +- master/Data.Vec.Membership.Setoid.html | 12 +- master/Data.Vec.Properties.html | 26 +- master/Data.Vec.Recursive.html | 6 +- ...ata.Vec.Relation.Binary.Equality.Cast.html | 6 +- ...tion.Binary.Equality.DecPropositional.html | 4 +- ...ec.Relation.Binary.Equality.DecSetoid.html | 4 +- ...a.Vec.Relation.Binary.Equality.Setoid.html | 8 +- master/Data.Vec.Relation.Binary.Lex.Core.html | 60 +-- ...ata.Vec.Relation.Binary.Lex.NonStrict.html | 58 +-- .../Data.Vec.Relation.Binary.Lex.Strict.html | 112 ++--- ...Relation.Binary.Pointwise.Extensional.html | 20 +- ...c.Relation.Binary.Pointwise.Inductive.html | 28 +- ...ata.Vec.Relation.Unary.All.Properties.html | 10 +- master/Data.Vec.Relation.Unary.All.html | 44 +- master/Data.Vec.Relation.Unary.AllPairs.html | 24 +- ...ata.Vec.Relation.Unary.Any.Properties.html | 50 +-- master/Data.Vec.Relation.Unary.Any.html | 26 +- ....Vec.Relation.Unary.Linked.Properties.html | 6 +- master/Data.Vec.Relation.Unary.Linked.html | 26 +- ...Unary.Unique.Propositional.Properties.html | 4 +- ...lation.Unary.Unique.Setoid.Properties.html | 8 +- ...Data.Vec.Relation.Unary.Unique.Setoid.html | 6 +- master/Data.Vec.html | 8 +- master/Data.W.Indexed.html | 8 +- master/Data.W.Sized.html | 4 +- master/Data.W.html | 4 +- master/Data.Word.Properties.html | 24 +- master/Effect.Applicative.Predicate.html | 12 +- master/Effect.Functor.Predicate.html | 4 +- master/Effect.Monad.Partiality.All.html | 8 +- master/Effect.Monad.Partiality.html | 62 +-- master/Effect.Monad.Predicate.html | 20 +- master/Everything.html | 295 ++++++------ master/EverythingSafe.html | 215 ++++----- .../Function.Consequences.Propositional.html | 2 +- master/Function.Consequences.Setoid.html | 2 +- master/Function.Consequences.html | 32 +- master/Function.Construct.Composition.html | 2 +- master/Function.Construct.Identity.html | 2 +- master/Function.Construct.Symmetry.html | 8 +- master/Function.Indexed.Bundles.html | 20 +- master/Function.Metric.Definitions.html | 6 +- master/Function.Nary.NonDependent.html | 4 +- master/Function.Properties.Bijection.html | 6 +- master/Function.Properties.Equivalence.html | 6 +- master/Function.Properties.Injection.html | 4 +- master/Function.Properties.Surjection.html | 6 +- master/Function.Related.Propositional.html | 8 +- master/Function.Related.TypeIsomorphisms.html | 20 +- ...ction.Relation.Binary.Setoid.Equality.html | 8 +- master/Induction.InfiniteDescent.html | 60 +-- master/Induction.WellFounded.html | 28 +- master/Induction.html | 14 +- master/README.Axiom.html | 2 +- ...E.Data.List.Relation.Binary.Pointwise.html | 4 +- ...ta.List.Relation.Ternary.Interleaving.html | 10 +- master/README.Data.Record.html | 6 +- master/README.Data.Trie.NonDependent.html | 6 +- master/README.Design.Decidability.html | 88 ++-- master/README.Foreign.Haskell.html | 2 +- master/README.Nary.html | 12 +- master/README.Text.Regex.html | 28 +- master/Reflection.AST.Abstraction.html | 10 +- master/Reflection.AST.AlphaEquality.html | 8 +- .../Reflection.AST.Argument.Information.html | 10 +- master/Reflection.AST.Argument.Modality.html | 10 +- master/Reflection.AST.Argument.Quantity.html | 14 +- master/Reflection.AST.Argument.Relevance.html | 14 +- .../Reflection.AST.Argument.Visibility.html | 24 +- master/Reflection.AST.Argument.html | 10 +- master/Reflection.AST.Definition.html | 82 ++-- master/Reflection.AST.Literal.html | 106 ++--- master/Reflection.AST.Meta.html | 10 +- master/Reflection.AST.Name.html | 10 +- master/Reflection.AST.Show.html | 2 +- master/Reflection.AST.Term.html | 418 +++++++++--------- master/Relation.Binary.Bundles.html | 8 +- master/Relation.Binary.Consequences.html | 132 +++--- ...Binary.Construct.Add.Extrema.Equality.html | 14 +- ...inary.Construct.Add.Extrema.NonStrict.html | 18 +- ...n.Binary.Construct.Add.Extrema.Strict.html | 34 +- ...inary.Construct.Add.Infimum.NonStrict.html | 24 +- ...n.Binary.Construct.Add.Infimum.Strict.html | 68 +-- ...n.Binary.Construct.Add.Point.Equality.html | 24 +- ...nary.Construct.Add.Supremum.NonStrict.html | 24 +- ....Binary.Construct.Add.Supremum.Strict.html | 68 +-- master/Relation.Binary.Construct.Always.html | 8 +- ....Binary.Construct.Closure.Equivalence.html | 8 +- ...ct.Closure.Reflexive.Properties.WithK.html | 10 +- ...onstruct.Closure.Reflexive.Properties.html | 46 +- ...on.Binary.Construct.Closure.Reflexive.html | 6 +- ...losure.ReflexiveTransitive.Properties.html | 6 +- ...Construct.Closure.ReflexiveTransitive.html | 22 +- ...on.Binary.Construct.Closure.Symmetric.html | 8 +- ...Construct.Closure.SymmetricTransitive.html | 8 +- ...n.Binary.Construct.Closure.Transitive.html | 10 +- ...Relation.Binary.Construct.Composition.html | 20 +- .../Relation.Binary.Construct.Constant.html | 8 +- ...lation.Binary.Construct.Flip.EqAndOrd.html | 38 +- .../Relation.Binary.Construct.Flip.Ord.html | 30 +- .../Relation.Binary.Construct.FromPred.html | 16 +- master/Relation.Binary.Construct.FromRel.html | 10 +- ...n.Binary.Construct.Interior.Symmetric.html | 20 +- ...elation.Binary.Construct.Intersection.html | 34 +- ...on.Binary.Construct.NaturalOrder.Left.html | 28 +- ...n.Binary.Construct.NaturalOrder.Right.html | 28 +- ...on.Binary.Construct.NonStrictToStrict.html | 70 +-- master/Relation.Binary.Construct.On.html | 24 +- ...on.Binary.Construct.StrictToNonStrict.html | 48 +- ...ation.Binary.Construct.Subst.Equality.html | 8 +- master/Relation.Binary.Construct.Union.html | 28 +- master/Relation.Binary.Definitions.html | 324 +++++++------- ...Relation.Binary.HeterogeneousEquality.html | 22 +- ...ary.Indexed.Heterogeneous.Definitions.html | 6 +- ...on.Binary.Indexed.Homogeneous.Bundles.html | 4 +- ...inary.Indexed.Homogeneous.Definitions.html | 10 +- ...Binary.Indexed.Homogeneous.Structures.html | 18 +- ...ry.Lattice.Properties.JoinSemilattice.html | 14 +- ...ry.Lattice.Properties.MeetSemilattice.html | 6 +- .../Relation.Binary.Lattice.Structures.html | 10 +- ...Binary.Morphism.Construct.Composition.html | 6 +- ...on.Binary.Morphism.Construct.Constant.html | 6 +- ...on.Binary.Morphism.Construct.Identity.html | 6 +- ...ion.Binary.Morphism.OrderMonomorphism.html | 20 +- ...ation.Binary.Morphism.RelMonomorphism.html | 18 +- ...n.Binary.Properties.ApartnessRelation.html | 8 +- .../Relation.Binary.Properties.DecSetoid.html | 16 +- ...ation.Binary.Properties.DecTotalOrder.html | 2 +- master/Relation.Binary.Properties.Poset.html | 20 +- master/Relation.Binary.Properties.Setoid.html | 20 +- ...Relation.Binary.Properties.TotalOrder.html | 4 +- ...ion.Binary.PropositionalEquality.Core.html | 20 +- ...nary.PropositionalEquality.Properties.html | 12 +- ...on.Binary.PropositionalEquality.WithK.html | 4 +- ...Relation.Binary.PropositionalEquality.html | 18 +- ...ation.Binary.Reasoning.Base.Apartness.html | 32 +- ...Relation.Binary.Reasoning.Base.Double.html | 18 +- ...elation.Binary.Reasoning.Base.Partial.html | 16 +- ...Relation.Binary.Reasoning.Base.Single.html | 10 +- ...Relation.Binary.Reasoning.Base.Triple.html | 34 +- ...Relation.Binary.Reasoning.MultiSetoid.html | 8 +- master/Relation.Binary.Reasoning.Syntax.html | 32 +- master/Relation.Binary.Rewriting.html | 4 +- master/Relation.Binary.Structures.Biased.html | 4 +- master/Relation.Binary.Structures.html | 70 +-- master/Relation.Nary.html | 28 +- master/Relation.Nullary.Decidable.Core.html | 295 ++++++------ master/Relation.Nullary.Decidable.html | 146 +++--- master/Relation.Nullary.Negation.Core.html | 101 +++-- master/Relation.Nullary.Negation.html | 197 ++++----- master/Relation.Nullary.Recomputable.html | 65 +++ master/Relation.Nullary.Reflects.html | 195 ++++---- master/Relation.Nullary.Universe.html | 12 +- master/Relation.Nullary.html | 32 +- master/Relation.Unary.Algebra.html | 102 ++--- master/Relation.Unary.Closure.Base.html | 36 +- master/Relation.Unary.Closure.Preorder.html | 8 +- ...tion.Unary.Closure.StrictPartialOrder.html | 8 +- master/Relation.Unary.Consequences.html | 6 +- master/Relation.Unary.Indexed.html | 4 +- ...Relation.Unary.Polymorphic.Properties.html | 38 +- master/Relation.Unary.Polymorphic.html | 6 +- .../Relation.Unary.PredicateTransformer.html | 28 +- master/Relation.Unary.Properties.html | 152 +++---- ...lation.Unary.Relation.Binary.Equality.html | 6 +- ...Relation.Unary.Relation.Binary.Subset.html | 16 +- master/Relation.Unary.html | 399 +++++++++-------- master/System.Clock.html | 2 +- master/Tactic.Cong.html | 6 +- ...actic.RingSolver.Core.Polynomial.Base.html | 16 +- ...r.Core.Polynomial.Homomorphism.Lemmas.html | 14 +- master/Test.Golden.html | 6 +- master/Text.Pretty.Core.html | 12 +- master/Text.Regex.Base.html | 6 +- master/Text.Regex.Derivative.Brzozowski.html | 58 +-- master/Text.Regex.Properties.Core.html | 40 +- master/Text.Regex.Properties.html | 58 +-- master/Text.Regex.Search.html | 96 ++-- master/Text.Regex.SmartConstructors.html | 64 +-- master/Text.Regex.String.Unsafe.html | 12 +- master/index.html | 141 +++--- 451 files changed, 6263 insertions(+), 6182 deletions(-) create mode 100644 master/Relation.Nullary.Recomputable.html diff --git a/master/Algebra.Apartness.Properties.HeytingCommutativeRing.html b/master/Algebra.Apartness.Properties.HeytingCommutativeRing.html index 3c47461a05..fe6727cad0 100644 --- a/master/Algebra.Apartness.Properties.HeytingCommutativeRing.html +++ b/master/Algebra.Apartness.Properties.HeytingCommutativeRing.html @@ -21,7 +21,7 @@ open import Algebra.Properties.Ring ring using (-0#≈0#; -‿distribˡ-*; -‿distribʳ-*; -‿anti-homo-+; -‿involutive) -open import Relation.Binary.Definitions using (Symmetric) +open import Relation.Binary.Definitions using (Symmetric) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning open import Algebra.Properties.CommutativeMonoid *-commutativeMonoid @@ -65,7 +65,7 @@ y⁻¹ * (y - 0#) ≈⟨ y⁻¹*y≈1 1# -#-sym : Symmetric _#_ +#-sym : Symmetric _#_ #-sym {x} {y} x#y = invertibleˡ⇒# (- x-y⁻¹ , x-y⁻¹*y-x≈1) where open ≈-Reasoning setoid diff --git a/master/Algebra.Apartness.Structures.html b/master/Algebra.Apartness.Structures.html index 2de6056b3d..4689192600 100644 --- a/master/Algebra.Apartness.Structures.html +++ b/master/Algebra.Apartness.Structures.html @@ -22,8 +22,8 @@ open import Algebra.Definitions _≈_ using (Invertible) open import Algebra.Structures _≈_ using (IsCommutativeRing) open import Relation.Binary.Structures using (IsEquivalence; IsApartnessRelation) -open import Relation.Binary.Definitions using (Tight) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Binary.Definitions using (Tight) +open import Relation.Nullary.Negation using (¬_) import Relation.Binary.Properties.ApartnessRelation as AR @@ -48,7 +48,7 @@ field isHeytingCommutativeRing : IsHeytingCommutativeRing - tight : Tight _≈_ _#_ + tight : Tight _≈_ _#_ open IsHeytingCommutativeRing isHeytingCommutativeRing public \ No newline at end of file diff --git a/master/Algebra.Bundles.Raw.html b/master/Algebra.Bundles.Raw.html index b0f5b16896..540864b606 100644 --- a/master/Algebra.Bundles.Raw.html +++ b/master/Algebra.Bundles.Raw.html @@ -12,7 +12,7 @@ open import Algebra.Core open import Relation.Binary.Core using (Rel) open import Level using (suc; _⊔_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) ------------------------------------------------------------------------ -- Raw bundles with 1 unary operation & 1 element @@ -42,7 +42,7 @@ infix 4 _≉_ _≉_ : Rel Carrier _ - x y = ¬ (x y) + x y = ¬ (x y) ------------------------------------------------------------------------ -- Raw bundles with 1 binary operation & 1 element diff --git a/master/Algebra.Consequences.Base.html b/master/Algebra.Consequences.Base.html index de462b69a1..dbb0385189 100644 --- a/master/Algebra.Consequences.Base.html +++ b/master/Algebra.Consequences.Base.html @@ -15,7 +15,7 @@ open import Algebra.Definitions open import Data.Sum.Base open import Relation.Binary.Core -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) module _ {} {_•_ : Op₂ A} (_≈_ : Rel A ) where @@ -24,7 +24,7 @@ module _ {} {f : Op₁ A} (_≈_ : Rel A ) where - reflexive∧selfInverse⇒involutive : Reflexive _≈_ + reflexive∧selfInverse⇒involutive : Reflexive _≈_ SelfInverse _≈_ f Involutive _≈_ f reflexive∧selfInverse⇒involutive refl inv _ = inv refl diff --git a/master/Algebra.Consequences.Propositional.html b/master/Algebra.Consequences.Propositional.html index d479bc0566..da0a0eed0d 100644 --- a/master/Algebra.Consequences.Propositional.html +++ b/master/Algebra.Consequences.Propositional.html @@ -14,12 +14,12 @@ open import Data.Sum.Base using (inj₁; inj₂) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (Symmetric; Total) +open import Relation.Binary.Definitions using (Symmetric; Total) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong₂; subst) open import Relation.Binary.PropositionalEquality.Properties using (setoid) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) open import Algebra.Core open import Algebra.Definitions {A = A} _≡_ @@ -99,7 +99,7 @@ comm∧distrʳ⇒distrˡ : _∙_ DistributesOverʳ _◦_ _∙_ DistributesOverˡ _◦_ comm∧distrʳ⇒distrˡ = Base.comm∧distrʳ⇒distrˡ (cong₂ _) ∙-comm - comm⇒sym[distribˡ] : x Symmetric y z (x (y z)) ((x y) (x z))) + comm⇒sym[distribˡ] : x Symmetric y z (x (y z)) ((x y) (x z))) comm⇒sym[distribˡ] = Base.comm⇒sym[distribˡ] (cong₂ _◦_) ∙-comm ------------------------------------------------------------------------ @@ -132,14 +132,14 @@ ------------------------------------------------------------------------ -- Without Loss of Generality -module _ {p} {P : Pred A p} where +module _ {p} {P : Pred A p} where subst∧comm⇒sym : {f} (f-comm : Commutative f) - Symmetric a b P (f a b)) + Symmetric a b P (f a b)) subst∧comm⇒sym = Base.subst∧comm⇒sym {P = P} subst wlog : {f} (f-comm : Commutative f) - {r} {_R_ : Rel _ r} Total _R_ + {r} {_R_ : Rel _ r} Total _R_ (∀ a b a R b P (f a b)) a b P (f a b) wlog = Base.wlog {P = P} subst diff --git a/master/Algebra.Consequences.Setoid.html b/master/Algebra.Consequences.Setoid.html index df46e2542e..dae1ed4916 100644 --- a/master/Algebra.Consequences.Setoid.html +++ b/master/Algebra.Consequences.Setoid.html @@ -11,7 +11,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Definitions - using (Substitutive; Symmetric; Total) + using (Substitutive; Symmetric; Total) module Algebra.Consequences.Setoid {a } (S : Setoid a ) where @@ -24,7 +24,7 @@ open import Function.Definitions import Relation.Binary.Consequences as Bin open import Relation.Binary.Reasoning.Setoid S -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) ------------------------------------------------------------------------ -- Re-exports @@ -249,7 +249,7 @@ comm∧distrʳ⇒distr : _∙_ DistributesOverʳ _◦_ _∙_ DistributesOver _◦_ comm∧distrʳ⇒distr distrʳ = comm∧distrʳ⇒distrˡ distrʳ , distrʳ - comm⇒sym[distribˡ] : x Symmetric y z (x (y z)) ((x y) (x z))) + comm⇒sym[distribˡ] : x Symmetric y z (x (y z)) ((x y) (x z))) comm⇒sym[distribˡ] x {y} {z} prf = begin x (z y) ≈⟨ ◦-cong refl (∙-comm z y) x (y z) ≈⟨ prf @@ -312,15 +312,15 @@ ------------------------------------------------------------------------ -- Without Loss of Generality -module _ {p} {f : Op₂ A} {P : Pred A p} - (≈-subst : Substitutive _≈_ p) +module _ {p} {f : Op₂ A} {P : Pred A p} + (≈-subst : Substitutive _≈_ p) (comm : Commutative f) where - subst∧comm⇒sym : Symmetric a b P (f a b)) + subst∧comm⇒sym : Symmetric a b P (f a b)) subst∧comm⇒sym = ≈-subst P (comm _ _) - wlog : {r} {_R_ : Rel _ r} Total _R_ + wlog : {r} {_R_ : Rel _ r} Total _R_ (∀ a b a R b P (f a b)) a b P (f a b) wlog r-total = Bin.wlog r-total subst∧comm⇒sym diff --git a/master/Algebra.Construct.Add.Identity.html b/master/Algebra.Construct.Add.Identity.html index aa7cab1352..1f1868656b 100644 --- a/master/Algebra.Construct.Add.Identity.html +++ b/master/Algebra.Construct.Add.Identity.html @@ -33,7 +33,7 @@ liftOp _ [ q ] = [ q ] liftOp _ = -module _ {_≈_ : Rel A } {op : Op₂ A} (refl-≈ : Reflexive _≈_) where +module _ {_≈_ : Rel A } {op : Op₂ A} (refl-≈ : Reflexive _≈_) where private _≈∙_ = lift≈ _≈_ op∙ = liftOp op diff --git a/master/Algebra.Construct.Flip.Op.html b/master/Algebra.Construct.Flip.Op.html index 360f80c769..8d25801554 100644 --- a/master/Algebra.Construct.Flip.Op.html +++ b/master/Algebra.Construct.Flip.Op.html @@ -16,7 +16,7 @@ open import Function.Base using (flip) open import Level using (Level) open import Relation.Binary.Core using (Rel; _Preserves₂_⟶_⟶_) -open import Relation.Binary.Definitions using (Symmetric) +open import Relation.Binary.Definitions using (Symmetric) private variable @@ -36,7 +36,7 @@ module _ ( : Rel A ) ( : Op₂ A) where - associative : Symmetric Associative Associative (flip ) + associative : Symmetric Associative Associative (flip ) associative sym assoc x y z = sym (assoc z y x) identity : Identity ε Identity ε (flip ) diff --git a/master/Algebra.Construct.Initial.html b/master/Algebra.Construct.Initial.html index bd0db975bd..02001bfaf1 100644 --- a/master/Algebra.Construct.Initial.html +++ b/master/Algebra.Construct.Initial.html @@ -26,7 +26,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) ------------------------------------------------------------------------ @@ -52,13 +52,13 @@ _∙_ : Op₂ Carrier _∙_ () - refl : Reflexive _≈_ + refl : Reflexive _≈_ refl {x = ()} - sym : Symmetric _≈_ + sym : Symmetric _≈_ sym {x = ()} - trans : Transitive _≈_ + trans : Transitive _≈_ trans {i = ()} ∙-cong : Congruent₂ _≈_ _∙_ diff --git a/master/Algebra.Construct.LexProduct.Base.html b/master/Algebra.Construct.LexProduct.Base.html index 1d454d82fe..b08880f577 100644 --- a/master/Algebra.Construct.LexProduct.Base.html +++ b/master/Algebra.Construct.LexProduct.Base.html @@ -11,13 +11,13 @@ open import Data.Bool.Base using (true; false) open import Data.Product.Base using (_×_; _,_) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary.Decidable.Core using (does; yes; no) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable.Core using (does; yes; no) module Algebra.Construct.LexProduct.Base {a b } {A : Set a} {B : Set b} (_∙_ : Op₂ A) (_◦_ : Op₂ B) - {_≈₁_ : Rel A } (_≟₁_ : Decidable _≈₁_) + {_≈₁_ : Rel A } (_≟₁_ : Decidable _≈₁_) where ------------------------------------------------------------------------ @@ -28,7 +28,7 @@ -- operator that only calculates the second component of product. innerLex : A A B B B -innerLex a b x y with does ((a b) ≟₁ a) | does ((a b) ≟₁ b) +innerLex a b x y with does ((a b) ≟₁ a) | does ((a b) ≟₁ b) ... | true | false = x ... | false | true = y ... | _ | _ = x y diff --git a/master/Algebra.Construct.LexProduct.Inner.html b/master/Algebra.Construct.LexProduct.Inner.html index fc740cfdf2..9eaf2e918c 100644 --- a/master/Algebra.Construct.LexProduct.Inner.html +++ b/master/Algebra.Construct.LexProduct.Inner.html @@ -12,17 +12,17 @@ open import Data.Product.Base using (_×_; _,_; swap; map; uncurry′) open import Function.Base using (_∘_) open import Level using (Level; _⊔_) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary.Decidable using (does; yes; no) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable using (does; yes; no) open import Relation.Nullary.Negation - using (contradiction; contradiction₂) + using (contradiction; contradiction₂) import Relation.Binary.Reasoning.Setoid as SetoidReasoning import Algebra.Construct.LexProduct.Base as Base module Algebra.Construct.LexProduct.Inner {ℓ₁ ℓ₂ ℓ₃ ℓ₄} (M : Magma ℓ₁ ℓ₂) (N : Magma ℓ₃ ℓ₄) - (_≟₁_ : Decidable (Magma._≈_ M)) + (_≟₁_ : Decidable (Magma._≈_ M)) where open module M = Magma M @@ -124,21 +124,21 @@ case₁ : a b ≈₁ a a b ≉₁ b lex a b x y ≈₂ x case₁ {a} {b} ab≈a ab≉b with (a b) ≟₁ a | (a b) ≟₁ b -... | no ab≉a | _ = contradiction ab≈a ab≉a -... | yes _ | yes ab≈b = contradiction ab≈b ab≉b -... | yes _ | no _ = N.refl +... | no ab≉a | _ = contradiction ab≈a ab≉a +... | yes _ | yes ab≈b = contradiction ab≈b ab≉b +... | yes _ | no _ = N.refl case₂ : a b ≉₁ a a b ≈₁ b lex a b x y ≈₂ y case₂ {a} {b} ab≉a ab≈b with (a b) ≟₁ a | (a b) ≟₁ b -... | yes ab≈a | _ = contradiction ab≈a ab≉a -... | no _ | no ab≉b = contradiction ab≈b ab≉b -... | no _ | yes _ = N.refl +... | yes ab≈a | _ = contradiction ab≈a ab≉a +... | no _ | no ab≉b = contradiction ab≈b ab≉b +... | no _ | yes _ = N.refl case₃ : a b ≈₁ a a b ≈₁ b lex a b x y ≈₂ (x y) case₃ {a} {b} ab≈a ab≈b with (a b) ≟₁ a | (a b) ≟₁ b -... | no ab≉a | _ = contradiction ab≈a ab≉a -... | yes _ | no ab≉b = contradiction ab≈b ab≉b -... | yes _ | yes _ = N.refl +... | no ab≉a | _ = contradiction ab≈a ab≉a +... | yes _ | no ab≉b = contradiction ab≈b ab≉b +... | yes _ | yes _ = N.refl ------------------------------------------------------------------------ -- Algebraic properties @@ -146,16 +146,16 @@ cong : a ≈₁ b c ≈₁ d w ≈₂ x y ≈₂ z lex a c w y ≈₂ lex b d x z cong {a} {b} {c} {d} a≈b c≈d w≈x y≈z with (a c) ≟₁ a | (a c) ≟₁ c | (b d) ≟₁ b | (b d) ≟₁ d -... | yes _ | yes _ | yes _ | yes _ = ◦-cong w≈x y≈z -... | yes _ | yes _ | no _ | no _ = ◦-cong w≈x y≈z -... | no _ | no _ | yes _ | yes _ = ◦-cong w≈x y≈z -... | no _ | no _ | no _ | no _ = ◦-cong w≈x y≈z -... | yes _ | no _ | yes _ | no _ = w≈x -... | no _ | yes _ | no _ | yes _ = y≈z -... | _ | yes ac≈c | _ | no bd≉d = contradiction (≤∙ˡ-resp-≈ ac≈c a≈b c≈d) bd≉d -... | yes ac≈a | _ | no bd≉b | _ = contradiction (≤∙ʳ-resp-≈ ac≈a a≈b c≈d) bd≉b -... | _ | no ac≉c | _ | yes bd≈d = contradiction (≤∙ˡ-resp-≈ bd≈d (M.sym a≈b) (M.sym c≈d)) ac≉c -... | no ac≉a | _ | yes bd≈b | _ = contradiction (≤∙ʳ-resp-≈ bd≈b (M.sym a≈b) (M.sym c≈d)) ac≉a +... | yes _ | yes _ | yes _ | yes _ = ◦-cong w≈x y≈z +... | yes _ | yes _ | no _ | no _ = ◦-cong w≈x y≈z +... | no _ | no _ | yes _ | yes _ = ◦-cong w≈x y≈z +... | no _ | no _ | no _ | no _ = ◦-cong w≈x y≈z +... | yes _ | no _ | yes _ | no _ = w≈x +... | no _ | yes _ | no _ | yes _ = y≈z +... | _ | yes ac≈c | _ | no bd≉d = contradiction (≤∙ˡ-resp-≈ ac≈c a≈b c≈d) bd≉d +... | yes ac≈a | _ | no bd≉b | _ = contradiction (≤∙ʳ-resp-≈ ac≈a a≈b c≈d) bd≉b +... | _ | no ac≉c | _ | yes bd≈d = contradiction (≤∙ˡ-resp-≈ bd≈d (M.sym a≈b) (M.sym c≈d)) ac≉c +... | no ac≉a | _ | yes bd≈b | _ = contradiction (≤∙ʳ-resp-≈ bd≈b (M.sym a≈b) (M.sym c≈d)) ac≉a cong₁₂ : a ≈₁ b c ≈₁ d lex a c x y ≈₂ lex b d x y cong₁₂ a≈b c≈d = cong a≈b c≈d N.refl N.refl @@ -174,53 +174,53 @@ a b c x y z lex (a b) c (lex a b x y) z ≈₂ lex a (b c) x (lex b c y z) assoc ∙-assoc ∙-comm ∙-sel ◦-assoc a b c x y z with (a b) ≟₁ a | (a b) ≟₁ b | (b c) ≟₁ b | (b c) ≟₁ c -... | _ | _ | no bc≉b | no bc≉c = contradiction₂ (∙-sel b c) bc≉b bc≉c -... | no ab≉a | no ab≉b | _ | _ = contradiction₂ (∙-sel a b) ab≉a ab≉b -... | yes ab≈a | no ab≉b | no bc≉b | yes bc≈c = cong₁₂ ab≈a (M.sym bc≈c) -... | no ab≉a | yes ab≈b | yes bc≈b | yes bc≈c = begin +... | _ | _ | no bc≉b | no bc≉c = contradiction₂ (∙-sel b c) bc≉b bc≉c +... | no ab≉a | no ab≉b | _ | _ = contradiction₂ (∙-sel a b) ab≉a ab≉b +... | yes ab≈a | no ab≉b | no bc≉b | yes bc≈c = cong₁₂ ab≈a (M.sym bc≈c) +... | no ab≉a | yes ab≈b | yes bc≈b | yes bc≈c = begin lex (a b) c y z ≈⟨ cong₁ ab≈b lex b c y z ≈⟨ case₃ bc≈b bc≈c y z ≈⟨ case₂ ab≉a ab≈b lex a b x (y z) ≈⟨ cong₂ bc≈b lex a (b c) x (y z) -... | no ab≉a | yes ab≈b | yes bc≈b | no bc≉c = begin +... | no ab≉a | yes ab≈b | yes bc≈b | no bc≉c = begin lex (a b) c y z ≈⟨ cong₁ ab≈b lex b c y z ≈⟨ case₁ bc≈b bc≉c y ≈⟨ case₂ ab≉a ab≈b lex a b x y ≈⟨ cong₂ bc≈b lex a (b c) x y -... | yes ab≈a | yes ab≈b | yes bc≈b | no bc≉c = begin +... | yes ab≈a | yes ab≈b | yes bc≈b | no bc≉c = begin lex (a b) c (x y) z ≈⟨ cong₁ ab≈b lex b c (x y) z ≈⟨ case₁ bc≈b bc≉c x y ≈⟨ case₃ ab≈a ab≈b lex a b x y ≈⟨ cong₂ bc≈b lex a (b c) x y -... | yes ab≈a | yes ab≈b | yes bc≈b | yes bc≈c = begin +... | yes ab≈a | yes ab≈b | yes bc≈b | yes bc≈c = begin lex (a b) c (x y) z ≈⟨ cong₁ ab≈b lex b c (x y) z ≈⟨ case₃ bc≈b bc≈c (x y) z ≈⟨ ◦-assoc x y z x (y z) ≈⟨ case₃ ab≈a ab≈b lex a b x (y z) ≈⟨ cong₂ bc≈b lex a (b c) x (y z) -... | yes ab≈a | yes ab≈b | no bc≉b | yes bc≈c = begin +... | yes ab≈a | yes ab≈b | no bc≉b | yes bc≈c = begin lex (a b) c (x y) z ≈⟨ cong₁ ab≈b lex b c (x y) z ≈⟨ case₂ bc≉b bc≈c z ≈⟨ case₂ bc≉b bc≈c lex b c x z ≈⟨ cong₁₂ (M.trans (M.sym ab≈a) ab≈b) bc≈c lex a (b c) x z -... | yes ab≈a | no ab≉b | yes bc≈b | yes bc≈c = begin +... | yes ab≈a | no ab≉b | yes bc≈b | yes bc≈c = begin lex (a b) c x z ≈⟨ cong₁₂ ab≈a (M.trans (M.sym bc≈c) bc≈b) lex a b x z ≈⟨ case₁ ab≈a ab≉b x ≈⟨ case₁ ab≈a ab≉b lex a b x (y z) ≈⟨ cong₂ bc≈b lex a (b c) x (y z) -... | no ab≉a | yes ab≈b | no bc≉b | yes bc≈c = begin +... | no ab≉a | yes ab≈b | no bc≉b | yes bc≈c = begin lex (a b) c y z ≈⟨ cong₁ ab≈b lex b c y z ≈⟨ case₂ bc≉b bc≈c z ≈⟨ uncurry′ case₂ (<∙ˡ-trans ∙-assoc ∙-comm ab≈b ab≉a bc≈c) lex a c x z ≈⟨ cong₂ bc≈c lex a (b c) x z -... | yes ab≈a | no ab≉b | yes bc≈b | no bc≉c = begin +... | yes ab≈a | no ab≉b | yes bc≈b | no bc≉c = begin lex (a b) c x z ≈⟨ cong₁ ab≈a lex a c x z ≈⟨ uncurry′ case₁ (<∙ʳ-trans ∙-assoc ∙-comm ab≈a bc≈b bc≉c) x ≈⟨ case₁ ab≈a ab≉b @@ -231,17 +231,17 @@ a b x y lex a b x y ≈₂ lex b a y x comm ∙-comm ◦-comm a b x y with (a b) ≟₁ a | (a b) ≟₁ b | (b a) ≟₁ b | (b a) ≟₁ a -... | yes ab≈a | _ | _ | no ba≉a = contradiction (M.trans (∙-comm b a) ab≈a) ba≉a -... | no ab≉a | _ | _ | yes ba≈a = contradiction (M.trans (∙-comm a b) ba≈a) ab≉a -... | _ | yes ab≈b | no ba≉b | _ = contradiction (M.trans (∙-comm b a) ab≈b) ba≉b -... | _ | no ab≉b | yes ba≈b | _ = contradiction (M.trans (∙-comm a b) ba≈b) ab≉b -... | yes _ | yes _ | yes _ | yes _ = ◦-comm x y -... | yes _ | no _ | no _ | yes _ = N.refl -... | no _ | yes _ | yes _ | no _ = N.refl -... | no _ | no _ | no _ | no _ = ◦-comm x y +... | yes ab≈a | _ | _ | no ba≉a = contradiction (M.trans (∙-comm b a) ab≈a) ba≉a +... | no ab≉a | _ | _ | yes ba≈a = contradiction (M.trans (∙-comm a b) ba≈a) ab≉a +... | _ | yes ab≈b | no ba≉b | _ = contradiction (M.trans (∙-comm b a) ab≈b) ba≉b +... | _ | no ab≉b | yes ba≈b | _ = contradiction (M.trans (∙-comm a b) ba≈b) ab≉b +... | yes _ | yes _ | yes _ | yes _ = ◦-comm x y +... | yes _ | no _ | no _ | yes _ = N.refl +... | no _ | yes _ | yes _ | no _ = N.refl +... | no _ | no _ | no _ | no _ = ◦-comm x y idem : Idempotent _≈₂_ _◦_ a b x lex a b x x ≈₂ x -idem ◦-idem a b x with does ((a b) ≟₁ a) | does ((a b) ≟₁ b) +idem ◦-idem a b x with does ((a b) ≟₁ a) | does ((a b) ≟₁ b) ... | false | false = ◦-idem x ... | false | true = N.refl ... | true | false = N.refl @@ -250,14 +250,14 @@ zeroʳ : {e f} RightZero _≈₁_ e _∙_ RightZero _≈₂_ f _◦_ lex a e x f ≈₂ f zeroʳ {a} {x} {e} {f} ze₁ ze₂ with (a e) ≟₁ a | (a e) ≟₁ e -... | _ | no a∙e≉e = contradiction (ze₁ a) a∙e≉e -... | no _ | yes _ = N.refl -... | yes _ | yes _ = ze₂ x +... | _ | no a∙e≉e = contradiction (ze₁ a) a∙e≉e +... | no _ | yes _ = N.refl +... | yes _ | yes _ = ze₂ x identityʳ : {e f} RightIdentity _≈₁_ e _∙_ RightIdentity _≈₂_ f _◦_ lex a e x f ≈₂ x identityʳ {a} {x} {e} {f} id₁ id₂ with (a e) ≟₁ a | (a e) ≟₁ e -... | no a∙e≉a | _ = contradiction (id₁ a) a∙e≉a -... | yes _ | no _ = N.refl -... | yes _ | yes _ = id₂ x +... | no a∙e≉a | _ = contradiction (id₁ a) a∙e≉a +... | yes _ | no _ = N.refl +... | yes _ | yes _ = id₂ x \ No newline at end of file diff --git a/master/Algebra.Construct.LexProduct.html b/master/Algebra.Construct.LexProduct.html index 0aa06f6fc2..56babe943c 100644 --- a/master/Algebra.Construct.LexProduct.html +++ b/master/Algebra.Construct.LexProduct.html @@ -15,14 +15,14 @@ open import Data.Sum.Base using (inj₁; inj₂; map) open import Function.Base using (_∘_) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary.Decidable.Core using (does; yes; no) -open import Relation.Nullary.Negation.Core using (¬_; contradiction; contradiction₂) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable.Core using (does; yes; no) +open import Relation.Nullary.Negation.Core using (¬_; contradiction; contradiction₂) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning module Algebra.Construct.LexProduct {ℓ₁ ℓ₂ ℓ₃ ℓ₄} (M : Magma ℓ₁ ℓ₂) (N : Magma ℓ₃ ℓ₄) - (_≟₁_ : Decidable (Magma._≈_ M)) + (_≟₁_ : Decidable (Magma._≈_ M)) where open Magma M using (_∙_ ; ∙-cong) @@ -105,8 +105,8 @@ sel : Selective _≈₁_ _∙_ Selective _≈₂_ _◦_ Selective _≋_ _⊕_ sel ∙-sel ◦-sel (a , x) (b , y) with (a b) ≟₁ a | (a b) ≟₁ b -... | no ab≉a | no ab≉b = contradiction₂ (∙-sel a b) ab≉a ab≉b -... | yes ab≈a | no _ = inj₁ (ab≈a , ≈₂-refl) -... | no _ | yes ab≈b = inj₂ (ab≈b , ≈₂-refl) -... | yes ab≈a | yes ab≈b = map (ab≈a ,_) (ab≈b ,_) (◦-sel x y) +... | no ab≉a | no ab≉b = contradiction₂ (∙-sel a b) ab≉a ab≉b +... | yes ab≈a | no _ = inj₁ (ab≈a , ≈₂-refl) +... | no _ | yes ab≈b = inj₂ (ab≈b , ≈₂-refl) +... | yes ab≈a | yes ab≈b = map (ab≈a ,_) (ab≈b ,_) (◦-sel x y) \ No newline at end of file diff --git a/master/Algebra.Construct.LiftedChoice.html b/master/Algebra.Construct.LiftedChoice.html index 68f1233b83..271723702b 100644 --- a/master/Algebra.Construct.LiftedChoice.html +++ b/master/Algebra.Construct.LiftedChoice.html @@ -17,10 +17,10 @@ open import Function.Base using (const; _$_) open import Level using (Level; _⊔_) open import Relation.Binary.Core using (Rel; _⇒_; _Preserves_⟶_) -open import Relation.Nullary using (¬_; yes; no) +open import Relation.Nullary using (¬_; yes; no) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning @@ -154,7 +154,7 @@ ------------------------------------------------------------------------ -- Other properties - module _ {P : Pred A p} (f : A B) where + module _ {P : Pred A p} (f : A B) where private _◦_ = Lift _≈_ _∙_ M.sel f diff --git a/master/Algebra.Construct.NaturalChoice.MinOp.html b/master/Algebra.Construct.NaturalChoice.MinOp.html index 7eeb84ecd0..83e713e4c1 100644 --- a/master/Algebra.Construct.NaturalChoice.MinOp.html +++ b/master/Algebra.Construct.NaturalChoice.MinOp.html @@ -16,7 +16,7 @@ open import Function.Base using (id; _∘_) open import Relation.Binary.Core using (_Preserves_⟶_; _Preserves₂_⟶_⟶_) open import Relation.Binary.Bundles using (TotalPreorder) -open import Relation.Binary.Definitions using (Maximum; Minimum) +open import Relation.Binary.Definitions using (Maximum; Minimum) open import Relation.Binary.Consequences module Algebra.Construct.NaturalChoice.MinOp @@ -101,22 +101,22 @@ ⊓-sel : Selective _⊓_ ⊓-sel x y = Sum.map x≤y⇒x⊓y≈x x≥y⇒x⊓y≈y (total x y) -⊓-identityˡ : {} Maximum _≤_ LeftIdentity _⊓_ +⊓-identityˡ : {} Maximum _≤_ LeftIdentity _⊓_ ⊓-identityˡ max = x≥y⇒x⊓y≈y max -⊓-identityʳ : {} Maximum _≤_ RightIdentity _⊓_ +⊓-identityʳ : {} Maximum _≤_ RightIdentity _⊓_ ⊓-identityʳ max = x≤y⇒x⊓y≈x max -⊓-identity : {} Maximum _≤_ Identity _⊓_ +⊓-identity : {} Maximum _≤_ Identity _⊓_ ⊓-identity max = ⊓-identityˡ max , ⊓-identityʳ max -⊓-zeroˡ : {} Minimum _≤_ LeftZero _⊓_ +⊓-zeroˡ : {} Minimum _≤_ LeftZero _⊓_ ⊓-zeroˡ min = x≤y⇒x⊓y≈x min -⊓-zeroʳ : {} Minimum _≤_ RightZero _⊓_ +⊓-zeroʳ : {} Minimum _≤_ RightZero _⊓_ ⊓-zeroʳ min = x≥y⇒x⊓y≈y min -⊓-zero : {} Minimum _≤_ Zero _⊓_ +⊓-zero : {} Minimum _≤_ Zero _⊓_ ⊓-zero min = ⊓-zeroˡ min , ⊓-zeroʳ min ------------------------------------------------------------------------ @@ -152,7 +152,7 @@ ; sel = ⊓-sel } -⊓-isMonoid : {} Maximum _≤_ IsMonoid _⊓_ +⊓-isMonoid : {} Maximum _≤_ IsMonoid _⊓_ ⊓-isMonoid max = record { isSemigroup = ⊓-isSemigroup ; identity = ⊓-identity max @@ -192,7 +192,7 @@ { isSelectiveMagma = ⊓-isSelectiveMagma } -⊓-monoid : {} Maximum _≤_ Monoid a ℓ₁ +⊓-monoid : {} Maximum _≤_ Monoid a ℓ₁ ⊓-monoid max = record { isMonoid = ⊓-isMonoid max } diff --git a/master/Algebra.Definitions.RawMagma.html b/master/Algebra.Definitions.RawMagma.html index fd5323ea68..222e984abe 100644 --- a/master/Algebra.Definitions.RawMagma.html +++ b/master/Algebra.Definitions.RawMagma.html @@ -15,7 +15,7 @@ open import Data.Product.Base using (_×_; ) open import Level using (_⊔_) open import Relation.Binary.Core using (Rel) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) module Algebra.Definitions.RawMagma {a } (M : RawMagma a ) @@ -44,7 +44,7 @@ equality : x quotient y _∤ˡ_ : Rel A (a ) -x ∤ˡ y = ¬ x ∣ˡ y +x ∤ˡ y = ¬ x ∣ˡ y -- Divisibility from the right @@ -55,7 +55,7 @@ equality : quotient x y _∤ʳ_ : Rel A (a ) -x ∤ʳ y = ¬ x ∣ʳ y +x ∤ʳ y = ¬ x ∣ʳ y -- General divisibility @@ -67,7 +67,7 @@ _∣_ = _∣ʳ_ _∤_ : Rel A (a ) -x y = ¬ x y +x y = ¬ x y ------------------------------------------------------------------------ -- Mutual divisibility. @@ -84,5 +84,5 @@ x ∣∣ y = x y × y x _∤∤_ : Rel A (a ) -x ∤∤ y = ¬ x ∣∣ y +x ∤∤ y = ¬ x ∣∣ y \ No newline at end of file diff --git a/master/Algebra.Definitions.html b/master/Algebra.Definitions.html index 30c3e4f965..2447e4ec79 100644 --- a/master/Algebra.Definitions.html +++ b/master/Algebra.Definitions.html @@ -17,7 +17,7 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Core using (Rel; _Preserves_⟶_; _Preserves₂_⟶_⟶_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) module Algebra.Definitions {a } {A : Set a} -- The underlying set @@ -151,10 +151,10 @@ Cancellative _•_ = (LeftCancellative _•_) × (RightCancellative _•_) AlmostLeftCancellative : A Op₂ A Set _ -AlmostLeftCancellative e _•_ = x y z ¬ x e (x y) (x z) y z +AlmostLeftCancellative e _•_ = x y z ¬ x e (x y) (x z) y z AlmostRightCancellative : A Op₂ A Set _ -AlmostRightCancellative e _•_ = x y z ¬ x e (y x) (z x) y z +AlmostRightCancellative e _•_ = x y z ¬ x e (y x) (z x) y z AlmostCancellative : A Op₂ A Set _ AlmostCancellative e _•_ = AlmostLeftCancellative e _•_ × AlmostRightCancellative e _•_ diff --git a/master/Algebra.Lattice.Morphism.Construct.Composition.html b/master/Algebra.Lattice.Morphism.Construct.Composition.html index e9ed08690d..35b2e7d335 100644 --- a/master/Algebra.Lattice.Morphism.Construct.Composition.html +++ b/master/Algebra.Lattice.Morphism.Construct.Composition.html @@ -15,7 +15,7 @@ import Function.Construct.Composition as Func open import Level using (Level) open import Relation.Binary.Morphism.Construct.Composition -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) private variable @@ -28,7 +28,7 @@ {L₂ : RawLattice b ℓ₂} {L₃ : RawLattice c ℓ₃} (open RawLattice) - (≈₃-trans : Transitive (_≈_ L₃)) + (≈₃-trans : Transitive (_≈_ L₃)) {f : Carrier L₁ Carrier L₂} {g : Carrier L₂ Carrier L₃} where diff --git a/master/Algebra.Lattice.Morphism.Construct.Identity.html b/master/Algebra.Lattice.Morphism.Construct.Identity.html index 84e0c3091e..461fe78968 100644 --- a/master/Algebra.Lattice.Morphism.Construct.Identity.html +++ b/master/Algebra.Lattice.Morphism.Construct.Identity.html @@ -17,13 +17,13 @@ import Function.Construct.Identity as Id open import Level using (Level) open import Relation.Binary.Morphism.Construct.Identity using (isRelHomomorphism) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) private variable c : Level -module _ (L : RawLattice c ) (open RawLattice L) (refl : Reflexive _≈_) where +module _ (L : RawLattice c ) (open RawLattice L) (refl : Reflexive _≈_) where open LatticeMorphisms L L isLatticeHomomorphism : IsLatticeHomomorphism id diff --git a/master/Algebra.Module.Bundles.Raw.html b/master/Algebra.Module.Bundles.Raw.html index ff573fbe20..63118838d6 100644 --- a/master/Algebra.Module.Bundles.Raw.html +++ b/master/Algebra.Module.Bundles.Raw.html @@ -13,7 +13,7 @@ open import Algebra.Core open import Algebra.Module.Core open import Level -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) open import Relation.Binary.Core using (Rel) private diff --git a/master/Algebra.Module.Bundles.html b/master/Algebra.Module.Bundles.html index dc0107e390..1925e31d79 100644 --- a/master/Algebra.Module.Bundles.html +++ b/master/Algebra.Module.Bundles.html @@ -37,7 +37,7 @@ open import Function.Base open import Level open import Relation.Binary.Core using (Rel) -open import Relation.Nullary using (¬_) +open import Relation.Nullary using (¬_) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning private diff --git a/master/Algebra.Module.Morphism.Construct.Composition.html b/master/Algebra.Module.Morphism.Construct.Composition.html index 742af00d99..b3992a2f5f 100644 --- a/master/Algebra.Module.Morphism.Construct.Composition.html +++ b/master/Algebra.Module.Morphism.Construct.Composition.html @@ -15,7 +15,7 @@ open import Function.Base using (_∘_) import Function.Construct.Composition as Func open import Level using (Level) -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) private variable @@ -27,7 +27,7 @@ {M₂ : RawLeftSemimodule R m₂ ℓm₂} {M₃ : RawLeftSemimodule R m₃ ℓm₃} (open RawLeftSemimodule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -62,7 +62,7 @@ {M₂ : RawLeftModule R m₂ ℓm₂} {M₃ : RawLeftModule R m₃ ℓm₃} (open RawLeftModule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -97,7 +97,7 @@ {M₂ : RawRightSemimodule R m₂ ℓm₂} {M₃ : RawRightSemimodule R m₃ ℓm₃} (open RawRightSemimodule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -132,7 +132,7 @@ {M₂ : RawRightModule R m₂ ℓm₂} {M₃ : RawRightModule R m₃ ℓm₃} (open RawRightModule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -168,7 +168,7 @@ {M₂ : RawBisemimodule R S m₂ ℓm₂} {M₃ : RawBisemimodule R S m₃ ℓm₃} (open RawBisemimodule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -205,7 +205,7 @@ {M₂ : RawBimodule R S m₂ ℓm₂} {M₃ : RawBimodule R S m₃ ℓm₃} (open RawBimodule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -241,7 +241,7 @@ {M₂ : RawSemimodule R m₂ ℓm₂} {M₃ : RawSemimodule R m₃ ℓm₃} (open RawSemimodule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where @@ -275,7 +275,7 @@ {M₂ : RawModule R m₂ ℓm₂} {M₃ : RawModule R m₃ ℓm₃} (open RawModule) - (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) + (≈ᴹ₃-trans : Transitive (_≈ᴹ_ M₃)) {f : Carrierᴹ M₁ Carrierᴹ M₂} {g : Carrierᴹ M₂ Carrierᴹ M₃} where diff --git a/master/Algebra.Module.Morphism.Construct.Identity.html b/master/Algebra.Module.Morphism.Construct.Identity.html index 23675c5216..4ee1f64626 100644 --- a/master/Algebra.Module.Morphism.Construct.Identity.html +++ b/master/Algebra.Module.Morphism.Construct.Identity.html @@ -25,13 +25,13 @@ open import Function.Base using (id) import Function.Construct.Identity as Id open import Level using (Level) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) private variable r s m ℓm : Level -module _ {R : Set r} (M : RawLeftSemimodule R m ℓm) (open RawLeftSemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} (M : RawLeftSemimodule R m ℓm) (open RawLeftSemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open LeftSemimoduleMorphisms M M isLeftSemimoduleHomomorphism : IsLeftSemimoduleHomomorphism id @@ -52,7 +52,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} (M : RawLeftModule R m ℓm) (open RawLeftModule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} (M : RawLeftModule R m ℓm) (open RawLeftModule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open LeftModuleMorphisms M M isLeftModuleHomomorphism : IsLeftModuleHomomorphism id @@ -73,7 +73,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} (M : RawRightSemimodule R m ℓm) (open RawRightSemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} (M : RawRightSemimodule R m ℓm) (open RawRightSemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open RightSemimoduleMorphisms M M isRightSemimoduleHomomorphism : IsRightSemimoduleHomomorphism id @@ -94,7 +94,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} (M : RawRightModule R m ℓm) (open RawRightModule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} (M : RawRightModule R m ℓm) (open RawRightModule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open RightModuleMorphisms M M isRightModuleHomomorphism : IsRightModuleHomomorphism id @@ -115,7 +115,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} {S : Set s} (M : RawBisemimodule R S m ℓm) (open RawBisemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} {S : Set s} (M : RawBisemimodule R S m ℓm) (open RawBisemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open BisemimoduleMorphisms M M isBisemimoduleHomomorphism : IsBisemimoduleHomomorphism id @@ -137,7 +137,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} {S : Set s} (M : RawBimodule R S m ℓm) (open RawBimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} {S : Set s} (M : RawBimodule R S m ℓm) (open RawBimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open BimoduleMorphisms M M isBimoduleHomomorphism : IsBimoduleHomomorphism id @@ -159,7 +159,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} (M : RawSemimodule R m ℓm) (open RawSemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} (M : RawSemimodule R m ℓm) (open RawSemimodule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open SemimoduleMorphisms M M isSemimoduleHomomorphism : IsSemimoduleHomomorphism id @@ -179,7 +179,7 @@ ; surjective = Id.surjective _ } -module _ {R : Set r} (M : RawModule R m ℓm) (open RawModule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where +module _ {R : Set r} (M : RawModule R m ℓm) (open RawModule M) (≈ᴹ-refl : Reflexive _≈ᴹ_) where open ModuleMorphisms M M isModuleHomomorphism : IsModuleHomomorphism id diff --git a/master/Algebra.Module.Morphism.ModuleHomomorphism.html b/master/Algebra.Module.Morphism.ModuleHomomorphism.html index 462a496fc3..127e2434ea 100644 --- a/master/Algebra.Module.Morphism.ModuleHomomorphism.html +++ b/master/Algebra.Module.Morphism.ModuleHomomorphism.html @@ -28,8 +28,8 @@ open import Axiom.DoubleNegationElimination open import Data.Product.Base using (∃₂; _×_; _,_) open import Relation.Binary.Reasoning.MultiSetoid -open import Relation.Nullary using (¬_) -open import Relation.Nullary.Negation using (contraposition) +open import Relation.Nullary using (¬_) +open import Relation.Nullary.Negation using (contraposition) module A = Module modA module B = Module modB @@ -52,7 +52,7 @@ B.0ᴹ fx≉0⇒x≉0 : {x} f x B.≉ᴹ B.0ᴹ x A.≉ᴹ A.0ᴹ -fx≉0⇒x≉0 = contraposition x≈0⇒fx≈0 +fx≉0⇒x≉0 = contraposition x≈0⇒fx≈0 -- Zero is a unique output of non-trivial (i.e. - ≉ `const 0`) linear map. x≉0⇒f[x]≉0 : {x} NonTrivial x x A.≉ᴹ A.0ᴹ f x B.≉ᴹ B.0ᴹ @@ -95,7 +95,7 @@ fx≈0⇒x≈0 {x} (s , y , s·x≈y , fy≉0) fx≈0 = dne ¬x≉0 where - ¬x≉0 : ¬ (x A.≉ᴹ A.0ᴹ) + ¬x≉0 : ¬ (x A.≉ᴹ A.0ᴹ) ¬x≉0 = λ x≉0 x≉0⇒f[x]≉0 (s , y , s·x≈y , fy≉0) x≉0 fx≈0 inj-lm : {x y} diff --git a/master/Algebra.Module.Properties.Semimodule.html b/master/Algebra.Module.Properties.Semimodule.html index 8017cc3fba..caebfcbe10 100644 --- a/master/Algebra.Module.Properties.Semimodule.html +++ b/master/Algebra.Module.Properties.Semimodule.html @@ -19,7 +19,7 @@ open CommutativeSemiring semiring open Semimodule semimod -open import Relation.Nullary.Negation using (contraposition) +open import Relation.Nullary.Negation using (contraposition) open import Relation.Binary.Reasoning.Setoid ≈ᴹ-setoid x≈0⇒x*y≈0 : {x y} x 0# x *ₗ y ≈ᴹ 0ᴹ @@ -35,8 +35,8 @@ 0ᴹ x*y≉0⇒x≉0 : {x y} x *ₗ y ≉ᴹ 0ᴹ x 0# -x*y≉0⇒x≉0 = contraposition x≈0⇒x*y≈0 +x*y≉0⇒x≉0 = contraposition x≈0⇒x*y≈0 x*y≉0⇒y≉0 : {x y} x *ₗ y ≉ᴹ 0ᴹ y ≉ᴹ 0ᴹ -x*y≉0⇒y≉0 = contraposition y≈0⇒x*y≈0 +x*y≉0⇒y≉0 = contraposition y≈0⇒x*y≈0 \ No newline at end of file diff --git a/master/Algebra.Morphism.Construct.Composition.html b/master/Algebra.Morphism.Construct.Composition.html index 3788a8dc98..58c78eb8e6 100644 --- a/master/Algebra.Morphism.Construct.Composition.html +++ b/master/Algebra.Morphism.Construct.Composition.html @@ -15,7 +15,7 @@ import Function.Construct.Composition as Func open import Level using (Level) open import Relation.Binary.Morphism.Construct.Composition -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) private variable @@ -28,7 +28,7 @@ {M₂ : RawMagma b ℓ₂} {M₃ : RawMagma c ℓ₃} (open RawMagma) - (≈₃-trans : Transitive (_≈_ M₃)) + (≈₃-trans : Transitive (_≈_ M₃)) {f : Carrier M₁ Carrier M₂} {g : Carrier M₂ Carrier M₃} where @@ -68,7 +68,7 @@ {M₂ : RawMonoid b ℓ₂} {M₃ : RawMonoid c ℓ₃} (open RawMonoid) - (≈₃-trans : Transitive (_≈_ M₃)) + (≈₃-trans : Transitive (_≈_ M₃)) {f : Carrier M₁ Carrier M₂} {g : Carrier M₂ Carrier M₃} where @@ -108,7 +108,7 @@ {G₂ : RawGroup b ℓ₂} {G₃ : RawGroup c ℓ₃} (open RawGroup) - (≈₃-trans : Transitive (_≈_ G₃)) + (≈₃-trans : Transitive (_≈_ G₃)) {f : Carrier G₁ Carrier G₂} {g : Carrier G₂ Carrier G₃} where @@ -149,7 +149,7 @@ {R₂ : RawNearSemiring b ℓ₂} {R₃ : RawNearSemiring c ℓ₃} (open RawNearSemiring) - (≈₃-trans : Transitive (_≈_ R₃)) + (≈₃-trans : Transitive (_≈_ R₃)) {f : Carrier R₁ Carrier R₂} {g : Carrier R₂ Carrier R₃} where @@ -190,7 +190,7 @@ {R₂ : RawSemiring b ℓ₂} {R₃ : RawSemiring c ℓ₃} (open RawSemiring) - (≈₃-trans : Transitive (_≈_ R₃)) + (≈₃-trans : Transitive (_≈_ R₃)) {f : Carrier R₁ Carrier R₂} {g : Carrier R₂ Carrier R₃} where @@ -230,7 +230,7 @@ {R₂ : RawRingWithoutOne b ℓ₂} {R₃ : RawRingWithoutOne c ℓ₃} (open RawRingWithoutOne) - (≈₃-trans : Transitive (_≈_ R₃)) + (≈₃-trans : Transitive (_≈_ R₃)) {f : Carrier R₁ Carrier R₂} {g : Carrier R₂ Carrier R₃} where @@ -270,7 +270,7 @@ {R₂ : RawRing b ℓ₂} {R₃ : RawRing c ℓ₃} (open RawRing) - (≈₃-trans : Transitive (_≈_ R₃)) + (≈₃-trans : Transitive (_≈_ R₃)) {f : Carrier R₁ Carrier R₂} {g : Carrier R₂ Carrier R₃} where @@ -310,7 +310,7 @@ {Q₂ : RawQuasigroup b ℓ₂} {Q₃ : RawQuasigroup c ℓ₃} (open RawQuasigroup) - (≈₃-trans : Transitive (_≈_ Q₃)) + (≈₃-trans : Transitive (_≈_ Q₃)) {f : Carrier Q₁ Carrier Q₂} {g : Carrier Q₂ Carrier Q₃} where @@ -352,7 +352,7 @@ {L₂ : RawLoop b ℓ₂} {L₃ : RawLoop c ℓ₃} (open RawLoop) - (≈₃-trans : Transitive (_≈_ L₃)) + (≈₃-trans : Transitive (_≈_ L₃)) {f : Carrier L₁ Carrier L₂} {g : Carrier L₂ Carrier L₃} where @@ -392,7 +392,7 @@ {K₂ : RawKleeneAlgebra b ℓ₂} {K₃ : RawKleeneAlgebra c ℓ₃} (open RawKleeneAlgebra) - (≈₃-trans : Transitive (_≈_ K₃)) + (≈₃-trans : Transitive (_≈_ K₃)) {f : Carrier K₁ Carrier K₂} {g : Carrier K₂ Carrier K₃} where diff --git a/master/Algebra.Morphism.Construct.Identity.html b/master/Algebra.Morphism.Construct.Identity.html index a435a98dd9..29a186601e 100644 --- a/master/Algebra.Morphism.Construct.Identity.html +++ b/master/Algebra.Morphism.Construct.Identity.html @@ -27,7 +27,7 @@ import Function.Construct.Identity as Id open import Level using (Level) open import Relation.Binary.Morphism.Construct.Identity using (isRelHomomorphism) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) private variable @@ -36,7 +36,7 @@ ------------------------------------------------------------------------ -- Magmas -module _ (M : RawMagma c ) (open RawMagma M) (refl : Reflexive _≈_) where +module _ (M : RawMagma c ) (open RawMagma M) (refl : Reflexive _≈_) where open MagmaMorphisms M M isMagmaHomomorphism : IsMagmaHomomorphism id @@ -60,7 +60,7 @@ ------------------------------------------------------------------------ -- Monoids -module _ (M : RawMonoid c ) (open RawMonoid M) (refl : Reflexive _≈_) where +module _ (M : RawMonoid c ) (open RawMonoid M) (refl : Reflexive _≈_) where open MonoidMorphisms M M isMonoidHomomorphism : IsMonoidHomomorphism id @@ -84,7 +84,7 @@ ------------------------------------------------------------------------ -- Groups -module _ (G : RawGroup c ) (open RawGroup G) (refl : Reflexive _≈_) where +module _ (G : RawGroup c ) (open RawGroup G) (refl : Reflexive _≈_) where open GroupMorphisms G G isGroupHomomorphism : IsGroupHomomorphism id @@ -108,7 +108,7 @@ ------------------------------------------------------------------------ -- Near semirings -module _ (R : RawNearSemiring c ) (open RawNearSemiring R) (refl : Reflexive _≈_) where +module _ (R : RawNearSemiring c ) (open RawNearSemiring R) (refl : Reflexive _≈_) where open NearSemiringMorphisms R R isNearSemiringHomomorphism : IsNearSemiringHomomorphism id @@ -132,7 +132,7 @@ ------------------------------------------------------------------------ -- Semirings -module _ (R : RawSemiring c ) (open RawSemiring R) (refl : Reflexive _≈_) where +module _ (R : RawSemiring c ) (open RawSemiring R) (refl : Reflexive _≈_) where open SemiringMorphisms R R isSemiringHomomorphism : IsSemiringHomomorphism id @@ -156,7 +156,7 @@ ------------------------------------------------------------------------ -- RingWithoutOne -module _ (R : RawRingWithoutOne c ) (open RawRingWithoutOne R) (refl : Reflexive _≈_) where +module _ (R : RawRingWithoutOne c ) (open RawRingWithoutOne R) (refl : Reflexive _≈_) where open RingWithoutOneMorphisms R R isRingWithoutOneHomomorphism : IsRingWithoutOneHomomorphism id @@ -180,7 +180,7 @@ ------------------------------------------------------------------------ -- Rings -module _ (R : RawRing c ) (open RawRing R) (refl : Reflexive _≈_) where +module _ (R : RawRing c ) (open RawRing R) (refl : Reflexive _≈_) where open RingMorphisms R R isRingHomomorphism : IsRingHomomorphism id @@ -204,7 +204,7 @@ ------------------------------------------------------------------------ -- Quasigroup -module _ (Q : RawQuasigroup c ) (open RawQuasigroup Q) (refl : Reflexive _≈_) where +module _ (Q : RawQuasigroup c ) (open RawQuasigroup Q) (refl : Reflexive _≈_) where open QuasigroupMorphisms Q Q isQuasigroupHomomorphism : IsQuasigroupHomomorphism id @@ -230,7 +230,7 @@ ------------------------------------------------------------------------ -- Loop -module _ (L : RawLoop c ) (open RawLoop L) (refl : Reflexive _≈_) where +module _ (L : RawLoop c ) (open RawLoop L) (refl : Reflexive _≈_) where open LoopMorphisms L L isLoopHomomorphism : IsLoopHomomorphism id @@ -254,7 +254,7 @@ ------------------------------------------------------------------------ -- KleeneAlgebra -module _ (K : RawKleeneAlgebra c ) (open RawKleeneAlgebra K) (refl : Reflexive _≈_) where +module _ (K : RawKleeneAlgebra c ) (open RawKleeneAlgebra K) (refl : Reflexive _≈_) where open KleeneAlgebraMorphisms K K isKleeneAlgebraHomomorphism : IsKleeneAlgebraHomomorphism id diff --git a/master/Algebra.Properties.CancellativeCommutativeSemiring.html b/master/Algebra.Properties.CancellativeCommutativeSemiring.html index fe42a3be47..c3bbc26011 100644 --- a/master/Algebra.Properties.CancellativeCommutativeSemiring.html +++ b/master/Algebra.Properties.CancellativeCommutativeSemiring.html @@ -10,9 +10,9 @@ open import Algebra using (CancellativeCommutativeSemiring) open import Algebra.Definitions using (AlmostRightCancellative) open import Data.Sum.Base using (_⊎_; inj₁; inj₂) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Negation using (contradiction) module Algebra.Properties.CancellativeCommutativeSemiring {a } (R : CancellativeCommutativeSemiring a ) @@ -25,16 +25,16 @@ *-almostCancelʳ : AlmostRightCancellative _≈_ 0# _*_ *-almostCancelʳ = comm+almostCancelˡ⇒almostCancelʳ *-comm *-cancelˡ-nonZero -xy≈0⇒x≈0∨y≈0 : Decidable _≈_ {x y} x * y 0# x 0# y 0# +xy≈0⇒x≈0∨y≈0 : Decidable _≈_ {x y} x * y 0# x 0# y 0# xy≈0⇒x≈0∨y≈0 _≟_ {x} {y} xy≈0 with x 0# | y 0# -... | yes x≈0 | _ = inj₁ x≈0 -... | no _ | yes y≈0 = inj₂ y≈0 -... | no x≉0 | no y≉0 = contradiction y≈0 y≉0 +... | yes x≈0 | _ = inj₁ x≈0 +... | no _ | yes y≈0 = inj₂ y≈0 +... | no x≉0 | no y≉0 = contradiction y≈0 y≉0 where xy≈x*0 = trans xy≈0 (sym (zeroʳ x)) y≈0 = *-cancelˡ-nonZero _ y 0# x≉0 xy≈x*0 -x≉0∧y≉0⇒xy≉0 : Decidable _≈_ {x y} x 0# y 0# x * y 0# +x≉0∧y≉0⇒xy≉0 : Decidable _≈_ {x y} x 0# y 0# x * y 0# x≉0∧y≉0⇒xy≉0 _≟_ x≉0 y≉0 xy≈0 with xy≈0⇒x≈0∨y≈0 _≟_ xy≈0 ... | inj₁ x≈0 = x≉0 x≈0 ... | inj₂ y≈0 = y≉0 y≈0 diff --git a/master/Algebra.Properties.CommutativeMonoid.Sum.html b/master/Algebra.Properties.CommutativeMonoid.Sum.html index d0d48dd7c5..fa15f8426d 100644 --- a/master/Algebra.Properties.CommutativeMonoid.Sum.html +++ b/master/Algebra.Properties.CommutativeMonoid.Sum.html @@ -16,7 +16,7 @@ open import Data.Vec.Functional open import Function.Base using (_∘_) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Negation using (contradiction) module Algebra.Properties.CommutativeMonoid.Sum {a } (M : CommutativeMonoid a ) where @@ -87,8 +87,8 @@ -- Summation is insensitive to permutations of the input sum-permute : {m n} f (π : Permutation m n) sum f sum (rearrange (π ⟨$⟩ʳ_) f) sum-permute {zero} {zero} f π = refl -sum-permute {zero} {suc n} f π = contradiction π (Perm.refute λ()) -sum-permute {suc m} {zero} f π = contradiction π (Perm.refute λ()) +sum-permute {zero} {suc n} f π = contradiction π (Perm.refute λ()) +sum-permute {suc m} {zero} f π = contradiction π (Perm.refute λ()) sum-permute {suc m} {suc n} f π = begin sum f ≡⟨⟩ f 0F + sum f/0 ≡⟨ ≡.cong (_+ sum f/0) (≡.cong f (Perm.inverseʳ π)) diff --git a/master/Algebra.Properties.Magma.Divisibility.html b/master/Algebra.Properties.Magma.Divisibility.html index 775a438e77..2fc39532d4 100644 --- a/master/Algebra.Properties.Magma.Divisibility.html +++ b/master/Algebra.Properties.Magma.Divisibility.html @@ -24,13 +24,13 @@ ------------------------------------------------------------------------ -- Properties of divisibility -∣-respʳ : _∣_ Respectsʳ _≈_ +∣-respʳ : _∣_ Respectsʳ _≈_ ∣-respʳ y≈z (q , qx≈y) = q , trans qx≈y y≈z -∣-respˡ : _∣_ Respectsˡ _≈_ +∣-respˡ : _∣_ Respectsˡ _≈_ ∣-respˡ x≈z (q , qx≈y) = q , trans (∙-congˡ (sym x≈z)) qx≈y -∣-resp : _∣_ Respects₂ _≈_ +∣-resp : _∣_ Respects₂ _≈_ ∣-resp = ∣-respʳ , ∣-respˡ x∣yx : x y x y x @@ -42,15 +42,15 @@ ------------------------------------------------------------------------ -- Properties of mutual divisibility _∣∣_ -∣∣-sym : Symmetric _∣∣_ +∣∣-sym : Symmetric _∣∣_ ∣∣-sym = swap -∣∣-respʳ-≈ : _∣∣_ Respectsʳ _≈_ +∣∣-respʳ-≈ : _∣∣_ Respectsʳ _≈_ ∣∣-respʳ-≈ y≈z (x∣y , y∣x) = ∣-respʳ y≈z x∣y , ∣-respˡ y≈z y∣x -∣∣-respˡ-≈ : _∣∣_ Respectsˡ _≈_ +∣∣-respˡ-≈ : _∣∣_ Respectsˡ _≈_ ∣∣-respˡ-≈ x≈z (x∣y , y∣x) = ∣-respˡ x≈z x∣y , ∣-respʳ x≈z y∣x -∣∣-resp-≈ : _∣∣_ Respects₂ _≈_ +∣∣-resp-≈ : _∣∣_ Respects₂ _≈_ ∣∣-resp-≈ = ∣∣-respʳ-≈ , ∣∣-respˡ-≈ \ No newline at end of file diff --git a/master/Algebra.Properties.Monoid.Divisibility.html b/master/Algebra.Properties.Monoid.Divisibility.html index 82d33f2f3b..da7c12b118 100644 --- a/master/Algebra.Properties.Monoid.Divisibility.html +++ b/master/Algebra.Properties.Monoid.Divisibility.html @@ -12,7 +12,7 @@ open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Preorder) open import Relation.Binary.Structures using (IsPreorder; IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) module Algebra.Properties.Monoid.Divisibility {a } (M : Monoid a ) where @@ -32,7 +32,7 @@ ε∣_ : x ε x ε∣ x = x , identityʳ x -∣-refl : Reflexive _∣_ +∣-refl : Reflexive _∣_ ∣-refl {x} = ε , identityˡ x ∣-reflexive : _≈_ _∣_ @@ -53,7 +53,7 @@ ------------------------------------------------------------------------ -- Properties of mutual divisibiity -∣∣-refl : Reflexive _∣∣_ +∣∣-refl : Reflexive _∣∣_ ∣∣-refl = ∣-refl , ∣-refl ∣∣-reflexive : _≈_ _∣∣_ diff --git a/master/Algebra.Properties.Semigroup.Divisibility.html b/master/Algebra.Properties.Semigroup.Divisibility.html index 4f2e971ef7..38edca82a9 100644 --- a/master/Algebra.Properties.Semigroup.Divisibility.html +++ b/master/Algebra.Properties.Semigroup.Divisibility.html @@ -9,7 +9,7 @@ open import Algebra using (Semigroup) open import Data.Product.Base using (_,_) -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) module Algebra.Properties.Semigroup.Divisibility {a } (S : Semigroup a ) where @@ -24,13 +24,13 @@ ------------------------------------------------------------------------ -- Properties of _∣_ -∣-trans : Transitive _∣_ +∣-trans : Transitive _∣_ ∣-trans (p , px≈y) (q , qy≈z) = q p , trans (assoc q p _) (trans (∙-congˡ px≈y) qy≈z) ------------------------------------------------------------------------ -- Properties of _∣∣_ -∣∣-trans : Transitive _∣∣_ +∣∣-trans : Transitive _∣∣_ ∣∣-trans (x∣y , y∣x) (y∣z , z∣y) = ∣-trans x∣y y∣z , ∣-trans z∣y y∣x \ No newline at end of file diff --git a/master/Algebra.Properties.Semiring.Primality.html b/master/Algebra.Properties.Semiring.Primality.html index 8bcfbbe7d5..d60dc7a863 100644 --- a/master/Algebra.Properties.Semiring.Primality.html +++ b/master/Algebra.Properties.Semiring.Primality.html @@ -10,7 +10,7 @@ open import Algebra using (Semiring) open import Data.Sum.Base using (reduce) open import Function.Base using (flip) -open import Relation.Binary.Definitions using (Symmetric) +open import Relation.Binary.Definitions using (Symmetric) module Algebra.Properties.Semiring.Primality {a } (R : Semiring a ) @@ -28,7 +28,7 @@ ------------------------------------------------------------------------ -- Properties of Coprime -Coprime-sym : Symmetric Coprime +Coprime-sym : Symmetric Coprime Coprime-sym coprime = flip coprime ∣1⇒Coprime : {x} y x 1# Coprime x y diff --git a/master/Algebra.Solver.CommutativeMonoid.html b/master/Algebra.Solver.CommutativeMonoid.html index 9cee787188..b6fdfa9422 100644 --- a/master/Algebra.Solver.CommutativeMonoid.html +++ b/master/Algebra.Solver.CommutativeMonoid.html @@ -29,7 +29,7 @@ import Data.Vec.Relation.Binary.Pointwise.Inductive as Pointwise open import Relation.Binary.PropositionalEquality.Core as using (_≡_) -open import Relation.Nullary.Decidable using (Dec) +open import Relation.Nullary.Decidable using (Dec) open CommutativeMonoid M open ≈-Reasoning setoid @@ -176,8 +176,8 @@ infix 5 _≟_ -_≟_ : (nf₁ nf₂ : Normal n) Dec (nf₁ nf₂) -nf₁ nf₂ = Dec.map Pointwise-≡↔≡ (decidable ℕ._≟_ nf₁ nf₂) +_≟_ : (nf₁ nf₂ : Normal n) Dec (nf₁ nf₂) +nf₁ nf₂ = Dec.map Pointwise-≡↔≡ (decidable ℕ._≟_ nf₁ nf₂) where open Pointwise -- We can also give a sound, but not necessarily complete, procedure diff --git a/master/Algebra.Solver.IdempotentCommutativeMonoid.html b/master/Algebra.Solver.IdempotentCommutativeMonoid.html index 8d0e66317d..72590b58b5 100644 --- a/master/Algebra.Solver.IdempotentCommutativeMonoid.html +++ b/master/Algebra.Solver.IdempotentCommutativeMonoid.html @@ -28,7 +28,7 @@ open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.PropositionalEquality.Properties using (decSetoid) -open import Relation.Nullary.Decidable using (Dec) +open import Relation.Nullary.Decidable using (Dec) module Algebra.Solver.IdempotentCommutativeMonoid {m₁ m₂} (M : IdempotentCommutativeMonoid m₁ m₂) where @@ -190,8 +190,8 @@ infix 5 _≟_ -_≟_ : (nf₁ nf₂ : Normal n) Dec (nf₁ nf₂) -nf₁ nf₂ = Dec.map Pointwise-≡↔≡ (decidable Bool._≟_ nf₁ nf₂) +_≟_ : (nf₁ nf₂ : Normal n) Dec (nf₁ nf₂) +nf₁ nf₂ = Dec.map Pointwise-≡↔≡ (decidable Bool._≟_ nf₁ nf₂) where open Pointwise -- We can also give a sound, but not necessarily complete, procedure diff --git a/master/Algebra.Solver.Monoid.html b/master/Algebra.Solver.Monoid.html index ef2e0508f5..316b9fa0e0 100644 --- a/master/Algebra.Solver.Monoid.html +++ b/master/Algebra.Solver.Monoid.html @@ -21,7 +21,7 @@ open import Data.Product.Base using (_×_; uncurry) open import Data.Vec.Base using (Vec; lookup) open import Function.Base using (_∘_; _$_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) import Relation.Binary.Reflection @@ -115,8 +115,8 @@ infix 5 _≟_ -_≟_ : {n} DecidableEquality (Normal n) -nf₁ nf₂ = Dec.map′ ≋⇒≡ ≡⇒≋ (nf₁ ≋? nf₂) +_≟_ : {n} DecidableEquality (Normal n) +nf₁ nf₂ = Dec.map′ ≋⇒≡ ≡⇒≋ (nf₁ ≋? nf₂) where open ListEq Fin._≟_ -- We can also give a sound, but not necessarily complete, procedure diff --git a/master/Algebra.Solver.Ring.Simple.html b/master/Algebra.Solver.Ring.Simple.html index 3138973df4..ef37e99129 100644 --- a/master/Algebra.Solver.Ring.Simple.html +++ b/master/Algebra.Solver.Ring.Simple.html @@ -9,12 +9,12 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Algebra.Solver.Ring.AlmostCommutativeRing -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.Consequences using (dec⇒weaklyDec) module Algebra.Solver.Ring.Simple {r₁ r₂} (R : AlmostCommutativeRing r₁ r₂) - (_≟_ : Decidable (AlmostCommutativeRing._≈_ R)) + (_≟_ : Decidable (AlmostCommutativeRing._≈_ R)) where open AlmostCommutativeRing R diff --git a/master/Algebra.Solver.Ring.html b/master/Algebra.Solver.Ring.html index 4055a8092e..78ef876799 100644 --- a/master/Algebra.Solver.Ring.html +++ b/master/Algebra.Solver.Ring.html @@ -20,14 +20,14 @@ open import Algebra.Bundles open import Algebra.Solver.Ring.AlmostCommutativeRing -open import Relation.Binary.Definitions using (WeaklyDecidable) +open import Relation.Binary.Definitions using (WeaklyDecidable) module Algebra.Solver.Ring {r₁ r₂ r₃ r₄} (Coeff : RawRing r₁ r₄) -- Coefficient "ring". (R : AlmostCommutativeRing r₂ r₃) -- Main "ring". (morphism : Coeff -Raw-AlmostCommutative⟶ R) - (_coeff≟_ : WeaklyDecidable (Induced-equivalence morphism)) + (_coeff≟_ : WeaklyDecidable (Induced-equivalence morphism)) where open import Algebra.Core @@ -40,7 +40,7 @@ open _-Raw-AlmostCommutative⟶_ morphism renaming (⟦_⟧ to ⟦_⟧′) open import Algebra.Properties.Semiring.Exp semiring -open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Decidable using (yes; no) open import Relation.Binary.Reasoning.Setoid setoid import Relation.Binary.PropositionalEquality.Core as import Relation.Binary.Reflection as Reflection @@ -178,7 +178,7 @@ infix 4 _≟H_ _≟N_ - _≟H_ : {n} WeaklyDecidable (_≈H_ {n = n}) + _≟H_ : {n} WeaklyDecidable (_≈H_ {n = n}) ≟H = just ≟H (_ *x+ _) = nothing (_ *x+ _) ≟H = nothing @@ -187,7 +187,7 @@ ... | _ | nothing = nothing ... | nothing | _ = nothing - _≟N_ : {n} WeaklyDecidable (_≈N_ {n = n}) + _≟N_ : {n} WeaklyDecidable (_≈N_ {n = n}) con c₁ ≟N con c₂ with c₁ coeff≟ c₂ ... | just c₁≈c₂ = just (con c₁≈c₂) ... | nothing = nothing diff --git a/master/Axiom.DoubleNegationElimination.html b/master/Axiom.DoubleNegationElimination.html index ff44816426..fa9beedd61 100644 --- a/master/Axiom.DoubleNegationElimination.html +++ b/master/Axiom.DoubleNegationElimination.html @@ -22,7 +22,7 @@ -- if a property is not not true then it is true. DoubleNegationElimination : ( : Level) Set (suc ) -DoubleNegationElimination = {P : Set } ¬ ¬ P P +DoubleNegationElimination = {P : Set } ¬ ¬ P P ------------------------------------------------------------------------ -- Properties @@ -30,8 +30,8 @@ -- Double negation elimination is equivalent to excluded middle em⇒dne : {} ExcludedMiddle DoubleNegationElimination -em⇒dne em = decidable-stable em +em⇒dne em = decidable-stable em dne⇒em : {} DoubleNegationElimination ExcludedMiddle -dne⇒em dne = dne ¬¬-excluded-middle +dne⇒em dne = dne ¬¬-excluded-middle \ No newline at end of file diff --git a/master/Axiom.ExcludedMiddle.html b/master/Axiom.ExcludedMiddle.html index 6080df0154..70bc344c0f 100644 --- a/master/Axiom.ExcludedMiddle.html +++ b/master/Axiom.ExcludedMiddle.html @@ -19,5 +19,5 @@ -- statement/set is decidable (i.e. it either holds or it doesn't hold). ExcludedMiddle : ( : Level) Set (suc ) -ExcludedMiddle = {P : Set } Dec P +ExcludedMiddle = {P : Set } Dec P \ No newline at end of file diff --git a/master/Axiom.UniquenessOfIdentityProofs.WithK.html b/master/Axiom.UniquenessOfIdentityProofs.WithK.html index ef63f16cd0..3f1c4ab513 100644 --- a/master/Axiom.UniquenessOfIdentityProofs.WithK.html +++ b/master/Axiom.UniquenessOfIdentityProofs.WithK.html @@ -14,6 +14,6 @@ -- Axiom K implies UIP. -uip : {a} {A : Set a} UIP A +uip : {a} {A : Set a} UIP A uip refl refl = refl \ No newline at end of file diff --git a/master/Axiom.UniquenessOfIdentityProofs.html b/master/Axiom.UniquenessOfIdentityProofs.html index 1e9e60948c..7dc15f5e62 100644 --- a/master/Axiom.UniquenessOfIdentityProofs.html +++ b/master/Axiom.UniquenessOfIdentityProofs.html @@ -9,71 +9,70 @@ module Axiom.UniquenessOfIdentityProofs where -open import Data.Bool.Base using (true; false) -open import Data.Empty -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary hiding (Irrelevant) -open import Relation.Binary.Core -open import Relation.Binary.Definitions -open import Relation.Binary.PropositionalEquality.Core -open import Relation.Binary.PropositionalEquality.Properties - ------------------------------------------------------------------------- --- Definition --- --- Uniqueness of Identity Proofs (UIP) states that all proofs of --- equality are themselves equal. In other words, the equality relation --- is irrelevant. Here we define UIP relative to a given type. - -UIP : {a} (A : Set a) Set a -UIP A = Irrelevant {A = A} _≡_ - ------------------------------------------------------------------------- --- Properties - --- UIP always holds when using axiom K --- (see `Axiom.UniquenessOfIdentityProofs.WithK`). - --- The existence of a constant function over proofs of equality for --- elements in A is enough to prove UIP for A. Indeed, we can relate any --- proof to its image via this function which we then know is equal to --- the image of any other proof. - -module Constant⇒UIP - {a} {A : Set a} (f : _≡_ {A = A} _≡_) - (f-constant : {a b} (p q : a b) f p f q) - where - - ≡-canonical : {a b} (p : a b) trans (sym (f refl)) (f p) p - ≡-canonical refl = trans-symˡ (f refl) - - ≡-irrelevant : UIP A - ≡-irrelevant p q = begin - p ≡⟨ sym (≡-canonical p) - trans (sym (f refl)) (f p) ≡⟨ cong (trans _) (f-constant p q) - trans (sym (f refl)) (f q) ≡⟨ ≡-canonical q - q - where open ≡-Reasoning - --- If equality is decidable for a given type, then we can prove UIP for --- that type. Indeed, the decision procedure allows us to define a --- function over proofs of equality which is constant: it returns the --- proof produced by the decision procedure. - -module Decidable⇒UIP - {a} {A : Set a} (_≟_ : DecidableEquality A) - where - - ≡-normalise : _≡_ {A = A} _≡_ - ≡-normalise {a} {b} a≡b with a b - ... | true because [p] = invert [p] - ... | false because [¬p] = ⊥-elim (invert [¬p] a≡b) - - ≡-normalise-constant : {a b} (p q : a b) ≡-normalise p ≡-normalise q - ≡-normalise-constant {a} {b} p q with a b - ... | true because _ = refl - ... | false because [¬p] = ⊥-elim (invert [¬p] p) - - ≡-irrelevant : UIP A - ≡-irrelevant = Constant⇒UIP.≡-irrelevant ≡-normalise ≡-normalise-constant +open import Level using (Level) +open import Relation.Nullary.Decidable.Core using (recompute; recompute-constant) +open import Relation.Binary.Core +open import Relation.Binary.Definitions +open import Relation.Binary.PropositionalEquality.Core +open import Relation.Binary.PropositionalEquality.Properties + +private + variable + a : Level + A : Set a + x y : A + +------------------------------------------------------------------------ +-- Definition +-- +-- Uniqueness of Identity Proofs (UIP) states that all proofs of +-- equality are themselves equal. In other words, the equality relation +-- is irrelevant. Here we define UIP relative to a given type. + +UIP : (A : Set a) Set a +UIP A = Irrelevant {A = A} _≡_ + +------------------------------------------------------------------------ +-- Properties + +-- UIP always holds when using axiom K +-- (see `Axiom.UniquenessOfIdentityProofs.WithK`). + +-- The existence of a constant function over proofs of equality for +-- elements in A is enough to prove UIP for A. Indeed, we can relate any +-- proof to its image via this function which we then know is equal to +-- the image of any other proof. + +module Constant⇒UIP + (f : _≡_ {A = A} _≡_) + (f-constant : {x y} (p q : x y) f p f q) + where + + ≡-canonical : (p : x y) trans (sym (f refl)) (f p) p + ≡-canonical refl = trans-symˡ (f refl) + + ≡-irrelevant : UIP A + ≡-irrelevant p q = begin + p ≡⟨ sym (≡-canonical p) + trans (sym (f refl)) (f p) ≡⟨ cong (trans _) (f-constant p q) + trans (sym (f refl)) (f q) ≡⟨ ≡-canonical q + q + where open ≡-Reasoning + +-- If equality is decidable for a given type, then we can prove UIP for +-- that type. Indeed, the decision procedure allows us to define a +-- function over proofs of equality which is constant: it returns the +-- proof produced by the decision procedure. + +module Decidable⇒UIP (_≟_ : DecidableEquality A) + where + + ≡-normalise : _≡_ {A = A} _≡_ + ≡-normalise {x} {y} x≡y = recompute (x y) x≡y + + ≡-normalise-constant : (p q : x y) ≡-normalise p ≡-normalise q + ≡-normalise-constant {x = x} {y = y} = recompute-constant (x y) + + ≡-irrelevant : UIP A + ≡-irrelevant = Constant⇒UIP.≡-irrelevant ≡-normalise ≡-normalise-constant \ No newline at end of file diff --git a/master/Codata.Guarded.Stream.Relation.Binary.Pointwise.html b/master/Codata.Guarded.Stream.Relation.Binary.Pointwise.html index 72a854769b..4c1aea8e9a 100644 --- a/master/Codata.Guarded.Stream.Relation.Binary.Pointwise.html +++ b/master/Codata.Guarded.Stream.Relation.Binary.Pointwise.html @@ -16,7 +16,7 @@ open import Relation.Binary.Core using (REL; _⇒_) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Definitions - using (Reflexive; Sym; Trans; Antisym; Symmetric; Transitive) + using (Reflexive; Sym; Trans; Antisym; Symmetric; Transitive) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) import Relation.Binary.PropositionalEquality.Properties as @@ -51,15 +51,15 @@ head (map R⇒S xs) = R⇒S (head xs) tail (map R⇒S xs) = map R⇒S (tail xs) -reflexive : Reflexive R Reflexive (Pointwise R) +reflexive : Reflexive R Reflexive (Pointwise R) head (reflexive R-refl) = R-refl tail (reflexive R-refl) = reflexive R-refl -symmetric : Sym R S Sym (Pointwise R) (Pointwise S) +symmetric : Sym R S Sym (Pointwise R) (Pointwise S) head (symmetric R-sym-S xsRys) = R-sym-S (head xsRys) tail (symmetric R-sym-S xsRys) = symmetric R-sym-S (tail xsRys) -transitive : Trans R S T Trans (Pointwise R) (Pointwise S) (Pointwise T) +transitive : Trans R S T Trans (Pointwise R) (Pointwise S) (Pointwise T) head (transitive RST-trans xsRys ysSzs) = RST-trans (head xsRys) (head ysSzs) tail (transitive RST-trans xsRys ysSzs) = transitive RST-trans (tail xsRys) (tail ysSzs) @@ -75,7 +75,7 @@ { isEquivalence = isEquivalence (Setoid.isEquivalence S) } -antisymmetric : Antisym R S T Antisym (Pointwise R) (Pointwise S) (Pointwise T) +antisymmetric : Antisym R S T Antisym (Pointwise R) (Pointwise S) (Pointwise T) head (antisymmetric RST-antisym xsRys ysSxs) = RST-antisym (head xsRys) (head ysSxs) tail (antisymmetric RST-antisym xsRys ysSxs) = antisymmetric RST-antisym (tail xsRys) (tail ysSxs) @@ -114,13 +114,13 @@ _≈_ : Stream A Stream A Set a _≈_ = Pointwise _≡_ - refl : Reflexive _≈_ + refl : Reflexive _≈_ refl = reflexive ≡.refl - sym : Symmetric _≈_ + sym : Symmetric _≈_ sym = symmetric ≡.sym - trans : Transitive _≈_ + trans : Transitive _≈_ trans = transitive ≡.trans ≈-setoid : Setoid _ _ diff --git a/master/Codata.Guarded.Stream.Relation.Unary.All.html b/master/Codata.Guarded.Stream.Relation.Unary.All.html index 53138b4a61..5564077ed3 100644 --- a/master/Codata.Guarded.Stream.Relation.Unary.All.html +++ b/master/Codata.Guarded.Stream.Relation.Unary.All.html @@ -18,12 +18,12 @@ variable a p : Level A : Set a - P Q R : Pred A p + P Q R : Pred A p xs : Stream A infixr 5 _∷_ -record All (P : Pred A ) (as : Stream A) : Set where +record All (P : Pred A ) (as : Stream A) : Set where coinductive constructor _∷_ field @@ -32,15 +32,15 @@ open All public -map : P Q All P All Q +map : P Q All P All Q head (map f xs) = f (head xs) tail (map f xs) = map f (tail xs) -zipWith : P Q R All P All Q All R +zipWith : P Q R All P All Q All R head (zipWith f (ps , qs)) = f (head ps , head qs) tail (zipWith f (ps , qs)) = zipWith f (tail ps , tail qs) -unzipWith : R P Q All R All P All Q +unzipWith : R P Q All R All P All Q head (proj₁ (unzipWith f rs)) = proj₁ (f (head rs)) tail (proj₁ (unzipWith f rs)) = proj₁ (unzipWith f (tail rs)) head (proj₂ (unzipWith f rs)) = proj₂ (f (head rs)) diff --git a/master/Codata.Guarded.Stream.Relation.Unary.Any.html b/master/Codata.Guarded.Stream.Relation.Unary.Any.html index 9a67e7fec3..129201d33d 100644 --- a/master/Codata.Guarded.Stream.Relation.Unary.Any.html +++ b/master/Codata.Guarded.Stream.Relation.Unary.Any.html @@ -20,22 +20,22 @@ variable a p q : Level A : Set a - P Q : Pred A p + P Q : Pred A p xs : Stream A -data Any {A : Set a} (P : Pred A p) : Stream A Set (a p) where +data Any {A : Set a} (P : Pred A p) : Stream A Set (a p) where here : {xs} P (Stream.head xs) Any P xs there : {xs} Any P (Stream.tail xs) Any P xs -head : ¬ Any P (Stream.tail xs) Any P xs P (Stream.head xs) +head : ¬ Any P (Stream.tail xs) Any P xs P (Stream.head xs) head ¬t (here h) = h head ¬t (there t) = ⊥-elim (¬t t) -tail : ¬ P (Stream.head xs) Any P xs Any P (Stream.tail xs) +tail : ¬ P (Stream.head xs) Any P xs Any P (Stream.tail xs) tail ¬h (here h) = ⊥-elim (¬h h) tail ¬h (there t) = t -map : P Q Any P Any Q +map : P Q Any P Any Q map g (here px ) = here (g px) map g (there pxs) = there (map g pxs) @@ -43,6 +43,6 @@ index (here px ) = zero index (there pxs) = suc (index pxs) -lookup : {P : Pred A p} Any P xs A +lookup : {P : Pred A p} Any P xs A lookup {xs = xs} p = Stream.lookup xs (index p) \ No newline at end of file diff --git a/master/Codata.Musical.Colist.Bisimilarity.html b/master/Codata.Musical.Colist.Bisimilarity.html index 07c38fe7a5..3d73cbfe88 100644 --- a/master/Codata.Musical.Colist.Bisimilarity.html +++ b/master/Codata.Musical.Colist.Bisimilarity.html @@ -15,7 +15,7 @@ open import Relation.Binary.Core using (Rel; _=[_]⇒_) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) private variable @@ -46,15 +46,15 @@ } } where - refl : Reflexive _≈_ + refl : Reflexive _≈_ refl {[]} = [] refl {x xs} = x refl - sym : Symmetric _≈_ + sym : Symmetric _≈_ sym [] = [] sym (x xs≈) = x sym ( xs≈) - trans : Transitive _≈_ + trans : Transitive _≈_ trans [] [] = [] trans (x xs≈) (.x ys≈) = x trans ( xs≈) ( ys≈) diff --git a/master/Codata.Musical.Colist.Infinite-merge.html b/master/Codata.Musical.Colist.Infinite-merge.html index 21c8dafb98..9c21e8d91c 100644 --- a/master/Codata.Musical.Colist.Infinite-merge.html +++ b/master/Codata.Musical.Colist.Infinite-merge.html @@ -24,7 +24,7 @@ import Function.Related.Propositional as Related open import Function.Related.TypeIsomorphisms open import Level -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) import Induction.WellFounded as WF open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) open import Relation.Binary.PropositionalEquality.Properties @@ -35,7 +35,7 @@ variable a p : Level A : Set a - P : Pred A p + P : Pred A p ------------------------------------------------------------------------ -- Some code that is used to work around Agda's syntactic guardedness diff --git a/master/Codata.Musical.Colist.Relation.Unary.All.Properties.html b/master/Codata.Musical.Colist.Relation.Unary.All.Properties.html index e3b9a5a52b..22c95e3927 100644 --- a/master/Codata.Musical.Colist.Relation.Unary.All.Properties.html +++ b/master/Codata.Musical.Colist.Relation.Unary.All.Properties.html @@ -15,14 +15,14 @@ open import Function.Base using (_∋_) open import Level using (Level; _⊔_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable a b p : Level A : Set a B : Set b - P : Pred A p + P : Pred A p ∷-injectiveˡ : {x xs px qx pxs qxs} (All P (x xs) px pxs) qx qxs px qx diff --git a/master/Codata.Musical.Colist.Relation.Unary.All.html b/master/Codata.Musical.Colist.Relation.Unary.All.html index b5ec5de3cb..77e2445886 100644 --- a/master/Codata.Musical.Colist.Relation.Unary.All.html +++ b/master/Codata.Musical.Colist.Relation.Unary.All.html @@ -12,16 +12,16 @@ open import Codata.Musical.Colist.Base open import Codata.Musical.Notation open import Level using (Level; _⊔_) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable a b p : Level A : Set a B : Set b - P : Pred A p + P : Pred A p -data All {A : Set a} (P : Pred A p) : Pred (Colist A) (a p) where +data All {A : Set a} (P : Pred A p) : Pred (Colist A) (a p) where [] : All P [] _∷_ : {x xs} (px : P x) (pxs : (All P ( xs))) All P (x xs) diff --git a/master/Codata.Musical.Colist.Relation.Unary.Any.Properties.html b/master/Codata.Musical.Colist.Relation.Unary.Any.Properties.html index 376d448a3e..4f6397f376 100644 --- a/master/Codata.Musical.Colist.Relation.Unary.Any.Properties.html +++ b/master/Codata.Musical.Colist.Relation.Unary.Any.Properties.html @@ -24,15 +24,15 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable a b p q : Level A : Set a B : Set b - P : Pred A p - Q : Pred A q + P : Pred A p + Q : Pred A q ------------------------------------------------------------------------ -- Equality properties diff --git a/master/Codata.Musical.Colist.Relation.Unary.Any.html b/master/Codata.Musical.Colist.Relation.Unary.Any.html index a9c4cfc82a..62914e1c37 100644 --- a/master/Codata.Musical.Colist.Relation.Unary.Any.html +++ b/master/Codata.Musical.Colist.Relation.Unary.Any.html @@ -15,16 +15,16 @@ open import Function.Base using (_∋_) open import Level using (Level; _⊔_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable a b p : Level A : Set a B : Set b - P : Pred A p + P : Pred A p -data Any {A : Set a} (P : Pred A p) : Pred (Colist A) (a p) where +data Any {A : Set a} (P : Pred A p) : Pred (Colist A) (a p) where here : {x xs} (px : P x) Any P (x xs) there : {x xs} (pxs : Any P ( xs)) Any P (x xs) diff --git a/master/Codata.Musical.Colist.html b/master/Codata.Musical.Colist.html index 94fe19b1ca..d754366788 100644 --- a/master/Codata.Musical.Colist.html +++ b/master/Codata.Musical.Colist.html @@ -30,24 +30,24 @@ open import Level using (_⊔_) open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Bundles using (Poset; Setoid; Preorder) -open import Relation.Binary.Definitions using (Transitive; Antisymmetric) +open import Relation.Binary.Definitions using (Transitive; Antisymmetric) import Relation.Binary.Construct.FromRel as Ind import Relation.Binary.Reasoning.Preorder as ≲-Reasoning import Relation.Binary.Reasoning.PartialOrder as ≤-Reasoning open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) open import Relation.Binary.Reasoning.Syntax -open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary.Reflects using (invert) open import Relation.Nullary open import Relation.Nullary.Negation -open import Relation.Nullary.Decidable using (¬¬-excluded-middle) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Decidable using (¬¬-excluded-middle) +open import Relation.Unary using (Pred) private variable a b p : Level A : Set a B : Set b - P : Pred A p + P : Pred A p ------------------------------------------------------------------------ -- Re-export type and basic definitions @@ -70,7 +70,7 @@ module ¬¬Monad {a} where - open RawMonad (¬¬-Monad {a}) public + open RawMonad (¬¬-Monad {a}) public open ¬¬Monad -- we don't want the RawMonad content to be opened publicly ------------------------------------------------------------------------ @@ -153,14 +153,14 @@ reflexive [] = [] reflexive (x xs≈) = x reflexive ( xs≈) - trans : Transitive _⊑_ + trans : Transitive _⊑_ trans [] _ = [] trans (x xs≈) (.x ys≈) = x trans ( xs≈) ( ys≈) tail : {x xs y ys} x xs y ys xs ys tail (_ p) = p - antisym : Antisymmetric _≈_ _⊑_ + antisym : Antisymmetric _≈_ _⊑_ antisym [] [] = [] antisym (x p₁) p₂ = x antisym ( p₁) (tail p₂) @@ -236,21 +236,21 @@ -- Colists which are not finite are infinite. not-finite-is-infinite : - (xs : Colist A) ¬ Finite xs Infinite xs -not-finite-is-infinite [] hyp = contradiction [] hyp + (xs : Colist A) ¬ Finite xs Infinite xs +not-finite-is-infinite [] hyp = contradiction [] hyp not-finite-is-infinite (x xs) hyp = x not-finite-is-infinite ( xs) (hyp _∷_ x) -- Colists are either finite or infinite (classically). finite-or-infinite : - (xs : Colist A) ¬ ¬ (Finite xs Infinite xs) -finite-or-infinite xs = helper <$> ¬¬-excluded-middle + (xs : Colist A) ¬ ¬ (Finite xs Infinite xs) +finite-or-infinite xs = helper <$> ¬¬-excluded-middle where - helper : Dec (Finite xs) Finite xs Infinite xs - helper ( true because [fin]) = inj₁ (invert [fin]) - helper (false because [¬fin]) = - inj₂ $ not-finite-is-infinite xs (invert [¬fin]) + helper : Dec (Finite xs) Finite xs Infinite xs + helper ( true because [fin]) = inj₁ (invert [fin]) + helper (false because [¬fin]) = + inj₂ $ not-finite-is-infinite xs (invert [¬fin]) -- Colists are not both finite and infinite. diff --git a/master/Codata.Musical.Conat.html b/master/Codata.Musical.Conat.html index 724f493335..cd7ed52f4f 100644 --- a/master/Codata.Musical.Conat.html +++ b/master/Codata.Musical.Conat.html @@ -14,7 +14,7 @@ open import Function.Base using (_∋_) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) ------------------------------------------------------------------------ @@ -59,15 +59,15 @@ } } where - refl : Reflexive _≈_ + refl : Reflexive _≈_ refl {zero} = zero refl {suc n} = suc ( refl) - sym : Symmetric _≈_ + sym : Symmetric _≈_ sym zero = zero sym (suc m≈n) = suc ( sym ( m≈n)) - trans : Transitive _≈_ + trans : Transitive _≈_ trans zero zero = zero trans (suc m≈n) (suc n≈k) = suc ( trans ( m≈n) ( n≈k)) \ No newline at end of file diff --git a/master/Codata.Musical.Covec.html b/master/Codata.Musical.Covec.html index 20fb1cea07..f6e1a56fb7 100644 --- a/master/Codata.Musical.Covec.html +++ b/master/Codata.Musical.Covec.html @@ -21,7 +21,7 @@ open import Relation.Binary.Core using (_⇒_; _=[_]⇒_) open import Relation.Binary.Bundles using (Setoid; Poset) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Antisymmetric) + using (Reflexive; Symmetric; Transitive; Antisymmetric) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) private @@ -127,15 +127,15 @@ } } where - refl : {n} Reflexive (_≈_ {n = n}) + refl : {n} Reflexive (_≈_ {n = n}) refl {x = []} = [] refl {x = x xs} = x refl - sym : {n} Symmetric (_≈_ {A = A} {n}) + sym : {n} Symmetric (_≈_ {A = A} {n}) sym [] = [] sym (x xs≈) = x sym ( xs≈) - trans : {n} Transitive (_≈_ {A = A} {n}) + trans : {n} Transitive (_≈_ {A = A} {n}) trans [] [] = [] trans (x xs≈) (.x ys≈) = x trans ( xs≈) ( ys≈) @@ -158,7 +158,7 @@ reflexive [] = [] reflexive (x xs≈) = x reflexive ( xs≈) - trans : {n} Transitive (_⊑_ {n = n}) + trans : {n} Transitive (_⊑_ {n = n}) trans [] _ = [] trans (x xs≈) (.x ys≈) = x trans ( xs≈) ( ys≈) @@ -166,7 +166,7 @@ _∷_ {n = n} x xs _∷_ {n = n} y ys xs ys tail (_ p) = p - antisym : {n} Antisymmetric (_≈_ {n = n}) _⊑_ + antisym : {n} Antisymmetric (_≈_ {n = n}) _⊑_ antisym [] [] = [] antisym (x p₁) p₂ = x antisym ( p₁) (tail p₂) diff --git a/master/Codata.Musical.M.Indexed.html b/master/Codata.Musical.M.Indexed.html index f7fbf05fd7..71c4a9ce78 100644 --- a/master/Codata.Musical.M.Indexed.html +++ b/master/Codata.Musical.M.Indexed.html @@ -28,18 +28,18 @@ -- Projections. - head : M Command + head : M Command head (inf (c , _)) = c tail : {o} (m : M o) (r : Response (head m)) M (next (head m) r) tail (inf (_ , k)) r = (k r) - force : M C M + force : M C M force (inf (c , k)) = c , λ r (k r) -- Coiteration. - coit : {} {X : Pred O } X C X X M + coit : {} {X : Pred O } X C X X M coit ψ x = inf (proj₁ cs , λ r coit ψ (proj₂ cs r)) where cs = ψ x diff --git a/master/Codata.Musical.Stream.html b/master/Codata.Musical.Stream.html index 029b5eaacb..d12ad68365 100644 --- a/master/Codata.Musical.Stream.html +++ b/master/Codata.Musical.Stream.html @@ -15,7 +15,7 @@ open import Data.Vec.Base using (Vec; []; _∷_) open import Data.Nat.Base using (; zero; suc) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -144,13 +144,13 @@ } } where - refl : Reflexive _≈_ + refl : Reflexive _≈_ refl {_ _} = ≡.refl refl - sym : Symmetric _≈_ + sym : Symmetric _≈_ sym (x≡ xs≈) = ≡.sym x≡ sym ( xs≈) - trans : Transitive _≈_ + trans : Transitive _≈_ trans (x≡ xs≈) (y≡ ys≈) = ≡.trans x≡ y≡ trans ( xs≈) ( ys≈) head-cong : {xs ys : Stream A} xs ys head xs head ys diff --git a/master/Codata.Sized.Cofin.Literals.html b/master/Codata.Sized.Cofin.Literals.html index e696fd8566..03324af7a1 100644 --- a/master/Codata.Sized.Cofin.Literals.html +++ b/master/Codata.Sized.Cofin.Literals.html @@ -18,7 +18,7 @@ number : n Number (Cofin n) number n = record - { Constraint = λ k True (suc k ℕ≤? n) - ; fromNat = λ n {{p}} fromℕ< (toWitness p) + { Constraint = λ k True (suc k ℕ≤? n) + ; fromNat = λ n {{p}} fromℕ< (toWitness p) } \ No newline at end of file diff --git a/master/Codata.Sized.Colist.Bisimilarity.html b/master/Codata.Sized.Colist.Bisimilarity.html index 17e35739a3..406198b625 100644 --- a/master/Codata.Sized.Colist.Bisimilarity.html +++ b/master/Codata.Sized.Colist.Bisimilarity.html @@ -20,7 +20,7 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Sym; Trans) + using (Reflexive; Symmetric; Transitive; Sym; Trans) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) import Relation.Binary.PropositionalEquality.Properties as @@ -42,19 +42,19 @@ module _ {R : Rel A r} where - reflexive : Reflexive R Reflexive (Bisim R i) + reflexive : Reflexive R Reflexive (Bisim R i) reflexive refl^R {[]} = [] reflexive refl^R {r rs} = refl^R λ where .force reflexive refl^R module _ {P : REL A B p} {Q : REL B A q} where - symmetric : Sym P Q Sym (Bisim P i) (Bisim Q i) + symmetric : Sym P Q Sym (Bisim P i) (Bisim Q i) symmetric sym^PQ [] = [] symmetric sym^PQ (p ps) = sym^PQ p λ where .force symmetric sym^PQ (ps .force) module _ {P : REL A B p} {Q : REL B C q} {R : REL A C r} where - transitive : Trans P Q R Trans (Bisim P i) (Bisim Q i) (Bisim R i) + transitive : Trans P Q R Trans (Bisim P i) (Bisim Q i) (Bisim R i) transitive trans^PQR [] [] = [] transitive trans^PQR (p ps) (q qs) = trans^PQR p q λ where .force transitive trans^PQR (ps .force) (qs .force) @@ -82,16 +82,16 @@ _⊢_≈_ : i Colist A Colist A Set a _⊢_≈_ = Bisim _≡_ - refl : Reflexive (i ⊢_≈_) + refl : Reflexive (i ⊢_≈_) refl = reflexive ≡.refl fromEq : {as bs} as bs i as bs fromEq ≡.refl = refl - sym : Symmetric (i ⊢_≈_) + sym : Symmetric (i ⊢_≈_) sym = symmetric ≡.sym - trans : Transitive (i ⊢_≈_) + trans : Transitive (i ⊢_≈_) trans = transitive ≡.trans isEquivalence : {R : Rel A r} IsEquivalence R IsEquivalence (Bisim R i) diff --git a/master/Codata.Sized.Conat.Properties.html b/master/Codata.Sized.Conat.Properties.html index 14477c4dc4..ef48e08a10 100644 --- a/master/Codata.Sized.Conat.Properties.html +++ b/master/Codata.Sized.Conat.Properties.html @@ -16,8 +16,8 @@ open import Codata.Sized.Conat.Bisimilarity open import Function.Base using (_∋_) open import Relation.Nullary -open import Relation.Nullary.Decidable using (map′) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable using (map′) +open import Relation.Binary.Definitions using (Decidable) private variable @@ -32,10 +32,10 @@ infix 4 _ℕ≤?_ -_ℕ≤?_ : Decidable _ℕ≤_ -zero ℕ≤? n = yes zℕ≤n -suc m ℕ≤? zero = no ()) -suc m ℕ≤? suc n = map′ sℕ≤s sℕ≤s⁻¹ (m ℕ≤? n .force) +_ℕ≤?_ : Decidable _ℕ≤_ +zero ℕ≤? n = yes zℕ≤n +suc m ℕ≤? zero = no ()) +suc m ℕ≤? suc n = map′ sℕ≤s sℕ≤s⁻¹ (m ℕ≤? n .force) 0ℕ+-identity : {n} i 0 ℕ+ n n 0ℕ+-identity = refl diff --git a/master/Codata.Sized.Conat.html b/master/Codata.Sized.Conat.html index 3391535f23..0559c3a597 100644 --- a/master/Codata.Sized.Conat.html +++ b/master/Codata.Sized.Conat.html @@ -86,7 +86,7 @@ toℕ zero = zero toℕ (suc n) = suc (toℕ n) -¬Finite∞ : ¬ (Finite infinity) +¬Finite∞ : ¬ (Finite infinity) ¬Finite∞ (suc p) = ¬Finite∞ p ------------------------------------------------------------------------ diff --git a/master/Codata.Sized.Covec.Bisimilarity.html b/master/Codata.Sized.Covec.Bisimilarity.html index a10679df16..eceefb22b9 100644 --- a/master/Codata.Sized.Covec.Bisimilarity.html +++ b/master/Codata.Sized.Covec.Bisimilarity.html @@ -15,7 +15,7 @@ open import Codata.Sized.Conat hiding (_⊔_) open import Codata.Sized.Covec open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Sym; Trans) + using (Reflexive; Symmetric; Transitive; Sym; Trans) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) data Bisim {a b r} {A : Set a} {B : Set b} (R : A B Set r) (i : Size) : @@ -28,21 +28,21 @@ module _ {a r} {A : Set a} {R : A A Set r} where - reflexive : Reflexive R {i m} Reflexive (Bisim R i m m) + reflexive : Reflexive R {i m} Reflexive (Bisim R i m m) reflexive refl^R {i} {m} {[]} = [] reflexive refl^R {i} {m} {r rs} = refl^R λ where .force reflexive refl^R module _ {a b} {A : Set a} {B : Set b} {r} {P : A B Set r} {Q : B A Set r} where - symmetric : Sym P Q {i m n} Sym (Bisim P i m n) (Bisim Q i n m) + symmetric : Sym P Q {i m n} Sym (Bisim P i m n) (Bisim Q i n m) symmetric sym^PQ [] = [] symmetric sym^PQ (p ps) = sym^PQ p λ where .force symmetric sym^PQ (ps .force) module _ {a b c} {A : Set a} {B : Set b} {C : Set c} {r} {P : A B Set r} {Q : B C Set r} {R : A C Set r} where - transitive : Trans P Q R {i m n p} Trans (Bisim P i m n) (Bisim Q i n p) (Bisim R i m p) + transitive : Trans P Q R {i m n p} Trans (Bisim P i m n) (Bisim Q i n p) (Bisim R i m p) transitive trans^PQR [] [] = [] transitive trans^PQR (p ps) (q qs) = trans^PQR p q λ where .force transitive trans^PQR (ps .force) (qs .force) @@ -56,12 +56,12 @@ _,_⊢_≈_ : i m Covec A m Covec A m Set _,_⊢_≈_ i m = Bisim _≡_ i m m - refl : {i m} Reflexive (i , m ⊢_≈_) + refl : {i m} Reflexive (i , m ⊢_≈_) refl = reflexive ≡.refl - sym : {i m} Symmetric (i , m ⊢_≈_) + sym : {i m} Symmetric (i , m ⊢_≈_) sym = symmetric ≡.sym - trans : {i m} Transitive (i , m ⊢_≈_) + trans : {i m} Transitive (i , m ⊢_≈_) trans = transitive ≡.trans \ No newline at end of file diff --git a/master/Codata.Sized.Cowriter.Bisimilarity.html b/master/Codata.Sized.Cowriter.Bisimilarity.html index 8709ec537d..bc9ea70e6f 100644 --- a/master/Codata.Sized.Cowriter.Bisimilarity.html +++ b/master/Codata.Sized.Cowriter.Bisimilarity.html @@ -17,7 +17,7 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Sym; Trans) + using (Reflexive; Symmetric; Transitive; Sym; Trans) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) import Relation.Binary.PropositionalEquality.Properties as @@ -42,25 +42,25 @@ infixr 5 _∷_ module _ {R : Rel W r} {S : Rel A s} - (refl^R : Reflexive R) (refl^S : Reflexive S) where + (refl^R : Reflexive R) (refl^S : Reflexive S) where - reflexive : Reflexive (Bisim R S i) + reflexive : Reflexive (Bisim R S i) reflexive {x = [ a ]} = [ refl^S ] reflexive {x = w ws} = refl^R λ where .force reflexive module _ {R : REL V W r} {S : REL W V s} {P : REL A B p} {Q : REL B A q} - (sym^RS : Sym R S) (sym^PQ : Sym P Q) where + (sym^RS : Sym R S) (sym^PQ : Sym P Q) where - symmetric : Sym (Bisim R P i) (Bisim S Q i) + symmetric : Sym (Bisim R P i) (Bisim S Q i) symmetric [ a ] = [ sym^PQ a ] symmetric (p ps) = sym^RS p λ where .force symmetric (ps .force) module _ {R : REL V W r} {S : REL W X s} {RS : REL V X rs} {P : REL A B p} {Q : REL B C q} {PQ : REL A C pq} - (trans^RS : Trans R S RS) (trans^PQ : Trans P Q PQ) where + (trans^RS : Trans R S RS) (trans^PQ : Trans P Q PQ) where - transitive : Trans (Bisim R P i) (Bisim S Q i) (Bisim RS PQ i) + transitive : Trans (Bisim R P i) (Bisim S Q i) (Bisim RS PQ i) transitive [ p ] [ q ] = [ trans^PQ p q ] transitive (p ps) (q qs) = trans^RS p q λ where .force transitive (ps .force) (qs .force) @@ -74,16 +74,16 @@ _⊢_≈_ : i Cowriter W A Cowriter W A Set (a w) _⊢_≈_ = Bisim _≡_ _≡_ - refl : Reflexive (i ⊢_≈_) + refl : Reflexive (i ⊢_≈_) refl = reflexive ≡.refl ≡.refl fromEq : {as bs} as bs i as bs fromEq ≡.refl = refl - sym : Symmetric (i ⊢_≈_) + sym : Symmetric (i ⊢_≈_) sym = symmetric ≡.sym ≡.sym - trans : Transitive (i ⊢_≈_) + trans : Transitive (i ⊢_≈_) trans = transitive ≡.trans ≡.trans module _ {R : Rel W r} {S : Rel A s} diff --git a/master/Codata.Sized.Delay.Bisimilarity.html b/master/Codata.Sized.Delay.Bisimilarity.html index 07278ad060..7c42bbfd47 100644 --- a/master/Codata.Sized.Delay.Bisimilarity.html +++ b/master/Codata.Sized.Delay.Bisimilarity.html @@ -14,7 +14,7 @@ open import Codata.Sized.Delay open import Level open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Sym; Trans) + using (Reflexive; Symmetric; Transitive; Sym; Trans) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) data Bisim {a b r} {A : Set a} {B : Set b} (R : A B Set r) i : @@ -24,21 +24,21 @@ module _ {a r} {A : Set a} {R : A A Set r} where - reflexive : Reflexive R {i} Reflexive (Bisim R i) + reflexive : Reflexive R {i} Reflexive (Bisim R i) reflexive refl^R {i} {now r} = now refl^R reflexive refl^R {i} {later rs} = later λ where .force reflexive refl^R module _ {a b} {A : Set a} {B : Set b} {r} {P : A B Set r} {Q : B A Set r} where - symmetric : Sym P Q {i} Sym (Bisim P i) (Bisim Q i) + symmetric : Sym P Q {i} Sym (Bisim P i) (Bisim Q i) symmetric sym^PQ (now p) = now (sym^PQ p) symmetric sym^PQ (later ps) = later λ where .force symmetric sym^PQ (ps .force) module _ {a b c} {A : Set a} {B : Set b} {C : Set c} {r} {P : A B Set r} {Q : B C Set r} {R : A C Set r} where - transitive : Trans P Q R {i} Trans (Bisim P i) (Bisim Q i) (Bisim R i) + transitive : Trans P Q R {i} Trans (Bisim P i) (Bisim Q i) (Bisim R i) transitive trans^PQR (now p) (now q) = now (trans^PQR p q) transitive trans^PQR (later ps) (later qs) = later λ where .force transitive trans^PQR (ps .force) (qs .force) @@ -53,12 +53,12 @@ _⊢_≈_ : i Delay A Delay A Set _⊢_≈_ = Bisim _≡_ - refl : {i} Reflexive (i ⊢_≈_) + refl : {i} Reflexive (i ⊢_≈_) refl = reflexive ≡.refl - sym : {i} Symmetric (i ⊢_≈_) + sym : {i} Symmetric (i ⊢_≈_) sym = symmetric ≡.sym - trans : {i} Transitive (i ⊢_≈_) + trans : {i} Transitive (i ⊢_≈_) trans = transitive ≡.trans \ No newline at end of file diff --git a/master/Codata.Sized.Delay.html b/master/Codata.Sized.Delay.html index 53fb60ede9..841879862e 100644 --- a/master/Codata.Sized.Delay.html +++ b/master/Codata.Sized.Delay.html @@ -97,7 +97,7 @@ extract (now a) = a extract (later d) = extract d - ¬never⇓ : ¬ (never ) + ¬never⇓ : ¬ (never ) ¬never⇓ (later p) = ¬never⇓ p length-⇓ : {d} d Finite (length d) diff --git a/master/Codata.Sized.M.Bisimilarity.html b/master/Codata.Sized.M.Bisimilarity.html index f0bb039c93..96e079d09e 100644 --- a/master/Codata.Sized.M.Bisimilarity.html +++ b/master/Codata.Sized.M.Bisimilarity.html @@ -21,7 +21,7 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) import Relation.Binary.PropositionalEquality.Core as data Bisim {s p} (C : Container s p) (i : Size) : Rel (M C ) (s p) where @@ -32,13 +32,13 @@ -- unfortunately the proofs are a lot nicer if we do not use the -- combinators C.refl, C.sym and C.trans - refl : {i} Reflexive (Bisim C i) + refl : {i} Reflexive (Bisim C i) refl {x = inf t} = inf (≡.refl , λ where p .force refl) - sym : {i} Symmetric (Bisim C i) + sym : {i} Symmetric (Bisim C i) sym (inf (≡.refl , f)) = inf (≡.refl , λ where p .force sym (f p .force)) - trans : {i} Transitive (Bisim C i) + trans : {i} Transitive (Bisim C i) trans (inf (≡.refl , f)) (inf (≡.refl , g)) = inf (≡.refl , λ where p .force trans (f p .force) (g p .force)) diff --git a/master/Codata.Sized.Stream.Bisimilarity.html b/master/Codata.Sized.Stream.Bisimilarity.html index aa99549b60..aca9377101 100644 --- a/master/Codata.Sized.Stream.Bisimilarity.html +++ b/master/Codata.Sized.Stream.Bisimilarity.html @@ -18,7 +18,7 @@ open import Relation.Binary.Core using (Rel; REL) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Sym; Trans) + using (Reflexive; Symmetric; Transitive; Sym; Trans) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) import Relation.Binary.PropositionalEquality.Properties as @@ -40,17 +40,17 @@ module _ {R : Rel A r} where - reflexive : Reflexive R Reflexive (Bisim R i) + reflexive : Reflexive R Reflexive (Bisim R i) reflexive refl^R {r rs} = refl^R λ where .force reflexive refl^R module _ {P : REL A B p} {Q : REL B A q} where - symmetric : Sym P Q Sym (Bisim P i) (Bisim Q i) + symmetric : Sym P Q Sym (Bisim P i) (Bisim Q i) symmetric sym^PQ (p ps) = sym^PQ p λ where .force symmetric sym^PQ (ps .force) module _ {P : REL A B p} {Q : REL B C q} {R : REL A C r} where - transitive : Trans P Q R Trans (Bisim P i) (Bisim Q i) (Bisim R i) + transitive : Trans P Q R Trans (Bisim P i) (Bisim Q i) (Bisim R i) transitive trans^PQR (p ps) (q qs) = trans^PQR p q λ where .force transitive trans^PQR (ps .force) (qs .force) @@ -87,13 +87,13 @@ _⊢_≈_ : i Stream A Stream A Set a _⊢_≈_ = Bisim _≡_ - refl : {i} Reflexive (i ⊢_≈_) + refl : {i} Reflexive (i ⊢_≈_) refl = reflexive ≡.refl - sym : {i} Symmetric (i ⊢_≈_) + sym : {i} Symmetric (i ⊢_≈_) sym = symmetric ≡.sym - trans : {i} Transitive (i ⊢_≈_) + trans : {i} Transitive (i ⊢_≈_) trans = transitive ≡.trans module ≈-Reasoning {a} {A : Set a} {i} where diff --git a/master/Data.Bool.Properties.html b/master/Data.Bool.Properties.html index 249acbb4ac..c317e6ae0c 100644 --- a/master/Data.Bool.Properties.html +++ b/master/Data.Bool.Properties.html @@ -26,10 +26,10 @@ open import Relation.Binary.Bundles using (Setoid; DecSetoid; Poset; Preorder; TotalOrder; DecTotalOrder; StrictPartialOrder; StrictTotalOrder) open import Relation.Binary.Definitions - using (Decidable; DecidableEquality; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_) + using (Decidable; DecidableEquality; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_) open import Relation.Binary.PropositionalEquality.Core open import Relation.Binary.PropositionalEquality.Properties -open import Relation.Nullary.Decidable.Core using (True; yes; no; fromWitness) +open import Relation.Nullary.Decidable.Core using (True; yes; no; fromWitness) import Relation.Unary as U open import Algebra.Definitions {A = Bool} _≡_ @@ -49,11 +49,11 @@ infix 4 _≟_ -_≟_ : DecidableEquality Bool -true true = yes refl -false false = yes refl -true false = no λ() -false true = no λ() +_≟_ : DecidableEquality Bool +true true = yes refl +false false = yes refl +true false = no λ() +false true = no λ() ≡-setoid : Setoid 0ℓ 0ℓ ≡-setoid = setoid Bool @@ -69,36 +69,36 @@ ≤-reflexive : _≡_ _≤_ ≤-reflexive refl = b≤b -≤-refl : Reflexive _≤_ +≤-refl : Reflexive _≤_ ≤-refl = ≤-reflexive refl -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans b≤b p = p ≤-trans f≤t b≤b = f≤t -≤-antisym : Antisymmetric _≡_ _≤_ +≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym b≤b _ = refl -≤-minimum : Minimum _≤_ false +≤-minimum : Minimum _≤_ false ≤-minimum false = b≤b ≤-minimum true = f≤t -≤-maximum : Maximum _≤_ true +≤-maximum : Maximum _≤_ true ≤-maximum false = f≤t ≤-maximum true = b≤b -≤-total : Total _≤_ +≤-total : Total _≤_ ≤-total false b = inj₁ (≤-minimum b) ≤-total true b = inj₂ (≤-maximum b) infix 4 _≤?_ -_≤?_ : Decidable _≤_ -false ≤? b = yes (≤-minimum b) -true ≤? false = no λ () -true ≤? true = yes b≤b +_≤?_ : Decidable _≤_ +false ≤? b = yes (≤-minimum b) +true ≤? false = no λ () +true ≤? true = yes b≤b -≤-irrelevant : Irrelevant _≤_ +≤-irrelevant : Irrelevant _≤_ ≤-irrelevant {_} f≤t f≤t = refl ≤-irrelevant {false} b≤b b≤b = refl ≤-irrelevant {true} b≤b b≤b = refl @@ -158,38 +158,38 @@ -- Relational properties -<-irrefl : Irreflexive _≡_ _<_ +<-irrefl : Irreflexive _≡_ _<_ <-irrefl refl () -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym f<t () -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans f<t () -<-transʳ : Trans _≤_ _<_ _<_ +<-transʳ : Trans _≤_ _<_ _<_ <-transʳ b≤b f<t = f<t -<-transˡ : Trans _<_ _≤_ _<_ +<-transˡ : Trans _<_ _≤_ _<_ <-transˡ f<t b≤b = f<t -<-cmp : Trichotomous _≡_ _<_ -<-cmp false false = tri≈ (λ()) refl (λ()) -<-cmp false true = tri< f<t (λ()) (λ()) -<-cmp true false = tri> (λ()) (λ()) f<t -<-cmp true true = tri≈ (λ()) refl (λ()) +<-cmp : Trichotomous _≡_ _<_ +<-cmp false false = tri≈ (λ()) refl (λ()) +<-cmp false true = tri< f<t (λ()) (λ()) +<-cmp true false = tri> (λ()) (λ()) f<t +<-cmp true true = tri≈ (λ()) refl (λ()) infix 4 _<?_ -_<?_ : Decidable _<_ -false <? false = no (λ()) -false <? true = yes f<t -true <? _ = no (λ()) +_<?_ : Decidable _<_ +false <? false = no (λ()) +false <? true = yes f<t +true <? _ = no (λ()) -<-resp₂-≡ : _<_ Respects₂ _≡_ +<-resp₂-≡ : _<_ Respects₂ _≡_ <-resp₂-≡ = subst (_ <_) , subst (_< _) -<-irrelevant : Irrelevant _<_ +<-irrelevant : Irrelevant _<_ <-irrelevant f<t f<t = refl <-wellFounded : WellFounded _<_ @@ -736,7 +736,7 @@ ------------------------------------------------------------------------ -- Properties of T -open Relation.Nullary.Decidable.Core public using (T?) +open Relation.Nullary.Decidable.Core public using (T?) T-≡ : {x} T x x true T-≡ {false} = mk⇔ ()) ()) @@ -756,11 +756,11 @@ T-∨ {false} {true} = mk⇔ inj₂ (const _) T-∨ {false} {false} = mk⇔ inj₁ [ id , id ] -T-irrelevant : U.Irrelevant T +T-irrelevant : U.Irrelevant T T-irrelevant {true} _ _ = refl -T?-diag : b T b True (T? b) -T?-diag b = fromWitness +T?-diag : b T b True (T? b) +T?-diag b = fromWitness ------------------------------------------------------------------------ -- Miscellaneous other properties diff --git a/master/Data.Bool.html b/master/Data.Bool.html index dfe2477276..a52a82fb04 100644 --- a/master/Data.Bool.html +++ b/master/Data.Bool.html @@ -18,5 +18,5 @@ -- Publicly re-export queries open import Data.Bool.Properties public - using (T?; _≟_; _≤?_; _<?_) + using (T?; _≟_; _≤?_; _<?_) \ No newline at end of file diff --git a/master/Data.Char.Properties.html b/master/Data.Char.Properties.html index 9e720bbc1b..1c21e014c5 100644 --- a/master/Data.Char.Properties.html +++ b/master/Data.Char.Properties.html @@ -16,15 +16,15 @@ open import Data.Product.Base using (_,_) open import Function.Base -open import Relation.Nullary using (¬_; yes; no) -open import Relation.Nullary.Decidable using (map′; isYes) +open import Relation.Nullary using (¬_; yes; no) +open import Relation.Nullary.Decidable using (map′; isYes) open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; StrictPartialOrder; StrictTotalOrder; Preorder; Poset; DecPoset) open import Relation.Binary.Structures using (IsDecEquivalence; IsStrictPartialOrder; IsStrictTotalOrder; IsPreorder; IsPartialOrder; IsDecPartialOrder; IsEquivalence) open import Relation.Binary.Definitions - using (Decidable; DecidableEquality; Trichotomous; Irreflexive; Transitive; Asymmetric; Antisymmetric; Symmetric; Substitutive; Reflexive; tri<; tri≈; tri>) + using (Decidable; DecidableEquality; Trichotomous; Irreflexive; Transitive; Asymmetric; Antisymmetric; Symmetric; Substitutive; Reflexive; tri<; tri≈; tri>) import Relation.Binary.Construct.On as On import Relation.Binary.Construct.Subst.Equality as Subst import Relation.Binary.Construct.Closure.Reflexive as Refl @@ -56,8 +56,8 @@ -- Properties of _≡_ infix 4 _≟_ -_≟_ : DecidableEquality Char -x y = map′ ≈⇒≡ ≈-reflexive (toℕ x ℕ.≟ toℕ y) +_≟_ : DecidableEquality Char +x y = map′ ≈⇒≡ ≈-reflexive (toℕ x ℕ.≟ toℕ y) setoid : Setoid _ _ setoid = ≡.setoid Char @@ -78,7 +78,7 @@ infix 4 _==_ _==_ : Char Char Bool -c₁ == c₂ = isYes (c₁ c₂) +c₁ == c₂ = isYes (c₁ c₂) private @@ -95,22 +95,22 @@ -- Properties of _<_ infix 4 _<?_ -_<?_ : Decidable _<_ +_<?_ : Decidable _<_ _<?_ = On.decidable toℕ ℕ._<_ ℕ._<?_ -<-cmp : Trichotomous _≡_ _<_ +<-cmp : Trichotomous _≡_ _<_ <-cmp c d with ℕ.<-cmp (toℕ c) (toℕ d) -... | tri< lt ¬eq ¬gt = tri< lt (≉⇒≢ ¬eq) ¬gt -... | tri≈ ¬lt eq ¬gt = tri≈ ¬lt (≈⇒≡ eq) ¬gt -... | tri> ¬lt ¬eq gt = tri> ¬lt (≉⇒≢ ¬eq) gt +... | tri< lt ¬eq ¬gt = tri< lt (≉⇒≢ ¬eq) ¬gt +... | tri≈ ¬lt eq ¬gt = tri≈ ¬lt (≈⇒≡ eq) ¬gt +... | tri> ¬lt ¬eq gt = tri> ¬lt (≉⇒≢ ¬eq) gt -<-irrefl : Irreflexive _≡_ _<_ +<-irrefl : Irreflexive _≡_ _<_ <-irrefl = ℕ.<-irrefl ∘′ cong toℕ -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans {c} {d} {e} = On.transitive toℕ ℕ._<_ ℕ.<-trans {c} {d} {e} -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym {c} {d} = On.asymmetric toℕ ℕ._<_ ℕ.<-asym {c} {d} <-isStrictPartialOrder : IsStrictPartialOrder _≡_ _<_ @@ -142,16 +142,16 @@ -- Properties of _≤_ infix 4 _≤?_ -_≤?_ : Decidable _≤_ +_≤?_ : Decidable _≤_ _≤?_ = Refl.decidable <-cmp ≤-reflexive : _≡_ _≤_ ≤-reflexive = Refl.reflexive -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans = Refl.trans {a} {b} {c} <-trans {a} {b} {c}) -≤-antisym : Antisymmetric _≡_ _≤_ +≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym = Refl.antisym _≡_ refl ℕ.<-asym ≤-isPreorder : IsPreorder _≡_ _≤_ @@ -191,28 +191,28 @@ -- Version 1.5 -≈-refl : Reflexive _≈_ +≈-refl : Reflexive _≈_ ≈-refl = refl {-# WARNING_ON_USAGE ≈-refl "Warning: ≈-refl was deprecated in v1.5. Please use Propositional Equality's refl instead." #-} -≈-sym : Symmetric _≈_ +≈-sym : Symmetric _≈_ ≈-sym = sym {-# WARNING_ON_USAGE ≈-sym "Warning: ≈-sym was deprecated in v1.5. Please use Propositional Equality's sym instead." #-} -≈-trans : Transitive _≈_ +≈-trans : Transitive _≈_ ≈-trans = trans {-# WARNING_ON_USAGE ≈-trans "Warning: ≈-trans was deprecated in v1.5. Please use Propositional Equality's trans instead." #-} -≈-subst : {} Substitutive _≈_ +≈-subst : {} Substitutive _≈_ ≈-subst P x≈y p = subst P (≈⇒≡ x≈y) p {-# WARNING_ON_USAGE ≈-subst "Warning: ≈-subst was deprecated in v1.5. @@ -220,7 +220,7 @@ #-} infix 4 _≈?_ -_≈?_ : Decidable _≈_ +_≈?_ : Decidable _≈_ x ≈? y = toℕ x ℕ.≟ toℕ y ≈-isEquivalence : IsEquivalence _≈_ diff --git a/master/Data.Container.Core.html b/master/Data.Container.Core.html index ee54ba9bfd..0db0769b72 100644 --- a/master/Data.Container.Core.html +++ b/master/Data.Container.Core.html @@ -13,7 +13,7 @@ open import Data.Product.Base as Product using (Σ-syntax) open import Function.Base using (_∘_; _∘′_) open import Function.Bundles using (Inverse; _↔_) -open import Relation.Unary using (Pred; _⊆_) +open import Relation.Unary using (Pred; _⊆_) -- Definition of Containers diff --git a/master/Data.Container.Indexed.Combinator.html b/master/Data.Container.Indexed.Combinator.html index d10a304efc..05a849eae3 100644 --- a/master/Data.Container.Indexed.Combinator.html +++ b/master/Data.Container.Indexed.Combinator.html @@ -21,8 +21,8 @@ open import Function.Bundles using (mk↔ₛ′) open import Function.Indexed.Bundles using (_↔ᵢ_) open import Level using (Level; _⊔_) -open import Relation.Unary using (Pred; _⊆_; _∪_; _∩_; ; ) - renaming (_⟨×⟩_ to _⟪×⟫_; _⟨⊙⟩_ to _⟪⊙⟫_; _⟨⊎⟩_ to _⟪⊎⟫_) +open import Relation.Unary using (Pred; _⊆_; _∪_; _∩_; ; ) + renaming (_⟨×⟩_ to _⟪×⟫_; _⟨⊙⟩_ to _⟪⊙⟫_; _⟨⊎⟩_ to _⟪⊎⟫_) open import Relation.Binary.PropositionalEquality.Core using (_≗_; refl; cong) @@ -42,7 +42,7 @@ -- Constant. -const : Pred O c Container I O c r +const : Pred O c Container I O c r const X = X F.const / F.const ⊥-elim -- Composition. @@ -93,7 +93,7 @@ _×_ : Container I O c₁ r₁ Container I O c₂ r₂ Container I O _ _ (C₁ R₁ / n₁) × (C₂ R₂ / n₂) = record - { Command = C₁ C₂ + { Command = C₁ C₂ ; Response = R₁ ⟪⊙⟫ R₂ ; next = λ { (c₁ , c₂) [ n₁ c₁ , n₂ c₂ ] } } @@ -102,8 +102,8 @@ Π : (X Container I O c r) Container I O _ _ Π {X = X} C = record - { Command = X (Command ⟨∘⟩ C) - ; Response = ⋃[ x X ] λ c Response (C x) (c x) + { Command = X (Command ⟨∘⟩ C) + ; Response = ⋃[ x X ] λ c Response (C x) (c x) ; next = λ { c (x , r) next (C x) (c x) r } } @@ -113,7 +113,7 @@ infixr 1 _⊎_ _⊎′_ _⊎_ : Container I O c₁ r₁ Container I O c₂ r₂ Container I O _ _ -(C₁ C₂) .Command = C₁ .Command C₂ .Command +(C₁ C₂) .Command = C₁ .Command C₂ .Command (C₁ C₂) .Response = All (C₁ .Response) (C₂ .Response) (C₁ C₂) .next = All.[ C₁ .next , C₂ .next ] @@ -121,7 +121,7 @@ _⊎′_ : Container I O c₁ r Container I O c₂ r Container I O _ r (C₁ R₁ / n₁) ⊎′ (C₂ R₂ / n₂) = record - { Command = C₁ C₂ + { Command = C₁ C₂ ; Response = [ R₁ , R₂ ] ; next = [ n₁ , n₂ ] } @@ -130,7 +130,7 @@ Σ : (X Container I O c r) Container I O _ r Σ {X = X} C = record - { Command = X (Command ⟨∘⟩ C) + { Command = X (Command ⟨∘⟩ C) ; Response = λ { (x , c) Response (C x) c } ; next = λ { (x , c) r next (C x) c r } } @@ -148,7 +148,7 @@ module Identity where - correct : {X : Pred O } id {c = c}{r} X ↔ᵢ F.id X + correct : {X : Pred O } id {c = c}{r} X ↔ᵢ F.id X correct {X = X} = mk↔ₛ′ to from _ refl) _ refl) where to : {x} id X x F.id X x @@ -159,13 +159,13 @@ module Constant (ext : {} Extensionality ) where - correct : (X : Pred O ℓ₁) {Y : Pred O ℓ₂} const X Y ↔ᵢ F.const X Y + correct : (X : Pred O ℓ₁) {Y : Pred O ℓ₂} const X Y ↔ᵢ F.const X Y correct X {Y} = mk↔ₛ′ to from _ refl) to∘from where - to : const X Y X + to : const X Y X to = proj₁ - from : X const X Y + from : X const X Y from = < F.id , F.const ⊥-elim > to∘from : _ @@ -173,7 +173,7 @@ module Duality where - correct : (C : Container I O c r) (X : Pred I ) + correct : (C : Container I O c r) (X : Pred I ) C ^⊥ X ↔ᵢ o (c : Command C o) λ r X (next C c r)) correct C X = mk↔ₛ′ { (f , g) < f , g > }) f proj₁ ⟨∘⟩ f , proj₂ ⟨∘⟩ f) _ refl) _ refl) @@ -181,25 +181,25 @@ module Composition where correct : (C₁ : Container J K c r) (C₂ : Container I J c r) - {X : Pred I } C₁ C₂ X ↔ᵢ ( C₁ ⟨∘⟩ C₂ ) X + {X : Pred I } C₁ C₂ X ↔ᵢ ( C₁ ⟨∘⟩ C₂ ) X correct C₁ C₂ {X} = mk↔ₛ′ to from _ refl) _ refl) where - to : C₁ C₂ X C₁ ( C₂ X) + to : C₁ C₂ X C₁ ( C₂ X) to ((c , f) , g) = (c , < f , curry g >) - from : C₁ ( C₂ X) C₁ C₂ X + from : C₁ ( C₂ X) C₁ C₂ X from (c , f) = ((c , proj₁ ⟨∘⟩ f) , uncurry (proj₂ ⟨∘⟩ f)) module Product (ext : {} Extensionality ) where - correct : (C₁ C₂ : Container I O c r) {X : Pred I _} - C₁ × C₂ X ↔ᵢ ( C₁ X C₂ X) + correct : (C₁ C₂ : Container I O c r) {X : Pred I _} + C₁ × C₂ X ↔ᵢ ( C₁ X C₂ X) correct C₁ C₂ {X} = mk↔ₛ′ to from _ refl) from∘to where - to : C₁ × C₂ X C₁ X C₂ X + to : C₁ × C₂ X C₁ X C₂ X to ((c₁ , c₂) , k) = ((c₁ , k ⟨∘⟩ inj₁) , (c₂ , k ⟨∘⟩ inj₂)) - from : C₁ X C₂ X C₁ × C₂ X + from : C₁ X C₂ X C₁ × C₂ X from ((c₁ , k₁) , (c₂ , k₂)) = ((c₁ , c₂) , [ k₁ , k₂ ]) from∘to : from ⟨∘⟩ to F.id @@ -208,27 +208,27 @@ module IndexedProduct where - correct : (C : X Container I O c r) {Y : Pred I } - Π C Y ↔ᵢ ⋂[ x X ] C x Y + correct : (C : X Container I O c r) {Y : Pred I } + Π C Y ↔ᵢ ⋂[ x X ] C x Y correct {X = X} C {Y} = mk↔ₛ′ to from _ refl) _ refl) where - to : Π C Y ⋂[ x X ] C x Y + to : Π C Y ⋂[ x X ] C x Y to (c , k) = λ x (c x , λ r k (x , r)) - from : ⋂[ x X ] C x Y Π C Y + from : ⋂[ x X ] C x Y Π C Y from f = (proj₁ ⟨∘⟩ f , uncurry (proj₂ ⟨∘⟩ f)) module Sum (ext : {ℓ₁ ℓ₂} Extensionality ℓ₁ ℓ₂) where - correct : (C₁ C₂ : Container I O c r) {X : Pred I } - C₁ C₂ X ↔ᵢ ( C₁ X C₂ X) + correct : (C₁ C₂ : Container I O c r) {X : Pred I } + C₁ C₂ X ↔ᵢ ( C₁ X C₂ X) correct C₁ C₂ {X} = mk↔ₛ′ to from to∘from from∘to where - to : C₁ C₂ X C₁ X C₂ X + to : C₁ C₂ X C₁ X C₂ X to (inj₁ c₁ , k) = inj₁ (c₁ , λ r k (All.inj₁ r)) to (inj₂ c₂ , k) = inj₂ (c₂ , λ r k (All.inj₂ r)) - from : C₁ X C₂ X C₁ C₂ X + from : C₁ X C₂ X C₁ C₂ X from (inj₁ (c , f)) = inj₁ c , λ{ (All.inj₁ r) f r} from (inj₂ (c , f)) = inj₂ c , λ{ (All.inj₂ r) f r} @@ -241,15 +241,15 @@ module Sum′ where - correct : (C₁ C₂ : Container I O c r) {X : Pred I } - C₁ ⊎′ C₂ X ↔ᵢ ( C₁ X C₂ X) + correct : (C₁ C₂ : Container I O c r) {X : Pred I } + C₁ ⊎′ C₂ X ↔ᵢ ( C₁ X C₂ X) correct C₁ C₂ {X} = mk↔ₛ′ to from to∘from from∘to where - to : C₁ ⊎′ C₂ X C₁ X C₂ X + to : C₁ ⊎′ C₂ X C₁ X C₂ X to (inj₁ c₁ , k) = inj₁ (c₁ , k) to (inj₂ c₂ , k) = inj₂ (c₂ , k) - from : C₁ X C₂ X C₁ ⊎′ C₂ X + from : C₁ X C₂ X C₁ ⊎′ C₂ X from = [ Prod.map inj₁ F.id , Prod.map inj₂ F.id ] from∘to : from ⟨∘⟩ to F.id @@ -261,19 +261,19 @@ module IndexedSum where - correct : (C : X Container I O c r) {Y : Pred I } - Σ C Y ↔ᵢ ⋃[ x X ] C x Y + correct : (C : X Container I O c r) {Y : Pred I } + Σ C Y ↔ᵢ ⋃[ x X ] C x Y correct {X = X} C {Y} = mk↔ₛ′ to from _ refl) _ refl) where - to : Σ C Y ⋃[ x X ] C x Y + to : Σ C Y ⋃[ x X ] C x Y to ((x , c) , k) = (x , (c , k)) - from : ⋃[ x X ] C x Y Σ C Y + from : ⋃[ x X ] C x Y Σ C Y from (x , (c , k)) = ((x , c) , k) module ConstantExponentiation where - correct : (C : Container I O c r) {Y : Pred I } - const[ X ]⟶ C Y ↔ᵢ ( X (F.const ( C Y))) + correct : (C : Container I O c r) {Y : Pred I } + const[ X ]⟶ C Y ↔ᵢ ( X (F.const ( C Y))) correct C {Y} = IndexedProduct.correct (F.const C) {Y} \ No newline at end of file diff --git a/master/Data.Container.Indexed.Core.html b/master/Data.Container.Indexed.Core.html index c666d8a530..63c33bdce3 100644 --- a/master/Data.Container.Indexed.Core.html +++ b/master/Data.Container.Indexed.Core.html @@ -33,27 +33,27 @@ ------------------------------------------------------------------------ -- The semantics ("extension") of an indexed container. -module _ (C : Container I O c r) (X : Pred I ) where +module _ (C : Container I O c r) (X : Pred I ) where open Container C Subtrees : o Command o Set _ Subtrees o c = (r : Response c) X (next c r) - ⟦_⟧ : Pred O _ + ⟦_⟧ : Pred O _ ⟦_⟧ o = Σ (Command o) (Subtrees o) ------------------------------------------------------------------------ -- All and any -module _ (C : Container I O c r) {X : Pred I } where +module _ (C : Container I O c r) {X : Pred I } where -- All. - : Pred (Σ I X) ℓ′ Pred (Σ O ( C X)) _ + : Pred (Σ I X) ℓ′ Pred (Σ O ( C X)) _ P (_ , _ , k) = r P (_ , k r) -- Any. - : Pred (Σ I X) ℓ′ Pred (Σ O ( C X)) _ + : Pred (Σ I X) ℓ′ Pred (Σ O ( C X)) _ P (_ , _ , k) = λ r P (_ , k r) \ No newline at end of file diff --git a/master/Data.Container.Indexed.Fixpoints.Guarded.html b/master/Data.Container.Indexed.Fixpoints.Guarded.html index cfd42955f9..05dd3430c5 100644 --- a/master/Data.Container.Indexed.Fixpoints.Guarded.html +++ b/master/Data.Container.Indexed.Fixpoints.Guarded.html @@ -12,7 +12,7 @@ open import Level using (Level; _⊔_) open import Codata.Musical.M.Indexed using (M) open import Data.Container.Indexed using (Container) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable @@ -27,6 +27,6 @@ -- This lives in its own module due to its use of guardedness. -ν : Container O O c r Pred O _ +ν : Container O O c r Pred O _ ν = M \ No newline at end of file diff --git a/master/Data.Container.Indexed.FreeMonad.html b/master/Data.Container.Indexed.FreeMonad.html index bc2281daae..a52f472cb4 100644 --- a/master/Data.Container.Indexed.FreeMonad.html +++ b/master/Data.Container.Indexed.FreeMonad.html @@ -28,7 +28,7 @@ infix 9 _⋆_ _⋆C_ : {i o c r} {I : Set i} {O : Set o} - Container I O c r Pred O c Container I O _ _ + Container I O c r Pred O c Container I O _ _ C ⋆C X = const X ⊎′ C _⋆_ : {} {O : Set } Container O O Pt O @@ -38,7 +38,7 @@ pattern doP c k = (inj₂ c , k) inn : {} {O : Set } {C : Container O O } {X} - C (C X) C X + C (C X) C X inn (c , k) = sup (doP c k) rawPMonad : {} {O : Set } {C : Container O O } @@ -48,22 +48,22 @@ ; _=<?_ = _=<<_ } where - return : {X} X C X + return : {X} X C X return x = sup (inj₁ x , ⊥-elim lower) - _=<<_ : {X Y} X C Y C X C Y + _=<<_ : {X Y} X C Y C X C Y f =<< sup (returnP x) = f x f =<< sup (doP c k) = inn (c , λ r f =<< k r) -leaf : {} {O : Set } {C : Container O O } {X : Pred O } - C X C X +leaf : {} {O : Set } {C : Container O O } {X : Pred O } + C X C X leaf (c , k) = inn (c , return? k) where open RawPMonad rawPMonad generic : {} {O : Set } {C : Container O O } {o} (c : Command C o) - o C (⋃[ r Response C c ] next C c r ) + o C (⋃[ r Response C c ] next C c r ) generic c = inn (c , λ r return? (r , refl)) where open RawPMonad rawPMonad diff --git a/master/Data.Container.Indexed.Relation.Binary.Equality.Setoid.html b/master/Data.Container.Indexed.Relation.Binary.Equality.Setoid.html index 3002befff8..7194d5fda7 100644 --- a/master/Data.Container.Indexed.Relation.Binary.Equality.Setoid.html +++ b/master/Data.Container.Indexed.Relation.Binary.Equality.Setoid.html @@ -39,13 +39,13 @@ ------------------------------------------------------------------------ -- Relational properties - refl : Reflexive Eq + refl : Reflexive Eq refl = Pointwise.refl C _ (Setoid.refl S) - sym : Symmetric Eq + sym : Symmetric Eq sym = Pointwise.sym C _ (Setoid.sym S) - trans : Transitive Eq + trans : Transitive Eq trans = Pointwise.trans C _ (Setoid.trans S) isEquivalence : IsEquivalence Eq diff --git a/master/Data.Container.Indexed.Relation.Binary.Pointwise.Properties.html b/master/Data.Container.Indexed.Relation.Binary.Pointwise.Properties.html index ed8a937280..c37dbcd3dd 100644 --- a/master/Data.Container.Indexed.Relation.Binary.Pointwise.Properties.html +++ b/master/Data.Container.Indexed.Relation.Binary.Pointwise.Properties.html @@ -16,7 +16,7 @@ open import Data.Product.Base using (_,_; Σ-syntax; -,_) open import Level using (Level; _⊔_) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; subst; cong) @@ -30,13 +30,13 @@ {o : O} where - refl : (∀ i Reflexive (R i)) Reflexive (Pointwise C R o) + refl : (∀ i Reflexive (R i)) Reflexive (Pointwise C R o) refl R-refl = ≡.refl , λ p R-refl _ - sym : (∀ i Symmetric (R i)) Symmetric (Pointwise C R o) + sym : (∀ i Symmetric (R i)) Symmetric (Pointwise C R o) sym R-sym (≡.refl , f) = ≡.refl , λ p R-sym _ (f p) - trans : (∀ i Transitive (R i)) Transitive (Pointwise C R o) + trans : (∀ i Transitive (R i)) Transitive (Pointwise C R o) trans R-trans (≡.refl , f) (≡.refl , g) = ≡.refl , λ p R-trans _ (f p) (g p) -- If propositional equality is extensional, then `Eq _≡_` and `_≡_` coincide. diff --git a/master/Data.Container.Indexed.WithK.html b/master/Data.Container.Indexed.WithK.html index 8b4a08f88c..9c021afe17 100644 --- a/master/Data.Container.Indexed.WithK.html +++ b/master/Data.Container.Indexed.WithK.html @@ -20,7 +20,7 @@ using (_,_; -,_; _×_; ; proj₁; proj₂; Σ-syntax) open import Function.Base renaming (id to ⟨id⟩; _∘_ to _⟨∘⟩_) open import Level -open import Relation.Unary using (Pred; _⊆_) +open import Relation.Unary using (Pred; _⊆_) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; refl) open import Relation.Binary.HeterogeneousEquality as using (_≅_; refl) open import Relation.Binary.Indexed.Heterogeneous @@ -30,7 +30,7 @@ -- Equality, parametrised on an underlying relation. Eq : {i o c r } {I : Set i} {O : Set o} (C : Container I O c r) - (X Y : Pred I ) IREL X Y IREL ( C X) ( C Y) _ + (X Y : Pred I ) IREL X Y IREL ( C X) ( C Y) _ Eq C _ _ _≈_ {o₁} {o₂} (c , k) (c′ , k′) = o₁ o₂ × c c′ × (∀ r r′ r r′ k r k′ r′) @@ -40,7 +40,7 @@ -- and _≅_ would coincide. Eq⇒≅ : {i o c r } {I : Set i} {O : Set o} - {C : Container I O c r} {X : Pred I } {o₁ o₂ : O} + {C : Container I O c r} {X : Pred I } {o₁ o₂ : O} {xs : C X o₁} {ys : C X o₂} Extensionality r Eq C X X x₁ x₂ x₁ x₂) xs ys xs ys Eq⇒≅ {xs = c , k} {.c , k′} ext (refl , refl , k≈k′) = @@ -84,9 +84,9 @@ identity C X = IndexedSetoid.refl (setoid C X) composition : {i o c r s ℓ₁ ℓ₂} {I : Set i} {O : Set o} - (C : Container I O c r) {X : Pred I ℓ₁} {Y : Pred I ℓ₂} + (C : Container I O c r) {X : Pred I ℓ₁} {Y : Pred I ℓ₂} (Z : IndexedSetoid I s _) let module Z = IndexedSetoid Z in - {f : Y Z.Carrier} {g : X Y} {o : O} {xs : C X o} + {f : Y Z.Carrier} {g : X Y} {o : O} {xs : C X o} Eq C Z.Carrier Z.Carrier Z._≈_ (map C {Y} f (map C {X} g xs)) (map C {X} (f ⟨∘⟩ g) xs) @@ -102,9 +102,9 @@ -- Naturality. Natural : {} {C₁ C₂ : Container I O c r} - ((X : Pred I ) C₁ X C₂ X) Set _ + ((X : Pred I ) C₁ X C₂ X) Set _ Natural {C₁ = C₁} {C₂} m = - {X} Y let module Y = IndexedSetoid Y in (f : X Y.Carrier) + {X} Y let module Y = IndexedSetoid Y in (f : X Y.Carrier) {o} (xs : C₁ X o) Eq C₂ Y.Carrier Y.Carrier Y._≈_ (m Y.Carrier $ map C₁ {X} f xs) (map C₂ {X} f $ m X xs) @@ -112,7 +112,7 @@ -- Natural transformations. NT : {} (C₁ C₂ : Container I O c r) Set _ - NT {} C₁ C₂ = λ (m : (X : Pred I ) C₁ X C₂ X) + NT {} C₁ C₂ = λ (m : (X : Pred I ) C₁ X C₂ X) Natural m -- Container morphisms are natural. @@ -181,6 +181,6 @@ infix 4 _∈_ _∈_ : {i o c r } {I : Set i} {O : Set o} - {C : Container I O c r} {X : Pred I (i )} IREL X ( C X) _ + {C : Container I O c r} {X : Pred I (i )} IREL X ( C X) _ _∈_ {C = C} {X} x xs = C {X = X} ((x ≅_) ⟨∘⟩ proj₂) (-, xs) \ No newline at end of file diff --git a/master/Data.Container.Indexed.html b/master/Data.Container.Indexed.html index ee2a87c03a..d570c4dcca 100644 --- a/master/Data.Container.Indexed.html +++ b/master/Data.Container.Indexed.html @@ -17,7 +17,7 @@ open import Data.W.Indexed using (W) open import Function.Base renaming (id to ⟨id⟩; _∘_ to _⟨∘⟩_) open import Function.Bundles using (_↔_; Inverse) -open import Relation.Unary using (Pred; _⊆_) +open import Relation.Unary using (Pred; _⊆_) open import Relation.Binary.Core using (Rel; REL) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≗_; refl; trans; subst) @@ -38,7 +38,7 @@ -- The least and greatest fixpoint. -μ : {o c r} {O : Set o} Container O O c r Pred O _ +μ : {o c r} {O : Set o} Container O O c r Pred O _ μ = W -- An equivalence relation is defined in Data.Container.Indexed.WithK. @@ -49,8 +49,8 @@ -- Indexed containers are functors. map : {i o c r ℓ₁ ℓ₂} {I : Set i} {O : Set o} - (C : Container I O c r) {X : Pred I ℓ₁} {Y : Pred I ℓ₂} - X Y C X C Y + (C : Container I O c r) {X : Pred I ℓ₁} {Y : Pred I ℓ₂} + X Y C X C Y map _ f = Prod.map ⟨id⟩ g f ⟨∘⟩ g) -- Some properties are proved in Data.Container.Indexed.WithK. @@ -70,7 +70,7 @@ (_·_ : {A B} A B A B) : Set (i₁ i₂ o₁ o₂ c₁ c₂ r₁ r₂ ℓ₁ ℓ₂) where field - command : Command C₁ Command C₂ ⟨∘⟩ g + command : Command C₁ Command C₂ ⟨∘⟩ g response : {o} {c₁ : Command C₁ o} Response C₂ (command c₁) Response C₁ c₁ coherent : {o} {c₁ : Command C₁ o} {r₂ : Response C₂ (command c₁)} @@ -122,7 +122,7 @@ -- Interpretation of _⇒_. ⟪_⟫ : {i o c r } {I : Set i} {O : Set o} {C₁ C₂ : Container I O c r} - C₁ C₂ (X : Pred I ) C₁ X C₂ X + C₁ C₂ (X : Pred I ) C₁ X C₂ X m X (c , k) = command m c , λ r₂ subst X (coherent m) (k (response m r₂)) @@ -151,7 +151,7 @@ -- Identity commutes with ⟪_⟫. - id-correct : {} {C : Container I O c r} {X : Pred I } {o} + id-correct : {} {C : Container I O c r} {X : Pred I } {o} id C X {o} ⟨id⟩ id-correct _ = refl @@ -172,7 +172,7 @@ ; coherent = coherent m } - ⟪_⟫⊸ : {} (X : Pred I ) C₁ X C₂ X + ⟪_⟫⊸ : {} (X : Pred I ) C₁ X C₂ X ⟪_⟫⊸ = morphism open LinearMorphism public using (⟪_⟫⊸) @@ -192,7 +192,7 @@ ; coherent = coherent m } - ⟪_⟫C : {} (X : Pred I ) C₁ X C₂ X + ⟪_⟫C : {} (X : Pred I ) C₁ X C₂ X ⟪_⟫C = morphism open CartesianMorphism public using (⟪_⟫C) @@ -203,16 +203,16 @@ -- □ and ◇ are defined in the core module. module _ {i o c r ℓ₁ ℓ₂} {I : Set i} {O : Set o} (C : Container I O c r) - {X : Pred I ℓ₁} {P Q : Pred (Σ I X) ℓ₂} where + {X : Pred I ℓ₁} {P Q : Pred (Σ I X) ℓ₂} where -- All. - □-map : P Q C P C Q + □-map : P Q C P C Q □-map P⊆Q = _⟨∘⟩_ P⊆Q -- Any. - ◇-map : P Q C P C Q + ◇-map : P Q C P C Q ◇-map P⊆Q = Prod.map ⟨id⟩ P⊆Q -- Membership is defined in Data.Container.Indexed.WithK. diff --git a/master/Data.Container.Membership.html b/master/Data.Container.Membership.html index 80e030647b..c0a17a3580 100644 --- a/master/Data.Container.Membership.html +++ b/master/Data.Container.Membership.html @@ -10,7 +10,7 @@ module Data.Container.Membership where open import Level using (_⊔_) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) open import Relation.Binary.PropositionalEquality.Core using (_≡_) open import Data.Container.Core using (Container; ⟦_⟧) @@ -19,6 +19,6 @@ module _ {s p} {C : Container s p} {x} {X : Set x} where infix 4 _∈_ - _∈_ : X Pred ( C X) (p x) + _∈_ : X Pred ( C X) (p x) x xs = C (_≡_ x) xs \ No newline at end of file diff --git a/master/Data.Container.Relation.Binary.Equality.Setoid.html b/master/Data.Container.Relation.Binary.Equality.Setoid.html index 5aaef27b7d..7059fcaf9c 100644 --- a/master/Data.Container.Relation.Binary.Equality.Setoid.html +++ b/master/Data.Container.Relation.Binary.Equality.Setoid.html @@ -15,7 +15,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Data.Container.Core open import Data.Container.Relation.Binary.Pointwise @@ -36,13 +36,13 @@ ------------------------------------------------------------------------ -- Relational properties - refl : Reflexive Eq + refl : Reflexive Eq refl = Pw.refl C _ S.refl - sym : Symmetric Eq + sym : Symmetric Eq sym = Pw.sym C _ S.sym - trans : Transitive Eq + trans : Transitive Eq trans = Pw.trans C _ S.trans isEquivalence : IsEquivalence Eq diff --git a/master/Data.Container.Relation.Binary.Pointwise.Properties.html b/master/Data.Container.Relation.Binary.Pointwise.Properties.html index 87828b9e60..3880d3108c 100644 --- a/master/Data.Container.Relation.Binary.Pointwise.Properties.html +++ b/master/Data.Container.Relation.Binary.Pointwise.Properties.html @@ -17,20 +17,20 @@ open import Level using (_⊔_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; subst; cong) module _ {s p x r} {X : Set x} (C : Container s p) (R : Rel X r) where - refl : Reflexive R Reflexive (Pointwise C R) + refl : Reflexive R Reflexive (Pointwise C R) refl R-refl = ≡.refl , λ p R-refl - sym : Symmetric R Symmetric (Pointwise C R) + sym : Symmetric R Symmetric (Pointwise C R) sym R-sym (≡.refl , f) = ≡.refl , λ p R-sym (f p) - trans : Transitive R Transitive (Pointwise C R) + trans : Transitive R Transitive (Pointwise C R) trans R-trans (≡.refl , f) (≡.refl , g) = ≡.refl , λ p R-trans (f p) (g p) private diff --git a/master/Data.Container.Relation.Unary.All.html b/master/Data.Container.Relation.Unary.All.html index b97140fb48..0c94b97472 100644 --- a/master/Data.Container.Relation.Unary.All.html +++ b/master/Data.Container.Relation.Unary.All.html @@ -10,7 +10,7 @@ module Data.Container.Relation.Unary.All where open import Level using (_⊔_) -open import Relation.Unary using (Pred; _⊆_) +open import Relation.Unary using (Pred; _⊆_) open import Data.Product.Base using (_,_; proj₁; proj₂; ) open import Function.Base using (_∘′_; id) @@ -18,28 +18,28 @@ import Data.Container.Morphism as M record {s p} (C : Container s p) {x } {X : Set x} - (P : Pred X ) (cx : C X) : Set (p ) where + (P : Pred X ) (cx : C X) : Set (p ) where constructor all field proof : p P (proj₂ cx p) module _ {s₁ p₁ s₂ p₂} {C : Container s₁ p₁} {D : Container s₂ p₂} - {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} + {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} where - map : (f : C D) P Q C P D Q ∘′ f + map : (f : C D) P Q C P D Q ∘′ f map f P⊆Q (all prf) .□.proof p = P⊆Q (prf (f .position p)) module _ {s₁ p₁ s₂ p₂} {C : Container s₁ p₁} {D : Container s₂ p₂} - {x } {X : Set x} {P : Pred X } + {x } {X : Set x} {P : Pred X } where - map₁ : (f : C D) C P D P ∘′ f + map₁ : (f : C D) C P D P ∘′ f map₁ f = map f id module _ {s p} {C : Container s p} - {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} + {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} where - map₂ : P Q C P C Q + map₂ : P Q C P C Q map₂ = map (M.id C) \ No newline at end of file diff --git a/master/Data.Container.Relation.Unary.Any.Properties.html b/master/Data.Container.Relation.Unary.Any.Properties.html index 39ada20d0d..e87c2bc931 100644 --- a/master/Data.Container.Relation.Unary.Any.Properties.html +++ b/master/Data.Container.Relation.Unary.Any.Properties.html @@ -23,7 +23,7 @@ open import Function.Related.TypeIsomorphisms using (×-⊎-commutativeSemiring; ∃∃↔∃∃; Σ-assoc; ×-comm) open import Level using (Level; _⊔_) -open import Relation.Unary using (Pred ; _∪_ ; _∩_) +open import Relation.Unary using (Pred ; _∪_ ; _∩_) open import Relation.Binary.Core using (REL) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; _≗_; refl) @@ -40,7 +40,7 @@ open import Data.Container.Relation.Unary.Any as Any using (; any) open import Data.Container.Membership -module _ {s p} (C : Container s p) {x} {X : Set x} {} {P : Pred X } where +module _ {s p} (C : Container s p) {x} {X : Set x} {} {P : Pred X } where -- ◇ can be unwrapped to reveal the Σ type @@ -62,7 +62,7 @@ to∘from (.(proj₂ xs p) , any (p , refl) , Px) = refl module _ {s p} {C : Container s p} {x} {X : Set x} - {ℓ₁ ℓ₂} {P₁ : Pred X ℓ₁} {P₂ : Pred X ℓ₂} where + {ℓ₁ ℓ₂} {P₁ : Pred X ℓ₁} {P₂ : Pred X ℓ₂} where -- ◇ is a congruence for bag and set equality and related preorders. cong : {k} {xs₁ xs₂ : C X} @@ -81,7 +81,7 @@ {x y} {X : Set x} {Y : Set y} {r} {P : REL X Y r} where swap : {xs : C₁ X} {ys : C₂ Y} - let : {s p} {C : Container s p} {x} {X : Set x} {} C X Pred X Set (p ) + let : {s p} {C : Container s p} {x} {X : Set x} {} C X Pred X Set (p ) = λ {_} {_} flip ( _) in xs ( ys P) ys ( xs flip P) swap {xs} {ys} = @@ -103,7 +103,7 @@ -- Nested occurrences of ◇ can sometimes be flattened. module _ {s₁ s₂ p₁ p₂} {C₁ : Container s₁ p₁} {C₂ : Container s₂ p₂} - {x} {X : Set x} {} (P : Pred X ) where + {x} {X : Set x} {} (P : Pred X ) where flatten : (xss : C₁ ( C₂ X)) C₁ ( C₂ P) xss @@ -122,9 +122,9 @@ -- Sums commute with ◇ (for a fixed instance of a given container). module _ {s p} {C : Container s p} {x} {X : Set x} - { ℓ′} {P : Pred X } {Q : Pred X ℓ′} where + { ℓ′} {P : Pred X } {Q : Pred X ℓ′} where - ◇⊎↔⊎◇ : {xs : C X} C (P Q) xs ( C P xs C Q xs) + ◇⊎↔⊎◇ : {xs : C X} C (P Q) xs ( C P xs C Q xs) ◇⊎↔⊎◇ {xs} = mk↔ₛ′ to from to∘from from∘to where to : C x P x Q x) xs C P xs C Q xs @@ -144,7 +144,7 @@ -- Products "commute" with ◇. module _ {s₁ s₂ p₁ p₂} {C₁ : Container s₁ p₁} {C₂ : Container s₂ p₂} - {x y} {X : Set x} {Y : Set y} { ℓ′} {P : Pred X } {Q : Pred Y ℓ′} where + {x y} {X : Set x} {Y : Set y} { ℓ′} {P : Pred X } {Q : Pred Y ℓ′} where ×◇↔◇◇× : {xs : C₁ X} {ys : C₂ Y} C₁ x C₂ y P x × Q y) ys) xs ( C₁ P xs × C₂ Q ys) @@ -161,7 +161,7 @@ -- map can be absorbed by the predicate. module _ {s p} (C : Container s p) {x y} {X : Set x} {Y : Set y} - {} (P : Pred Y ) where + {} (P : Pred Y ) where map↔∘ : {xs : C X} (f : X Y) C P (map f xs) C (P ∘′ f) xs map↔∘ {xs} f = @@ -175,7 +175,7 @@ -- to map. module _ {s p} (C : Container s p) {x y} {X : Set x} {Y : Set y} - {} (P : Pred Y ) where + {} (P : Pred Y ) where ∈map↔∈×≡ : {f : X Y} {xs : C X} {y} y map f xs ( λ x x xs × y f x) @@ -188,7 +188,7 @@ -- map is a congruence for bag and set equality and related preorders. module _ {s p} (C : Container s p) {x y} {X : Set x} {Y : Set y} - {} (P : Pred Y ) where + {} (P : Pred Y ) where map-cong : {k} {f₁ f₂ : X Y} {xs₁ xs₂ : C X} f₁ f₂ xs₁ ≲[ k ] xs₂ @@ -206,7 +206,7 @@ -- Uses of linear morphisms can be removed. module _ {s₁ s₂ p₁ p₂} {C₁ : Container s₁ p₁} {C₂ : Container s₂ p₂} - {x} {X : Set x} {} (P : Pred X ) where + {x} {X : Set x} {} (P : Pred X ) where remove-linear : {xs : C₁ X} (m : C₁ C₂) C₂ P ( m ⟫⊸ xs) C₁ P xs remove-linear {xs} m = mk↔ₛ′ t f t∘f f∘t @@ -304,7 +304,7 @@ module _ {s₁ s₂ s₃ p₁ p₂ p₃} {C₁ : Container s₁ p₁} {C₂ : Container s₂ p₂} {C₃ : Container s₃ p₃} - {x} {X : Set x} {} (P : Pred X ) where + {x} {X : Set x} {} (P : Pred X ) where join↔◇ : (join′ : (C₁ C.∘ C₂) C₃) (xss : C₁ ( C₂ X)) let join : {X} C₁ ( C₂ X) C₃ X diff --git a/master/Data.Container.Relation.Unary.Any.html b/master/Data.Container.Relation.Unary.Any.html index 806a6cd6a4..0bcd3b2a40 100644 --- a/master/Data.Container.Relation.Unary.Any.html +++ b/master/Data.Container.Relation.Unary.Any.html @@ -10,7 +10,7 @@ module Data.Container.Relation.Unary.Any where open import Level using (_⊔_) -open import Relation.Unary using (Pred; _⊆_) +open import Relation.Unary using (Pred; _⊆_) open import Data.Product.Base using (_,_; proj₂; ) open import Function.Base using (_∘′_; id) @@ -18,30 +18,30 @@ import Data.Container.Morphism as M record {s p} (C : Container s p) {x } {X : Set x} - (P : Pred X ) (cx : C X) : Set (p ) where + (P : Pred X ) (cx : C X) : Set (p ) where constructor any field proof : λ p P (proj₂ cx p) module _ {s₁ p₁ s₂ p₂} {C : Container s₁ p₁} {D : Container s₂ p₂} - {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} + {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} where - map : (f : C D) P Q D P ∘′ f C Q + map : (f : C D) P Q D P ∘′ f C Q map f P⊆Q (any (p , P)) .◇.proof = f .position p , P⊆Q P module _ {s₁ p₁ s₂ p₂} {C : Container s₁ p₁} {D : Container s₂ p₂} - {x } {X : Set x} {P : Pred X } + {x } {X : Set x} {P : Pred X } where - map₁ : (f : C D) D P ∘′ f C P + map₁ : (f : C D) D P ∘′ f C P map₁ f = map f id module _ {s p} {C : Container s p} - {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} + {x ℓ′} {X : Set x} {P : Pred X } {Q : Pred X ℓ′} where - map₂ : P Q C P C Q + map₂ : P Q C P C Q map₂ = map (M.id C) \ No newline at end of file diff --git a/master/Data.Digit.Properties.html b/master/Data.Digit.Properties.html index 5ca69fecea..0a6eb683b0 100644 --- a/master/Data.Digit.Properties.html +++ b/master/Data.Digit.Properties.html @@ -16,22 +16,22 @@ open import Data.Vec.Relation.Unary.Unique.Propositional using (Unique) import Data.Vec.Relation.Unary.Unique.Propositional.Properties as Unique open import Data.Vec.Relation.Unary.AllPairs using (allPairs?) -open import Relation.Nullary.Decidable.Core using (True; from-yes; ¬?) +open import Relation.Nullary.Decidable.Core using (True; from-yes; ¬?) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) open import Function.Base using (_∘_) module Data.Digit.Properties where digitCharsUnique : Unique digitChars -digitCharsUnique = from-yes (allPairs? x y ¬? (x Char.≟ y)) digitChars) +digitCharsUnique = from-yes (allPairs? x y ¬? (x Char.≟ y)) digitChars) module _ (base : ) where - module _ {base≥2 base≥2′ : True (2 ≤? base)} where + module _ {base≥2 base≥2′ : True (2 ≤? base)} where toDigits-injective : n m proj₁ (toDigits base {base≥2} n) proj₁ (toDigits base {base≥2′} m) n m toDigits-injective n m eq with toDigits base {base≥2} n | toDigits base {base≥2′} m toDigits-injective ._ ._ refl | _ , refl | ._ , refl = refl - module _ {base≤16 base≤16′ : True (base ≤? 16)} where + module _ {base≤16 base≤16′ : True (base ≤? 16)} where showDigit-injective : (n m : Digit base) showDigit {base} {base≤16} n showDigit {base} {base≤16′} m n m showDigit-injective n m = inject≤-injective _ _ n m Unique.lookup-injective digitCharsUnique _ _ \ No newline at end of file diff --git a/master/Data.Digit.html b/master/Data.Digit.html index a42899b133..413e0cc006 100644 --- a/master/Data.Digit.html +++ b/master/Data.Digit.html @@ -24,8 +24,8 @@ open import Data.Nat.Induction using (Acc; acc; <-wellFounded-fast; <′-Rec; <′-rec) open import Function.Base using (_$_) -open import Relation.Nullary.Decidable using (True; does; toWitness) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable using (True; does; toWitness) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; cong; cong₂; module ≡-Reasoning) @@ -53,13 +53,13 @@ ------------------------------------------------------------------------ -- Converting between `ℕ` and `expansions of ℕ` -toNatDigits : (base : ) {base≤16 : True (1 ≤? base)} List +toNatDigits : (base : ) {base≤16 : True (1 ≤? base)} List toNatDigits base@(suc zero) n = replicate n 1 toNatDigits base@(suc (suc _)) n = aux (<-wellFounded-fast n) [] where aux : {n : } Acc _<_ n List List aux {zero} _ xs = (0 xs) - aux {n@(suc _)} (acc wf) xs with does (0 <? n / base) + aux {n@(suc _)} (acc wf) xs with does (0 <? n / base) ... | false = (n % base) xs -- Could this more simply be n ∷ xs here? ... | true = aux (wf (m/n<m n base sz<ss)) ((n % base) xs) @@ -82,7 +82,7 @@ -- -- Note that the list of digits is always non-empty. -toDigits : (base : ) {base≥2 : True (2 ≤? base)} (n : ) +toDigits : (base : ) {base≥2 : True (2 ≤? base)} (n : ) λ (ds : Expansion base) fromDigits ds n toDigits base@(suc (suc k)) n = <′-rec Pred helper n where @@ -136,7 +136,7 @@ -- showDigit shows digits in base ≤ 16. -showDigit : {base} {base≤16 : True (base ≤? 16)} Digit base Char +showDigit : {base} {base≤16 : True (base ≤? 16)} Digit base Char showDigit {base≤16 = base≤16} d = - Vec.lookup digitChars (Fin.inject≤ d (toWitness base≤16)) + Vec.lookup digitChars (Fin.inject≤ d (toWitness base≤16)) \ No newline at end of file diff --git a/master/Data.Empty.html b/master/Data.Empty.html index 50905ada45..eada821167 100644 --- a/master/Data.Empty.html +++ b/master/Data.Empty.html @@ -36,4 +36,7 @@ ⊥-elim : {w} {Whatever : Set w} Whatever ⊥-elim () + +⊥-elim-irr : {w} {Whatever : Set w} . Whatever +⊥-elim-irr () \ No newline at end of file diff --git a/master/Data.Fin.Base.html b/master/Data.Fin.Base.html index 1fde40f710..57fbaf9d81 100644 --- a/master/Data.Fin.Base.html +++ b/master/Data.Fin.Base.html @@ -21,7 +21,7 @@ open import Relation.Binary.Core open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; cong) open import Relation.Binary.Indexed.Heterogeneous.Core using (IRel) -open import Relation.Nullary.Negation.Core using (contradiction) +open import Relation.Nullary.Negation.Core using (contradiction) private variable @@ -119,7 +119,7 @@ -- lower₁ "i" _ = "i". lower₁ : (i : Fin (suc n)) n toℕ i Fin n -lower₁ {zero} zero ne = contradiction refl ne +lower₁ {zero} zero ne = contradiction refl ne lower₁ {suc n} zero _ = zero lower₁ {suc n} (suc i) ne = suc (lower₁ i (ne cong suc)) @@ -251,7 +251,7 @@ -- McBride's "First-order unification by structural recursion". punchOut : {i j : Fin (suc n)} i j Fin n -punchOut {_} {zero} {zero} i≢j = contradiction refl i≢j +punchOut {_} {zero} {zero} i≢j = contradiction refl i≢j punchOut {_} {zero} {suc j} _ = j punchOut {suc _} {suc i} {zero} _ = zero punchOut {suc _} {suc i} {suc j} i≢j = suc (punchOut (i≢j cong suc)) diff --git a/master/Data.Fin.Induction.html b/master/Data.Fin.Induction.html index baf5074809..71bd05ce28 100644 --- a/master/Data.Fin.Induction.html +++ b/master/Data.Fin.Induction.html @@ -31,17 +31,17 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (StrictPartialOrder) open import Relation.Binary.Structures using (IsPartialOrder; IsStrictPartialOrder) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) import Relation.Binary.Construct.Flip.EqAndOrd as EqAndOrd import Relation.Binary.Construct.Flip.Ord as Ord import Relation.Binary.Construct.NonStrictToStrict as ToStrict import Relation.Binary.Construct.On as On -open import Relation.Binary.Definitions using (Tri; tri<; tri≈; tri>) +open import Relation.Binary.Definitions using (Tri; tri<; tri≈; tri>) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; subst; trans; cong) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary using (Pred) private variable @@ -59,22 +59,22 @@ <-wellFounded : WellFounded {A = Fin n} _<_ <-wellFounded = On.wellFounded toℕ ℕ.<-wellFounded -<-weakInduction-startingFrom : (P : Pred (Fin (suc n)) ) +<-weakInduction-startingFrom : (P : Pred (Fin (suc n)) ) {i} P i (∀ j P (inject₁ j) P (suc j)) {j} j i P j <-weakInduction-startingFrom P {i} Pi Pᵢ⇒Pᵢ₊₁ {j} j≥i = induct (<-wellFounded _) (<-cmp i j) j≥i where - induct : {j} Acc _<_ j Tri (i < j) (i j) (i > j) j i P j - induct (acc rs) (tri≈ _ refl _) i≤j = Pi - induct (acc rs) (tri> _ _ i>sj) i≤j with ()≤⇒≯ i≤j i>sj - induct {suc j} (acc rs) (tri< (s≤s i≤j) _ _) _ = Pᵢ⇒Pᵢ₊₁ j P[1+j] + induct : {j} Acc _<_ j Tri (i < j) (i j) (i > j) j i P j + induct (acc rs) (tri≈ _ refl _) i≤j = Pi + induct (acc rs) (tri> _ _ i>sj) i≤j with ()≤⇒≯ i≤j i>sj + induct {suc j} (acc rs) (tri< (s≤s i≤j) _ _) _ = Pᵢ⇒Pᵢ₊₁ j P[1+j] where toℕj≡toℕinjJ = sym $ toℕ-inject₁ j P[1+j] = induct (rs (s≤s (subst (ℕ._≤ toℕ j) toℕj≡toℕinjJ ≤-refl))) (<-cmp i $ inject₁ j) (subst (toℕ i ℕ.≤_) toℕj≡toℕinjJ i≤j) -<-weakInduction : (P : Pred (Fin (suc n)) ) +<-weakInduction : (P : Pred (Fin (suc n)) ) P zero (∀ i P (inject₁ i) P (suc i)) i P i @@ -91,7 +91,7 @@ >-wellFounded : WellFounded {A = Fin n} _>_ >-wellFounded {n} x = acc-map (ℕ.<-wellFounded (n toℕ x)) ->-weakInduction : (P : Pred (Fin (suc n)) ) +>-weakInduction : (P : Pred (Fin (suc n)) ) P (fromℕ n) (∀ i P (suc i) P (inject₁ i)) i P i @@ -99,8 +99,8 @@ where induct : {i} Acc _>_ i P i induct {i} (acc rec) with n ℕ.≟ toℕ i - ... | yes n≡i = subst P (toℕ-injective (trans (toℕ-fromℕ n) n≡i)) Pₙ - ... | no n≢i = subst P (inject₁-lower₁ i n≢i) (Pᵢ₊₁⇒Pᵢ _ Pᵢ₊₁) + ... | yes n≡i = subst P (toℕ-injective (trans (toℕ-fromℕ n) n≡i)) Pₙ + ... | no n≢i = subst P (inject₁-lower₁ i n≢i) (Pᵢ₊₁⇒Pᵢ _ Pᵢ₊₁) where Pᵢ₊₁ = induct (rec (ℕ.≤-reflexive (cong suc (sym (toℕ-lower₁ i n≢i))))) ------------------------------------------------------------------------ @@ -132,7 +132,7 @@ let (i₁ , i₂ , i₁<i₂ , xs[i₁]≡xs[i₂]) = pigeonhole (n<1+n n) (Vec.lookup (i xs)) in let xs[i₁]⊏xs[i₂] = Linked.lookup⁺ (Ord.transitive _⊏_ ⊏.trans) i∷xs↑ i₁<i₂ in let xs[i₁]⊏xs[i₁] = ⊏.<-respʳ-≈ (⊏.Eq.reflexive xs[i₁]≡xs[i₂]) xs[i₁]⊏xs[i₂] in - contradiction xs[i₁]⊏xs[i₁] (⊏.irrefl ⊏.Eq.refl) + contradiction xs[i₁]⊏xs[i₁] (⊏.irrefl ⊏.Eq.refl) po-wellFounded : {r} {_⊑_ : Rel (Fin n) r} IsPartialOrder _≈_ _⊑_ WellFounded (ToStrict._<_ _≈_ _⊑_) diff --git a/master/Data.Fin.Literals.html b/master/Data.Fin.Literals.html index a0d898aed3..fd1c8254ad 100644 --- a/master/Data.Fin.Literals.html +++ b/master/Data.Fin.Literals.html @@ -12,11 +12,11 @@ open import Agda.Builtin.FromNat open import Data.Nat using (suc; _≤?_) open import Data.Fin using (Fin ; #_) -open import Relation.Nullary.Decidable using (True) +open import Relation.Nullary.Decidable using (True) number : n Number (Fin n) number n = record - { Constraint = λ m True (suc m ≤? n) + { Constraint = λ m True (suc m ≤? n) ; fromNat = λ m {{pr}} (# m) {n} {pr} } \ No newline at end of file diff --git a/master/Data.Fin.Permutation.Components.html b/master/Data.Fin.Permutation.Components.html index 3db5baa901..4c00ae0c96 100644 --- a/master/Data.Fin.Permutation.Components.html +++ b/master/Data.Fin.Permutation.Components.html @@ -16,9 +16,9 @@ open import Data.Nat.Base as using (zero; suc; _∸_) open import Data.Product.Base using (proj₂) open import Function.Base using (_∘_) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary using (does; _because_; yes; no) -open import Relation.Nullary.Decidable using (dec-true; dec-false) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary using (does; _because_; yes; no) +open import Relation.Nullary.Decidable using (dec-true; dec-false) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; trans) open import Relation.Binary.PropositionalEquality.Properties @@ -33,9 +33,9 @@ -- 'tranpose i j' swaps the places of 'i' and 'j'. transpose : {n} Fin n Fin n Fin n Fin n -transpose i j k with does (k i) +transpose i j k with does (k i) ... | true = j -... | false with does (k j) +... | false with does (k j) ... | true = i ... | false = k @@ -46,14 +46,14 @@ transpose-inverse : {n} (i j : Fin n) {k} transpose i j (transpose j i k) k transpose-inverse i j {k} with k j -... | true because [k≡j] rewrite dec-true (i i) refl = sym (invert [k≡j]) -... | false because [k≢j] with k i -... | true because [k≡i] - rewrite dec-false (j i) (invert [k≢j] trans (invert [k≡i]) sym) - | dec-true (j j) refl - = sym (invert [k≡i]) -... | false because [k≢i] rewrite dec-false (k i) (invert [k≢i]) - | dec-false (k j) (invert [k≢j]) = refl +... | true because [k≡j] rewrite dec-true (i i) refl = sym (invert [k≡j]) +... | false because [k≢j] with k i +... | true because [k≡i] + rewrite dec-false (j i) (invert [k≢j] trans (invert [k≡i]) sym) + | dec-true (j j) refl + = sym (invert [k≡i]) +... | false because [k≢i] rewrite dec-false (k i) (invert [k≢i]) + | dec-false (k j) (invert [k≢j]) = refl ------------------------------------------------------------------------ -- DEPRECATED NAMES diff --git a/master/Data.Fin.Permutation.html b/master/Data.Fin.Permutation.html index 3d4b976264..6553d9b731 100644 --- a/master/Data.Fin.Permutation.html +++ b/master/Data.Fin.Permutation.html @@ -26,9 +26,9 @@ open import Function.Base using (_∘_) open import Level using (0ℓ) open import Relation.Binary.Core using (Rel) -open import Relation.Nullary using (does; ¬_; yes; no) -open import Relation.Nullary.Decidable using (dec-yes; dec-no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary using (does; ¬_; yes; no) +open import Relation.Nullary.Decidable using (dec-yes; dec-no) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; sym; trans; subst; cong; cong₂) open import Relation.Binary.PropositionalEquality.Properties @@ -188,20 +188,20 @@ where to : Fin (suc m) Fin (suc n) to k with i k - ... | yes i≡k = j - ... | no i≢k = punchIn j (π ⟨$⟩ʳ punchOut i≢k) + ... | yes i≡k = j + ... | no i≢k = punchIn j (π ⟨$⟩ʳ punchOut i≢k) from : Fin (suc n) Fin (suc m) from k with j k - ... | yes j≡k = i - ... | no j≢k = punchIn i (π ⟨$⟩ˡ punchOut j≢k) + ... | yes j≡k = i + ... | no j≢k = punchIn i (π ⟨$⟩ˡ punchOut j≢k) inverseʳ′ : StrictlyInverseʳ _≡_ to from inverseʳ′ k with i k - ... | yes i≡k rewrite proj₂ (dec-yes (j j) refl) = i≡k - ... | no i≢k + ... | yes i≡k rewrite proj₂ (dec-yes (j j) refl) = i≡k + ... | no i≢k with j≢punchInⱼπʳpunchOuti≢kpunchInᵢ≢i j (π ⟨$⟩ʳ punchOut i≢k) sym - rewrite dec-no (j punchIn j (π ⟨$⟩ʳ punchOut i≢k)) j≢punchInⱼπʳpunchOuti≢k + rewrite dec-no (j punchIn j (π ⟨$⟩ʳ punchOut i≢k)) j≢punchInⱼπʳpunchOuti≢k = begin punchIn i (π ⟨$⟩ˡ punchOut j≢punchInⱼπʳpunchOuti≢k) ≡⟨ cong l punchIn i (π ⟨$⟩ˡ l)) (punchOut-cong j refl) punchIn i (π ⟨$⟩ˡ punchOut (punchInᵢ≢i j (π ⟨$⟩ʳ punchOut i≢k) sym)) ≡⟨ cong l punchIn i (π ⟨$⟩ˡ l)) (punchOut-punchIn j) @@ -211,10 +211,10 @@ inverseˡ′ : StrictlyInverseˡ _≡_ to from inverseˡ′ k with j k - ... | yes j≡k rewrite proj₂ (dec-yes (i i) refl) = j≡k - ... | no j≢k + ... | yes j≡k rewrite proj₂ (dec-yes (i i) refl) = j≡k + ... | no j≢k with i≢punchInᵢπˡpunchOutj≢kpunchInᵢ≢i i (π ⟨$⟩ˡ punchOut j≢k) sym - rewrite dec-no (i punchIn i (π ⟨$⟩ˡ punchOut j≢k)) i≢punchInᵢπˡpunchOutj≢k + rewrite dec-no (i punchIn i (π ⟨$⟩ˡ punchOut j≢k)) i≢punchInᵢπˡpunchOutj≢k = begin punchIn j (π ⟨$⟩ʳ punchOut i≢punchInᵢπˡpunchOutj≢k) ≡⟨ cong l punchIn j (π ⟨$⟩ʳ l)) (punchOut-cong i refl) punchIn j (π ⟨$⟩ʳ punchOut (punchInᵢ≢i i (π ⟨$⟩ˡ punchOut j≢k) sym)) ≡⟨ cong l punchIn j (π ⟨$⟩ʳ l)) (punchOut-punchIn i) @@ -244,20 +244,20 @@ lift₀-remove p (suc i) = punchOut-zero (πʳ (suc i)) p where punchOut-zero : {i} (j : Fin (suc n)) {neq} i 0F suc (punchOut {i = i} {j} neq) j - punchOut-zero 0F {neq} p = contradiction p neq + punchOut-zero 0F {neq} p = contradiction p neq punchOut-zero (suc j) refl = refl ↔⇒≡ : Permutation m n m n ↔⇒≡ {zero} {zero} π = refl -↔⇒≡ {zero} {suc n} π = contradiction (π ⟨$⟩ˡ 0F) ¬Fin0 -↔⇒≡ {suc m} {zero} π = contradiction (π ⟨$⟩ʳ 0F) ¬Fin0 +↔⇒≡ {zero} {suc n} π = contradiction (π ⟨$⟩ˡ 0F) ¬Fin0 +↔⇒≡ {suc m} {zero} π = contradiction (π ⟨$⟩ʳ 0F) ¬Fin0 ↔⇒≡ {suc m} {suc n} π = cong suc (↔⇒≡ (remove 0F π)) fromPermutation : Permutation m n Permutation′ m fromPermutation π = subst (Permutation _) (sym (↔⇒≡ π)) π -refute : m n ¬ Permutation m n -refute m≢n π = contradiction (↔⇒≡ π) m≢n +refute : m n ¬ Permutation m n +refute m≢n π = contradiction (↔⇒≡ π) m≢n lift₀-id : (i : Fin (suc n)) lift₀ id ⟨$⟩ʳ i i lift₀-id 0F = refl @@ -274,32 +274,32 @@ lift₀-transpose : (i j : Fin n) transpose (suc i) (suc j) lift₀ (transpose i j) lift₀-transpose i j 0F = refl -lift₀-transpose i j (suc k) with does (k i) +lift₀-transpose i j (suc k) with does (k i) ... | true = refl -... | false with does (k j) +... | false with does (k j) ... | false = refl ... | true = refl insert-punchIn : i j (π : Permutation m n) k insert i j π ⟨$⟩ʳ punchIn i k punchIn j (π ⟨$⟩ʳ k) insert-punchIn i j π k with i punchIn i k -... | yes i≡punchInᵢk = contradiction (sym i≡punchInᵢk) (punchInᵢ≢i i k) -... | no i≢punchInᵢk = begin +... | yes i≡punchInᵢk = contradiction (sym i≡punchInᵢk) (punchInᵢ≢i i k) +... | no i≢punchInᵢk = begin punchIn j (π ⟨$⟩ʳ punchOut i≢punchInᵢk) ≡⟨ cong l punchIn j (π ⟨$⟩ʳ l)) (punchOut-cong i refl) punchIn j (π ⟨$⟩ʳ punchOut (punchInᵢ≢i i k sym)) ≡⟨ cong l punchIn j (π ⟨$⟩ʳ l)) (punchOut-punchIn i) punchIn j (π ⟨$⟩ʳ k) insert-remove : i (π : Permutation (suc m) (suc n)) insert i (π ⟨$⟩ʳ i) (remove i π) π insert-remove {m = m} {n = n} i π j with i j -... | yes i≡j = cong (π ⟨$⟩ʳ_) i≡j -... | no i≢j = begin +... | yes i≡j = cong (π ⟨$⟩ʳ_) i≡j +... | no i≢j = begin punchIn (π ⟨$⟩ʳ i) (punchOut (punchInᵢ≢i i (punchOut i≢j) sym Injection.injective (↔⇒↣ π))) ≡⟨ punchIn-punchOut _ π ⟨$⟩ʳ punchIn i (punchOut i≢j) ≡⟨ cong (π ⟨$⟩ʳ_) (punchIn-punchOut i≢j) π ⟨$⟩ʳ j remove-insert : i j (π : Permutation m n) remove i (insert i j π) π remove-insert i j π k with i i -... | no i≢i = contradiction refl i≢i -... | yes _ = begin +... | no i≢i = contradiction refl i≢i +... | yes _ = begin punchOut {i = j} _ ≡⟨ punchOut-cong j (insert-punchIn i j π k) punchOut {i = j} (punchInᵢ≢i j (π ⟨$⟩ʳ k) sym) diff --git a/master/Data.Fin.Properties.html b/master/Data.Fin.Properties.html index 4a9a5cb382..4619624acf 100644 --- a/master/Data.Fin.Properties.html +++ b/master/Data.Fin.Properties.html @@ -35,7 +35,7 @@ open import Function.Consequences.Propositional using (contraInjective) open import Function.Construct.Composition as Comp hiding (injective) open import Level using (Level) -open import Relation.Binary.Definitions as B hiding (Decidable) +open import Relation.Binary.Definitions as B hiding (Decidable) open import Relation.Binary.Core using (_⇒_; _Preserves_⟶_) open import Relation.Binary.Bundles using (Preorder; Setoid; DecSetoid; Poset; TotalOrder; DecTotalOrder; StrictPartialOrder; StrictTotalOrder) @@ -46,11 +46,11 @@ open import Relation.Binary.PropositionalEquality.Properties as using (module ≡-Reasoning) open import Relation.Nullary.Decidable as Dec - using (Dec; _because_; yes; no; _×-dec_; _⊎-dec_; map′) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) -open import Relation.Nullary.Reflects using (Reflects; invert) + using (Dec; _because_; yes; no; _×-dec_; _⊎-dec_; map′) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Reflects using (Reflects; invert) open import Relation.Unary as U - using (U; Pred; Decidable; _⊆_; Satisfiable; Universal) + using (U; Pred; Decidable; _⊆_; Satisfiable; Universal) open import Relation.Unary.Properties using (U?) private @@ -64,7 +64,7 @@ -- Fin ------------------------------------------------------------------------ -¬Fin0 : ¬ Fin 0 +¬Fin0 : ¬ Fin 0 ¬Fin0 () nonZeroIndex : Fin n ℕ.NonZero n @@ -95,11 +95,11 @@ infix 4 _≟_ -_≟_ : DecidableEquality (Fin n) -zero zero = yes refl -zero suc y = no λ() -suc x zero = no λ() -suc x suc y = map′ (cong suc) suc-injective (x y) +_≟_ : DecidableEquality (Fin n) +zero zero = yes refl +zero suc y = no λ() +suc x zero = no λ() +suc x suc y = map′ (cong suc) suc-injective (x y) ------------------------------------------------------------------------ -- Structures @@ -288,27 +288,27 @@ ≤-reflexive : _≡_ (_≤_ {n}) ≤-reflexive refl = ℕ.≤-refl -≤-refl : Reflexive (_≤_ {n}) +≤-refl : Reflexive (_≤_ {n}) ≤-refl = ≤-reflexive refl -≤-trans : Transitive (_≤_ {n}) +≤-trans : Transitive (_≤_ {n}) ≤-trans = ℕ.≤-trans -≤-antisym : Antisymmetric _≡_ (_≤_ {n}) +≤-antisym : Antisymmetric _≡_ (_≤_ {n}) ≤-antisym x≤y y≤x = toℕ-injective (ℕ.≤-antisym x≤y y≤x) -≤-total : Total (_≤_ {n}) +≤-total : Total (_≤_ {n}) ≤-total x y = ℕ.≤-total (toℕ x) (toℕ y) -≤-irrelevant : Irrelevant (_≤_ {m} {n}) +≤-irrelevant : Irrelevant (_≤_ {m} {n}) ≤-irrelevant = ℕ.≤-irrelevant infix 4 _≤?_ _<?_ -_≤?_ : B.Decidable (_≤_ {m} {n}) +_≤?_ : B.Decidable (_≤_ {m} {n}) a ≤? b = toℕ a ℕ.≤? toℕ b -_<?_ : B.Decidable (_<_ {m} {n}) +_<?_ : B.Decidable (_<_ {m} {n}) m <? n = suc (toℕ m) ℕ.≤? toℕ n ------------------------------------------------------------------------ @@ -368,34 +368,34 @@ ------------------------------------------------------------------------ -- Relational properties -<-irrefl : Irreflexive _≡_ (_<_ {n}) +<-irrefl : Irreflexive _≡_ (_<_ {n}) <-irrefl refl = ℕ.<-irrefl refl -<-asym : Asymmetric (_<_ {n}) +<-asym : Asymmetric (_<_ {n}) <-asym = ℕ.<-asym -<-trans : Transitive (_<_ {n}) +<-trans : Transitive (_<_ {n}) <-trans = ℕ.<-trans -<-cmp : Trichotomous _≡_ (_<_ {n}) -<-cmp zero zero = tri≈ (λ()) refl (λ()) -<-cmp zero (suc j) = tri< z<s (λ()) (λ()) -<-cmp (suc i) zero = tri> (λ()) (λ()) z<s +<-cmp : Trichotomous _≡_ (_<_ {n}) +<-cmp zero zero = tri≈ (λ()) refl (λ()) +<-cmp zero (suc j) = tri< z<s (λ()) (λ()) +<-cmp (suc i) zero = tri> (λ()) (λ()) z<s <-cmp (suc i) (suc j) with <-cmp i j -... | tri< i<j i≢j j≮i = tri< (s<s i<j) (i≢j suc-injective) (j≮i s<s⁻¹) -... | tri> i≮j i≢j j<i = tri> (i≮j s<s⁻¹) (i≢j suc-injective) (s<s j<i) -... | tri≈ i≮j i≡j j≮i = tri≈ (i≮j s<s⁻¹) (cong suc i≡j) (j≮i s<s⁻¹) +... | tri< i<j i≢j j≮i = tri< (s<s i<j) (i≢j suc-injective) (j≮i s<s⁻¹) +... | tri> i≮j i≢j j<i = tri> (i≮j s<s⁻¹) (i≢j suc-injective) (s<s j<i) +... | tri≈ i≮j i≡j j≮i = tri≈ (i≮j s<s⁻¹) (cong suc i≡j) (j≮i s<s⁻¹) -<-respˡ-≡ : (_<_ {m} {n}) Respectsˡ _≡_ +<-respˡ-≡ : (_<_ {m} {n}) Respectsˡ _≡_ <-respˡ-≡ refl x≤y = x≤y -<-respʳ-≡ : (_<_ {m} {n}) Respectsʳ _≡_ +<-respʳ-≡ : (_<_ {m} {n}) Respectsʳ _≡_ <-respʳ-≡ refl x≤y = x≤y -<-resp₂-≡ : (_<_ {n}) Respects₂ _≡_ +<-resp₂-≡ : (_<_ {n}) Respects₂ _≡_ <-resp₂-≡ = <-respʳ-≡ , <-respˡ-≡ -<-irrelevant : Irrelevant (_<_ {m} {n}) +<-irrelevant : Irrelevant (_<_ {m} {n}) <-irrelevant = ℕ.<-irrelevant ------------------------------------------------------------------------ @@ -438,7 +438,7 @@ <⇒≢ i<i refl = ℕ.n≮n _ i<i ≤∧≢⇒< : i j i j i < j -≤∧≢⇒< {i = zero} {zero} _ 0≢0 = contradiction refl 0≢0 +≤∧≢⇒< {i = zero} {zero} _ 0≢0 = contradiction refl 0≢0 ≤∧≢⇒< {i = zero} {suc j} _ _ = z<s ≤∧≢⇒< {i = suc i} {suc j} 1+i≤1+j 1+i≢1+j = s<s (≤∧≢⇒< (ℕ.s≤s⁻¹ 1+i≤1+j) (1+i≢1+j (cong suc))) @@ -491,14 +491,14 @@ ------------------------------------------------------------------------ toℕ-lower₁ : i (p : n toℕ i) toℕ (lower₁ i p) toℕ i -toℕ-lower₁ {ℕ.zero} zero p = contradiction refl p +toℕ-lower₁ {ℕ.zero} zero p = contradiction refl p toℕ-lower₁ {ℕ.suc m} zero p = refl toℕ-lower₁ {ℕ.suc m} (suc i) p = cong ℕ.suc (toℕ-lower₁ i (p cong ℕ.suc)) lower₁-injective : {n≢i : n toℕ i} {n≢j : n toℕ j} lower₁ i n≢i lower₁ j n≢j i j -lower₁-injective {zero} {zero} {_} {n≢i} {_} _ = contradiction refl n≢i -lower₁-injective {zero} {_} {zero} {_} {n≢j} _ = contradiction refl n≢j +lower₁-injective {zero} {zero} {_} {n≢i} {_} _ = contradiction refl n≢i +lower₁-injective {zero} {_} {zero} {_} {n≢j} _ = contradiction refl n≢j lower₁-injective {suc n} {zero} {zero} {_} {_} refl = refl lower₁-injective {suc n} {suc i} {suc j} {n≢i} {n≢j} eq = cong suc (lower₁-injective (suc-injective eq)) @@ -508,7 +508,7 @@ inject₁-lower₁ : (i : Fin (suc n)) (n≢i : n toℕ i) inject₁ (lower₁ i n≢i) i -inject₁-lower₁ {zero} zero 0≢0 = contradiction refl 0≢0 +inject₁-lower₁ {zero} zero 0≢0 = contradiction refl 0≢0 inject₁-lower₁ {suc n} zero _ = refl inject₁-lower₁ {suc n} (suc i) n+1≢i+1 = cong suc (inject₁-lower₁ i (n+1≢i+1 cong suc)) @@ -525,7 +525,7 @@ lower₁-irrelevant : (i : Fin (suc n)) (n≢i₁ n≢i₂ : n toℕ i) lower₁ i n≢i₁ lower₁ i n≢i₂ -lower₁-irrelevant {zero} zero 0≢0 _ = contradiction refl 0≢0 +lower₁-irrelevant {zero} zero 0≢0 _ = contradiction refl 0≢0 lower₁-irrelevant {suc n} zero _ _ = refl lower₁-irrelevant {suc n} (suc i) _ _ = cong suc (lower₁-irrelevant i _ _) @@ -572,7 +572,7 @@ ------------------------------------------------------------------------ pred< : (i : Fin (suc n)) i zero pred i < i -pred< zero i≢0 = contradiction refl i≢0 +pred< zero i≢0 = contradiction refl i≢0 pred< (suc i) _ = ≤̄⇒inject₁< ℕ.≤-refl ------------------------------------------------------------------------ @@ -697,9 +697,9 @@ combine-injectiveˡ : (i : Fin m) (j : Fin n) (k : Fin m) (l : Fin n) combine i j combine k l i k combine-injectiveˡ i j k l cᵢⱼ≡cₖₗ with <-cmp i k -... | tri< i<k _ _ = contradiction cᵢⱼ≡cₖₗ (<⇒≢ (combine-monoˡ-< j l i<k)) -... | tri≈ _ i≡k _ = i≡k -... | tri> _ _ i>k = contradiction (sym cᵢⱼ≡cₖₗ) (<⇒≢ (combine-monoˡ-< l j i>k)) +... | tri< i<k _ _ = contradiction cᵢⱼ≡cₖₗ (<⇒≢ (combine-monoˡ-< j l i<k)) +... | tri≈ _ i≡k _ = i≡k +... | tri> _ _ i>k = contradiction (sym cᵢⱼ≡cₖₗ) (<⇒≢ (combine-monoˡ-< l j i>k)) combine-injectiveʳ : (i : Fin m) (j : Fin n) (k : Fin m) (l : Fin n) combine i j combine k l j l @@ -852,8 +852,8 @@ punchOut-cong : (i : Fin (suc n)) {j k} {i≢j : i j} {i≢k : i k} j k punchOut i≢j punchOut i≢k -punchOut-cong {_} zero {zero} {i≢j = 0≢0} = contradiction refl 0≢0 -punchOut-cong {_} zero {suc j} {zero} {i≢k = 0≢0} = contradiction refl 0≢0 +punchOut-cong {_} zero {zero} {i≢j = 0≢0} = contradiction refl 0≢0 +punchOut-cong {_} zero {suc j} {zero} {i≢k = 0≢0} = contradiction refl 0≢0 punchOut-cong {_} zero {suc j} {suc k} = suc-injective punchOut-cong {suc n} (suc i) {zero} {zero} _ = refl punchOut-cong {suc n} (suc i) {suc j} {suc k} = cong suc punchOut-cong i suc-injective @@ -869,8 +869,8 @@ punchOut-injective : {i j k : Fin (suc n)} (i≢j : i j) (i≢k : i k) punchOut i≢j punchOut i≢k j k -punchOut-injective {_} {zero} {zero} {_} 0≢0 _ _ = contradiction refl 0≢0 -punchOut-injective {_} {zero} {_} {zero} _ 0≢0 _ = contradiction refl 0≢0 +punchOut-injective {_} {zero} {zero} {_} 0≢0 _ _ = contradiction refl 0≢0 +punchOut-injective {_} {zero} {_} {zero} _ 0≢0 _ = contradiction refl 0≢0 punchOut-injective {_} {zero} {suc j} {suc k} _ _ pⱼ≡pₖ = cong suc pⱼ≡pₖ punchOut-injective {suc n} {suc i} {zero} {zero} _ _ _ = refl punchOut-injective {suc n} {suc i} {suc j} {suc k} i≢j i≢k pⱼ≡pₖ = @@ -878,7 +878,7 @@ punchIn-punchOut : {i j : Fin (suc n)} (i≢j : i j) punchIn i (punchOut i≢j) j -punchIn-punchOut {_} {zero} {zero} 0≢0 = contradiction refl 0≢0 +punchIn-punchOut {_} {zero} {zero} 0≢0 = contradiction refl 0≢0 punchIn-punchOut {_} {zero} {suc j} _ = refl punchIn-punchOut {suc m} {suc i} {zero} i≢j = refl punchIn-punchOut {suc m} {suc i} {suc j} i≢j = @@ -913,9 +913,9 @@ suc i j suc i k pinch i j pinch i k j k pinch-injective {i = i} {zero} {zero} _ _ _ = refl pinch-injective {i = zero} {zero} {suc k} _ 1+i≢k eq = - contradiction (cong suc eq) 1+i≢k + contradiction (cong suc eq) 1+i≢k pinch-injective {i = zero} {suc j} {zero} 1+i≢j _ eq = - contradiction (cong suc (sym eq)) 1+i≢j + contradiction (cong suc (sym eq)) 1+i≢j pinch-injective {i = zero} {suc j} {suc k} _ _ eq = cong suc eq pinch-injective {i = suc i} {suc j} {suc k} 1+i≢j 1+i≢k eq = @@ -927,75 +927,75 @@ -- Quantification ------------------------------------------------------------------------ -module _ {p} {P : Pred (Fin (suc n)) p} where +module _ {p} {P : Pred (Fin (suc n)) p} where - ∀-cons : P zero Π[ P suc ] Π[ P ] + ∀-cons : P zero Π[ P suc ] Π[ P ] ∀-cons z s zero = z ∀-cons z s (suc i) = s i - ∀-cons-⇔ : (P zero × Π[ P suc ]) Π[ P ] + ∀-cons-⇔ : (P zero × Π[ P suc ]) Π[ P ] ∀-cons-⇔ = mk⇔ (uncurry ∀-cons) < _$ zero , _∘ suc > - ∃-here : P zero ∃⟨ P + ∃-here : P zero ∃⟨ P ∃-here = zero ,_ - ∃-there : ∃⟨ P suc ∃⟨ P + ∃-there : ∃⟨ P suc ∃⟨ P ∃-there = map suc id - ∃-toSum : ∃⟨ P P zero ∃⟨ P suc + ∃-toSum : ∃⟨ P P zero ∃⟨ P suc ∃-toSum ( zero , P₀ ) = inj₁ P₀ ∃-toSum (suc f , P₁₊) = inj₂ (f , P₁₊) - ⊎⇔∃ : (P zero ∃⟨ P suc ) ∃⟨ P + ⊎⇔∃ : (P zero ∃⟨ P suc ) ∃⟨ P ⊎⇔∃ = mk⇔ [ ∃-here , ∃-there ] ∃-toSum -decFinSubset : {p q} {P : Pred (Fin n) p} {Q : Pred (Fin n) q} - Decidable Q (∀ {i} Q i Dec (P i)) Dec (Q P) -decFinSubset {zero} {_} {_} Q? P? = yes λ {} +decFinSubset : {p q} {P : Pred (Fin n) p} {Q : Pred (Fin n) q} + Decidable Q (∀ {i} Q i Dec (P i)) Dec (Q P) +decFinSubset {zero} {_} {_} Q? P? = yes λ {} decFinSubset {suc n} {P = P} {Q} Q? P? with Q? zero | ∀-cons {P = λ x Q x P x} -... | false because [¬Q0] | cons = - map′ f {x} cons (⊥-elim invert [¬Q0]) x f {x}) x) +... | false because [¬Q0] | cons = + map′ f {x} cons (⊥-elim invert [¬Q0]) x f {x}) x) f {x} f {suc x}) (decFinSubset (Q? suc) P?) -... | true because [Q0] | cons = - map′ (uncurry λ P0 rec {x} cons _ P0) x rec {x}) x) - < _$ invert [Q0] , f {x} f {suc x}) > - (P? (invert [Q0]) ×-dec decFinSubset (Q? suc) P?) +... | true because [Q0] | cons = + map′ (uncurry λ P0 rec {x} cons _ P0) x rec {x}) x) + < _$ invert [Q0] , f {x} f {suc x}) > + (P? (invert [Q0]) ×-dec decFinSubset (Q? suc) P?) -any? : {p} {P : Pred (Fin n) p} Decidable P Dec ( P) -any? {zero} {P = _} P? = no λ { (() , _) } -any? {suc n} {P = P} P? = Dec.map ⊎⇔∃ (P? zero ⊎-dec any? (P? suc)) +any? : {p} {P : Pred (Fin n) p} Decidable P Dec ( P) +any? {zero} {P = _} P? = no λ { (() , _) } +any? {suc n} {P = P} P? = Dec.map ⊎⇔∃ (P? zero ⊎-dec any? (P? suc)) -all? : {p} {P : Pred (Fin n) p} Decidable P Dec (∀ f P f) -all? P? = map′ ∀p f ∀p tt) ∀p {x} _ ∀p x) +all? : {p} {P : Pred (Fin n) p} Decidable P Dec (∀ f P f) +all? P? = map′ ∀p f ∀p tt) ∀p {x} _ ∀p x) (decFinSubset U? {f} _ P? f)) private -- A nice computational property of `all?`: -- The boolean component of the result is exactly the -- obvious fold of boolean tests (`foldr _∧_ true`). - note : {p} {P : Pred (Fin 3) p} (P? : Decidable P) - λ z Dec.does (all? P?) z - note P? = Dec.does (P? 0F) Dec.does (P? 1F) Dec.does (P? 2F) true + note : {p} {P : Pred (Fin 3) p} (P? : Decidable P) + λ z Dec.does (all? P?) z + note P? = Dec.does (P? 0F) Dec.does (P? 1F) Dec.does (P? 2F) true , refl -- If a decidable predicate P over a finite set is sometimes false, -- then we can find the smallest value for which this is the case. -¬∀⟶∃¬-smallest : n {p} (P : Pred (Fin n) p) Decidable P - ¬ (∀ i P i) λ i ¬ P i × ((j : Fin′ i) P (inject j)) -¬∀⟶∃¬-smallest zero P P? ¬∀P = contradiction (λ()) ¬∀P +¬∀⟶∃¬-smallest : n {p} (P : Pred (Fin n) p) Decidable P + ¬ (∀ i P i) λ i ¬ P i × ((j : Fin′ i) P (inject j)) +¬∀⟶∃¬-smallest zero P P? ¬∀P = contradiction (λ()) ¬∀P ¬∀⟶∃¬-smallest (suc n) P P? ¬∀P with P? zero -... | false because [¬P₀] = (zero , invert [¬P₀] , λ ()) -... | true because [P₀] = map suc (map id (∀-cons (invert [P₀]))) - (¬∀⟶∃¬-smallest n (P suc) (P? suc) (¬∀P (∀-cons (invert [P₀])))) +... | false because [¬P₀] = (zero , invert [¬P₀] , λ ()) +... | true because [P₀] = map suc (map id (∀-cons (invert [P₀]))) + (¬∀⟶∃¬-smallest n (P suc) (P? suc) (¬∀P (∀-cons (invert [P₀])))) -- When P is a decidable predicate over a finite set the following -- lemma can be proved. -¬∀⟶∃¬ : n {p} (P : Pred (Fin n) p) Decidable P - ¬ (∀ i P i) ( λ i ¬ P i) +¬∀⟶∃¬ : n {p} (P : Pred (Fin n) p) Decidable P + ¬ (∀ i P i) ( λ i ¬ P i) ¬∀⟶∃¬ n P P? ¬P = map id proj₁ (¬∀⟶∃¬-smallest n P P? ¬P) ------------------------------------------------------------------------ @@ -1005,25 +1005,25 @@ -- The pigeonhole principle. pigeonhole : m ℕ.< n (f : Fin n Fin m) ∃₂ λ i j i < j × f i f j -pigeonhole z<s f = contradiction (f zero) λ() +pigeonhole z<s f = contradiction (f zero) λ() pigeonhole (s<s m<n@(s≤s _)) f with any? k f zero f (suc k)) -... | yes (j , f₀≡fⱼ) = zero , suc j , z<s , f₀≡fⱼ -... | no f₀≢fₖ +... | yes (j , f₀≡fⱼ) = zero , suc j , z<s , f₀≡fⱼ +... | no f₀≢fₖ with i , j , i<j , fᵢ≡fⱼpigeonhole m<n j punchOut (f₀≢fₖ (j ,_ ))) = suc i , suc j , s<s i<j , punchOut-injective (f₀≢fₖ (i ,_)) _ fᵢ≡fⱼ injective⇒≤ : {f : Fin m Fin n} Injective _≡_ _≡_ f m ℕ.≤ n injective⇒≤ {zero} {_} {f} _ = z≤n -injective⇒≤ {suc _} {zero} {f} _ = contradiction (f zero) ¬Fin0 +injective⇒≤ {suc _} {zero} {f} _ = contradiction (f zero) ¬Fin0 injective⇒≤ {suc _} {suc _} {f} inj = s≤s (injective⇒≤ eq suc-injective (inj (punchOut-injective (contraInjective inj 0≢1+n) (contraInjective inj 0≢1+n) eq)))) -<⇒notInjective : {f : Fin m Fin n} n ℕ.< m ¬ (Injective _≡_ _≡_ f) +<⇒notInjective : {f : Fin m Fin n} n ℕ.< m ¬ (Injective _≡_ _≡_ f) <⇒notInjective n<m inj = ℕ.≤⇒≯ (injective⇒≤ inj) n<m -ℕ→Fin-notInjective : (f : Fin n) ¬ (Injective _≡_ _≡_ f) +ℕ→Fin-notInjective : (f : Fin n) ¬ (Injective _≡_ _≡_ f) ℕ→Fin-notInjective f inj = ℕ.<-irrefl refl (injective⇒≤ (Comp.injective _≡_ _≡_ _≡_ toℕ-injective inj)) @@ -1043,7 +1043,7 @@ open RawApplicative RA - sequence : {n} {P : Pred (Fin n) f} + sequence : {n} {P : Pred (Fin n) f} (∀ i F (P i)) F (∀ i P i) sequence {zero} ∀iPi = pure λ() sequence {suc n} ∀iPi = ∀-cons <$> ∀iPi zero <*> sequence (∀iPi suc) @@ -1052,7 +1052,7 @@ open RawFunctor RF - sequence⁻¹ : {A : Set f} {P : Pred A f} + sequence⁻¹ : {A : Set f} {P : Pred A f} F (∀ i P i) (∀ i F (P i)) sequence⁻¹ F∀iPi i = f f i) <$> F∀iPi @@ -1063,8 +1063,8 @@ module _ {} {S : Setoid a } (inj : Injection S (≡-setoid n)) where open Setoid S - inj⇒≟ : B.Decidable _≈_ - inj⇒≟ = Dec.via-injection inj _≟_ + inj⇒≟ : B.Decidable _≈_ + inj⇒≟ = Dec.via-injection inj _≟_ inj⇒decSetoid : DecSetoid a inj⇒decSetoid = record @@ -1153,7 +1153,7 @@ "Warning: Fin0↔⊥ was deprecated in v2.0. Please use 0↔⊥ instead." #-} -eq? : A Fin n DecidableEquality A +eq? : A Fin n DecidableEquality A eq? = inj⇒≟ {-# WARNING_ON_USAGE eq? "Warning: eq? was deprecated in v2.0. diff --git a/master/Data.Fin.Show.html b/master/Data.Fin.Show.html index 084b111feb..cd511139a5 100644 --- a/master/Data.Fin.Show.html +++ b/master/Data.Fin.Show.html @@ -15,16 +15,16 @@ import Data.Nat.Show as using (show; readMaybe) open import Data.String.Base using (String) open import Function.Base -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Decidable using (True) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Decidable using (True) show : {n} Fin n String show = ℕ.show ∘′ toℕ -readMaybe : {n} base {base≤16 : True (base ≤? 16)} String Maybe (Fin n) +readMaybe : {n} base {base≤16 : True (base ≤? 16)} String Maybe (Fin n) readMaybe {n} base {pr} str = do nat ℕ.readMaybe base {pr} str case nat <? n of λ where - (yes pr) just (fromℕ< pr) - (no ¬pr) nothing + (yes pr) just (fromℕ< pr) + (no ¬pr) nothing \ No newline at end of file diff --git a/master/Data.Fin.Subset.Properties.html b/master/Data.Fin.Subset.Properties.html index ab20135ee4..8c27d8d26e 100644 --- a/master/Data.Fin.Subset.Properties.html +++ b/master/Data.Fin.Subset.Properties.html @@ -38,14 +38,14 @@ using (IsPreorder; IsPartialOrder; IsStrictPartialOrder; IsDecStrictPartialOrder) open import Relation.Binary.Bundles using (Preorder; Poset; StrictPartialOrder; DecStrictPartialOrder) -open import Relation.Binary.Definitions as B hiding (Decidable; Empty) +open import Relation.Binary.Definitions as B hiding (Decidable; Empty) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂; subst; _≢_; sym) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning; isEquivalence) -open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _⊎-dec_) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Unary using (Pred; Decidable; Satisfiable) +open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _⊎-dec_) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary using (Pred; Decidable; Satisfiable) private variable @@ -62,13 +62,13 @@ drop-there (there x∈p) = x∈p drop-not-there : suc x s p x p -drop-not-there x∉sp x∈p = contradiction (there x∈p) x∉sp +drop-not-there x∉sp x∈p = contradiction (there x∈p) x∉sp drop-∷-⊆ : s p t q p q drop-∷-⊆ sp⊆tq x∈p = drop-there (sp⊆tq (there x∈p)) drop-∷-⊂ : s p s q p q -drop-∷-⊂ {s = inside} (_ , zero , _ , x∉sp) = contradiction here x∉sp +drop-∷-⊂ {s = inside} (_ , zero , _ , x∉sp) = contradiction here x∉sp drop-∷-⊂ {s} (sp⊆sq , suc x , there x∈q , x∉sp) = drop-∷-⊆ sp⊆sq , x , x∈q , drop-not-there x∉sp out⊆ : p q outside p s q @@ -113,10 +113,10 @@ -- _∈_ infix 4 _∈?_ -_∈?_ : x (p : Subset n) Dec (x p) -zero ∈? inside p = yes here -zero ∈? outside p = no λ() -suc n ∈? s p = Dec.map′ there drop-there (n ∈? p) +_∈?_ : x (p : Subset n) Dec (x p) +zero ∈? inside p = yes here +zero ∈? outside p = no λ() +suc n ∈? s p = Dec.map′ there drop-there (n ∈? p) ------------------------------------------------------------------------ -- Empty @@ -126,11 +126,11 @@ Empty-unique : Empty p p Empty-unique {p = []} ¬∃∈ = refl -Empty-unique {p = inside p} ¬∃∈ = contradiction (zero , here) ¬∃∈ +Empty-unique {p = inside p} ¬∃∈ = contradiction (zero , here) ¬∃∈ Empty-unique {p = outside p} ¬∃∈ = cong (outside ∷_) (Empty-unique (drop-∷-Empty ¬∃∈)) -nonempty? : Decidable {A = Subset n} Nonempty +nonempty? : Decidable {A = Subset n} Nonempty nonempty? p = any? (_∈? p) ------------------------------------------------------------------------ @@ -150,7 +150,7 @@ ∉⊥ (there p) = ∉⊥ p ⊥⊆ : p -⊥⊆ x∈⊥ = contradiction x∈⊥ ∉⊥ +⊥⊆ x∈⊥ = contradiction x∈⊥ ∉⊥ ∣⊥∣≡0 : n {n = n} 0 ∣⊥∣≡0 zero = refl @@ -172,7 +172,7 @@ ∣p∣≡n⇒p≡⊤ : p n p {n} ∣p∣≡n⇒p≡⊤ {p = []} _ = refl -∣p∣≡n⇒p≡⊤ {p = outside p} |p|≡n = contradiction |p|≡n (ℕ.<⇒≢ (s≤s (∣p∣≤n p))) +∣p∣≡n⇒p≡⊤ {p = outside p} |p|≡n = contradiction |p|≡n (ℕ.<⇒≢ (s≤s (∣p∣≤n p))) ∣p∣≡n⇒p≡⊤ {p = inside p} |p|≡n = cong (inside ∷_) (∣p∣≡n⇒p≡⊤ (ℕ.suc-injective |p|≡n)) ------------------------------------------------------------------------ @@ -184,7 +184,7 @@ x∈⁅y⁆⇒x≡y : {x} (y : Fin n) x y x y x∈⁅y⁆⇒x≡y zero here = refl -x∈⁅y⁆⇒x≡y zero (there p) = contradiction p ∉⊥ +x∈⁅y⁆⇒x≡y zero (there p) = contradiction p ∉⊥ x∈⁅y⁆⇒x≡y (suc y) (there p) = cong suc (x∈⁅y⁆⇒x≡y y p) x∈⁅y⁆⇔x≡y : x y x y @@ -205,35 +205,35 @@ ------------------------------------------------------------------------ -- _⊆_ -⊆-refl : Reflexive {A = Subset n} _⊆_ +⊆-refl : Reflexive {A = Subset n} _⊆_ ⊆-refl = id ⊆-reflexive : _≡_ {A = Subset n} _⊆_ ⊆-reflexive refl = ⊆-refl -⊆-trans : Transitive {A = Subset n} _⊆_ +⊆-trans : Transitive {A = Subset n} _⊆_ ⊆-trans p⊆q q⊆r x∈p = q⊆r (p⊆q x∈p) -⊆-antisym : Antisymmetric {A = Subset n} _≡_ _⊆_ +⊆-antisym : Antisymmetric {A = Subset n} _≡_ _⊆_ ⊆-antisym {i = []} {[]} p⊆q q⊆p = refl ⊆-antisym {i = x xs} {y ys} p⊆q q⊆p with x | y ... | inside | inside = cong₂ _∷_ refl (⊆-antisym (drop-∷-⊆ p⊆q) (drop-∷-⊆ q⊆p)) -... | inside | outside = contradiction (p⊆q here) λ() -... | outside | inside = contradiction (q⊆p here) λ() +... | inside | outside = contradiction (p⊆q here) λ() +... | outside | inside = contradiction (q⊆p here) λ() ... | outside | outside = cong₂ _∷_ refl (⊆-antisym (drop-∷-⊆ p⊆q) (drop-∷-⊆ q⊆p)) -⊆-min : Minimum {A = Subset n} _⊆_ +⊆-min : Minimum {A = Subset n} _⊆_ ⊆-min p = ⊥⊆ -⊆-max : Maximum {A = Subset n} _⊆_ +⊆-max : Maximum {A = Subset n} _⊆_ ⊆-max p = ⊆⊤ infix 4 _⊆?_ -_⊆?_ : B.Decidable {A = Subset n} _⊆_ -[] ⊆? [] = yes id -outside p ⊆? y q = Dec.map out⊆-⇔ (p ⊆? q) -inside p ⊆? outside q = no p⊆q case (p⊆q here) of λ()) -inside p ⊆? inside q = Dec.map in⊆in-⇔ (p ⊆? q) +_⊆?_ : B.Decidable {A = Subset n} _⊆_ +[] ⊆? [] = yes id +outside p ⊆? y q = Dec.map out⊆-⇔ (p ⊆? q) +inside p ⊆? outside q = no p⊆q case (p⊆q here) of λ()) +inside p ⊆? inside q = Dec.map in⊆in-⇔ (p ⊆? q) module _ (n : ) where @@ -264,7 +264,7 @@ p⊆q⇒∣p∣≤∣q∣ {p = []} {[]} p⊆q = z≤n p⊆q⇒∣p∣≤∣q∣ {p = outside p} {outside q} p⊆q = p⊆q⇒∣p∣≤∣q∣ (drop-∷-⊆ p⊆q) p⊆q⇒∣p∣≤∣q∣ {p = outside p} {inside q} p⊆q = ℕ.m≤n⇒m≤1+n (p⊆q⇒∣p∣≤∣q∣ (drop-∷-⊆ p⊆q)) -p⊆q⇒∣p∣≤∣q∣ {p = inside p} {outside q} p⊆q = contradiction (p⊆q here) λ() +p⊆q⇒∣p∣≤∣q∣ {p = inside p} {outside q} p⊆q = contradiction (p⊆q here) λ() p⊆q⇒∣p∣≤∣q∣ {p = inside p} {inside q} p⊆q = s≤s (p⊆q⇒∣p∣≤∣q∣ (drop-∷-⊆ p⊆q)) @@ -274,32 +274,32 @@ p⊂q⇒p⊆q : p q p q p⊂q⇒p⊆q = proj₁ -⊂-trans : Transitive {A = Subset n} _⊂_ +⊂-trans : Transitive {A = Subset n} _⊂_ ⊂-trans (p⊆q , x , x∈q , x∉p) (q⊆r , _ , _ , _) = ⊆-trans p⊆q q⊆r , x , q⊆r x∈q , x∉p -⊂-⊆-trans : Trans {A = Subset n} _⊂_ _⊆_ _⊂_ +⊂-⊆-trans : Trans {A = Subset n} _⊂_ _⊆_ _⊂_ ⊂-⊆-trans (p⊆q , x , x∈q , x∉p) q⊆r = ⊆-trans p⊆q q⊆r , x , q⊆r x∈q , x∉p -⊆-⊂-trans : Trans {A = Subset n} _⊆_ _⊂_ _⊂_ +⊆-⊂-trans : Trans {A = Subset n} _⊆_ _⊂_ _⊂_ ⊆-⊂-trans p⊆q (q⊆r , x , x∈r , x∉q) = ⊆-trans p⊆q q⊆r , x , x∈r , x∉q p⊆q -⊂-irref : Irreflexive {A = Subset n} _≡_ _⊂_ -⊂-irref refl (_ , x , x∈p , x∉q) = contradiction x∈p x∉q +⊂-irref : Irreflexive {A = Subset n} _≡_ _⊂_ +⊂-irref refl (_ , x , x∈p , x∉q) = contradiction x∈p x∉q -⊂-antisym : Antisymmetric {A = Subset n} _≡_ _⊂_ +⊂-antisym : Antisymmetric {A = Subset n} _≡_ _⊂_ ⊂-antisym (p⊆q , _) (q⊆p , _) = ⊆-antisym p⊆q q⊆p -⊂-asymmetric : Asymmetric {A = Subset n} _⊂_ -⊂-asymmetric (p⊆q , _) (_ , x , x∈p , x∉q) = contradiction (p⊆q x∈p) x∉q +⊂-asymmetric : Asymmetric {A = Subset n} _⊂_ +⊂-asymmetric (p⊆q , _) (_ , x , x∈p , x∉q) = contradiction (p⊆q x∈p) x∉q infix 4 _⊂?_ -_⊂?_ : B.Decidable {A = Subset n} _⊂_ -[] ⊂? [] = no λ () -outside p ⊂? outside q = Dec.map out⊂out-⇔ (p ⊂? q) -outside p ⊂? inside q = Dec.map out⊂in-⇔ (p ⊆? q) -inside p ⊂? outside q = no {(p⊆q , _) case (p⊆q here) of λ ()}) -inside p ⊂? inside q = Dec.map in⊂in-⇔ (p ⊂? q) +_⊂?_ : B.Decidable {A = Subset n} _⊂_ +[] ⊂? [] = no λ () +outside p ⊂? outside q = Dec.map out⊂out-⇔ (p ⊂? q) +outside p ⊂? inside q = Dec.map out⊂in-⇔ (p ⊆? q) +inside p ⊂? outside q = no {(p⊆q , _) case (p⊆q here) of λ ()}) +inside p ⊂? inside q = Dec.map in⊂in-⇔ (p ⊂? q) module _ (n : ) where @@ -331,8 +331,8 @@ p⊂q⇒∣p∣<∣q∣ : p q p < q p⊂q⇒∣p∣<∣q∣ {p = outside p} {outside q} op⊂oq@(_ , _ , _ , _) = p⊂q⇒∣p∣<∣q∣ (drop-∷-⊂ op⊂oq) p⊂q⇒∣p∣<∣q∣ {p = outside p} {inside q} (op⊆iq , _ , _ , _) = s≤s (p⊆q⇒∣p∣≤∣q∣ (drop-∷-⊆ op⊆iq)) -p⊂q⇒∣p∣<∣q∣ {p = inside p} {outside q} (ip⊆oq , _ , _ , _) = contradiction (ip⊆oq here) λ() -p⊂q⇒∣p∣<∣q∣ {p = inside p} {inside q} (_ , zero , _ , x∉ip) = contradiction here x∉ip +p⊂q⇒∣p∣<∣q∣ {p = inside p} {outside q} (ip⊆oq , _ , _ , _) = contradiction (ip⊆oq here) λ() +p⊂q⇒∣p∣<∣q∣ {p = inside p} {inside q} (_ , zero , _ , x∉ip) = contradiction here x∉ip p⊂q⇒∣p∣<∣q∣ {p = inside p} {inside q} ip⊂iq@(_ , suc x , _ , _) = s≤s (p⊂q⇒∣p∣<∣q∣ (drop-∷-⊂ ip⊂iq)) ------------------------------------------------------------------------ @@ -345,13 +345,13 @@ x∈∁p⇒x∉p (there x∈∁p) (there x∈p) = x∈∁p⇒x∉p x∈∁p x∈p x∉∁p⇒x∈p : x p x p -x∉∁p⇒x∈p {x = zero} {outside p} x∉∁p = contradiction here x∉∁p +x∉∁p⇒x∈p {x = zero} {outside p} x∉∁p = contradiction here x∉∁p x∉∁p⇒x∈p {x = zero} {inside p} x∉∁p = here x∉∁p⇒x∈p {x = suc x} {_ p} x∉∁p = there (x∉∁p⇒x∈p (x∉∁p there)) x∉p⇒x∈∁p : x p x p x∉p⇒x∈∁p {x = zero} {outside p} x∉p = here -x∉p⇒x∈∁p {x = zero} {inside p} x∉p = contradiction here x∉p +x∉p⇒x∈∁p {x = zero} {inside p} x∉p = contradiction here x∉p x∉p⇒x∈∁p {x = suc x} {_ p} x∉p = there (x∉p⇒x∈∁p (x∉p there)) p∪∁p≡⊤ : (p : Subset n) p p @@ -796,7 +796,7 @@ x∈p∧x∉q⇒x∈p─q : x p x q x p q x∈p∧x∉q⇒x∈p─q {q = outside q} here i∉q = here -x∈p∧x∉q⇒x∈p─q {q = inside q} here i∉q = contradiction here i∉q +x∈p∧x∉q⇒x∈p─q {q = inside q} here i∉q = contradiction here i∉q x∈p∧x∉q⇒x∈p─q {q = outside q} (there i∈p) i∉q = there (x∈p∧x∉q⇒x∈p─q i∈p (i∉q there)) x∈p∧x∉q⇒x∈p─q {q = inside q} (there i∈p) i∉q = there (x∈p∧x∉q⇒x∈p─q i∈p (i∉q there)) @@ -836,35 +836,35 @@ ------------------------------------------------------------------------ -- Lift -Lift? : {P : Pred (Fin n) } Decidable P Decidable (Lift P) +Lift? : {P : Pred (Fin n) } Decidable P Decidable (Lift P) Lift? P? p = decFinSubset (_∈? p) {x} _ P? x) ------------------------------------------------------------------------ -- Other -module _ {P : Pred (Subset 0) } where +module _ {P : Pred (Subset 0) } where - ∃-Subset-zero : ∃⟨ P P [] + ∃-Subset-zero : ∃⟨ P P [] ∃-Subset-zero ([] , P[]) = P[] - ∃-Subset-[]-⇔ : P [] ∃⟨ P + ∃-Subset-[]-⇔ : P [] ∃⟨ P ∃-Subset-[]-⇔ = mk⇔ ([] ,_) ∃-Subset-zero -module _ {P : Pred (Subset (suc n)) } where +module _ {P : Pred (Subset (suc n)) } where - ∃-Subset-suc : ∃⟨ P ∃⟨ P (inside ∷_) ∃⟨ P (outside ∷_) + ∃-Subset-suc : ∃⟨ P ∃⟨ P (inside ∷_) ∃⟨ P (outside ∷_) ∃-Subset-suc (outside p , Pop) = inj₂ (p , Pop) ∃-Subset-suc ( inside p , Pip) = inj₁ (p , Pip) - ∃-Subset-∷-⇔ : (∃⟨ P (inside ∷_) ∃⟨ P (outside ∷_) ) ∃⟨ P + ∃-Subset-∷-⇔ : (∃⟨ P (inside ∷_) ∃⟨ P (outside ∷_) ) ∃⟨ P ∃-Subset-∷-⇔ = mk⇔ [ Product.map _ id , Product.map _ id ]′ ∃-Subset-suc -anySubset? : {P : Pred (Subset n) } Decidable P Dec ∃⟨ P -anySubset? {n = zero} P? = Dec.map ∃-Subset-[]-⇔ (P? []) -anySubset? {n = suc n} P? = Dec.map ∃-Subset-∷-⇔ - (anySubset? (P? (inside ∷_)) ⊎-dec anySubset? (P? (outside ∷_))) +anySubset? : {P : Pred (Subset n) } Decidable P Dec ∃⟨ P +anySubset? {n = zero} P? = Dec.map ∃-Subset-[]-⇔ (P? []) +anySubset? {n = suc n} P? = Dec.map ∃-Subset-∷-⇔ + (anySubset? (P? (inside ∷_)) ⊎-dec anySubset? (P? (outside ∷_))) diff --git a/master/Data.Fin.Subset.html b/master/Data.Fin.Subset.html index 16a5ff33aa..598f15233e 100644 --- a/master/Data.Fin.Subset.html +++ b/master/Data.Fin.Subset.html @@ -64,19 +64,19 @@ x p = p [ x ]= inside _∉_ : Fin n Subset n Set -x p = ¬ (x p) +x p = ¬ (x p) _⊆_ : Subset n Subset n Set p q = {x} x p x q _⊈_ : Subset n Subset n Set -p q = ¬ (p q) +p q = ¬ (p q) _⊂_ : Subset n Subset n Set p q = p q × x x q × x p) _⊄_ : Subset n Subset n Set -p q = ¬ (p q) +p q = ¬ (p q) ------------------------------------------------------------------------ -- Set operations @@ -128,7 +128,7 @@ Nonempty p = λ f f p Empty : (p : Subset n) Set -Empty p = ¬ Nonempty p +Empty p = ¬ Nonempty p Lift : {} (Fin n Set ) (Subset n Set ) Lift P p = {x} x p P x diff --git a/master/Data.Fin.Substitution.Lemmas.html b/master/Data.Fin.Substitution.Lemmas.html index d204d53c0e..a3c5b6d1d8 100644 --- a/master/Data.Fin.Substitution.Lemmas.html +++ b/master/Data.Fin.Substitution.Lemmas.html @@ -23,7 +23,7 @@ open import Relation.Binary.Construct.Closure.ReflexiveTransitive using (Star; ε; _◅_; _▻_) open ≡-Reasoning -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable @@ -45,7 +45,7 @@ -- assumption that the underlying substitution machinery satisfies -- certain properties. -record Lemmas₀ (T : Pred ) : Set where +record Lemmas₀ (T : Pred ) : Set where field simple : Simple T open Simple simple @@ -74,7 +74,7 @@ weaken (lookup ((ρ ) ↑⋆ k) (lift k suc x)) ≡⟨ sym $ Vec.lookup-map (lift k suc x) weaken ((ρ ) ↑⋆ k) lookup (map weaken ((ρ ) ↑⋆ k)) (lift k suc x) -record Lemmas₁ (T : Pred ) : Set where +record Lemmas₁ (T : Pred ) : Set where field lemmas₀ : Lemmas₀ T open Lemmas₀ lemmas₀ @@ -131,7 +131,7 @@ open Lemmas₀ lemmas₀ public -record Lemmas₂ (T : Pred ) : Set where +record Lemmas₂ (T : Pred ) : Set where field lemmas₁ : Lemmas₁ T application : Application T T @@ -216,7 +216,7 @@ open Subst subst public hiding (simple; application) open Lemmas₁ lemmas₁ public -record Lemmas₃ (T : Pred ) : Set where +record Lemmas₃ (T : Pred ) : Set where field lemmas₂ : Lemmas₂ T open Lemmas₂ lemmas₂ @@ -246,7 +246,7 @@ open Lemmas₂ lemmas₂ public hiding (wk-⊙-sub′) -record Lemmas₄ (T : Pred ) : Set where +record Lemmas₄ (T : Pred ) : Set where field lemmas₃ : Lemmas₃ T open Lemmas₃ lemmas₃ @@ -369,7 +369,7 @@ -- For an example of how AppLemmas can be used, see -- Data.Fin.Substitution.List. -record AppLemmas (T₁ : Pred ℓ₁) (T₂ : Pred ℓ₂) : Set (ℓ₁ ℓ₂) where +record AppLemmas (T₁ : Pred ℓ₁) (T₂ : Pred ℓ₂) : Set (ℓ₁ ℓ₂) where field application : Application T₁ T₂ lemmas₄ : Lemmas₄ T₂ @@ -422,7 +422,7 @@ hiding (application; _⊙_; _/_; _/✶_; id-vanishes; /-⊙; wk-commutes) -record Lemmas₅ {} (T : Pred ) : Set where +record Lemmas₅ {} (T : Pred ) : Set where field lemmas₄ : Lemmas₄ T private module L₄ = Lemmas₄ lemmas₄ diff --git a/master/Data.Fin.Substitution.html b/master/Data.Fin.Substitution.html index deaf61a1e7..7e7e63cb55 100644 --- a/master/Data.Fin.Substitution.html +++ b/master/Data.Fin.Substitution.html @@ -23,7 +23,7 @@ open import Relation.Binary.Construct.Closure.ReflexiveTransitive as Star using (Star; ε; _◅_) open import Level using (Level; _⊔_; 0ℓ) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable @@ -37,17 +37,17 @@ -- A Sub T m n is a substitution which, when applied to something with -- at most m variables, yields something with at most n variables. -Sub : Pred Set +Sub : Pred Set Sub T m n = Vec (T n) m -- A /reversed/ sequence of matching substitutions. -Subs : Pred Set +Subs : Pred Set Subs T = flip (Star (flip (Sub T))) -- Some simple substitutions. -record Simple (T : Pred ) : Set where +record Simple (T : Pred ) : Set where infix 10 _↑ infixl 10 _↑⋆_ _↑✶_ @@ -89,7 +89,7 @@ -- Application of substitutions. -record Application (T₁ : Pred ℓ₁) (T₂ : Pred ℓ₂) : Set (ℓ₁ ℓ₂) where +record Application (T₁ : Pred ℓ₁) (T₂ : Pred ℓ₂) : Set (ℓ₁ ℓ₂) where infixl 8 _/_ _/✶_ infixl 9 _⊙_ @@ -109,7 +109,7 @@ -- A combination of the two records above. -record Subst (T : Pred ) : Set where +record Subst (T : Pred ) : Set where field simple : Simple T application : Application T T @@ -129,7 +129,7 @@ -- Liftings from T₁ to T₂. -record Lift (T₁ : Pred ℓ₁) (T₂ : Pred ℓ₂) : Set (ℓ₁ ℓ₂) where +record Lift (T₁ : Pred ℓ₁) (T₂ : Pred ℓ₂) : Set (ℓ₁ ℓ₂) where field simple : Simple T₁ lift : {n} T₁ n T₂ n @@ -150,12 +150,12 @@ -- "Term" substitutions. -record TermSubst (T : Pred 0ℓ) : Set₁ where +record TermSubst (T : Pred 0ℓ) : Set₁ where field var : {n} Fin n T n - app : {T′ : Pred 0ℓ} Lift T′ T {m n} T m Sub T′ m n T n + app : {T′ : Pred 0ℓ} Lift T′ T {m n} T m Sub T′ m n T n - module Lifted {T′ : Pred 0ℓ} (lift : Lift T′ T) where + module Lifted {T′ : Pred 0ℓ} (lift : Lift T′ T) where application : Application T T′ application = record { _/_ = app lift } diff --git a/master/Data.Fin.html b/master/Data.Fin.html index 3fb0ca6819..7de6c4d8e8 100644 --- a/master/Data.Fin.html +++ b/master/Data.Fin.html @@ -27,6 +27,6 @@ infix 10 #_ -#_ : m {n} {m<n : True (m ℕ.<? n)} Fin n -#_ _ {m<n = m<n} = fromℕ< (toWitness m<n) +#_ : m {n} {m<n : True (m ℕ.<? n)} Fin n +#_ _ {m<n = m<n} = fromℕ< (toWitness m<n) \ No newline at end of file diff --git a/master/Data.Float.Properties.html b/master/Data.Float.Properties.html index 0f7bd7fe62..e9991d37b0 100644 --- a/master/Data.Float.Properties.html +++ b/master/Data.Float.Properties.html @@ -17,13 +17,13 @@ import Data.Word.Base as Word import Data.Word.Properties as Word open import Function.Base using (_∘_) -open import Relation.Nullary.Decidable as RN using (map′) +open import Relation.Nullary.Decidable as RN using (map′) open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Substitutive; Decidable; DecidableEquality) + using (Reflexive; Symmetric; Transitive; Substitutive; Decidable; DecidableEquality) import Relation.Binary.Construct.On as On open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; sym; trans; subst) @@ -46,20 +46,20 @@ ≈-reflexive : _≡_ _≈_ ≈-reflexive eq = cong (Maybe.map Word.toℕ toWord) eq -≈-refl : Reflexive _≈_ +≈-refl : Reflexive _≈_ ≈-refl = refl -≈-sym : Symmetric _≈_ +≈-sym : Symmetric _≈_ ≈-sym = sym -≈-trans : Transitive _≈_ +≈-trans : Transitive _≈_ ≈-trans = trans -≈-subst : {} Substitutive _≈_ +≈-subst : {} Substitutive _≈_ ≈-subst P x≈y p = subst P (≈⇒≡ x≈y) p infix 4 _≈?_ -_≈?_ : Decidable _≈_ +_≈?_ : Decidable _≈_ _≈?_ = On.decidable (Maybe.map Word.toℕ toWord) _≡_ (Maybe.≡-dec ℕ._≟_) ≈-isEquivalence : IsEquivalence _≈_ @@ -88,8 +88,8 @@ -- Properties of _≡_ infix 4 _≟_ -_≟_ : DecidableEquality Float -x y = map′ ≈⇒≡ ≈-reflexive (x ≈? y) +_≟_ : DecidableEquality Float +x y = map′ ≈⇒≡ ≈-reflexive (x ≈? y) ≡-setoid : Setoid _ _ ≡-setoid = setoid Float diff --git a/master/Data.Integer.Base.html b/master/Data.Integer.Base.html index 46b701e41e..dc8c0ec8a9 100644 --- a/master/Data.Integer.Base.html +++ b/master/Data.Integer.Base.html @@ -21,8 +21,8 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Unary using (Pred) infix 8 -_ infixr 8 _^_ @@ -94,16 +94,16 @@ x > y = y < x _≰_ : Rel 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≱_ : Rel 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≮_ : Rel 0ℓ -x y = ¬ (x < y) +x y = ¬ (x < y) _≯_ : Rel 0ℓ -x y = ¬ (x > y) +x y = ¬ (x > y) ------------------------------------------------------------------------ -- Boolean ordering @@ -120,7 +120,7 @@ -- See `Data.Nat.Base` for a discussion on the design of these. -NonZero : Pred 0ℓ +NonZero : Pred 0ℓ NonZero i = ℕ.NonZero i record Positive (i : ) : Set where @@ -164,7 +164,7 @@ ≢-nonZero : {i} i 0ℤ NonZero i ≢-nonZero { +[1+ n ]} _ = _ -≢-nonZero { +0} 0≢0 = contradiction refl 0≢0 +≢-nonZero { +0} 0≢0 = contradiction refl 0≢0 ≢-nonZero { -[1+ n ]} _ = _ >-nonZero : {i} i > 0ℤ NonZero i diff --git a/master/Data.Integer.Coprimality.html b/master/Data.Integer.Coprimality.html index 5da67d09df..c74d824488 100644 --- a/master/Data.Integer.Coprimality.html +++ b/master/Data.Integer.Coprimality.html @@ -17,7 +17,7 @@ open import Function.Base using (_on_) open import Level using (0ℓ) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Decidable; Symmetric) +open import Relation.Binary.Definitions using (Decidable; Symmetric) open import Relation.Binary.PropositionalEquality.Core using (subst) ------------------------------------------------------------------------ @@ -29,10 +29,10 @@ ------------------------------------------------------------------------ -- Properties of coprimality -sym : Symmetric Coprime +sym : Symmetric Coprime sym = ℕ.sym -coprime? : Decidable Coprime +coprime? : Decidable Coprime coprime? x y = ℕ.coprime? x y coprime-divisor : i j k Coprime i j i j * k i k diff --git a/master/Data.Integer.Divisibility.Signed.html b/master/Data.Integer.Divisibility.Signed.html index c099340cd0..1d822340fd 100644 --- a/master/Data.Integer.Divisibility.Signed.html +++ b/master/Data.Integer.Divisibility.Signed.html @@ -24,13 +24,13 @@ open import Relation.Binary.Bundles using (Preorder) open import Relation.Binary.Structures using (IsPreorder) open import Relation.Binary.Definitions - using (Reflexive; Transitive; Decidable) + using (Reflexive; Transitive; Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; trans; sym; cong; refl) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning; isEquivalence) import Relation.Binary.Reasoning.Preorder as ≲-Reasoning -open import Relation.Nullary.Decidable as Dec using (yes; no) +open import Relation.Nullary.Decidable as Dec using (yes; no) open import Relation.Binary.Reasoning.Syntax @@ -51,8 +51,8 @@ ∣ᵤ⇒∣ : {k i} k Unsigned.∣ i k i ∣ᵤ⇒∣ {k} {i} (Unsigned.divides 0 eq) = divides +0 (∣i∣≡0⇒i≡0 eq) ∣ᵤ⇒∣ {k} {i} (Unsigned.divides q@(ℕ.suc _) eq) with k +0 -... | yes refl = divides +0 (∣i∣≡0⇒i≡0 (trans eq (ℕ.*-zeroʳ q))) -... | no neq = divides s[i*k]◃q (◃-cong sign-eq abs-eq) +... | yes refl = divides +0 (∣i∣≡0⇒i≡0 (trans eq (ℕ.*-zeroʳ q))) +... | no neq = divides s[i*k]◃q (◃-cong sign-eq abs-eq) where s[i*k] = sign i Sign.* sign k s[i*k]◃q = s[i*k] q @@ -90,13 +90,13 @@ ------------------------------------------------------------------------ -- _∣_ is a preorder -∣-refl : Reflexive _∣_ +∣-refl : Reflexive _∣_ ∣-refl = ∣ᵤ⇒∣ ℕ.∣-refl ∣-reflexive : _≡_ _∣_ ∣-reflexive refl = ∣-refl -∣-trans : Transitive _∣_ +∣-trans : Transitive _∣_ ∣-trans i∣j j∣k = ∣ᵤ⇒∣ (ℕ.∣-trans (∣⇒∣ᵤ i∣j) (∣⇒∣ᵤ j∣k)) ∣-isPreorder : IsPreorder _≡_ _∣_ @@ -126,8 +126,8 @@ infix 4 _∣?_ -_∣?_ : Decidable _∣_ -k ∣? m = Dec.map′ ∣ᵤ⇒∣ ∣⇒∣ᵤ ( k ℕ.∣? m ) +_∣?_ : Decidable _∣_ +k ∣? m = Dec.map′ ∣ᵤ⇒∣ ∣⇒∣ᵤ ( k ℕ.∣? m ) 0∣⇒≡0 : {m} 0ℤ m m 0ℤ 0∣⇒≡0 0|m = ∣i∣≡0⇒i≡0 (ℕ.0∣⇒≡0 (∣⇒∣ᵤ 0|m)) diff --git a/master/Data.Integer.Properties.html b/master/Data.Integer.Properties.html index 5f9b81ef1b..1798f3fc62 100644 --- a/master/Data.Integer.Properties.html +++ b/master/Data.Integer.Properties.html @@ -34,14 +34,14 @@ open import Relation.Binary.Structures using (IsPreorder; IsTotalPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictPartialOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (DecidableEquality; Reflexive; Transitive; Antisymmetric; Total; Decidable; Irrelevant; Irreflexive; Asymmetric; LeftTrans; RightTrans; Trichotomous; tri≈; tri<; tri>) + using (DecidableEquality; Reflexive; Transitive; Antisymmetric; Total; Decidable; Irrelevant; Irreflexive; Asymmetric; LeftTrans; RightTrans; Trichotomous; tri≈; tri<; tri>) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂; sym; _≢_; subst; resp₂; trans) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning; setoid; decSetoid; isEquivalence) -open import Relation.Nullary.Decidable.Core using (yes; no) +open import Relation.Nullary.Decidable.Core using (yes; no) import Relation.Nullary.Reflects as Reflects -open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) import Relation.Nullary.Decidable as Dec open import Algebra.Definitions {A = } _≡_ @@ -70,11 +70,11 @@ +[1+-injective refl = refl infix 4 _≟_ -_≟_ : DecidableEquality -+ m + n = Dec.map′ (cong (+_)) +-injective (m ℕ.≟ n) -+ m -[1+ n ] = no λ() --[1+ m ] + n = no λ() --[1+ m ] -[1+ n ] = Dec.map′ (cong -[1+_]) -[1+-injective (m ℕ.≟ n) +_≟_ : DecidableEquality ++ m + n = Dec.map′ (cong (+_)) +-injective (m ℕ.≟ n) ++ m -[1+ n ] = no λ() +-[1+ m ] + n = no λ() +-[1+ m ] -[1+ n ] = Dec.map′ (cong -[1+_]) -[1+-injective (m ℕ.≟ n) ≡-setoid : Setoid 0ℓ 0ℓ ≡-setoid = setoid @@ -99,33 +99,33 @@ ≤-reflexive { -[1+ n ]} refl = -≤- ℕ.≤-refl ≤-reflexive {+ n} refl = +≤+ ℕ.≤-refl -≤-refl : Reflexive _≤_ +≤-refl : Reflexive _≤_ ≤-refl = ≤-reflexive refl -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans -≤+ (+≤+ n≤m) = -≤+ ≤-trans (-≤- n≤m) -≤+ = -≤+ ≤-trans (-≤- n≤m) (-≤- k≤n) = -≤- (ℕ.≤-trans k≤n n≤m) ≤-trans (+≤+ m≤n) (+≤+ n≤k) = +≤+ (ℕ.≤-trans m≤n n≤k) -≤-antisym : Antisymmetric _≡_ _≤_ +≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym (-≤- n≤m) (-≤- m≤n) = cong -[1+_] $ ℕ.≤-antisym m≤n n≤m ≤-antisym (+≤+ m≤n) (+≤+ n≤m) = cong (+_) $ ℕ.≤-antisym m≤n n≤m -≤-total : Total _≤_ +≤-total : Total _≤_ ≤-total (-[1+ m ]) (-[1+ n ]) = Sum.map -≤- -≤- (ℕ.≤-total n m) ≤-total (-[1+ m ]) (+ n ) = inj₁ -≤+ ≤-total (+ m ) (-[1+ n ]) = inj₂ -≤+ ≤-total (+ m ) (+ n ) = Sum.map +≤+ +≤+ (ℕ.≤-total m n) infix 4 _≤?_ -_≤?_ : Decidable _≤_ --[1+ m ] ≤? -[1+ n ] = Dec.map′ -≤- drop‿-≤- (n ℕ.≤? m) --[1+ m ] ≤? + n = yes -≤+ -+ m ≤? -[1+ n ] = no λ () -+ m ≤? + n = Dec.map′ +≤+ drop‿+≤+ (m ℕ.≤? n) +_≤?_ : Decidable _≤_ +-[1+ m ] ≤? -[1+ n ] = Dec.map′ -≤- drop‿-≤- (n ℕ.≤? m) +-[1+ m ] ≤? + n = yes -≤+ ++ m ≤? -[1+ n ] = no λ () ++ m ≤? + n = Dec.map′ +≤+ drop‿+≤+ (m ℕ.≤? n) -≤-irrelevant : Irrelevant _≤_ +≤-irrelevant : Irrelevant _≤_ ≤-irrelevant -≤+ -≤+ = refl ≤-irrelevant (-≤- n≤m₁) (-≤- n≤m₂) = cong -≤- (ℕ.≤-irrelevant n≤m₁ n≤m₂) ≤-irrelevant (+≤+ n≤m₁) (+≤+ n≤m₂) = cong +≤+ (ℕ.≤-irrelevant n≤m₁ n≤m₂) @@ -247,13 +247,13 @@ ≰⇒> : _≰_ _>_ ≰⇒> {+ n} {+_ n₁} i≰j = +<+ (ℕ.≰⇒> (i≰j +≤+)) ≰⇒> {+ n} { -[1+_] n₁} i≰j = -<+ -≰⇒> { -[1+_] n} {+_ n₁} i≰j = contradiction -≤+ i≰j +≰⇒> { -[1+_] n} {+_ n₁} i≰j = contradiction -≤+ i≰j ≰⇒> { -[1+_] n} { -[1+_] n₁} i≰j = -<- (ℕ.≰⇒> (i≰j -≤-)) ≮⇒≥ : _≮_ _≥_ ≮⇒≥ {+ i} {+ j} i≮j = +≤+ (ℕ.≮⇒≥ (i≮j +<+)) ≮⇒≥ {+ i} { -[1+_] j} i≮j = -≤+ -≮⇒≥ { -[1+_] i} {+ j} i≮j = contradiction -<+ i≮j +≮⇒≥ { -[1+_] i} {+ j} i≮j = contradiction -<+ i≮j ≮⇒≥ { -[1+_] i} { -[1+_] j} i≮j = -≤- (ℕ.≮⇒≥ (i≮j -<-)) >⇒≰ : _>_ _≰_ @@ -270,53 +270,53 @@ ------------------------------------------------------------------------ -- Relational properties -<-irrefl : Irreflexive _≡_ _<_ +<-irrefl : Irreflexive _≡_ _<_ <-irrefl { -[1+ n ]} refl = ℕ.<-irrefl refl drop‿-<- <-irrefl { +0} refl (+<+ ()) <-irrefl { +[1+ n ]} refl = ℕ.<-irrefl refl drop‿+<+ -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym (-<- n<m) = ℕ.<-asym n<m drop‿-<- <-asym (+<+ m<n) = ℕ.<-asym m<n drop‿+<+ -≤-<-trans : LeftTrans _≤_ _<_ +≤-<-trans : LeftTrans _≤_ _<_ ≤-<-trans (-≤- n≤m) (-<- o<n) = -<- (ℕ.<-≤-trans o<n n≤m) ≤-<-trans (-≤- n≤m) -<+ = -<+ ≤-<-trans -≤+ (+<+ m<o) = -<+ ≤-<-trans (+≤+ m≤n) (+<+ n<o) = +<+ (ℕ.≤-<-trans m≤n n<o) -<-≤-trans : RightTrans _<_ _≤_ +<-≤-trans : RightTrans _<_ _≤_ <-≤-trans (-<- n<m) (-≤- o≤n) = -<- (ℕ.≤-<-trans o≤n n<m) <-≤-trans (-<- n<m) -≤+ = -<+ <-≤-trans -<+ (+≤+ m≤n) = -<+ <-≤-trans (+<+ m<n) (+≤+ n≤o) = +<+ (ℕ.<-≤-trans m<n n≤o) -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans m<n n<p = ≤-<-trans (<⇒≤ m<n) n<p -<-cmp : Trichotomous _≡_ _<_ -<-cmp +0 +0 = tri≈ +≮0 refl +≮0 -<-cmp +0 +[1+ n ] = tri< (+<+ z<s) (λ()) +≮0 -<-cmp +[1+ n ] +0 = tri> +≮0 (λ()) (+<+ z<s) -<-cmp (+ m) -[1+ n ] = tri> +≮- (λ()) -<+ -<-cmp -[1+ m ] (+ n) = tri< -<+ (λ()) +≮- +<-cmp : Trichotomous _≡_ _<_ +<-cmp +0 +0 = tri≈ +≮0 refl +≮0 +<-cmp +0 +[1+ n ] = tri< (+<+ z<s) (λ()) +≮0 +<-cmp +[1+ n ] +0 = tri> +≮0 (λ()) (+<+ z<s) +<-cmp (+ m) -[1+ n ] = tri> +≮- (λ()) -<+ +<-cmp -[1+ m ] (+ n) = tri< -<+ (λ()) +≮- <-cmp -[1+ m ] -[1+ n ] with ℕ.<-cmp m n -... | tri< m<n m≢n n≯m = tri> (n≯m drop‿-<-) (m≢n -[1+-injective) (-<- m<n) -... | tri≈ m≮n m≡n n≯m = tri≈ (n≯m drop‿-<-) (cong -[1+_] m≡n) (m≮n drop‿-<-) -... | tri> m≮n m≢n n>m = tri< (-<- n>m) (m≢n -[1+-injective) (m≮n drop‿-<-) +... | tri< m<n m≢n n≯m = tri> (n≯m drop‿-<-) (m≢n -[1+-injective) (-<- m<n) +... | tri≈ m≮n m≡n n≯m = tri≈ (n≯m drop‿-<-) (cong -[1+_] m≡n) (m≮n drop‿-<-) +... | tri> m≮n m≢n n>m = tri< (-<- n>m) (m≢n -[1+-injective) (m≮n drop‿-<-) <-cmp +[1+ m ] +[1+ n ] with ℕ.<-cmp m n -... | tri< m<n m≢n n≯m = tri< (+<+ (s<s m<n)) (m≢n +[1+-injective) (n≯m s<s⁻¹ drop‿+<+) -... | tri≈ m≮n m≡n n≯m = tri≈ (m≮n s<s⁻¹ drop‿+<+) (cong (+_ suc) m≡n) (n≯m s<s⁻¹ drop‿+<+) -... | tri> m≮n m≢n n>m = tri> (m≮n s<s⁻¹ drop‿+<+) (m≢n +[1+-injective) (+<+ (s<s n>m)) +... | tri< m<n m≢n n≯m = tri< (+<+ (s<s m<n)) (m≢n +[1+-injective) (n≯m s<s⁻¹ drop‿+<+) +... | tri≈ m≮n m≡n n≯m = tri≈ (m≮n s<s⁻¹ drop‿+<+) (cong (+_ suc) m≡n) (n≯m s<s⁻¹ drop‿+<+) +... | tri> m≮n m≢n n>m = tri> (m≮n s<s⁻¹ drop‿+<+) (m≢n +[1+-injective) (+<+ (s<s n>m)) infix 4 _<?_ -_<?_ : Decidable _<_ --[1+ m ] <? -[1+ n ] = Dec.map′ -<- drop‿-<- (n ℕ.<? m) --[1+ m ] <? + n = yes -<+ -+ m <? -[1+ n ] = no λ() -+ m <? + n = Dec.map′ +<+ drop‿+<+ (m ℕ.<? n) +_<?_ : Decidable _<_ +-[1+ m ] <? -[1+ n ] = Dec.map′ -<- drop‿-<- (n ℕ.<? m) +-[1+ m ] <? + n = yes -<+ ++ m <? -[1+ n ] = no λ() ++ m <? + n = Dec.map′ +<+ drop‿+<+ (m ℕ.<? n) -<-irrelevant : Irrelevant _<_ +<-irrelevant : Irrelevant _<_ <-irrelevant (-<- n<m₁) (-<- n<m₂) = cong -<- (ℕ.<-irrelevant n<m₁ n<m₂) <-irrelevant -<+ -<+ = refl <-irrelevant (+<+ m<n₁) (+<+ m<n₂) = cong +<+ (ℕ.<-irrelevant m<n₁ m<n₂) @@ -357,7 +357,7 @@ i≮i : i i i≮i = <-irrefl refl ->-irrefl : Irreflexive _≡_ _>_ +>-irrefl : Irreflexive _≡_ _>_ >-irrefl = <-irrefl sym ------------------------------------------------------------------------ @@ -619,8 +619,8 @@ - (suc n suc m) where open ≡-Reasoning ⊖-≥ : m ℕ.≥ n m n + (m n) -⊖-≥ {m} {n} p with m ℕ.<ᵇ n | Reflects.invert (ℕ.<ᵇ-reflects-< m n) -... | true | q = contradiction (ℕ.≤-<-trans p q) (ℕ.<-irrefl refl) +⊖-≥ {m} {n} p with m ℕ.<ᵇ n | Reflects.invert (ℕ.<ᵇ-reflects-< m n) +... | true | q = contradiction (ℕ.≤-<-trans p q) (ℕ.<-irrefl refl) ... | false | q = refl ≤-⊖ : m ℕ.≤ n n m + (n m) @@ -632,7 +632,7 @@ + (suc n suc m) where open ≡-Reasoning ⊖-≤ : m ℕ.≤ n m n - + (n m) -⊖-≤ {m} {n} p with m ℕ.<ᵇ n | Reflects.invert (ℕ.<ᵇ-reflects-< m n) +⊖-≤ {m} {n} p with m ℕ.<ᵇ n | Reflects.invert (ℕ.<ᵇ-reflects-< m n) ... | true | q = refl ... | false | q rewrite ℕ.≤-antisym p (ℕ.≮⇒≥ q) | ℕ.n∸n≡0 n = refl @@ -670,7 +670,7 @@ m-n≡m⊖n (suc m) (suc n) = refl -[n⊖m]≡-m+n : m n - (m n) (- (+ m)) + (+ n) --[n⊖m]≡-m+n m n with m ℕ.<ᵇ n | Reflects.invert (ℕ.<ᵇ-reflects-< m n) +-[n⊖m]≡-m+n m n with m ℕ.<ᵇ n | Reflects.invert (ℕ.<ᵇ-reflects-< m n) ... | true | p = begin - (- (+ (n m))) ≡⟨ neg-involutive (+ (n m)) + (n m) ≡⟨ ⊖-≥ (ℕ.≤-trans (ℕ.m≤n+m m 1) p) @@ -1365,13 +1365,13 @@ rewrite +-cancelˡ-⊖ m (n ℕ.* suc m) (o ℕ.* suc m) | ⊖-swap (n ℕ.* suc m) (o ℕ.* suc m) with n ℕ.≤? o - ... | yes n≤o + ... | yes n≤o rewrite ⊖-≥ n≤o | ⊖-≥ (ℕ.*-mono-≤ n≤o (ℕ.≤-refl {x = suc m})) | -◃n≡-n ((o n) ℕ.* suc m) | ℕ.*-distribʳ-∸ (suc m) o n = refl - ... | no n≰o + ... | no n≰o rewrite sign-⊖-≰ n≰o | ∣⊖∣-≰ n≰o | +◃n≡+n ((n o) ℕ.* suc m) @@ -1409,7 +1409,7 @@ m ℕ.+ o ℕ.* suc m (m ℕ.+ n ℕ.* suc m) ≡⟨ [1+m]⊖[1+n]≡m⊖n (m ℕ.+ o ℕ.* suc m) (m ℕ.+ n ℕ.* suc m) +[1+ n ] * -[1+ m ] + -[1+ o ] * -[1+ m ] where open ≡-Reasoning *-distribʳ-+ +[1+ m ] -[1+ n ] +[1+ o ] with n ℕ.≤? o -... | yes n≤o +... | yes n≤o rewrite [1+m]⊖[1+n]≡m⊖n o n | [1+m]⊖[1+n]≡m⊖n (m ℕ.+ o ℕ.* suc m) (m ℕ.+ n ℕ.* suc m) | +-cancelˡ-⊖ m (o ℕ.* suc m) (n ℕ.* suc m) @@ -1419,7 +1419,7 @@ | ℕ.*-distribʳ-∸ (suc m) o n | +◃n≡+n (o ℕ.* suc m n ℕ.* suc m) = refl -... | no n≰o +... | no n≰o rewrite [1+m]⊖[1+n]≡m⊖n o n | [1+m]⊖[1+n]≡m⊖n (m ℕ.+ o ℕ.* suc m) (m ℕ.+ n ℕ.* suc m) | +-cancelˡ-⊖ m (o ℕ.* suc m) (n ℕ.* suc m) @@ -1430,7 +1430,7 @@ | ℕ.*-distribʳ-∸ (suc m) n o = refl *-distribʳ-+ +[1+ o ] +[1+ m ] -[1+ n ] with n ℕ.≤? m -... | yes n≤m +... | yes n≤m rewrite [1+m]⊖[1+n]≡m⊖n m n | [1+m]⊖[1+n]≡m⊖n (o ℕ.+ m ℕ.* suc o) (o ℕ.+ n ℕ.* suc o) | +-cancelˡ-⊖ o (m ℕ.* suc o) (n ℕ.* suc o) @@ -1439,7 +1439,7 @@ | +◃n≡+n ((m n) ℕ.* suc o) | ℕ.*-distribʳ-∸ (suc o) m n = refl -... | no n≰m +... | no n≰m rewrite [1+m]⊖[1+n]≡m⊖n m n | [1+m]⊖[1+n]≡m⊖n (o ℕ.+ m ℕ.* suc o) (o ℕ.+ n ℕ.* suc o) | +-cancelˡ-⊖ o (m ℕ.* suc o) (n ℕ.* suc o) @@ -1772,7 +1772,7 @@ *-cancelˡ-<-nonNeg : k .{{_ : NonNegative k}} k * i < k * j i < j *-cancelˡ-<-nonNeg {+ i} {+ j} (+ n) leq = +<+ (ℕ.*-cancelˡ-< n _ _ (+◃-cancel-< leq)) -*-cancelˡ-<-nonNeg {+ i} { -[1+ j ]} (+ n) leq = contradiction leq +◃≮-◃ +*-cancelˡ-<-nonNeg {+ i} { -[1+ j ]} (+ n) leq = contradiction leq +◃≮-◃ *-cancelˡ-<-nonNeg { -[1+ i ]} {+ j} (+ n)leq = -<+ *-cancelˡ-<-nonNeg { -[1+ i ]} { -[1+ j ]} (+ n) leq = -<- (s<s⁻¹ (ℕ.*-cancelˡ-< n _ _ (neg◃-cancel-< leq))) @@ -1981,27 +1981,27 @@ mono-<-distrib-⊓ : f f Preserves _<_ _<_ i j f (i j) f i f j mono-<-distrib-⊓ f f-mono-< i j with <-cmp i j -... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊓j≡i (<⇒≤ i<j))) (sym (i≤j⇒i⊓j≡i (<⇒≤ (f-mono-< i<j)))) -... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊓j≡i ≤-refl)) (sym (i≤j⇒i⊓j≡i ≤-refl)) -... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊓j≡j (<⇒≤ i>j))) (sym (i≥j⇒i⊓j≡j (<⇒≤ (f-mono-< i>j)))) +... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊓j≡i (<⇒≤ i<j))) (sym (i≤j⇒i⊓j≡i (<⇒≤ (f-mono-< i<j)))) +... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊓j≡i ≤-refl)) (sym (i≤j⇒i⊓j≡i ≤-refl)) +... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊓j≡j (<⇒≤ i>j))) (sym (i≥j⇒i⊓j≡j (<⇒≤ (f-mono-< i>j)))) mono-<-distrib-⊔ : f f Preserves _<_ _<_ i j f (i j) f i f j mono-<-distrib-⊔ f f-mono-< i j with <-cmp i j -... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊔j≡j (<⇒≤ i<j))) (sym (i≤j⇒i⊔j≡j (<⇒≤ (f-mono-< i<j)))) -... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊔j≡j ≤-refl)) (sym (i≤j⇒i⊔j≡j ≤-refl)) -... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊔j≡i (<⇒≤ i>j))) (sym (i≥j⇒i⊔j≡i (<⇒≤ (f-mono-< i>j)))) +... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊔j≡j (<⇒≤ i<j))) (sym (i≤j⇒i⊔j≡j (<⇒≤ (f-mono-< i<j)))) +... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊔j≡j ≤-refl)) (sym (i≤j⇒i⊔j≡j ≤-refl)) +... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊔j≡i (<⇒≤ i>j))) (sym (i≥j⇒i⊔j≡i (<⇒≤ (f-mono-< i>j)))) antimono-<-distrib-⊔ : f f Preserves _<_ _>_ i j f (i j) f i f j antimono-<-distrib-⊔ f f-mono-< i j with <-cmp i j -... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊔j≡j (<⇒≤ i<j))) (sym (i≥j⇒i⊓j≡j (<⇒≤ (f-mono-< i<j)))) -... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊔j≡j ≤-refl)) (sym (i≥j⇒i⊓j≡j ≤-refl)) -... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊔j≡i (<⇒≤ i>j))) (sym (i≤j⇒i⊓j≡i (<⇒≤ (f-mono-< i>j)))) +... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊔j≡j (<⇒≤ i<j))) (sym (i≥j⇒i⊓j≡j (<⇒≤ (f-mono-< i<j)))) +... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊔j≡j ≤-refl)) (sym (i≥j⇒i⊓j≡j ≤-refl)) +... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊔j≡i (<⇒≤ i>j))) (sym (i≤j⇒i⊓j≡i (<⇒≤ (f-mono-< i>j)))) antimono-<-distrib-⊓ : f f Preserves _<_ _>_ i j f (i j) f i f j antimono-<-distrib-⊓ f f-mono-< i j with <-cmp i j -... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊓j≡i (<⇒≤ i<j))) (sym (i≥j⇒i⊔j≡i (<⇒≤ (f-mono-< i<j)))) -... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊓j≡i ≤-refl)) (sym (i≥j⇒i⊔j≡i ≤-refl)) -... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊓j≡j (<⇒≤ i>j))) (sym (i≤j⇒i⊔j≡j (<⇒≤ (f-mono-< i>j)))) +... | tri< i<j _ _ = trans (cong f (i≤j⇒i⊓j≡i (<⇒≤ i<j))) (sym (i≥j⇒i⊔j≡i (<⇒≤ (f-mono-< i<j)))) +... | tri≈ _ refl _ = trans (cong f (i≤j⇒i⊓j≡i ≤-refl)) (sym (i≥j⇒i⊔j≡i ≤-refl)) +... | tri> _ _ i>j = trans (cong f (i≥j⇒i⊓j≡j (<⇒≤ i>j))) (sym (i≤j⇒i⊔j≡j (<⇒≤ (f-mono-< i>j)))) ------------------------------------------------------------------------ -- Other properties of _⊓_, _⊔_ and -_ diff --git a/master/Data.List.Base.html b/master/Data.List.Base.html index 6fa1bb9493..5fab988e67 100644 --- a/master/Data.List.Base.html +++ b/master/Data.List.Base.html @@ -24,11 +24,11 @@ open import Function.Base using (id; _∘_ ; _∘′_; _∘₂_; _$_; const; flip) open import Level using (Level) -open import Relation.Unary using (Pred; Decidable) +open import Relation.Unary using (Pred; Decidable) open import Relation.Binary.Core using (Rel) import Relation.Binary.Definitions as B open import Relation.Binary.PropositionalEquality.Core using (_≡_) -open import Relation.Nullary.Decidable.Core using (T?; does; ¬?) +open import Relation.Nullary.Decidable.Core using (T?; does; ¬?) private variable @@ -114,10 +114,10 @@ partitionSums : List (A B) List A × List B partitionSums = partitionSumsWith id -merge : {R : Rel A } B.Decidable R List A List A List A +merge : {R : Rel A } B.Decidable R List A List A List A merge R? [] ys = ys merge R? xs [] = xs -merge R? x∷xs@(x xs) y∷ys@(y ys) = if does (R? x y) +merge R? x∷xs@(x xs) y∷ys@(y ys) = if does (R? x y) then x merge R? xs y∷ys else y merge R? x∷xs ys @@ -357,84 +357,84 @@ -- versions over the boolean versions, e.g. use `takeWhile (_≤? 10) xs` -- rather than `takeWhileᵇ (_≤ᵇ 10) xs`. -takeWhile : {P : Pred A p} Decidable P List A List A +takeWhile : {P : Pred A p} Decidable P List A List A takeWhile P? [] = [] -takeWhile P? (x xs) = if does (P? x) +takeWhile P? (x xs) = if does (P? x) then x takeWhile P? xs else [] takeWhileᵇ : (A Bool) List A List A -takeWhileᵇ p = takeWhile (T? p) +takeWhileᵇ p = takeWhile (T? p) -dropWhile : {P : Pred A p} Decidable P List A List A +dropWhile : {P : Pred A p} Decidable P List A List A dropWhile P? [] = [] -dropWhile P? (x xs) = if does (P? x) +dropWhile P? (x xs) = if does (P? x) then dropWhile P? xs else x xs dropWhileᵇ : (A Bool) List A List A -dropWhileᵇ p = dropWhile (T? p) +dropWhileᵇ p = dropWhile (T? p) -filter : {P : Pred A p} Decidable P List A List A +filter : {P : Pred A p} Decidable P List A List A filter P? [] = [] filter P? (x xs) = let xs′ = filter P? xs in - if does (P? x) + if does (P? x) then x xs′ else xs′ filterᵇ : (A Bool) List A List A -filterᵇ p = filter (T? p) +filterᵇ p = filter (T? p) -partition : {P : Pred A p} Decidable P List A (List A × List A) +partition : {P : Pred A p} Decidable P List A (List A × List A) partition P? [] = [] , [] partition P? (x xs) = let ys , zs = partition P? xs in - if does (P? x) + if does (P? x) then (x ys , zs) else (ys , x zs) partitionᵇ : (A Bool) List A List A × List A -partitionᵇ p = partition (T? p) +partitionᵇ p = partition (T? p) -span : {P : Pred A p} Decidable P List A (List A × List A) +span : {P : Pred A p} Decidable P List A (List A × List A) span P? [] = [] , [] -span P? ys@(x xs) = if does (P? x) +span P? ys@(x xs) = if does (P? x) then Product.map (x ∷_) id (span P? xs) else ([] , ys) spanᵇ : (A Bool) List A List A × List A -spanᵇ p = span (T? p) +spanᵇ p = span (T? p) -break : {P : Pred A p} Decidable P List A (List A × List A) -break P? = span (¬? P?) +break : {P : Pred A p} Decidable P List A (List A × List A) +break P? = span (¬? P?) breakᵇ : (A Bool) List A List A × List A -breakᵇ p = break (T? p) +breakᵇ p = break (T? p) -- The predicate `P` represents the notion of newline character for the -- type `A`. It is used to split the input list into a list of lines. -- Some lines may be empty if the input contains at least two -- consecutive newline characters. -linesBy : {P : Pred A p} Decidable P List A List (List A) +linesBy : {P : Pred A p} Decidable P List A List (List A) linesBy {A = A} P? = go nothing where go : Maybe (List A) List A List (List A) go acc [] = maybe′ ([_] ∘′ reverse) [] acc - go acc (c cs) = if does (P? c) + go acc (c cs) = if does (P? c) then reverse acc′ go nothing cs else go (just (c acc′)) cs where acc′ = Maybe.fromMaybe [] acc linesByᵇ : (A Bool) List A List (List A) -linesByᵇ p = linesBy (T? p) +linesByᵇ p = linesBy (T? p) -- The predicate `P` represents the notion of space character for the -- type `A`. It is used to split the input list into a list of words. -- All the words are non empty and the output does not contain any space -- characters. -wordsBy : {P : Pred A p} Decidable P List A List (List A) +wordsBy : {P : Pred A p} Decidable P List A List (List A) wordsBy {A = A} P? = go [] where cons : List A List (List A) List (List A) @@ -443,60 +443,60 @@ go : List A List A List (List A) go acc [] = cons acc [] - go acc (c cs) = if does (P? c) + go acc (c cs) = if does (P? c) then cons acc (go [] cs) else go (c acc) cs wordsByᵇ : (A Bool) List A List (List A) -wordsByᵇ p = wordsBy (T? p) +wordsByᵇ p = wordsBy (T? p) -derun : {R : Rel A p} B.Decidable R List A List A +derun : {R : Rel A p} B.Decidable R List A List A derun R? [] = [] derun R? (x []) = x [] derun R? (x xs@(y _)) = let ys = derun R? xs in - if does (R? x y) + if does (R? x y) then ys else x ys derunᵇ : (A A Bool) List A List A -derunᵇ r = derun (T? ∘₂ r) +derunᵇ r = derun (T? ∘₂ r) -deduplicate : {R : Rel A p} B.Decidable R List A List A +deduplicate : {R : Rel A p} B.Decidable R List A List A deduplicate R? [] = [] -deduplicate R? (x xs) = x filter (¬? R? x) (deduplicate R? xs) +deduplicate R? (x xs) = x filter (¬? R? x) (deduplicate R? xs) deduplicateᵇ : (A A Bool) List A List A -deduplicateᵇ r = deduplicate (T? ∘₂ r) +deduplicateᵇ r = deduplicate (T? ∘₂ r) -- Finds the first element satisfying the boolean predicate -find : {P : Pred A p} Decidable P List A Maybe A +find : {P : Pred A p} Decidable P List A Maybe A find P? [] = nothing -find P? (x xs) = if does (P? x) then just x else find P? xs +find P? (x xs) = if does (P? x) then just x else find P? xs findᵇ : (A Bool) List A Maybe A -findᵇ p = find (T? p) +findᵇ p = find (T? p) -- Finds the index of the first element satisfying the boolean predicate -findIndex : {P : Pred A p} Decidable P (xs : List A) Maybe $ Fin (length xs) +findIndex : {P : Pred A p} Decidable P (xs : List A) Maybe $ Fin (length xs) findIndex P? [] = nothing -findIndex P? (x xs) = if does (P? x) +findIndex P? (x xs) = if does (P? x) then just zero else Maybe.map suc (findIndex P? xs) findIndexᵇ : (A Bool) (xs : List A) Maybe $ Fin (length xs) -findIndexᵇ p = findIndex (T? p) +findIndexᵇ p = findIndex (T? p) -- Finds indices of all the elements satisfying the boolean predicate -findIndices : {P : Pred A p} Decidable P (xs : List A) List $ Fin (length xs) +findIndices : {P : Pred A p} Decidable P (xs : List A) List $ Fin (length xs) findIndices P? [] = [] -findIndices P? (x xs) = if does (P? x) +findIndices P? (x xs) = if does (P? x) then zero indices else indices where indices = map suc (findIndices P? xs) findIndicesᵇ : (A Bool) (xs : List A) List $ Fin (length xs) -findIndicesᵇ p = findIndices (T? p) +findIndicesᵇ p = findIndices (T? p) ------------------------------------------------------------------------ -- Actions on single elements diff --git a/master/Data.List.Countdown.html b/master/Data.List.Countdown.html index a81989dbed..8aae0f5b98 100644 --- a/master/Data.List.Countdown.html +++ b/master/Data.List.Countdown.html @@ -27,9 +27,9 @@ open import Data.Product.Base using (; _,_; _×_) open import Data.Sum.Base open import Data.Sum.Properties -open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary.Reflects using (invert) open import Relation.Nullary -open import Relation.Nullary.Decidable using (dec-true; dec-false) +open import Relation.Nullary.Decidable using (dec-true; dec-false) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; _≢_; refl; cong) import Relation.Binary.PropositionalEquality.Properties as @@ -50,8 +50,8 @@ first-occurrence : {xs} x x xs x xs first-occurrence x (here x≈y) = here x≈y first-occurrence x (there {x = y} x∈xs) with x y - ... | true because [x≈y] = here (invert [x≈y]) - ... | false because _ = there $ first-occurrence x x∈xs + ... | true because [x≈y] = here (invert [x≈y]) + ... | false because _ = there $ first-occurrence x x∈xs -- The index of the first occurrence of x in xs. @@ -68,16 +68,16 @@ first-index x₁ x₁∈xs first-index x₂ x₂∈xs helper (here x₁≈x) (here x₂≈x) = refl helper (here x₁≈x) (there {x = x} x₂∈xs) - with x₂ x | dec-true (x₂ x) (trans (sym x₁≈x₂) x₁≈x) + with x₂ x | dec-true (x₂ x) (trans (sym x₁≈x₂) x₁≈x) ... | _ | refl = refl helper (there {x = x} x₁∈xs) (here x₂≈x) - with x₁ x | dec-true (x₁ x) (trans x₁≈x₂ x₂≈x) + with x₁ x | dec-true (x₁ x) (trans x₁≈x₂ x₂≈x) ... | _ | refl = refl helper (there {x = x} x₁∈xs) (there x₂∈xs) with x₁ x | x₂ x - ... | true because _ | true because _ = refl - ... | false because _ | false because _ = cong suc $ helper x₁∈xs x₂∈xs - ... | yes x₁≈x | no x₂≉x = ⊥-elim (x₂≉x (trans (sym x₁≈x₂) x₁≈x)) - ... | no x₁≉x | yes x₂≈x = ⊥-elim (x₁≉x (trans x₁≈x₂ x₂≈x)) + ... | true because _ | true because _ = refl + ... | false because _ | false because _ = cong suc $ helper x₁∈xs x₂∈xs + ... | yes x₁≈x | no x₂≉x = ⊥-elim (x₂≉x (trans (sym x₁≈x₂) x₁≈x)) + ... | no x₁≉x | yes x₂≈x = ⊥-elim (x₁≉x (trans x₁≈x₂ x₂≈x)) -- first-index is injective in its first argument. @@ -90,16 +90,16 @@ first-index x₁ x₁∈xs first-index x₂ x₂∈xs x₁ x₂ helper (here x₁≈x) (here x₂≈x) _ = trans x₁≈x (sym x₂≈x) helper (here x₁≈x) (there {x = x} x₂∈xs) _ with x₂ x - helper (here x₁≈x) (there {x = x} x₂∈xs) _ | yes x₂≈x = trans x₁≈x (sym x₂≈x) - helper (here x₁≈x) (there {x = x} x₂∈xs) () | no x₂≉x + helper (here x₁≈x) (there {x = x} x₂∈xs) _ | yes x₂≈x = trans x₁≈x (sym x₂≈x) + helper (here x₁≈x) (there {x = x} x₂∈xs) () | no x₂≉x helper (there {x = x} x₁∈xs) (here x₂≈x) _ with x₁ x - helper (there {x = x} x₁∈xs) (here x₂≈x) _ | yes x₁≈x = trans x₁≈x (sym x₂≈x) - helper (there {x = x} x₁∈xs) (here x₂≈x) () | no x₁≉x + helper (there {x = x} x₁∈xs) (here x₂≈x) _ | yes x₁≈x = trans x₁≈x (sym x₂≈x) + helper (there {x = x} x₁∈xs) (here x₂≈x) () | no x₁≉x helper (there {x = x} x₁∈xs) (there x₂∈xs) _ with x₁ x | x₂ x - helper (there {x = x} x₁∈xs) (there x₂∈xs) _ | yes x₁≈x | yes x₂≈x = trans x₁≈x (sym x₂≈x) - helper (there {x = x} x₁∈xs) (there x₂∈xs) () | yes x₁≈x | no x₂≉x - helper (there {x = x} x₁∈xs) (there x₂∈xs) () | no x₁≉x | yes x₂≈x - helper (there {x = x} x₁∈xs) (there x₂∈xs) eq | no x₁≉x | no x₂≉x = + helper (there {x = x} x₁∈xs) (there x₂∈xs) _ | yes x₁≈x | yes x₂≈x = trans x₁≈x (sym x₂≈x) + helper (there {x = x} x₁∈xs) (there x₂∈xs) () | yes x₁≈x | no x₂≉x + helper (there {x = x} x₁∈xs) (there x₂∈xs) () | no x₁≉x | yes x₂≈x + helper (there {x = x} x₁∈xs) (there x₂∈xs) eq | no x₁≉x | no x₂≉x = helper x₁∈xs x₂∈xs (suc-injective eq) ------------------------------------------------------------------------ @@ -147,7 +147,7 @@ -- Finds out if an element has been counted yet. -lookup : {counted n} counted n x Dec (x counted) +lookup : {counted n} counted n x Dec (x counted) lookup {counted} _ x = Any.any? (_≟_ x) counted -- When no element remains to be counted all elements have been @@ -183,21 +183,21 @@ kind′ : y y x counted Fin n kind′ y with y x | kind x | kind y | helper x y - kind′ y | yes y≈x | _ | _ | _ = inj₁ (here y≈x) + kind′ y | yes y≈x | _ | _ | _ = inj₁ (here y≈x) kind′ y | _ | inj₁ x∈counted | _ | _ = ⊥-elim (x∉counted x∈counted) kind′ y | _ | _ | inj₁ y∈counted | _ = inj₁ (there y∈counted) - kind′ y | no y≉x | inj₂ i | inj₂ j | hlp = + kind′ y | no y≉x | inj₂ i | inj₂ j | hlp = inj₂ (punchOut (y≉x sym hlp _ refl refl)) inj : {y z i} kind′ y inj₂ i kind′ z inj₂ i y z inj {y} {z} eq₁ eq₂ with y x | z x | kind x | kind y | kind z | helper x y | helper x z | helper y z - inj () _ | yes _ | _ | _ | _ | _ | _ | _ | _ - inj _ () | _ | yes _ | _ | _ | _ | _ | _ | _ - inj _ _ | no _ | no _ | inj₁ x∈counted | _ | _ | _ | _ | _ = ⊥-elim (x∉counted x∈counted) - inj () _ | no _ | no _ | inj₂ _ | inj₁ _ | _ | _ | _ | _ - inj _ () | no _ | no _ | inj₂ _ | _ | inj₁ _ | _ | _ | _ - inj eq₁ eq₂ | no _ | no _ | inj₂ i | inj₂ _ | inj₂ _ | _ | _ | hlp = + inj () _ | yes _ | _ | _ | _ | _ | _ | _ | _ + inj _ () | _ | yes _ | _ | _ | _ | _ | _ | _ + inj _ _ | no _ | no _ | inj₁ x∈counted | _ | _ | _ | _ | _ = ⊥-elim (x∉counted x∈counted) + inj () _ | no _ | no _ | inj₂ _ | inj₁ _ | _ | _ | _ | _ + inj _ () | no _ | no _ | inj₂ _ | _ | inj₁ _ | _ | _ | _ + inj eq₁ eq₂ | no _ | no _ | inj₂ i | inj₂ _ | inj₂ _ | _ | _ | hlp = hlp _ refl refl $ punchOut-injective {i = i} _ _ $ (≡.trans (inj₂-injective eq₁) (≡.sym (inj₂-injective eq₂))) @@ -209,7 +209,7 @@ x x counted λ n m suc n × x counted n lookupOrInsert counted⊕n x with lookup counted⊕n x -... | yes x∈counted = inj₁ x∈counted -... | no x∉counted with lookup‼ counted⊕n x x∉counted +... | yes x∈counted = inj₁ x∈counted +... | no x∉counted with lookup‼ counted⊕n x x∉counted ... | (n , refl) = inj₂ (n , refl , insert counted⊕n x x∉counted) \ No newline at end of file diff --git a/master/Data.List.Extrema.Core.html b/master/Data.List.Extrema.Core.html index 0dc5df17db..5c10878e8c 100644 --- a/master/Data.List.Extrema.Core.html +++ b/master/Data.List.Extrema.Core.html @@ -7,7 +7,7 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (Trans) +open import Relation.Binary.Definitions using (Trans) open import Relation.Binary.Bundles using (TotalOrder; Setoid) module Data.List.Extrema.Core @@ -42,10 +42,10 @@ a : Level A : Set a - <-transʳ : Trans _≤_ _<_ _<_ + <-transʳ : Trans _≤_ _<_ _<_ <-transʳ = ≤-<-trans trans antisym ≤-respˡ-≈ - <-transˡ : Trans _<_ _≤_ _<_ + <-transˡ : Trans _<_ _≤_ _<_ <-transˡ = <-≤-trans Eq.sym trans antisym ≤-respʳ-≈ module _ (f : A B) where diff --git a/master/Data.List.Extrema.html b/master/Data.List.Extrema.html index 4fe9f27aed..2e80d0fef4 100644 --- a/master/Data.List.Extrema.html +++ b/master/Data.List.Extrema.html @@ -25,7 +25,7 @@ open import Data.Sum.Base using (_⊎_; inj₁; inj₂) open import Function.Base using (id; flip; _on_; _∘_) open import Level using (Level) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) import Relation.Binary.Construct.NonStrictToStrict as NonStrictToStrict open import Relation.Binary.PropositionalEquality.Core using (_≡_; sym; subst) renaming (refl to ≡-refl) @@ -109,7 +109,7 @@ argmin-sel : (f : A B) xs (argmin f xs ) (argmin f xs xs) argmin-sel f = foldr-selective (⊓ᴸ-sel f) -argmin-all : (f : A B) { xs} {P : Pred A p} +argmin-all : (f : A B) { xs} {P : Pred A p} P All P xs P (argmin f xs) argmin-all f {} {xs} {P = P} p⊤ pxs with argmin-sel f xs ... | inj₁ argmin≡⊤ = subst P (sym argmin≡⊤) p⊤ @@ -165,7 +165,7 @@ argmax-sel : (f : A B) xs (argmax f xs ) (argmax f xs xs) argmax-sel f = foldr-selective (⊔ᴸ-sel f) -argmax-all : (f : A B) {P : Pred A p} { xs} +argmax-all : (f : A B) {P : Pred A p} { xs} P All P xs P (argmax f xs) argmax-all f {P = P} {} {xs} p⊥ pxs with argmax-sel f xs ... | inj₁ argmax≡⊥ = subst P (sym argmax≡⊥) p⊥ diff --git a/master/Data.List.Fresh.Membership.Setoid.Properties.html b/master/Data.List.Fresh.Membership.Setoid.Properties.html index edfdc42725..03b51e6bca 100644 --- a/master/Data.List.Fresh.Membership.Setoid.Properties.html +++ b/master/Data.List.Fresh.Membership.Setoid.Properties.html @@ -21,7 +21,7 @@ open import Function.Base using (id; _∘′_; _$_) open import Relation.Nullary -open import Relation.Unary as Unary using (Pred) +open import Relation.Unary as Unary using (Pred) import Relation.Binary.Definitions as Binary import Relation.Binary.PropositionalEquality.Core as open import Relation.Nary @@ -82,7 +82,7 @@ module _ {R : Rel A r} (R⇒≉ : ∀[ R _≉_ ]) (≉⇒R : ∀[ _≉_ R ]) where private - R≈ : R Binary.Respectsˡ _≈_ + R≈ : R Binary.Respectsˡ _≈_ R≈ x≈y Rxz = ≉⇒R (R⇒≉ Rxz ∘′ trans x≈y) fresh-remove : {x} {xs : List# A R} (x∈xs : x xs) x # (xs x∈xs) @@ -138,9 +138,9 @@ ------------------------------------------------------------------------ -- proof irrelevance -module _ {R : Rel A r} (R⇒≉ : ∀[ R _≉_ ]) (≈-irrelevant : Binary.Irrelevant _≈_) where +module _ {R : Rel A r} (R⇒≉ : ∀[ R _≉_ ]) (≈-irrelevant : Binary.Irrelevant _≈_) where - ∈-irrelevant : {x} {xs : List# A R} Irrelevant (x xs) + ∈-irrelevant : {x} {xs : List# A R} Irrelevant (x xs) -- positive cases ∈-irrelevant (here x≈y₁) (here x≈y₂) = ≡.cong here (≈-irrelevant x≈y₁ x≈y₂) ∈-irrelevant (there x∈xs₁) (there x∈xs₂) = ≡.cong there (∈-irrelevant x∈xs₁ x∈xs₂) diff --git a/master/Data.List.Fresh.Membership.Setoid.html b/master/Data.List.Fresh.Membership.Setoid.html index 87f1a44a63..2de1219afd 100644 --- a/master/Data.List.Fresh.Membership.Setoid.html +++ b/master/Data.List.Fresh.Membership.Setoid.html @@ -29,5 +29,5 @@ x xs = Any (x ≈_) xs _∉_ : {R : Rel A r} A List# A R Set _ -x xs = ¬ (x xs) +x xs = ¬ (x xs) \ No newline at end of file diff --git a/master/Data.List.Fresh.Properties.html b/master/Data.List.Fresh.Properties.html index ac275a94ce..c8c8239ae9 100644 --- a/master/Data.List.Fresh.Properties.html +++ b/master/Data.List.Fresh.Properties.html @@ -12,7 +12,7 @@ open import Level using (Level; _⊔_) open import Data.Product.Base using (_,_) open import Relation.Nullary -open import Relation.Unary as U using (Pred) +open import Relation.Unary as U using (Pred) import Relation.Binary.Definitions as B open import Relation.Binary.Core using (Rel) @@ -27,7 +27,7 @@ ------------------------------------------------------------------------ -- Fresh congruence -module _ {R : Rel A r} {_≈_ : Rel A e} (R≈ : R B.Respectsˡ _≈_) where +module _ {R : Rel A r} {_≈_ : Rel A e} (R≈ : R B.Respectsˡ _≈_) where fresh-respectsˡ : {x y} {xs : List# A R} x y x # xs y # xs fresh-respectsˡ {xs = []} x≈y x#xs = _ @@ -37,17 +37,17 @@ ------------------------------------------------------------------------ -- Empty and NotEmpty -Empty⇒¬NonEmpty : {R : Rel A r} {xs : List# A R} Empty xs ¬ (NonEmpty xs) +Empty⇒¬NonEmpty : {R : Rel A r} {xs : List# A R} Empty xs ¬ (NonEmpty xs) Empty⇒¬NonEmpty [] () -NonEmpty⇒¬Empty : {R : Rel A r} {xs : List# A R} NonEmpty xs ¬ (Empty xs) +NonEmpty⇒¬Empty : {R : Rel A r} {xs : List# A R} NonEmpty xs ¬ (Empty xs) NonEmpty⇒¬Empty () [] -empty? : {R : Rel A r} (xs : List# A R) Dec (Empty xs) -empty? [] = yes [] -empty? (_ ∷# _) = no ()) +empty? : {R : Rel A r} (xs : List# A R) Dec (Empty xs) +empty? [] = yes [] +empty? (_ ∷# _) = no ()) -nonEmpty? : {R : Rel A r} (xs : List# A R) Dec (NonEmpty xs) -nonEmpty? [] = no ()) -nonEmpty? (cons x xs pr) = yes (cons x xs pr) +nonEmpty? : {R : Rel A r} (xs : List# A R) Dec (NonEmpty xs) +nonEmpty? [] = no ()) +nonEmpty? (cons x xs pr) = yes (cons x xs pr) \ No newline at end of file diff --git a/master/Data.List.Fresh.Relation.Unary.All.Properties.html b/master/Data.List.Fresh.Relation.Unary.All.Properties.html index 529aa4766d..f3ad2fca91 100644 --- a/master/Data.List.Fresh.Relation.Unary.All.Properties.html +++ b/master/Data.List.Fresh.Relation.Unary.All.Properties.html @@ -37,7 +37,7 @@ toAll {xs = []} _ = [] toAll {xs = a ∷# as} (p , ps) = p toAll ps -module _ {R : Rel A r} {P : Pred A p} where +module _ {R : Rel A r} {P : Pred A p} where append⁺ : {xs ys : List# A R} {ps : All (_# ys) xs} All P xs All P ys All P (append xs ys ps) diff --git a/master/Data.List.Fresh.Relation.Unary.All.html b/master/Data.List.Fresh.Relation.Unary.All.html index cd4af5afee..d703dec620 100644 --- a/master/Data.List.Fresh.Relation.Unary.All.html +++ b/master/Data.List.Fresh.Relation.Unary.All.html @@ -13,7 +13,7 @@ open import Data.Product.Base using (_×_; _,_; proj₁; uncurry) open import Data.Sum.Base as Sum using (inj₁; inj₂; [_,_]′) open import Function.Base using (_∘_; _$_) -open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _×-dec_) +open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _×-dec_) open import Relation.Unary as U open import Relation.Binary.Core using (Rel) @@ -25,7 +25,7 @@ a p q r : Level A : Set a -module _ {A : Set a} {R : Rel A r} (P : Pred A p) where +module _ {A : Set a} {R : Rel A r} (P : Pred A p) where infixr 5 _∷_ @@ -33,7 +33,7 @@ [] : All [] _∷_ : {x xs pr} P x All xs All (cons x xs pr) -module _ {R : Rel A r} {P : Pred A p} where +module _ {R : Rel A r} {P : Pred A p} where uncons : {x} {xs : List# A R} {pr} All P (cons x xs pr) P x × All P xs @@ -52,9 +52,9 @@ append-# [] ys x#xs x#ys = x#ys append-# (cons x xs pr) ys (r , x#xs) x#ys = r , append-# xs ys x#xs x#ys -module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} where +module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} where - map : {xs : List# A R} ∀[ P Q ] All P xs All Q xs + map : {xs : List# A R} ∀[ P Q ] All P xs All Q xs map p⇒q [] = [] map p⇒q (p ps) = p⇒q p map p⇒q ps @@ -63,18 +63,18 @@ lookup (q _) (here _) = q lookup (_ qs) (there k) = lookup qs k -module _ {R : Rel A r} {P : Pred A p} (P? : Decidable P) where +module _ {R : Rel A r} {P : Pred A p} (P? : Decidable P) where - all? : (xs : List# A R) Dec (All P xs) - all? [] = yes [] - all? (x ∷# xs) = Dec.map′ (uncurry _∷_) uncons (P? x ×-dec all? xs) + all? : (xs : List# A R) Dec (All P xs) + all? [] = yes [] + all? (x ∷# xs) = Dec.map′ (uncurry _∷_) uncons (P? x ×-dec all? xs) ------------------------------------------------------------------------ -- Generalised decidability procedure -module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} where +module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} where - decide : Π[ P Q ] Π[ All {R = R} P Any Q ] + decide : Π[ P Q ] Π[ All {R = R} P Any Q ] decide p∪q [] = inj₁ [] decide p∪q (x ∷# xs) = [ px Sum.map (px ∷_) there (decide p∪q xs)) diff --git a/master/Data.List.Fresh.Relation.Unary.Any.Properties.html b/master/Data.List.Fresh.Relation.Unary.Any.Properties.html index 5eb1077366..b77056e733 100644 --- a/master/Data.List.Fresh.Relation.Unary.Any.Properties.html +++ b/master/Data.List.Fresh.Relation.Unary.Any.Properties.html @@ -16,9 +16,9 @@ open import Data.Product.Base using (_,_) open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂) open import Function.Base using (_∘′_) -open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary.Reflects using (invert) open import Relation.Nullary -open import Relation.Unary as U using (Pred) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core using (Rel) open import Relation.Nary open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) @@ -36,7 +36,7 @@ ------------------------------------------------------------------------ -- NonEmpty -module _ {R : Rel A r} {P : Pred A p} where +module _ {R : Rel A r} {P : Pred A p} where Any⇒NonEmpty : {xs : List# A R} Any P xs NonEmpty xs Any⇒NonEmpty {xs = cons x xs pr} p = cons x xs pr @@ -44,34 +44,34 @@ ------------------------------------------------------------------------ -- Correspondence between Any and All -module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} (P⇒¬Q : ∀[ P Q ]) where +module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} (P⇒¬Q : ∀[ P Q ]) where - Any⇒¬All : {xs : List# A R} Any P xs ¬ (All Q xs) + Any⇒¬All : {xs : List# A R} Any P xs ¬ (All Q xs) Any⇒¬All (here p) (q _) = P⇒¬Q p q Any⇒¬All (there ps) (_ qs) = Any⇒¬All ps qs - All⇒¬Any : {xs : List# A R} All P xs ¬ (Any Q xs) + All⇒¬Any : {xs : List# A R} All P xs ¬ (Any Q xs) All⇒¬Any (p _) (here q) = P⇒¬Q p q All⇒¬Any (_ ps) (there qs) = All⇒¬Any ps qs -module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} (P? : Decidable P) where +module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} (P? : Decidable P) where - ¬All⇒Any : {xs : List# A R} ¬ (All P xs) Any ( P) xs + ¬All⇒Any : {xs : List# A R} ¬ (All P xs) Any ( P) xs ¬All⇒Any {xs = []} ¬ps = ⊥-elim (¬ps []) ¬All⇒Any {xs = x ∷# xs} ¬ps with P? x - ... | true because [p] = there (¬All⇒Any (¬ps ∘′ (invert [p] ∷_))) - ... | false because [¬p] = here (invert [¬p]) + ... | true because [p] = there (¬All⇒Any (¬ps ∘′ (invert [p] ∷_))) + ... | false because [¬p] = here (invert [¬p]) - ¬Any⇒All : {xs : List# A R} ¬ (Any P xs) All ( P) xs + ¬Any⇒All : {xs : List# A R} ¬ (Any P xs) All ( P) xs ¬Any⇒All {xs = []} ¬ps = [] ¬Any⇒All {xs = x ∷# xs} ¬ps with P? x - ... | true because [p] = ⊥-elim (¬ps (here (invert [p]))) - ... | false because [¬p] = invert [¬p] ¬Any⇒All (¬ps ∘′ there) + ... | true because [p] = ⊥-elim (¬ps (here (invert [p]))) + ... | false because [¬p] = invert [¬p] ¬Any⇒All (¬ps ∘′ there) ------------------------------------------------------------------------ -- remove -module _ {R : Rel A r} {P : Pred A p} where +module _ {R : Rel A r} {P : Pred A p} where length-remove : {xs : List# A R} (k : Any P xs) length xs suc (length (xs k)) @@ -81,7 +81,7 @@ ------------------------------------------------------------------------ -- append -module _ {R : Rel A r} {P : Pred A p} where +module _ {R : Rel A r} {P : Pred A p} where append⁺ˡ : {xs ys : List# A R} {ps : All (_# ys) xs} Any P xs Any P (append xs ys ps) diff --git a/master/Data.List.Fresh.Relation.Unary.Any.html b/master/Data.List.Fresh.Relation.Unary.Any.html index a2acb395ea..da372f586a 100644 --- a/master/Data.List.Fresh.Relation.Unary.Any.html +++ b/master/Data.List.Fresh.Relation.Unary.Any.html @@ -14,8 +14,8 @@ open import Data.Product.Base using (; _,_; -,_) open import Data.Sum.Base using (_⊎_; [_,_]′; inj₁; inj₂) open import Function.Bundles using (_⇔_; mk⇔) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _⊎-dec_) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _⊎-dec_) open import Relation.Unary as U open import Relation.Binary.Core using (Rel) @@ -26,19 +26,19 @@ a p q r : Level A : Set a -module _ {A : Set a} {R : Rel A r} (P : Pred A p) where +module _ {A : Set a} {R : Rel A r} (P : Pred A p) where data Any : List# A R Set (p a r) where here : {x xs pr} P x Any (cons x xs pr) there : {x xs pr} Any xs Any (cons x xs pr) -module _ {R : Rel A r} {P : Pred A p} {x} {xs : List# A R} {pr} where +module _ {R : Rel A r} {P : Pred A p} {x} {xs : List# A R} {pr} where - head : ¬ Any P xs Any P (cons x xs pr) P x + head : ¬ Any P xs Any P (cons x xs pr) P x head ¬tail (here p) = p head ¬tail (there ps) = ⊥-elim (¬tail ps) - tail : ¬ P x Any P (cons x xs pr) Any P xs + tail : ¬ P x Any P (cons x xs pr) Any P xs tail ¬head (here p) = ⊥-elim (¬head p) tail ¬head (there ps) = ps @@ -52,13 +52,13 @@ ⊎⇔Any : (P x Any P xs) Any P (cons x xs pr) ⊎⇔Any = mk⇔ fromSum toSum -module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} where +module _ {R : Rel A r} {P : Pred A p} {Q : Pred A q} where - map : {xs : List# A R} ∀[ P Q ] Any P xs Any Q xs + map : {xs : List# A R} ∀[ P Q ] Any P xs Any Q xs map p⇒q (here p) = here (p⇒q p) map p⇒q (there p) = there (map p⇒q p) -module _ {R : Rel A r} {P : Pred A p} where +module _ {R : Rel A r} {P : Pred A p} where witness : {xs : List# A R} Any P xs P witness (here p) = -, p @@ -76,9 +76,9 @@ infixl 4 _─_ _─_ = remove -module _ {R : Rel A r} {P : Pred A p} (P? : Decidable P) where +module _ {R : Rel A r} {P : Pred A p} (P? : Decidable P) where - any? : (xs : List# A R) Dec (Any P xs) - any? [] = no ()) - any? (x ∷# xs) = Dec.map ⊎⇔Any (P? x ⊎-dec any? xs) + any? : (xs : List# A R) Dec (Any P xs) + any? [] = no ()) + any? (x ∷# xs) = Dec.map ⊎⇔Any (P? x ⊎-dec any? xs) \ No newline at end of file diff --git a/master/Data.List.Fresh.html b/master/Data.List.Fresh.html index 4c6ab0a9f5..f02def8ee8 100644 --- a/master/Data.List.Fresh.html +++ b/master/Data.List.Fresh.html @@ -23,8 +23,8 @@ open import Data.Maybe.Base as Maybe using (Maybe; just; nothing) open import Data.Nat.Base using (; zero; suc) open import Function.Base using (_∘′_; flip; id; _on_) -open import Relation.Nullary using (does) -open import Relation.Unary as U using (Pred) +open import Relation.Nullary using (does) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core using (Rel) import Relation.Binary.Definitions as B open import Relation.Nary @@ -116,7 +116,7 @@ fromMaybe nothing = [] fromMaybe (just a) = [ a ] -module _ {R : Rel A r} (R-refl : B.Reflexive R) where +module _ {R : Rel A r} (R-refl : B.Reflexive R) where replicate : A List# A R replicate-# : (n : ) (a : A) a # replicate n a @@ -156,24 +156,24 @@ drop (suc n) [] = [] drop (suc n) (a ∷# as) = drop n as -module _ {P : Pred A p} (P? : U.Decidable P) where +module _ {P : Pred A p} (P? : U.Decidable P) where takeWhile : {R : Rel A r} List# A R List# A R takeWhile-# : {R : Rel A r} a (as : List# A R) a # as a # takeWhile as takeWhile [] = [] takeWhile (cons a as ps) = - if does (P? a) then cons a (takeWhile as) (takeWhile-# a as ps) else [] + if does (P? a) then cons a (takeWhile as) (takeWhile-# a as ps) else [] -- this 'with' is needed to cause reduction in the type of 'takeWhile (a ∷# as)' takeWhile-# a [] _ = _ - takeWhile-# a (x ∷# xs) (p , ps) with does (P? x) + takeWhile-# a (x ∷# xs) (p , ps) with does (P? x) ... | true = p , takeWhile-# a xs ps ... | false = _ dropWhile : {R : Rel A r} List# A R List# A R dropWhile [] = [] - dropWhile aas@(a ∷# as) = if does (P? a) then dropWhile as else aas + dropWhile aas@(a ∷# as) = if does (P? a) then dropWhile as else aas filter : {R : Rel A r} List# A R List# A R filter-# : {R : Rel A r} a (as : List# A R) a # as a # filter as @@ -181,11 +181,11 @@ filter [] = [] filter (cons a as ps) = let l = filter as in - if does (P? a) then cons a l (filter-# a as ps) else l + if does (P? a) then cons a l (filter-# a as ps) else l -- this 'with' is needed to cause reduction in the type of 'filter-# a (x ∷# xs)' filter-# a [] _ = _ - filter-# a (x ∷# xs) (p , ps) with does (P? x) + filter-# a (x ∷# xs) (p , ps) with does (P? x) ... | true = p , filter-# a xs ps ... | false = filter-# a xs ps diff --git a/master/Data.List.Membership.DecPropositional.html b/master/Data.List.Membership.DecPropositional.html index b7e694d3d3..0baa05bd9b 100644 --- a/master/Data.List.Membership.DecPropositional.html +++ b/master/Data.List.Membership.DecPropositional.html @@ -7,10 +7,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Membership.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) where + {a} {A : Set a} (_≟_ : DecidableEquality A) where open import Relation.Binary.PropositionalEquality.Properties using (decSetoid) diff --git a/master/Data.List.Membership.DecSetoid.html b/master/Data.List.Membership.DecSetoid.html index 675f9649a0..8c1545b878 100644 --- a/master/Data.List.Membership.DecSetoid.html +++ b/master/Data.List.Membership.DecSetoid.html @@ -12,8 +12,8 @@ module Data.List.Membership.DecSetoid {a } (DS : DecSetoid a ) where open import Data.List.Relation.Unary.Any using (any?) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary.Decidable using (¬?) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable using (¬?) open DecSetoid DS @@ -27,9 +27,9 @@ infix 4 _∈?_ _∉?_ -_∈?_ : Decidable _∈_ +_∈?_ : Decidable _∈_ x ∈? xs = any? (x ≟_) xs -_∉?_ : Decidable _∉_ -x ∉? xs = ¬? (x ∈? xs) +_∉?_ : Decidable _∉_ +x ∉? xs = ¬? (x ∈? xs) \ No newline at end of file diff --git a/master/Data.List.Membership.Propositional.Properties.Core.html b/master/Data.List.Membership.Propositional.Properties.Core.html index df373aca7f..881c5e48fd 100644 --- a/master/Data.List.Membership.Propositional.Properties.Core.html +++ b/master/Data.List.Membership.Propositional.Properties.Core.html @@ -23,7 +23,7 @@ open import Level using (Level) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; subst) -open import Relation.Unary using (Pred; _⊆_) +open import Relation.Unary using (Pred; _⊆_) private variable @@ -33,16 +33,16 @@ ------------------------------------------------------------------------ -- Lemmas relating map and find. -map∘find : {P : Pred A p} {xs} +map∘find : {P : Pred A p} {xs} (p : Any P xs) let p′ = find p in - {f : _≡_ (proj₁ p′) P} + {f : _≡_ (proj₁ p′) P} f refl proj₂ (proj₂ p′) Any.map f (proj₁ (proj₂ p′)) p map∘find (here p) hyp = cong here hyp map∘find (there p) hyp = cong there (map∘find p hyp) -find∘map : {P : Pred A p} {Q : Pred A q} - {xs : List A} (p : Any P xs) (f : P Q) +find∘map : {P : Pred A p} {Q : Pred A q} + {xs : List A} (p : Any P xs) (f : P Q) find (Any.map f p) Product.map id (Product.map id f) (find p) find∘map (here p) f = refl find∘map (there p) f rewrite find∘map p f = refl @@ -59,12 +59,12 @@ ------------------------------------------------------------------------ -- find and lose are inverses (more or less). -lose∘find : {P : Pred A p} {xs : List A} +lose∘find : {P : Pred A p} {xs : List A} (p : Any P xs) uncurry′ lose (proj₂ (find p)) p lose∘find p = map∘find p refl -find∘lose : (P : Pred A p) {x xs} +find∘lose : (P : Pred A p) {x xs} (x∈xs : x xs) (pp : P x) find {P = P} (lose x∈xs pp) (x , x∈xs , pp) find∘lose P x∈xs p @@ -75,7 +75,7 @@ ------------------------------------------------------------------------ -- Any can be expressed using _∈_ -module _ {P : Pred A p} where +module _ {P : Pred A p} where ∃∈-Any : {xs} ( λ x x xs × P x) Any P xs ∃∈-Any = uncurry′ lose proj₂ diff --git a/master/Data.List.Membership.Propositional.Properties.WithK.html b/master/Data.List.Membership.Propositional.Properties.WithK.html index 239adaf8e0..dc2a357937 100644 --- a/master/Data.List.Membership.Propositional.Properties.WithK.html +++ b/master/Data.List.Membership.Propositional.Properties.WithK.html @@ -14,7 +14,7 @@ open import Data.List.Relation.Unary.Unique.Propositional open import Data.List.Membership.Propositional import Data.List.Membership.Setoid.Properties as Membership -open import Relation.Unary using (Irrelevant) +open import Relation.Unary using (Irrelevant) open import Relation.Binary.PropositionalEquality.Properties as open import Relation.Binary.PropositionalEquality.WithK @@ -22,6 +22,6 @@ -- Irrelevance unique⇒irrelevant : {a} {A : Set a} {xs : List A} - Unique xs Irrelevant (_∈ xs) + Unique xs Irrelevant (_∈ xs) unique⇒irrelevant = Membership.unique⇒irrelevant (≡.setoid _) ≡-irrelevant \ No newline at end of file diff --git a/master/Data.List.Membership.Propositional.Properties.html b/master/Data.List.Membership.Propositional.Properties.html index 8814f23af3..cf4e52933f 100644 --- a/master/Data.List.Membership.Propositional.Properties.html +++ b/master/Data.List.Membership.Propositional.Properties.html @@ -39,17 +39,17 @@ open import Function.Construct.Identity using (↔-id) open import Level using (Level) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions as Binary hiding (Decidable) +open import Relation.Binary.Definitions as Binary hiding (Decidable) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; _≢_; refl; sym; trans; cong; cong₂; subst; _≗_) open import Relation.Binary.PropositionalEquality.Properties as using (setoid) import Relation.Binary.Properties.DecTotalOrder as DTOProperties -open import Relation.Unary using (_⟨×⟩_; Decidable) +open import Relation.Unary using (_⟨×⟩_; Decidable) import Relation.Nullary.Reflects as Reflects -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary using (¬_; Dec; does; yes; no; _because_) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Nullary.Decidable using (¬¬-excluded-middle) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary using (¬_; Dec; does; yes; no; _because_) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (¬¬-excluded-middle) private open module ListMonad {} = RawMonad (monad { = }) @@ -66,10 +66,10 @@ ------------------------------------------------------------------------ -- Equality -∈-resp-≋ : {x : A} (x ∈_) Respects _≋_ +∈-resp-≋ : {x : A} (x ∈_) Respects _≋_ ∈-resp-≋ = Membership.∈-resp-≋ (≡.setoid _) -∉-resp-≋ : {x : A} (x ∉_) Respects _≋_ +∉-resp-≋ : {x : A} (x ∉_) Respects _≋_ ∉-resp-≋ = Membership.∉-resp-≋ (≡.setoid _) ------------------------------------------------------------------------ @@ -245,7 +245,7 @@ ------------------------------------------------------------------------ -- filter -module _ {p} {P : A Set p} (P? : Decidable P) where +module _ {p} {P : A Set p} (P? : Decidable P) where ∈-filter⁺ : {x xs} x xs P x x filter P? xs ∈-filter⁺ = Membership.∈-filter⁺ (≡.setoid A) P? (subst P) @@ -256,7 +256,7 @@ ------------------------------------------------------------------------ -- derun and deduplicate -module _ {r} {R : Rel A r} (R? : Binary.Decidable R) where +module _ {r} {R : Rel A r} (R? : Binary.Decidable R) where ∈-derun⁻ : xs {z} z derun R? xs z xs ∈-derun⁻ xs z∈derun[R,xs] = Membership.∈-derun⁻ (≡.setoid A) R? xs z∈derun[R,xs] @@ -264,7 +264,7 @@ ∈-deduplicate⁻ : xs {z} z deduplicate R? xs z xs ∈-deduplicate⁻ xs z∈dedup[R,xs] = Membership.∈-deduplicate⁻ (≡.setoid A) R? xs z∈dedup[R,xs] -module _ (_≈?_ : DecidableEquality A) where +module _ (_≈?_ : DecidableEquality A) where ∈-derun⁺ : {xs z} z xs z derun _≈?_ xs ∈-derun⁺ z∈xs = Membership.∈-derun⁺ (≡.setoid A) _≈?_ (flip trans) z∈xs @@ -303,7 +303,7 @@ (x xs × y ys) (x , y) (xs ys) ⊗-∈↔ {xs = xs} {ys} {x} {y} = (x xs × y ys) ↔⟨ ⊗↔′ - Any (x ≡_ ⟨×⟩ y ≡_) (xs ys) ↔⟨ Any-cong _ ×-≡,≡↔≡) (↔-id _) + Any (x ≡_ ⟨×⟩ y ≡_) (xs ys) ↔⟨ Any-cong _ ×-≡,≡↔≡) (↔-id _) (x , y) (xs ys) where open Related.EquationalReasoning @@ -347,9 +347,9 @@ -- Only a finite number of distinct elements can be members of a -- given list. -finite : (inj : A) xs ¬ (∀ i Injection.to inj i xs) +finite : (inj : A) xs ¬ (∀ i Injection.to inj i xs) finite inj [] fᵢ∈[] = ¬Any[] (fᵢ∈[] 0) -finite inj (x xs) fᵢ∈x∷xs = ¬¬-excluded-middle helper +finite inj (x xs) fᵢ∈x∷xs = ¬¬-excluded-middle helper where open Injection inj renaming (injective to f-inj) @@ -358,35 +358,35 @@ not-x : {i} f i x f i xs not-x {i} fᵢ≢x with fᵢ∈x∷xs i - ... | here fᵢ≡x = contradiction fᵢ≡x fᵢ≢x + ... | here fᵢ≡x = contradiction fᵢ≡x fᵢ≢x ... | there fᵢ∈xs = fᵢ∈xs - helper : ¬ Dec ( λ i f i x) - helper (no fᵢ≢x) = finite inj xs i not-x (fᵢ≢x _,_ i)) - helper (yes (i , fᵢ≡x)) = finite f′-inj xs f′ⱼ∈xs + helper : ¬ Dec ( λ i f i x) + helper (no fᵢ≢x) = finite inj xs i not-x (fᵢ≢x _,_ i)) + helper (yes (i , fᵢ≡x)) = finite f′-inj xs f′ⱼ∈xs where f′ : _ - f′ j with does (i ≤? j) + f′ j with does (i ≤? j) ... | true = f (suc j) ... | false = f j ∈-if-not-i : {j} i j f j xs ∈-if-not-i i≢j = not-x (i≢j f-inj trans fᵢ≡x sym) - lemma : {k j} i j ¬ (i k) suc j k + lemma : {k j} i j ¬ (i k) suc j k lemma i≤j i≰1+j refl = i≰1+j (m≤n⇒m≤1+n i≤j) f′ⱼ∈xs : j f′ j xs - f′ⱼ∈xs j with i ≤ᵇ j | Reflects.invert (≤ᵇ-reflects-≤ i j) + f′ⱼ∈xs j with i ≤ᵇ j | Reflects.invert (≤ᵇ-reflects-≤ i j) ... | true | p = ∈-if-not-i (<⇒≢ (s≤s p)) ... | false | p = ∈-if-not-i (<⇒≢ (≰⇒> p) sym) f′-injective′ : Injective _≡_ _≡_ f′ - f′-injective′ {j} {k} eq with i ≤ᵇ j | Reflects.invert (≤ᵇ-reflects-≤ i j) - | i ≤ᵇ k | Reflects.invert (≤ᵇ-reflects-≤ i k) + f′-injective′ {j} {k} eq with i ≤ᵇ j | Reflects.invert (≤ᵇ-reflects-≤ i j) + | i ≤ᵇ k | Reflects.invert (≤ᵇ-reflects-≤ i k) ... | true | p | true | q = ≡.cong pred (f-inj eq) - ... | true | p | false | q = contradiction (f-inj eq) (lemma p q) - ... | false | p | true | q = contradiction (f-inj eq) (lemma q p sym) + ... | true | p | false | q = contradiction (f-inj eq) (lemma p q) + ... | false | p | true | q = contradiction (f-inj eq) (lemma q p sym) ... | false | p | false | q = f-inj eq f′-inj : _ diff --git a/master/Data.List.Membership.Setoid.Properties.html b/master/Data.List.Membership.Setoid.Properties.html index e600df5b45..3853fb9331 100644 --- a/master/Data.List.Membership.Setoid.Properties.html +++ b/master/Data.List.Membership.Setoid.Properties.html @@ -29,14 +29,14 @@ open import Function.Bundles using (_↔_) open import Level using (Level) open import Relation.Binary.Core using (Rel; _Preserves₂_⟶_⟶_; _Preserves_⟶_) -open import Relation.Binary.Definitions as Binary hiding (Decidable) +open import Relation.Binary.Definitions as Binary hiding (Decidable) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) -open import Relation.Unary as Unary using (Decidable; Pred) -open import Relation.Nullary using (¬_; does; _because_; yes; no) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Nullary.Decidable using (¬?) +open import Relation.Unary as Unary using (Decidable; Pred) +open import Relation.Nullary using (¬_; does; _because_; yes; no) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (¬?) open Setoid using (Carrier) private @@ -54,16 +54,16 @@ -- _∈_ respects the underlying equality - ∈-resp-≈ : {xs} (_∈ xs) Respects _≈_ + ∈-resp-≈ : {xs} (_∈ xs) Respects _≈_ ∈-resp-≈ x≈y x∈xs = Any.map (trans (sym x≈y)) x∈xs - ∉-resp-≈ : {xs} (_∉ xs) Respects _≈_ + ∉-resp-≈ : {xs} (_∉ xs) Respects _≈_ ∉-resp-≈ v≈w v∉xs w∈xs = v∉xs (∈-resp-≈ (sym v≈w) w∈xs) - ∈-resp-≋ : {x} (x ∈_) Respects _≋_ + ∈-resp-≋ : {x} (x ∈_) Respects _≋_ ∈-resp-≋ = Any.lift-resp (flip trans) - ∉-resp-≋ : {x} (x ∉_) Respects _≋_ + ∉-resp-≋ : {x} (x ∉_) Respects _≋_ ∉-resp-≋ xs≋ys v∉xs v∈ys = v∉xs (∈-resp-≋ (≋-sym xs≋ys) v∈ys) -- index is injective in its first argument. @@ -86,15 +86,15 @@ ∉×∈⇒≉ : {x y xs} All (y ≉_) xs x xs x y ∉×∈⇒≉ = All.lookupWith λ y≉z x≈z x≈y y≉z (trans (sym x≈y) x≈z) - unique⇒irrelevant : Binary.Irrelevant _≈_ {xs} Unique xs Unary.Irrelevant (_∈ xs) + unique⇒irrelevant : Binary.Irrelevant _≈_ {xs} Unique xs Unary.Irrelevant (_∈ xs) unique⇒irrelevant ≈-irr _ (here p) (here q) = ≡.cong here (≈-irr p q) unique⇒irrelevant ≈-irr (_ u) (there p) (there q) = ≡.cong there (unique⇒irrelevant ≈-irr u p q) unique⇒irrelevant ≈-irr (≉s _) (here p) (there q) = - contradiction p (∉×∈⇒≉ ≉s q) + contradiction p (∉×∈⇒≉ ≉s q) unique⇒irrelevant ≈-irr (≉s _) (there p) (here q) = - contradiction q (∉×∈⇒≉ ≉s p) + contradiction q (∉×∈⇒≉ ≉s p) ------------------------------------------------------------------------ -- mapWith∈ @@ -340,39 +340,39 @@ ------------------------------------------------------------------------ -- filter -module _ (S : Setoid c ) {P : Pred (Carrier S) p} - (P? : Decidable P) (resp : P Respects (Setoid._≈_ S)) where +module _ (S : Setoid c ) {P : Pred (Carrier S) p} + (P? : Decidable P) (resp : P Respects (Setoid._≈_ S)) where open Setoid S using (_≈_; sym) open Membership S using (_∈_) ∈-filter⁺ : {v xs} v xs P v v filter P? xs ∈-filter⁺ {xs = x _} (here v≈x) Pv with P? x - ... | true because _ = here v≈x - ... | false because [¬Px] = contradiction (resp v≈x Pv) (invert [¬Px]) - ∈-filter⁺ {xs = x _} (there v∈xs) Pv with does (P? x) + ... | true because _ = here v≈x + ... | false because [¬Px] = contradiction (resp v≈x Pv) (invert [¬Px]) + ∈-filter⁺ {xs = x _} (there v∈xs) Pv with does (P? x) ... | true = there (∈-filter⁺ v∈xs Pv) ... | false = ∈-filter⁺ v∈xs Pv ∈-filter⁻ : {v xs} v filter P? xs v xs × P v ∈-filter⁻ {xs = x xs} v∈f[x∷xs] with P? x - ... | false because _ = Product.map there id (∈-filter⁻ v∈f[x∷xs]) - ... | true because [Px] with v∈f[x∷xs] - ... | here v≈x = here v≈x , resp (sym v≈x) (invert [Px]) + ... | false because _ = Product.map there id (∈-filter⁻ v∈f[x∷xs]) + ... | true because [Px] with v∈f[x∷xs] + ... | here v≈x = here v≈x , resp (sym v≈x) (invert [Px]) ... | there v∈fxs = Product.map there id (∈-filter⁻ v∈fxs) ------------------------------------------------------------------------ -- derun and deduplicate -module _ (S : Setoid c ) {R : Rel (Carrier S) ℓ₂} (R? : Binary.Decidable R) where +module _ (S : Setoid c ) {R : Rel (Carrier S) ℓ₂} (R? : Binary.Decidable R) where open Setoid S using (_≈_) open Membership S using (_∈_) - ∈-derun⁺ : _≈_ Respectsʳ R {xs z} z xs z derun R? xs + ∈-derun⁺ : _≈_ Respectsʳ R {xs z} z xs z derun R? xs ∈-derun⁺ ≈-resp-R z∈xs = Any.derun⁺ R? ≈-resp-R z∈xs - ∈-deduplicate⁺ : _≈_ Respectsʳ (flip R) {xs z} + ∈-deduplicate⁺ : _≈_ Respectsʳ (flip R) {xs z} z xs z deduplicate R? xs ∈-deduplicate⁺ ≈-resp-R z∈xs = Any.deduplicate⁺ R? ≈-resp-R z∈xs @@ -434,14 +434,14 @@ ∈-∷=⁺-updated (here px) = here refl ∈-∷=⁺-updated (there pxs) = there (∈-∷=⁺-updated pxs) - ∈-∷=⁺-untouched : {xs x y v} (x∈xs : x xs) (¬ x y) y xs y (x∈xs ∷= v) - ∈-∷=⁺-untouched (here x≈z) x≉y (here y≈z) = contradiction (trans x≈z (sym y≈z)) x≉y + ∈-∷=⁺-untouched : {xs x y v} (x∈xs : x xs) (¬ x y) y xs y (x∈xs ∷= v) + ∈-∷=⁺-untouched (here x≈z) x≉y (here y≈z) = contradiction (trans x≈z (sym y≈z)) x≉y ∈-∷=⁺-untouched (here x≈z) x≉y (there y∈xs) = there y∈xs ∈-∷=⁺-untouched (there x∈xs) x≉y (here y≈z) = here y≈z ∈-∷=⁺-untouched (there x∈xs) x≉y (there y∈xs) = there (∈-∷=⁺-untouched x∈xs x≉y y∈xs) - ∈-∷=⁻ : {xs x y v} (x∈xs : x xs) (¬ y v) y (x∈xs ∷= v) y xs - ∈-∷=⁻ (here x≈z) y≉v (here y≈v) = contradiction y≈v y≉v + ∈-∷=⁻ : {xs x y v} (x∈xs : x xs) (¬ y v) y (x∈xs ∷= v) y xs + ∈-∷=⁻ (here x≈z) y≉v (here y≈v) = contradiction y≈v y≉v ∈-∷=⁻ (here x≈z) y≉v (there y∈) = there y∈ ∈-∷=⁻ (there x∈xs) y≉v (here y≈z) = here y≈z ∈-∷=⁻ (there x∈xs) y≉v (there y∈) = there (∈-∷=⁻ x∈xs y≉v y∈) diff --git a/master/Data.List.Membership.Setoid.html b/master/Data.List.Membership.Setoid.html index 151274b25e..e914f5b583 100644 --- a/master/Data.List.Membership.Setoid.html +++ b/master/Data.List.Membership.Setoid.html @@ -8,7 +8,7 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) module Data.List.Membership.Setoid {c } (S : Setoid c ) where @@ -17,8 +17,8 @@ open import Data.List.Relation.Unary.Any as Any using (Any; index; map; here; there) open import Data.Product.Base as Product using (; _×_; _,_) -open import Relation.Unary using (Pred) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Unary using (Pred) +open import Relation.Nullary.Negation using (¬_) open Setoid S renaming (Carrier to A) @@ -31,7 +31,7 @@ x xs = Any (x ≈_) xs _∉_ : A List A Set _ -x xs = ¬ x xs +x xs = ¬ x xs ------------------------------------------------------------------------ -- Operations @@ -47,12 +47,12 @@ ------------------------------------------------------------------------ -- Finding and losing witnesses -module _ {p} {P : Pred A p} where +module _ {p} {P : Pred A p} where find : {xs} Any P xs λ x x xs × P x find (here px) = (_ , here refl , px) find (there pxs) = Product.map id (Product.map there id) (find pxs) - lose : P Respects _≈_ {x xs} x xs P x Any P xs + lose : P Respects _≈_ {x xs} x xs P x Any P xs lose resp x∈xs px = map (flip resp px) x∈xs \ No newline at end of file diff --git a/master/Data.List.NonEmpty.Base.html b/master/Data.List.NonEmpty.Base.html index 23cab733d9..59706961e7 100644 --- a/master/Data.List.NonEmpty.Base.html +++ b/master/Data.List.NonEmpty.Base.html @@ -21,9 +21,9 @@ open import Function.Base open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl) -open import Relation.Unary using (Pred; Decidable; U; ) +open import Relation.Unary using (Pred; Decidable; U; ) open import Relation.Unary.Properties using (U?; ∅?) -open import Relation.Nullary.Decidable using (does) +open import Relation.Nullary.Decidable using (does) private variable @@ -237,11 +237,11 @@ wordsByᵇ : (A Bool) List A List (List⁺ A) wordsByᵇ p = List.mapMaybe Sum.[ const nothing , just ] groupSeqsᵇ p -groupSeqs : {P : Pred A p} Decidable P List A List (List⁺ A List⁺ A) -groupSeqs P? = groupSeqsᵇ (does P?) +groupSeqs : {P : Pred A p} Decidable P List A List (List⁺ A List⁺ A) +groupSeqs P? = groupSeqsᵇ (does P?) -wordsBy : {P : Pred A p} Decidable P List A List (List⁺ A) -wordsBy P? = wordsByᵇ (does P?) +wordsBy : {P : Pred A p} Decidable P List A List (List⁺ A) +wordsBy P? = wordsByᵇ (does P?) -- Inverse operation for groupSequences. ungroupSeqs : List (List⁺ A List⁺ A) List A diff --git a/master/Data.List.NonEmpty.Properties.html b/master/Data.List.NonEmpty.Properties.html index 4d4b06ae69..466f40502d 100644 --- a/master/Data.List.NonEmpty.Properties.html +++ b/master/Data.List.NonEmpty.Properties.html @@ -32,8 +32,8 @@ using (_≡_; refl; cong; cong₂; _≗_) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) -open import Relation.Unary using (Pred; Decidable; ) -open import Relation.Nullary using (¬_; does; yes; no) +open import Relation.Unary using (Pred; Decidable; ) +open import Relation.Nullary using (¬_; does; yes; no) open ≡-Reasoning @@ -137,22 +137,22 @@ -- Groups all contiguous elements for which the predicate returns the -- same result into lists. -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where - groupSeqs-groups : xs ListAll (Sum.All (All P) (All ( P))) (groupSeqs P? xs) + groupSeqs-groups : xs ListAll (Sum.All (All P) (All ( P))) (groupSeqs P? xs) groupSeqs-groups [] = [] groupSeqs-groups (x xs) with P? x | groupSeqs P? xs | groupSeqs-groups xs - ... | yes px | [] | hyp = inj₁ (px []) hyp - ... | yes px | inj₁ xs′ xss | inj₁ pxs pxss = inj₁ (px toList⁺ pxs) pxss - ... | yes px | inj₂ xs′ xss | inj₂ pxs pxss = inj₁ (px []) inj₂ pxs pxss - ... | no ¬px | [] | hyp = inj₂ (¬px []) hyp - ... | no ¬px | inj₂ xs′ xss | inj₂ pxs pxss = inj₂ (¬px toList⁺ pxs) pxss - ... | no ¬px | inj₁ xs′ xss | inj₁ pxs pxss = inj₂ (¬px []) inj₁ pxs pxss + ... | yes px | [] | hyp = inj₁ (px []) hyp + ... | yes px | inj₁ xs′ xss | inj₁ pxs pxss = inj₁ (px toList⁺ pxs) pxss + ... | yes px | inj₂ xs′ xss | inj₂ pxs pxss = inj₁ (px []) inj₂ pxs pxss + ... | no ¬px | [] | hyp = inj₂ (¬px []) hyp + ... | no ¬px | inj₂ xs′ xss | inj₂ pxs pxss = inj₂ (¬px toList⁺ pxs) pxss + ... | no ¬px | inj₁ xs′ xss | inj₁ pxs pxss = inj₂ (¬px []) inj₁ pxs pxss ungroupSeqs-groupSeqs : xs ungroupSeqs (groupSeqs P? xs) xs ungroupSeqs-groupSeqs [] = refl ungroupSeqs-groupSeqs (x xs) - with does (P? x) | groupSeqs P? xs | ungroupSeqs-groupSeqs xs + with does (P? x) | groupSeqs P? xs | ungroupSeqs-groupSeqs xs ... | true | [] | hyp = cong (x ∷_) hyp ... | true | inj₁ _ _ | hyp = cong (x ∷_) hyp ... | true | inj₂ _ _ | hyp = cong (x ∷_) hyp diff --git a/master/Data.List.NonEmpty.Relation.Unary.All.html b/master/Data.List.NonEmpty.Relation.Unary.All.html index f909614c62..3831f4fbf9 100644 --- a/master/Data.List.NonEmpty.Relation.Unary.All.html +++ b/master/Data.List.NonEmpty.Relation.Unary.All.html @@ -14,13 +14,13 @@ open import Data.List.Base using ([]; _∷_) open import Data.List.NonEmpty.Base using (List⁺; _∷_; toList) open import Level -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable a p : Level A : Set a - P : Pred A p + P : Pred A p ------------------------------------------------------------------------ -- Definition @@ -30,7 +30,7 @@ infixr 5 _∷_ -data All {A : Set a} (P : Pred A p) : Pred (List⁺ A) (a p) where +data All {A : Set a} (P : Pred A p) : Pred (List⁺ A) (a p) where _∷_ : {x xs} (px : P x) (pxs : List.All P xs) All P (x xs) ------------------------------------------------------------------------ diff --git a/master/Data.List.Properties.html b/master/Data.List.Properties.html index acc7950307..b90e171bb7 100644 --- a/master/Data.List.Properties.html +++ b/master/Data.List.Properties.html @@ -39,15 +39,15 @@ open import Function.Base using (id; _∘_; _∘′_; _∋_; _-⟨_∣; ∣_⟩-_; _$_; const; flip) open import Function.Definitions using (Injective) open import Level using (Level) -open import Relation.Binary.Definitions as B using (DecidableEquality) +open import Relation.Binary.Definitions as B using (DecidableEquality) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning open import Relation.Binary.PropositionalEquality.Core as open import Relation.Binary.PropositionalEquality.Properties as open import Relation.Binary.Core using (Rel) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary using (¬_; Dec; does; _because_; yes; no; contradiction) -open import Relation.Nullary.Decidable as Decidable using (isYes; map′; ⌊_⌋; ¬?; _×-dec_) -open import Relation.Unary using (Pred; Decidable; ) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary using (¬_; Dec; does; _because_; yes; no; contradiction) +open import Relation.Nullary.Decidable as Decidable using (isYes; map′; ⌊_⌋; ¬?; _×-dec_) +open import Relation.Unary using (Pred; Decidable; ) open import Relation.Unary.Properties using (∁?) import Data.Nat.GeneralisedArithmetic as @@ -76,13 +76,13 @@ ∷-injectiveʳ : x xs y List.∷ ys xs ys ∷-injectiveʳ refl = refl -∷-dec : Dec (x y) Dec (xs ys) Dec (x xs y List.∷ ys) -∷-dec x≟y xs≟ys = Decidable.map′ (uncurry (cong₂ _∷_)) ∷-injective (x≟y ×-dec xs≟ys) +∷-dec : Dec (x y) Dec (xs ys) Dec (x xs y List.∷ ys) +∷-dec x≟y xs≟ys = Decidable.map′ (uncurry (cong₂ _∷_)) ∷-injective (x≟y ×-dec xs≟ys) -≡-dec : DecidableEquality A DecidableEquality (List A) -≡-dec _≟_ [] [] = yes refl -≡-dec _≟_ (x xs) [] = no λ() -≡-dec _≟_ [] (y ys) = no λ() +≡-dec : DecidableEquality A DecidableEquality (List A) +≡-dec _≟_ [] [] = yes refl +≡-dec _≟_ (x xs) [] = no λ() +≡-dec _≟_ [] (y ys) = no λ() ≡-dec _≟_ (x xs) (y ys) = ∷-dec (x y) (≡-dec _≟_ xs ys) ------------------------------------------------------------------------ @@ -173,9 +173,9 @@ ++-cancelʳ : RightCancellative _++_ ++-cancelʳ _ [] [] _ = refl ++-cancelʳ xs [] (z zs) eq = - contradiction (trans (cong length eq) (length-++ (z zs))) (m≢1+n+m (length xs)) + contradiction (trans (cong length eq) (length-++ (z zs))) (m≢1+n+m (length xs)) ++-cancelʳ xs (y ys) [] eq = - contradiction (trans (sym (length-++ (y ys))) (cong length eq)) (m≢1+n+m (length xs) sym) + contradiction (trans (sym (length-++ (y ys))) (cong length eq)) (m≢1+n+m (length xs) sym) ++-cancelʳ _ (y ys) (z zs) eq = cong₂ _∷_ (∷-injectiveˡ eq) (++-cancelʳ _ ys zs (∷-injectiveʳ eq)) @@ -607,7 +607,7 @@ -- Interaction with predicates -module _ {P : Pred A p} {f : A A A} where +module _ {P : Pred A p} {f : A A A} where foldr-forcesᵇ : (∀ x y P (f x y) P x × P y) e xs P (foldr f e xs) All P xs @@ -740,7 +740,7 @@ map-catMaybes f (just x xs) = cong (f x ∷_) $ map-catMaybes f xs map-catMaybes f (nothing xs) = map-catMaybes f xs -Any-catMaybes⁺ : {P : Pred A } {xs : List (Maybe A)} +Any-catMaybes⁺ : {P : Pred A } {xs : List (Maybe A)} Any (MAny P) xs Any P (catMaybes xs) Any-catMaybes⁺ {xs = nothing xs} (there x∈) = Any-catMaybes⁺ x∈ Any-catMaybes⁺ {xs = just x xs} (here (just px)) = here px @@ -1136,104 +1136,104 @@ ------------------------------------------------------------------------ -- takeWhile, dropWhile, and span -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where takeWhile++dropWhile : xs takeWhile P? xs ++ dropWhile P? xs xs takeWhile++dropWhile [] = refl - takeWhile++dropWhile (x xs) with does (P? x) + takeWhile++dropWhile (x xs) with does (P? x) ... | true = cong (x ∷_) (takeWhile++dropWhile xs) ... | false = refl span-defn : span P? < takeWhile P? , dropWhile P? > span-defn [] = refl - span-defn (x xs) with does (P? x) + span-defn (x xs) with does (P? x) ... | true = cong (Product.map (x ∷_) id) (span-defn xs) ... | false = refl ------------------------------------------------------------------------ -- filter -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where length-filter : xs length (filter P? xs) length xs length-filter [] = z≤n - length-filter (x xs) with ihlength-filter xs | does (P? x) + length-filter (x xs) with ihlength-filter xs | does (P? x) ... | false = m≤n⇒m≤1+n ih ... | true = s≤s ih filter-all : {xs} All P xs filter P? xs xs filter-all {[]} [] = refl filter-all {x xs} (px pxs) with P? x - ... | false because [¬px] = contradiction px (invert [¬px]) - ... | true because _ = cong (x ∷_) (filter-all pxs) + ... | false because [¬px] = contradiction px (invert [¬px]) + ... | true because _ = cong (x ∷_) (filter-all pxs) - filter-notAll : xs Any ( P) xs length (filter P? xs) < length xs + filter-notAll : xs Any ( P) xs length (filter P? xs) < length xs filter-notAll (x xs) (here ¬px) with P? x - ... | false because _ = s≤s (length-filter xs) - ... | true because [px] = contradiction (invert [px]) ¬px - filter-notAll (x xs) (there any) with ihfilter-notAll xs any | does (P? x) + ... | false because _ = s≤s (length-filter xs) + ... | true because [px] = contradiction (invert [px]) ¬px + filter-notAll (x xs) (there any) with ihfilter-notAll xs any | does (P? x) ... | false = m≤n⇒m≤1+n ih ... | true = s≤s ih filter-some : {xs} Any P xs 0 < length (filter P? xs) filter-some {x xs} (here px) with P? x - ... | true because _ = z<s - ... | no ¬px = contradiction px ¬px - filter-some {x xs} (there pxs) with does (P? x) + ... | true because _ = z<s + ... | no ¬px = contradiction px ¬px + filter-some {x xs} (there pxs) with does (P? x) ... | true = m≤n⇒m≤1+n (filter-some pxs) ... | false = filter-some pxs - filter-none : {xs} All ( P) xs filter P? xs [] + filter-none : {xs} All ( P) xs filter P? xs [] filter-none {[]} [] = refl filter-none {x xs} (¬px ¬pxs) with P? x - ... | false because _ = filter-none ¬pxs - ... | true because [px] = contradiction (invert [px]) ¬px + ... | false because _ = filter-none ¬pxs + ... | true because [px] = contradiction (invert [px]) ¬px filter-complete : {xs} length (filter P? xs) length xs filter P? xs xs filter-complete {[]} eq = refl - filter-complete {x xs} eq with does (P? x) - ... | false = contradiction eq (<⇒≢ (s≤s (length-filter xs))) + filter-complete {x xs} eq with does (P? x) + ... | false = contradiction eq (<⇒≢ (s≤s (length-filter xs))) ... | true = cong (x ∷_) (filter-complete (suc-injective eq)) filter-accept : {x xs} P x filter P? (x xs) x (filter P? xs) filter-accept {x} Px with P? x - ... | true because _ = refl - ... | false because [¬Px] = contradiction Px (invert [¬Px]) + ... | true because _ = refl + ... | false because [¬Px] = contradiction Px (invert [¬Px]) - filter-reject : {x xs} ¬ P x filter P? (x xs) filter P? xs + filter-reject : {x xs} ¬ P x filter P? (x xs) filter P? xs filter-reject {x} ¬Px with P? x - ... | true because [Px] = contradiction (invert [Px]) ¬Px - ... | false because _ = refl + ... | true because [Px] = contradiction (invert [Px]) ¬Px + ... | false because _ = refl filter-idem : filter P? filter P? filter P? filter-idem [] = refl - filter-idem (x xs) with does (P? x) in eq + filter-idem (x xs) with does (P? x) in eq ... | false = filter-idem xs ... | true rewrite eq = cong (x ∷_) (filter-idem xs) filter-++ : xs ys filter P? (xs ++ ys) filter P? xs ++ filter P? ys filter-++ [] ys = refl - filter-++ (x xs) ys with ihfilter-++ xs ys | does (P? x) + filter-++ (x xs) ys with ihfilter-++ xs ys | does (P? x) ... | true = cong (x ∷_) ih ... | false = ih ------------------------------------------------------------------------ -- derun and deduplicate -module _ {R : Rel A p} (R? : B.Decidable R) where +module _ {R : Rel A p} (R? : B.Decidable R) where length-derun : xs length (derun R? xs) length xs length-derun [] = ≤-refl length-derun (x []) = ≤-refl - length-derun (x y xs) with ihlength-derun (y xs) | does (R? x y) + length-derun (x y xs) with ihlength-derun (y xs) | does (R? x y) ... | true = m≤n⇒m≤1+n ih ... | false = s≤s ih length-deduplicate : xs length (deduplicate R? xs) length xs length-deduplicate [] = z≤n length-deduplicate (x xs) = ≤-begin - 1 + length (filter (¬? R? x) r) ≤⟨ s≤s (length-filter (¬? R? x) r) + 1 + length (filter (¬? R? x) r) ≤⟨ s≤s (length-filter (¬? R? x) r) 1 + length r ≤⟨ s≤s (length-deduplicate xs) 1 + length xs ≤-∎ where @@ -1242,29 +1242,29 @@ derun-reject : {x y} xs R x y derun R? (x y xs) derun R? (y xs) derun-reject {x} {y} xs Rxy with R? x y - ... | true because _ = refl - ... | false because [¬Rxy] = contradiction Rxy (invert [¬Rxy]) + ... | true because _ = refl + ... | false because [¬Rxy] = contradiction Rxy (invert [¬Rxy]) - derun-accept : {x y} xs ¬ R x y derun R? (x y xs) x derun R? (y xs) + derun-accept : {x y} xs ¬ R x y derun R? (x y xs) x derun R? (y xs) derun-accept {x} {y} xs ¬Rxy with R? x y - ... | true because [Rxy] = contradiction (invert [Rxy]) ¬Rxy - ... | false because _ = refl + ... | true because [Rxy] = contradiction (invert [Rxy]) ¬Rxy + ... | false because _ = refl ------------------------------------------------------------------------ -- partition -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where partition-defn : partition P? < filter P? , filter (∁? P?) > partition-defn [] = refl - partition-defn (x xs) with ihpartition-defn xs | does (P? x) + partition-defn (x xs) with ihpartition-defn xs | does (P? x) ... | true = cong (Product.map (x ∷_) id) ih ... | false = cong (Product.map id (x ∷_)) ih length-partition : xs (let ys , zs = partition P? xs) length ys length xs × length zs length xs length-partition [] = z≤n , z≤n - length-partition (x xs) with ihlength-partition xs | does (P? x) + length-partition (x xs) with ihlength-partition xs | does (P? x) ... | true = Product.map s≤s m≤n⇒m≤1+n ih ... | false = Product.map m≤n⇒m≤1+n s≤s ih diff --git a/master/Data.List.Relation.Binary.BagAndSetEquality.html b/master/Data.List.Relation.Binary.BagAndSetEquality.html index f14a51837f..53e259d32f 100644 --- a/master/Data.List.Relation.Binary.BagAndSetEquality.html +++ b/master/Data.List.Relation.Binary.BagAndSetEquality.html @@ -45,7 +45,7 @@ open import Function.Properties.Inverse using (↔-sym; ↔-trans; to-from) open import Level using (Level) open import Relation.Binary.Core using (_⇒_) -open import Relation.Binary.Definitions using (Trans) +open import Relation.Binary.Definitions using (Trans) open import Relation.Binary.Bundles using (Preorder; Setoid) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning import Relation.Binary.Reasoning.Preorder as ≲-Reasoning @@ -54,7 +54,7 @@ open import Relation.Binary.PropositionalEquality.Properties as using (module ≡-Reasoning) open import Relation.Binary.Reasoning.Syntax -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) private variable @@ -112,7 +112,7 @@ open ⊆-syntax _IsRelatedTo_ _IsRelatedTo_ ⊆-go public module _ {k : Related.ForwardKind} where - ∼-go : Trans _∼[ k ⌋→ ]_ _IsRelatedTo_ _IsRelatedTo_ + ∼-go : Trans _∼[ k ⌋→ ]_ _IsRelatedTo_ _IsRelatedTo_ ∼-go eq = ⊆-go (⇒→ eq) open ∼-syntax _IsRelatedTo_ _IsRelatedTo_ ∼-go public @@ -303,7 +303,7 @@ -- necessarily set equal. ¬-drop-cons : {x : A} - ¬ (∀ {xs ys} x xs ∼[ set ] x ys xs ∼[ set ] ys) + ¬ (∀ {xs ys} x xs ∼[ set ] x ys xs ∼[ set ] ys) ¬-drop-cons {x = x} drop-cons with Equivalence.to x∼[] (here refl) where x,x≈x : (x x []) ∼[ set ] [ x ] diff --git a/master/Data.List.Relation.Binary.Disjoint.DecPropositional.html b/master/Data.List.Relation.Binary.Disjoint.DecPropositional.html index ac0277de1f..2d4924498b 100644 --- a/master/Data.List.Relation.Binary.Disjoint.DecPropositional.html +++ b/master/Data.List.Relation.Binary.Disjoint.DecPropositional.html @@ -7,10 +7,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Relation.Binary.Disjoint.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) + {a} {A : Set a} (_≟_ : DecidableEquality A) where ------------------------------------------------------------------------ diff --git a/master/Data.List.Relation.Binary.Disjoint.DecSetoid.html b/master/Data.List.Relation.Binary.Disjoint.DecSetoid.html index b512f9bf3d..56b092e0fc 100644 --- a/master/Data.List.Relation.Binary.Disjoint.DecSetoid.html +++ b/master/Data.List.Relation.Binary.Disjoint.DecSetoid.html @@ -15,17 +15,17 @@ open import Data.List.Relation.Unary.Any using (map) open import Data.List.Relation.Unary.All using (all?; lookupₛ) open import Data.List.Relation.Unary.All.Properties using (¬All⇒Any¬) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary using (yes; no; decidable-stable) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary using (yes; no; decidable-stable) open DecSetoid S open import Data.List.Relation.Binary.Equality.DecSetoid S open import Data.List.Relation.Binary.Disjoint.Setoid setoid public open import Data.List.Membership.DecSetoid S -disjoint? : Decidable Disjoint +disjoint? : Decidable Disjoint disjoint? xs ys with all? (_∉? ys) xs -... | yes xs♯ys = yes λ (v∈ , v∈′) +... | yes xs♯ys = yes λ (v∈ , v∈′) lookupₛ setoid x≈y ∉ys ∈ys ∉ys (map (trans x≈y) ∈ys)) xs♯ys v∈ v∈′ -... | no ¬xs♯ys = let (x , x∈ , ¬∉ys) = find (¬All⇒Any¬ (_∉? _) _ ¬xs♯ys) in - no λ p p (x∈ , decidable-stable (_ ∈? _) ¬∉ys) +... | no ¬xs♯ys = let (x , x∈ , ¬∉ys) = find (¬All⇒Any¬ (_∉? _) _ ¬xs♯ys) in + no λ p p (x∈ , decidable-stable (_ ∈? _) ¬∉ys) \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Disjoint.Setoid.Properties.html b/master/Data.List.Relation.Binary.Disjoint.Setoid.Properties.html index 4f785cf4fa..951f402e9d 100644 --- a/master/Data.List.Relation.Binary.Disjoint.Setoid.Properties.html +++ b/master/Data.List.Relation.Binary.Disjoint.Setoid.Properties.html @@ -18,8 +18,8 @@ open import Data.Product.Base using (_,_) open import Data.Sum.Base using (inj₁; inj₂) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (Symmetric) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Binary.Definitions using (Symmetric) +open import Relation.Nullary.Negation using (¬_) ------------------------------------------------------------------------ -- Relational properties @@ -27,7 +27,7 @@ module _ {c } (S : Setoid c ) where - sym : Symmetric (Disjoint S) + sym : Symmetric (Disjoint S) sym xs#ys (v∈ys , v∈xs) = xs#ys (v∈xs , v∈ys) ------------------------------------------------------------------------ @@ -39,7 +39,7 @@ open Setoid S Disjoint⇒AllAll : {xs ys} Disjoint S xs ys - All x All y ¬ x y) ys) xs + All x All y ¬ x y) ys) xs Disjoint⇒AllAll xs#ys = All.map (¬Any⇒All¬ _) (All.tabulate v∈xs v∈ys xs#ys (Any.map reflexive v∈xs , v∈ys))) diff --git a/master/Data.List.Relation.Binary.Disjoint.Setoid.html b/master/Data.List.Relation.Binary.Disjoint.Setoid.html index ed6d74e21e..2f1f904989 100644 --- a/master/Data.List.Relation.Binary.Disjoint.Setoid.html +++ b/master/Data.List.Relation.Binary.Disjoint.Setoid.html @@ -13,7 +13,7 @@ module Data.List.Relation.Binary.Disjoint.Setoid {c } (S : Setoid c ) where open import Level using (_⊔_) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Function.Base using (_∘_) open import Data.List.Base using (List; []; [_]; _∷_) open import Data.List.Relation.Unary.Any using (here; there) @@ -26,7 +26,7 @@ -- Definition Disjoint : Rel (List A) ( c) -Disjoint xs ys = {v} ¬ (v xs × v ys) +Disjoint xs ys = {v} ¬ (v xs × v ys) ------------------------------------------------------------------------ -- Operations diff --git a/master/Data.List.Relation.Binary.Equality.DecPropositional.html b/master/Data.List.Relation.Binary.Equality.DecPropositional.html index e98b85b573..e573a96502 100644 --- a/master/Data.List.Relation.Binary.Equality.DecPropositional.html +++ b/master/Data.List.Relation.Binary.Equality.DecPropositional.html @@ -11,10 +11,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Relation.Binary.Equality.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) where + {a} {A : Set a} (_≟_ : DecidableEquality A) where open import Data.List.Base using (List) open import Data.List.Properties using (≡-dec) @@ -35,6 +35,6 @@ infix 4 _≡?_ -_≡?_ : DecidableEquality (List A) +_≡?_ : DecidableEquality (List A) _≡?_ = ≡-dec _≟_ \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Equality.DecSetoid.html b/master/Data.List.Relation.Binary.Equality.DecSetoid.html index ec72ae1749..c09cb83e8f 100644 --- a/master/Data.List.Relation.Binary.Equality.DecSetoid.html +++ b/master/Data.List.Relation.Binary.Equality.DecSetoid.html @@ -9,7 +9,7 @@ open import Relation.Binary.Bundles using (DecSetoid) open import Relation.Binary.Structures using (IsDecEquivalence) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) module Data.List.Relation.Binary.Equality.DecSetoid {a } (DS : DecSetoid a ) where @@ -17,7 +17,7 @@ import Data.List.Relation.Binary.Equality.Setoid as SetoidEquality import Data.List.Relation.Binary.Pointwise as PW open import Level -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open DecSetoid DS ------------------------------------------------------------------------ @@ -30,7 +30,7 @@ infix 4 _≋?_ -_≋?_ : Decidable _≋_ +_≋?_ : Decidable _≋_ _≋?_ = PW.decidable _≟_ ≋-isDecEquivalence : IsDecEquivalence _≋_ diff --git a/master/Data.List.Relation.Binary.Equality.Setoid.html b/master/Data.List.Relation.Binary.Equality.Setoid.html index 333970d9de..bc780e4460 100644 --- a/master/Data.List.Relation.Binary.Equality.Setoid.html +++ b/master/Data.List.Relation.Binary.Equality.Setoid.html @@ -19,11 +19,11 @@ open import Function.Base using (_∘_) open import Level using (Level; _⊔_) open import Relation.Binary.Core using (_⇒_; _Preserves_⟶_) renaming (Rel to Rel₂) -open import Relation.Binary.Definitions using (Transitive; Symmetric; Reflexive; _Respects_) +open import Relation.Binary.Definitions using (Transitive; Symmetric; Reflexive; _Respects_) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Properties.Setoid S using (≉-resp₂) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Unary as U using (Pred) +open import Relation.Unary as U using (Pred) open Setoid S renaming (Carrier to A) @@ -47,16 +47,16 @@ -- Relational properties ------------------------------------------------------------------------ -≋-refl : Reflexive _≋_ +≋-refl : Reflexive _≋_ ≋-refl = PW.refl refl ≋-reflexive : _≡_ _≋_ ≋-reflexive ≡.refl = ≋-refl -≋-sym : Symmetric _≋_ +≋-sym : Symmetric _≋_ ≋-sym = PW.symmetric sym -≋-trans : Transitive _≋_ +≋-trans : Transitive _≋_ ≋-trans = PW.transitive trans ≋-isEquivalence : IsEquivalence _≋_ @@ -76,7 +76,7 @@ ; AllPairs-resp-Pointwise to AllPairs-resp-≋ ) -Unique-resp-≋ : Unique Respects _≋_ +Unique-resp-≋ : Unique Respects _≋_ Unique-resp-≋ = AllPairs-resp-≋ ≉-resp₂ ------------------------------------------------------------------------ @@ -144,7 +144,7 @@ ------------------------------------------------------------------------ -- filter -module _ {P : Pred A p} (P? : U.Decidable P) (resp : P Respects _≈_) +module _ {P : Pred A p} (P? : U.Decidable P) (resp : P Respects _≈_) where filter⁺ : {xs ys} xs ys filter P? xs filter P? ys diff --git a/master/Data.List.Relation.Binary.Infix.Heterogeneous.Properties.html b/master/Data.List.Relation.Binary.Infix.Heterogeneous.Properties.html index 1376d84f7d..256baf2067 100644 --- a/master/Data.List.Relation.Binary.Infix.Heterogeneous.Properties.html +++ b/master/Data.List.Relation.Binary.Infix.Heterogeneous.Properties.html @@ -18,11 +18,11 @@ open import Data.Sum.Base using (_⊎_; inj₁; inj₂; [_,_]′) open import Function.Base using (case_of_; _$′_) -open import Relation.Nullary.Decidable using (yes; no; does; map′; _⊎-dec_) -open import Relation.Nullary.Negation using (¬_; contradiction) -open import Relation.Unary as U using (Pred) +open import Relation.Nullary.Decidable using (yes; no; does; map′; _⊎-dec_) +open import Relation.Nullary.Negation using (¬_; contradiction) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core using (REL; _⇒_) -open import Relation.Binary.Definitions using (Decidable; Trans; Antisym) +open import Relation.Binary.Definitions using (Decidable; Trans; Antisym) open import Relation.Binary.PropositionalEquality.Core using (_≢_; refl; cong) open import Data.List.Relation.Binary.Pointwise.Base as Pointwise using (Pointwise) open import Data.List.Relation.Binary.Infix.Heterogeneous @@ -52,11 +52,11 @@ module _ {c t} {C : Set c} {T : REL A C t} where - fromPrefixSuffix : Trans R S T Trans (Prefix R) (Suffix S) (Infix T) + fromPrefixSuffix : Trans R S T Trans (Prefix R) (Suffix S) (Infix T) fromPrefixSuffix tr p (here q) = here (Prefix.trans tr p (Prefix.fromPointwise q)) fromPrefixSuffix tr p (there q) = there (fromPrefixSuffix tr p q) - fromSuffixPrefix : Trans R S T Trans (Suffix R) (Prefix S) (Infix T) + fromSuffixPrefix : Trans R S T Trans (Suffix R) (Prefix S) (Infix T) fromSuffixPrefix tr (here p) q = here (Prefix.trans tr (Prefix.fromPointwise p) q) fromSuffixPrefix tr (there p) (_ q) = there (fromSuffixPrefix tr p q) @@ -76,27 +76,27 @@ module _ {c t} {C : Set c} {T : REL A C t} where - Prefix-Infix-trans : Trans R S T Trans (Prefix R) (Infix S) (Infix T) + Prefix-Infix-trans : Trans R S T Trans (Prefix R) (Infix S) (Infix T) Prefix-Infix-trans tr p (here q) = here (Prefix.trans tr p q) Prefix-Infix-trans tr p (there q) = there (Prefix-Infix-trans tr p q) - Infix-Prefix-trans : Trans R S T Trans (Infix R) (Prefix S) (Infix T) + Infix-Prefix-trans : Trans R S T Trans (Infix R) (Prefix S) (Infix T) Infix-Prefix-trans tr (here p) q = here (Prefix.trans tr p q) Infix-Prefix-trans tr (there p) (_ q) = there (Infix-Prefix-trans tr p q) - Suffix-Infix-trans : Trans R S T Trans (Suffix R) (Infix S) (Infix T) + Suffix-Infix-trans : Trans R S T Trans (Suffix R) (Infix S) (Infix T) Suffix-Infix-trans tr p (here q) = fromSuffixPrefix tr p q Suffix-Infix-trans tr p (there q) = there (Suffix-Infix-trans tr p q) - Infix-Suffix-trans : Trans R S T Trans (Infix R) (Suffix S) (Infix T) + Infix-Suffix-trans : Trans R S T Trans (Infix R) (Suffix S) (Infix T) Infix-Suffix-trans tr p (here q) = Infix-Prefix-trans tr p (Prefix.fromPointwise q) Infix-Suffix-trans tr p (there q) = there (Infix-Suffix-trans tr p q) - trans : Trans R S T Trans (Infix R) (Infix S) (Infix T) + trans : Trans R S T Trans (Infix R) (Infix S) (Infix T) trans tr p (here q) = Infix-Prefix-trans tr p q trans tr p (there q) = there (trans tr p q) - antisym : Antisym R S T Antisym (Infix R) (Infix S) (Pointwise T) + antisym : Antisym R S T Antisym (Infix R) (Infix S) (Pointwise T) antisym asym (here p) (here q) = Prefix.antisym asym p q antisym asym {i = a as} {j = bs} p@(here _) (there q) = ⊥-elim $′ ℕ.<-irrefl refl $′ begin-strict @@ -135,13 +135,13 @@ ------------------------------------------------------------------------ -- filter -module _ {p q} {P : Pred A p} {Q : Pred B q} (P? : U.Decidable P) (Q? : U.Decidable Q) +module _ {p q} {P : Pred A p} {Q : Pred B q} (P? : U.Decidable P) (Q? : U.Decidable Q) (P⇒Q : {a b} P a Q b) (Q⇒P : {a b} Q b P a) where filter⁺ : {as bs} Infix R as bs Infix R (filter P? as) (filter Q? bs) filter⁺ (here p) = here (Prefix.filter⁺ P? Q? _ P⇒Q) _ Q⇒P) p) - filter⁺ {bs = b bs} (there p) with does (Q? b) + filter⁺ {bs = b bs} (there p) with does (Q? b) ... | true = there (filter⁺ p) ... | false = filter⁺ p @@ -161,10 +161,10 @@ ------------------------------------------------------------------------ -- decidability -infix? : Decidable R Decidable (Infix R) -infix? R? [] [] = yes (here []) -infix? R? (a as) [] = no where (here ())) +infix? : Decidable R Decidable (Infix R) +infix? R? [] [] = yes (here []) +infix? R? (a as) [] = no where (here ())) infix? R? as bbs@(_ bs) = - map′ [ here , there ]′ ∷⁻ - (Prefix.prefix? R? as bbs ⊎-dec infix? R? as bs) + map′ [ here , there ]′ ∷⁻ + (Prefix.prefix? R? as bbs ⊎-dec infix? R? as bs) \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Lex.Core.html b/master/Data.List.Relation.Binary.Lex.Core.html index 824bb4d101..85610dbb92 100644 --- a/master/Data.List.Relation.Binary.Lex.Core.html +++ b/master/Data.List.Relation.Binary.Lex.Core.html @@ -15,7 +15,7 @@ open import Data.List.Base using (List; []; _∷_) open import Function.Base using (_∘_; flip; id) open import Level using (Level; _⊔_) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Relation.Binary.Core using (Rel) open import Data.List.Relation.Binary.Pointwise.Base using (Pointwise; []; _∷_; head; tail) diff --git a/master/Data.List.Relation.Binary.Lex.NonStrict.html b/master/Data.List.Relation.Binary.Lex.NonStrict.html index 483c023628..85a3a38196 100644 --- a/master/Data.List.Relation.Binary.Lex.NonStrict.html +++ b/master/Data.List.Relation.Binary.Lex.NonStrict.html @@ -26,7 +26,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsPartialOrder; IsStrictPartialOrder; IsTotalOrder; IsStrictTotalOrder; IsPreorder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Irreflexive; _Respects₂_; Antisymmetric; Asymmetric; Symmetric; Transitive; Decidable; Total; Trichotomous) + using (Irreflexive; _Respects₂_; Antisymmetric; Asymmetric; Symmetric; Transitive; Decidable; Total; Trichotomous) import Relation.Binary.Construct.NonStrictToStrict as Conv import Data.List.Relation.Binary.Lex as Core @@ -53,41 +53,41 @@ _≋_ = Pointwise _≈_ _<_ = Lex-< _≈_ _≼_ - <-irreflexive : Irreflexive _≋_ _<_ + <-irreflexive : Irreflexive _≋_ _<_ <-irreflexive = Strict.<-irreflexive (Conv.<-irrefl _≈_ _≼_) - <-asymmetric : IsEquivalence _≈_ _≼_ Respects₂ _≈_ - Antisymmetric _≈_ _≼_ Asymmetric _<_ + <-asymmetric : IsEquivalence _≈_ _≼_ Respects₂ _≈_ + Antisymmetric _≈_ _≼_ Asymmetric _<_ <-asymmetric eq resp antisym = Strict.<-asymmetric sym (Conv.<-resp-≈ _ _ eq resp) (Conv.<-asym _≈_ _ antisym) where open IsEquivalence eq - <-antisymmetric : Symmetric _≈_ Antisymmetric _≈_ _≼_ - Antisymmetric _≋_ _<_ + <-antisymmetric : Symmetric _≈_ Antisymmetric _≈_ _≼_ + Antisymmetric _≋_ _<_ <-antisymmetric sym antisym = Core.antisymmetric sym (Conv.<-irrefl _≈_ _≼_) (Conv.<-asym _ _≼_ antisym) - <-transitive : IsPartialOrder _≈_ _≼_ Transitive _<_ + <-transitive : IsPartialOrder _≈_ _≼_ Transitive _<_ <-transitive po = Core.transitive isEquivalence (Conv.<-resp-≈ _ _ isEquivalence ≤-resp-≈) (Conv.<-trans _ _≼_ po) where open IsPartialOrder po - <-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ _<_ Respects₂ _≋_ + <-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ _<_ Respects₂ _≋_ <-resp₂ eq resp = Core.respects₂ eq (Conv.<-resp-≈ _ _ eq resp) - <-compare : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ - Total _≼_ Trichotomous _≋_ _<_ + <-compare : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ + Total _≼_ Trichotomous _≋_ _<_ <-compare sym _≟_ antisym tot = Strict.<-compare sym (Conv.<-trichotomous _ _ sym _≟_ antisym tot) - <-decidable : Decidable _≈_ Decidable _≼_ Decidable _<_ + <-decidable : Decidable _≈_ Decidable _≼_ Decidable _<_ <-decidable _≟_ _≼?_ = - Core.decidable (no id) _≟_ (Conv.<-decidable _ _ _≟_ _≼?_) + Core.decidable (no id) _≟_ (Conv.<-decidable _ _ _≟_ _≼?_) <-isStrictPartialOrder : IsPartialOrder _≈_ _≼_ IsStrictPartialOrder _≋_ _<_ @@ -95,7 +95,7 @@ Strict.<-isStrictPartialOrder (Conv.<-isStrictPartialOrder _ _ po) - <-isStrictTotalOrder : Decidable _≈_ IsTotalOrder _≈_ _≼_ + <-isStrictTotalOrder : Decidable _≈_ IsTotalOrder _≈_ _≼_ IsStrictTotalOrder _≋_ _<_ <-isStrictTotalOrder dec tot = Strict.<-isStrictTotalOrder @@ -131,29 +131,29 @@ _≋_ = Pointwise _≈_ _≤_ = Lex-≤ _≈_ _≼_ - ≤-antisymmetric : Symmetric _≈_ Antisymmetric _≈_ _≼_ - Antisymmetric _≋_ _≤_ + ≤-antisymmetric : Symmetric _≈_ Antisymmetric _≈_ _≼_ + Antisymmetric _≋_ _≤_ ≤-antisymmetric sym antisym = Core.antisymmetric sym (Conv.<-irrefl _≈_ _≼_) (Conv.<-asym _ _≼_ antisym) - ≤-transitive : IsPartialOrder _≈_ _≼_ Transitive _≤_ + ≤-transitive : IsPartialOrder _≈_ _≼_ Transitive _≤_ ≤-transitive po = Core.transitive isEquivalence (Conv.<-resp-≈ _ _ isEquivalence ≤-resp-≈) (Conv.<-trans _ _≼_ po) where open IsPartialOrder po - ≤-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ _≤_ Respects₂ _≋_ + ≤-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ _≤_ Respects₂ _≋_ ≤-resp₂ eq resp = Core.respects₂ eq (Conv.<-resp-≈ _ _ eq resp) - ≤-decidable : Decidable _≈_ Decidable _≼_ Decidable _≤_ + ≤-decidable : Decidable _≈_ Decidable _≼_ Decidable _≤_ ≤-decidable _≟_ _≼?_ = - Core.decidable (yes tt) _≟_ (Conv.<-decidable _ _ _≟_ _≼?_) + Core.decidable (yes tt) _≟_ (Conv.<-decidable _ _ _≟_ _≼?_) - ≤-total : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ - Total _≼_ Total _≤_ + ≤-total : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ + Total _≼_ Total _≤_ ≤-total sym dec-≈ antisym tot = Strict.≤-total sym (Conv.<-trichotomous _ _ sym dec-≈ antisym tot) @@ -169,7 +169,7 @@ Strict.≤-isPartialOrder (Conv.<-isStrictPartialOrder _ _ po) - ≤-isTotalOrder : Decidable _≈_ IsTotalOrder _≈_ _≼_ + ≤-isTotalOrder : Decidable _≈_ IsTotalOrder _≈_ _≼_ IsTotalOrder _≋_ _≤_ ≤-isTotalOrder dec tot = Strict.≤-isTotalOrder diff --git a/master/Data.List.Relation.Binary.Lex.Strict.html b/master/Data.List.Relation.Binary.Lex.Strict.html index 4e7bfb716c..ee83719e1b 100644 --- a/master/Data.List.Relation.Binary.Lex.Strict.html +++ b/master/Data.List.Relation.Binary.Lex.Strict.html @@ -19,14 +19,14 @@ open import Data.Sum.Base using (inj₁; inj₂) open import Data.List.Base using (List; []; _∷_) open import Level using (_⊔_) -open import Relation.Nullary using (yes; no; ¬_) +open import Relation.Nullary using (yes; no; ¬_) open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Bundles using (StrictPartialOrder; StrictTotalOrder; Preorder; Poset; DecPoset; DecTotalOrder) open import Relation.Binary.Structures using (IsEquivalence; IsStrictPartialOrder; IsStrictTotalOrder; IsPreorder; IsPartialOrder; IsDecPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Irreflexive; Symmetric; _Respects₂_; Total; Asymmetric; Antisymmetric; Transitive; Trichotomous; Decidable; tri≈; tri<; tri>) + using (Irreflexive; Symmetric; _Respects₂_; Total; Asymmetric; Antisymmetric; Transitive; Trichotomous; Decidable; tri≈; tri<; tri>) open import Relation.Binary.Consequences open import Data.List.Relation.Binary.Pointwise as Pointwise using (Pointwise; []; _∷_; head; tail) @@ -52,62 +52,62 @@ _≋_ = Pointwise _≈_ _<_ = Lex-< _≈_ _≺_ - xs≮[] : {xs} ¬ xs < [] + xs≮[] : {xs} ¬ xs < [] xs≮[] (base ()) - ¬[]<[] : ¬ [] < [] + ¬[]<[] : ¬ [] < [] ¬[]<[] = xs≮[] - <-irreflexive : Irreflexive _≈_ _≺_ Irreflexive _≋_ _<_ + <-irreflexive : Irreflexive _≈_ _≺_ Irreflexive _≋_ _<_ <-irreflexive irr (x≈y xs≋ys) (this x<y) = irr x≈y x<y <-irreflexive irr (x≈y xs≋ys) (next _ xs⊴ys) = <-irreflexive irr xs≋ys xs⊴ys - <-asymmetric : Symmetric _≈_ _≺_ Respects₂ _≈_ Asymmetric _≺_ - Asymmetric _<_ + <-asymmetric : Symmetric _≈_ _≺_ Respects₂ _≈_ Asymmetric _≺_ + Asymmetric _<_ <-asymmetric sym resp as = asym where - irrefl : Irreflexive _≈_ _≺_ + irrefl : Irreflexive _≈_ _≺_ irrefl = asym⇒irr resp sym as - asym : Asymmetric _<_ + asym : Asymmetric _<_ asym (base bot) _ = bot asym (this x<y) (this y<x) = as x<y y<x asym (this x<y) (next y≈x ys⊴xs) = irrefl (sym y≈x) x<y asym (next x≈y xs⊴ys) (this y<x) = irrefl (sym x≈y) y<x asym (next x≈y xs⊴ys) (next y≈x ys⊴xs) = asym xs⊴ys ys⊴xs - <-antisymmetric : Symmetric _≈_ Irreflexive _≈_ _≺_ - Asymmetric _≺_ Antisymmetric _≋_ _<_ + <-antisymmetric : Symmetric _≈_ Irreflexive _≈_ _≺_ + Asymmetric _≺_ Antisymmetric _≋_ _<_ <-antisymmetric = Core.antisymmetric - <-transitive : IsEquivalence _≈_ _≺_ Respects₂ _≈_ - Transitive _≺_ Transitive _<_ + <-transitive : IsEquivalence _≈_ _≺_ Respects₂ _≈_ + Transitive _≺_ Transitive _<_ <-transitive = Core.transitive - <-compare : Symmetric _≈_ Trichotomous _≈_ _≺_ - Trichotomous _≋_ _<_ - <-compare sym tri [] [] = tri≈ ¬[]<[] [] ¬[]<[] - <-compare sym tri [] (y ys) = tri< halt (λ()) (λ()) - <-compare sym tri (x xs) [] = tri> (λ()) (λ()) halt + <-compare : Symmetric _≈_ Trichotomous _≈_ _≺_ + Trichotomous _≋_ _<_ + <-compare sym tri [] [] = tri≈ ¬[]<[] [] ¬[]<[] + <-compare sym tri [] (y ys) = tri< halt (λ()) (λ()) + <-compare sym tri (x xs) [] = tri> (λ()) (λ()) halt <-compare sym tri (x xs) (y ys) with tri x y - ... | tri< x<y x≉y y≮x = - tri< (this x<y) (x≉y head) (¬≤-this (x≉y sym) y≮x) - ... | tri> x≮y x≉y y<x = - tri> (¬≤-this x≉y x≮y) (x≉y head) (this y<x) - ... | tri≈ x≮y x≈y y≮x with <-compare sym tri xs ys - ... | tri< xs<ys xs≉ys ys≮xs = - tri< (next x≈y xs<ys) (xs≉ys tail) (¬≤-next y≮x ys≮xs) - ... | tri≈ xs≮ys xs≈ys ys≮xs = - tri≈ (¬≤-next x≮y xs≮ys) (x≈y xs≈ys) (¬≤-next y≮x ys≮xs) - ... | tri> xs≮ys xs≉ys ys<xs = - tri> (¬≤-next x≮y xs≮ys) (xs≉ys tail) (next (sym x≈y) ys<xs) - - <-decidable : Decidable _≈_ Decidable _≺_ Decidable _<_ - <-decidable = Core.decidable (no id) - - <-respects₂ : IsEquivalence _≈_ _≺_ Respects₂ _≈_ - _<_ Respects₂ _≋_ + ... | tri< x<y x≉y y≮x = + tri< (this x<y) (x≉y head) (¬≤-this (x≉y sym) y≮x) + ... | tri> x≮y x≉y y<x = + tri> (¬≤-this x≉y x≮y) (x≉y head) (this y<x) + ... | tri≈ x≮y x≈y y≮x with <-compare sym tri xs ys + ... | tri< xs<ys xs≉ys ys≮xs = + tri< (next x≈y xs<ys) (xs≉ys tail) (¬≤-next y≮x ys≮xs) + ... | tri≈ xs≮ys xs≈ys ys≮xs = + tri≈ (¬≤-next x≮y xs≮ys) (x≈y xs≈ys) (¬≤-next y≮x ys≮xs) + ... | tri> xs≮ys xs≉ys ys<xs = + tri> (¬≤-next x≮y xs≮ys) (xs≉ys tail) (next (sym x≈y) ys<xs) + + <-decidable : Decidable _≈_ Decidable _≺_ Decidable _<_ + <-decidable = Core.decidable (no id) + + <-respects₂ : IsEquivalence _≈_ _≺_ Respects₂ _≈_ + _<_ Respects₂ _≋_ <-respects₂ = Core.respects₂ <-isStrictPartialOrder : IsStrictPartialOrder _≈_ _≺_ @@ -157,37 +157,37 @@ _≋_ = Pointwise _≈_ _≤_ = Lex-≤ _≈_ _≺_ - ≤-antisymmetric : Symmetric _≈_ Irreflexive _≈_ _≺_ - Asymmetric _≺_ Antisymmetric _≋_ _≤_ + ≤-antisymmetric : Symmetric _≈_ Irreflexive _≈_ _≺_ + Asymmetric _≺_ Antisymmetric _≋_ _≤_ ≤-antisymmetric = Core.antisymmetric - ≤-transitive : IsEquivalence _≈_ _≺_ Respects₂ _≈_ - Transitive _≺_ Transitive _≤_ + ≤-transitive : IsEquivalence _≈_ _≺_ Respects₂ _≈_ + Transitive _≺_ Transitive _≤_ ≤-transitive = Core.transitive -- Note that trichotomy is an unnecessarily strong precondition for -- the following lemma. - ≤-total : Symmetric _≈_ Trichotomous _≈_ _≺_ Total _≤_ + ≤-total : Symmetric _≈_ Trichotomous _≈_ _≺_ Total _≤_ ≤-total _ _ [] [] = inj₁ (base tt) ≤-total _ _ [] (x xs) = inj₁ halt ≤-total _ _ (x xs) [] = inj₂ halt ≤-total sym tri (x xs) (y ys) with tri x y - ... | tri< x<y _ _ = inj₁ (this x<y) - ... | tri> _ _ y<x = inj₂ (this y<x) - ... | tri≈ _ x≈y _ with ≤-total sym tri xs ys + ... | tri< x<y _ _ = inj₁ (this x<y) + ... | tri> _ _ y<x = inj₂ (this y<x) + ... | tri≈ _ x≈y _ with ≤-total sym tri xs ys ... | inj₁ xs≲ys = inj₁ (next x≈y xs≲ys) ... | inj₂ ys≲xs = inj₂ (next (sym x≈y) ys≲xs) - ≤-decidable : Decidable _≈_ Decidable _≺_ Decidable _≤_ - ≤-decidable = Core.decidable (yes tt) + ≤-decidable : Decidable _≈_ Decidable _≺_ Decidable _≤_ + ≤-decidable = Core.decidable (yes tt) - ≤-respects₂ : IsEquivalence _≈_ _≺_ Respects₂ _≈_ - _≤_ Respects₂ _≋_ + ≤-respects₂ : IsEquivalence _≈_ _≺_ Respects₂ _≈_ + _≤_ Respects₂ _≋_ ≤-respects₂ = Core.respects₂ - ≤-isPreorder : IsEquivalence _≈_ Transitive _≺_ - _≺_ Respects₂ _≈_ IsPreorder _≋_ _≤_ + ≤-isPreorder : IsEquivalence _≈_ Transitive _≺_ + _≺_ Respects₂ _≈_ IsPreorder _≋_ _≤_ ≤-isPreorder eq tr resp = record { isEquivalence = Pointwise.isEquivalence eq ; reflexive = ≤-reflexive _≈_ _≺_ diff --git a/master/Data.List.Relation.Binary.Lex.html b/master/Data.List.Relation.Binary.Lex.html index 0b5aee05a8..14790fbb95 100644 --- a/master/Data.List.Relation.Binary.Lex.html +++ b/master/Data.List.Relation.Binary.Lex.html @@ -17,13 +17,13 @@ open import Function.Base using (_∘_; flip; id) open import Function.Bundles using (_⇔_; mk⇔) open import Level using (_⊔_) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Relation.Nullary.Decidable as Dec - using (Dec; yes; no; _×-dec_; _⊎-dec_) + using (Dec; yes; no; _×-dec_; _⊎-dec_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Symmetric; Transitive; Irreflexive; Asymmetric; Antisymmetric; Decidable; _Respects₂_; _Respects_) + using (Symmetric; Transitive; Irreflexive; Asymmetric; Antisymmetric; Decidable; _Respects₂_; _Respects_) open import Data.List.Relation.Binary.Pointwise.Base using (Pointwise; []; _∷_; head; tail) @@ -42,21 +42,21 @@ _≋_ = Pointwise _≈_ _<_ = Lex P _≈_ _≺_ - ¬≤-this : {x y xs ys} ¬ (x y) ¬ (x y) - ¬ (x xs) < (y ys) + ¬≤-this : {x y xs ys} ¬ (x y) ¬ (x y) + ¬ (x xs) < (y ys) ¬≤-this x≉y x≮y (this x≺y) = x≮y x≺y ¬≤-this x≉y x≮y (next x≈y xs<ys) = x≉y x≈y - ¬≤-next : {x y xs ys} ¬ x y ¬ xs < ys - ¬ (x xs) < (y ys) + ¬≤-next : {x y xs ys} ¬ x y ¬ xs < ys + ¬ (x xs) < (y ys) ¬≤-next x≮y xs≮ys (this x≺y) = x≮y x≺y ¬≤-next x≮y xs≮ys (next _ xs<ys) = xs≮ys xs<ys - antisymmetric : Symmetric _≈_ Irreflexive _≈_ _≺_ - Asymmetric _≺_ Antisymmetric _≋_ _<_ + antisymmetric : Symmetric _≈_ Irreflexive _≈_ _≺_ + Asymmetric _≺_ Antisymmetric _≋_ _<_ antisymmetric sym ir asym = as where - as : Antisymmetric _≋_ _<_ + as : Antisymmetric _≋_ _<_ as (base _) (base _) = [] as (this x≺y) (this y≺x) = ⊥-elim (asym x≺y y≺x) as (this x≺y) (next y≈x ys<xs) = ⊥-elim (ir (sym y≈x) x≺y) @@ -67,11 +67,11 @@ toSum (this x≺y) = inj₁ x≺y toSum (next x≈y xs<ys) = inj₂ (x≈y , xs<ys) - transitive : IsEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ - Transitive _<_ + transitive : IsEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ + Transitive _<_ transitive eq resp tr = trans where - trans : Transitive (Lex P _≈_ _≺_) + trans : Transitive (Lex P _≈_ _≺_) trans (base p) (base _) = base p trans (base y) halt = halt trans halt (this y≺z) = halt @@ -83,18 +83,18 @@ trans (next x≈y xs<ys) (next y≈z ys<zs) = next (IsEquivalence.trans eq x≈y y≈z) (trans xs<ys ys<zs) - respects₂ : IsEquivalence _≈_ _≺_ Respects₂ _≈_ _<_ Respects₂ _≋_ + respects₂ : IsEquivalence _≈_ _≺_ Respects₂ _≈_ _<_ Respects₂ _≋_ respects₂ eq (resp₁ , resp₂) = resp¹ , resp² where open IsEquivalence eq using (sym; trans) - resp¹ : {xs} Lex P _≈_ _≺_ xs Respects _≋_ + resp¹ : {xs} Lex P _≈_ _≺_ xs Respects _≋_ resp¹ [] xs<[] = xs<[] resp¹ (_ _) halt = halt resp¹ (x≈y _) (this z≺x) = this (resp₁ x≈y z≺x) resp¹ (x≈y xs≋ys) (next z≈x zs<xs) = next (trans z≈x x≈y) (resp¹ xs≋ys zs<xs) - resp² : {ys} flip (Lex P _≈_ _≺_) ys Respects _≋_ + resp² : {ys} flip (Lex P _≈_ _≺_) ys Respects _≋_ resp² [] []<ys = []<ys resp² (x≈z _) (this x≺y) = this (resp₂ x≈z x≺y) resp² (x≈z xs≋zs) (next x≈y xs<ys) = @@ -108,13 +108,13 @@ ∷<∷-⇔ : {x y xs ys} (x y (x y × xs < ys)) (x xs) < (y ys) ∷<∷-⇔ = mk⇔ [ this , uncurry next ] toSum - module _ (dec-P : Dec P) (dec-≈ : Decidable _≈_) (dec-≺ : Decidable _≺_) + module _ (dec-P : Dec P) (dec-≈ : Decidable _≈_) (dec-≺ : Decidable _≺_) where - decidable : Decidable _<_ - decidable [] [] = Dec.map []<[]-⇔ dec-P - decidable [] (y ys) = yes halt - decidable (x xs) [] = no λ() + decidable : Decidable _<_ + decidable [] [] = Dec.map []<[]-⇔ dec-P + decidable [] (y ys) = yes halt + decidable (x xs) [] = no λ() decidable (x xs) (y ys) = - Dec.map ∷<∷-⇔ (dec-≺ x y ⊎-dec (dec-≈ x y ×-dec decidable xs ys)) + Dec.map ∷<∷-⇔ (dec-≺ x y ⊎-dec (dec-≈ x y ×-dec decidable xs ys)) \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Permutation.Homogeneous.html b/master/Data.List.Relation.Binary.Permutation.Homogeneous.html index 0c082f1b78..d3505d9d9d 100644 --- a/master/Data.List.Relation.Binary.Permutation.Homogeneous.html +++ b/master/Data.List.Relation.Binary.Permutation.Homogeneous.html @@ -18,7 +18,7 @@ open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Symmetric) +open import Relation.Binary.Definitions using (Reflexive; Symmetric) private variable @@ -36,20 +36,20 @@ module _ {R : Rel A r} where - sym : Symmetric R Symmetric (Permutation R) + sym : Symmetric R Symmetric (Permutation R) sym R-sym (refl xs∼ys) = refl (Pointwise.symmetric R-sym xs∼ys) sym R-sym (prep x∼x′ xs↭ys) = prep (R-sym x∼x′) (sym R-sym xs↭ys) sym R-sym (swap x∼x′ y∼y′ xs↭ys) = swap (R-sym y∼y′) (R-sym x∼x′) (sym R-sym xs↭ys) sym R-sym (trans xs↭ys ys↭zs) = trans (sym R-sym ys↭zs) (sym R-sym xs↭ys) - isEquivalence : Reflexive R Symmetric R IsEquivalence (Permutation R) + isEquivalence : Reflexive R Symmetric R IsEquivalence (Permutation R) isEquivalence R-refl R-sym = record { refl = refl (Pointwise.refl R-refl) ; sym = sym R-sym ; trans = trans } - setoid : Reflexive R Symmetric R Setoid _ _ + setoid : Reflexive R Symmetric R Setoid _ _ setoid R-refl R-sym = record { isEquivalence = isEquivalence R-refl R-sym } diff --git a/master/Data.List.Relation.Binary.Permutation.Propositional.Properties.html b/master/Data.List.Relation.Binary.Permutation.Propositional.Properties.html index 33f7310cd6..7154cf35ee 100644 --- a/master/Data.List.Relation.Binary.Permutation.Propositional.Properties.html +++ b/master/Data.List.Relation.Binary.Permutation.Propositional.Properties.html @@ -27,9 +27,9 @@ open import Data.Maybe.Base using (Maybe; just; nothing) open import Function.Base using (_∘_; _⟨_⟩_; _$_) open import Level using (Level) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) open import Relation.Binary.Core using (Rel; _Preserves_⟶_; _Preserves₂_⟶_⟶_) -open import Relation.Binary.Definitions using (_Respects_; Decidable) +open import Relation.Binary.Definitions using (_Respects_; Decidable) open import Relation.Binary.PropositionalEquality.Core as using (_≡_ ; refl ; cong; cong₂; _≢_) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) @@ -49,7 +49,7 @@ ↭-empty-inv refl = refl ↭-empty-inv (trans p q) with refl↭-empty-inv q = ↭-empty-inv p -¬x∷xs↭[] : {x} {xs : List A} ¬ ((x xs) []) +¬x∷xs↭[] : {x} {xs : List A} ¬ ((x xs) []) ¬x∷xs↭[] (trans s₁ s₂) with ↭-empty-inv s₂ ... | refl = ¬x∷xs↭[] s₁ @@ -71,13 +71,13 @@ ------------------------------------------------------------------------ -- Relationships to other predicates -All-resp-↭ : {P : Pred A p} (All P) Respects _↭_ +All-resp-↭ : {P : Pred A p} (All P) Respects _↭_ All-resp-↭ refl wit = wit All-resp-↭ (prep x p) (px wit) = px All-resp-↭ p wit All-resp-↭ (swap x y p) (px py wit) = py px All-resp-↭ p wit All-resp-↭ (trans p₁ p₂) wit = All-resp-↭ p₂ (All-resp-↭ p₁ wit) -Any-resp-↭ : {P : Pred A p} (Any P) Respects _↭_ +Any-resp-↭ : {P : Pred A p} (Any P) Respects _↭_ Any-resp-↭ refl wit = wit Any-resp-↭ (prep x p) (here px) = here px Any-resp-↭ (prep x p) (there wit) = there (Any-resp-↭ p wit) @@ -86,10 +86,10 @@ Any-resp-↭ (swap x y p) (there (there wit)) = there (there (Any-resp-↭ p wit)) Any-resp-↭ (trans p p₁) wit = Any-resp-↭ p₁ (Any-resp-↭ p wit) -∈-resp-↭ : {x : A} (x ∈_) Respects _↭_ +∈-resp-↭ : {x : A} (x ∈_) Respects _↭_ ∈-resp-↭ = Any-resp-↭ -Any-resp-[σ⁻¹∘σ] : {xs ys : List A} {P : Pred A p} +Any-resp-[σ⁻¹∘σ] : {xs ys : List A} {P : Pred A p} (σ : xs ys) (ix : Any P xs) Any-resp-↭ (trans σ (↭-sym σ)) ix ix @@ -347,14 +347,14 @@ ------------------------------------------------------------------------ -- merge -module _ {} {R : Rel A } (R? : Decidable R) where +module _ {} {R : Rel A } (R? : Decidable R) where merge-↭ : xs ys merge R? xs ys xs ++ ys merge-↭ [] [] = ↭-refl merge-↭ [] (y ys) = ↭-refl merge-↭ (x xs) [] = ↭-sym (++-identityʳ (x xs)) merge-↭ (x xs) (y ys) - with does (R? x y) | merge-↭ xs (y ys) | merge-↭ (x xs) ys + with does (R? x y) | merge-↭ xs (y ys) | merge-↭ (x xs) ys ... | true | rec | _ = prep x rec ... | false | _ | rec = begin y merge R? (x xs) ys <⟨ rec diff --git a/master/Data.List.Relation.Binary.Permutation.Propositional.html b/master/Data.List.Relation.Binary.Permutation.Propositional.html index 8ea6840e8e..90e441d427 100644 --- a/master/Data.List.Relation.Binary.Permutation.Propositional.html +++ b/master/Data.List.Relation.Binary.Permutation.Propositional.html @@ -14,7 +14,7 @@ open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Transitive) +open import Relation.Binary.Definitions using (Reflexive; Transitive) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) import Relation.Binary.Reasoning.Setoid as EqReasoning open import Relation.Binary.Reasoning.Syntax @@ -42,7 +42,7 @@ ↭-reflexive : _≡_ _↭_ ↭-reflexive refl = refl -↭-refl : Reflexive _↭_ +↭-refl : Reflexive _↭_ ↭-refl = refl ↭-sym : {xs ys} xs ys ys xs @@ -52,7 +52,7 @@ ↭-sym (trans xs↭ys ys↭zs) = trans (↭-sym ys↭zs) (↭-sym xs↭ys) -- A smart version of trans that avoids unnecessary `refl`s (see #1113). -↭-trans : Transitive _↭_ +↭-trans : Transitive _↭_ ↭-trans refl ρ₂ = ρ₂ ↭-trans ρ₁ refl = ρ₁ ↭-trans ρ₁ ρ₂ = trans ρ₁ ρ₂ diff --git a/master/Data.List.Relation.Binary.Permutation.Setoid.Properties.html b/master/Data.List.Relation.Binary.Permutation.Setoid.Properties.html index 7a5376811c..bc1a152b43 100644 --- a/master/Data.List.Relation.Binary.Permutation.Setoid.Properties.html +++ b/master/Data.List.Relation.Binary.Permutation.Setoid.Properties.html @@ -10,7 +10,7 @@ open import Relation.Binary.Core using (Rel; _⇒_; _Preserves_⟶_; _Preserves₂_⟶_⟶_) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions as B hiding (Decidable) +open import Relation.Binary.Definitions as B hiding (Decidable) module Data.List.Relation.Binary.Permutation.Setoid.Properties {a } (S : Setoid a ) @@ -37,13 +37,13 @@ open import Data.Product.Base using (_,_; _×_; ; ∃₂; proj₁; proj₂) open import Function.Base using (_∘_; _⟨_⟩_; flip) open import Level using (Level; _⊔_) -open import Relation.Unary using (Pred; Decidable) +open import Relation.Unary using (Pred; Decidable) import Relation.Binary.Reasoning.Setoid as RelSetoid open import Relation.Binary.Properties.Setoid S using (≉-resp₂) open import Relation.Binary.PropositionalEquality.Core as using (_≡_ ; refl; sym; cong; cong₂; subst; _≢_) -open import Relation.Nullary.Decidable using (yes; no; does) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (yes; no; does) +open import Relation.Nullary.Negation using (contradiction) private variable @@ -61,13 +61,13 @@ -- Relationships to other predicates ------------------------------------------------------------------------ -All-resp-↭ : {P : Pred A p} P Respects _≈_ (All P) Respects _↭_ +All-resp-↭ : {P : Pred A p} P Respects _≈_ (All P) Respects _↭_ All-resp-↭ resp (refl xs≋ys) pxs = All-resp-≋ resp xs≋ys pxs All-resp-↭ resp (prep x≈y p) (px pxs) = resp x≈y px All-resp-↭ resp p pxs All-resp-↭ resp (swap ≈₁ ≈₂ p) (px py pxs) = resp ≈₂ py resp ≈₁ px All-resp-↭ resp p pxs All-resp-↭ resp (trans p₁ p₂) pxs = All-resp-↭ resp p₂ (All-resp-↭ resp p₁ pxs) -Any-resp-↭ : {P : Pred A p} P Respects _≈_ (Any P) Respects _↭_ +Any-resp-↭ : {P : Pred A p} P Respects _≈_ (Any P) Respects _↭_ Any-resp-↭ resp (refl xs≋ys) pxs = Any-resp-≋ resp xs≋ys pxs Any-resp-↭ resp (prep x≈y p) (here px) = here (resp x≈y px) Any-resp-↭ resp (prep x≈y p) (there pxs) = there (Any-resp-↭ resp p pxs) @@ -76,7 +76,7 @@ Any-resp-↭ resp (swap x y p) (there (there pxs)) = there (there (Any-resp-↭ resp p pxs)) Any-resp-↭ resp (trans p₁ p₂) pxs = Any-resp-↭ resp p₂ (Any-resp-↭ resp p₁ pxs) -AllPairs-resp-↭ : {R : Rel A r} Symmetric R R Respects₂ _≈_ (AllPairs R) Respects _↭_ +AllPairs-resp-↭ : {R : Rel A r} Symmetric R R Respects₂ _≈_ (AllPairs R) Respects _↭_ AllPairs-resp-↭ sym resp (refl xs≋ys) pxs = AllPairs-resp-≋ resp xs≋ys pxs AllPairs-resp-↭ sym resp (prep x≈y p) ( pxs) = All-resp-↭ (proj₁ resp) p (All.map (proj₂ resp x≈y) ) @@ -88,10 +88,10 @@ AllPairs-resp-↭ sym resp (trans p₁ p₂) pxs = AllPairs-resp-↭ sym resp p₂ (AllPairs-resp-↭ sym resp p₁ pxs) -∈-resp-↭ : {x} (x ∈_) Respects _↭_ +∈-resp-↭ : {x} (x ∈_) Respects _↭_ ∈-resp-↭ = Any-resp-↭ (flip ≈-trans) -Unique-resp-↭ : Unique Respects _↭_ +Unique-resp-↭ : Unique Respects _↭_ Unique-resp-↭ = AllPairs-resp-↭ (_∘ ≈-sym) ≉-resp₂ ------------------------------------------------------------------------ @@ -101,13 +101,13 @@ ≋⇒↭ : _≋_ _↭_ ≋⇒↭ = refl -↭-respʳ-≋ : _↭_ Respectsʳ _≋_ +↭-respʳ-≋ : _↭_ Respectsʳ _≋_ ↭-respʳ-≋ xs≋ys (refl zs≋xs) = refl (≋-trans zs≋xs xs≋ys) ↭-respʳ-≋ (x≈y xs≋ys) (prep eq zs↭xs) = prep (≈-trans eq x≈y) (↭-respʳ-≋ xs≋ys zs↭xs) ↭-respʳ-≋ (x≈y w≈z xs≋ys) (swap eq₁ eq₂ zs↭xs) = swap (≈-trans eq₁ w≈z) (≈-trans eq₂ x≈y) (↭-respʳ-≋ xs≋ys zs↭xs) ↭-respʳ-≋ xs≋ys (trans ws↭zs zs↭xs) = trans ws↭zs (↭-respʳ-≋ xs≋ys zs↭xs) -↭-respˡ-≋ : _↭_ Respectsˡ _≋_ +↭-respˡ-≋ : _↭_ Respectsˡ _≋_ ↭-respˡ-≋ xs≋ys (refl ys≋zs) = refl (≋-trans (≋-sym xs≋ys) ys≋zs) ↭-respˡ-≋ (x≈y xs≋ys) (prep eq zs↭xs) = prep (≈-trans (≈-sym x≈y) eq) (↭-respˡ-≋ xs≋ys zs↭xs) ↭-respˡ-≋ (x≈y w≈z xs≋ys) (swap eq₁ eq₂ zs↭xs) = swap (≈-trans (≈-sym x≈y) eq₁) (≈-trans (≈-sym w≈z) eq₂) (↭-respˡ-≋ xs≋ys zs↭xs) @@ -398,46 +398,46 @@ ------------------------------------------------------------------------ -- filter -module _ {p} {P : Pred A p} (P? : Decidable P) (P≈ : P Respects _≈_) where +module _ {p} {P : Pred A p} (P? : Decidable P) (P≈ : P Respects _≈_) where filter⁺ : {xs ys : List A} xs ys filter P? xs filter P? ys filter⁺ (refl xs≋ys) = refl (≋.filter⁺ P? P≈ xs≋ys) filter⁺ (trans xs↭zs zs↭ys) = trans (filter⁺ xs↭zs) (filter⁺ zs↭ys) filter⁺ {x xs} {y ys} (prep x≈y xs↭ys) with P? x | P? y - ... | yes _ | yes _ = prep x≈y (filter⁺ xs↭ys) - ... | yes Px | no ¬Py = contradiction (P≈ x≈y Px) ¬Py - ... | no ¬Px | yes Py = contradiction (P≈ (≈-sym x≈y) Py) ¬Px - ... | no _ | no _ = filter⁺ xs↭ys + ... | yes _ | yes _ = prep x≈y (filter⁺ xs↭ys) + ... | yes Px | no ¬Py = contradiction (P≈ x≈y Px) ¬Py + ... | no ¬Px | yes Py = contradiction (P≈ (≈-sym x≈y) Py) ¬Px + ... | no _ | no _ = filter⁺ xs↭ys filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) with P? x | P? y - filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | no ¬Px | no ¬Py + filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | no ¬Px | no ¬Py with P? z | P? w - ... | _ | yes Pw = contradiction (P≈ w≈y Pw) ¬Py - ... | yes Pz | _ = contradiction (P≈ (≈-sym x≈z) Pz) ¬Px - ... | no _ | no _ = filter⁺ xs↭ys - filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | no ¬Px | yes Py + ... | _ | yes Pw = contradiction (P≈ w≈y Pw) ¬Py + ... | yes Pz | _ = contradiction (P≈ (≈-sym x≈z) Pz) ¬Px + ... | no _ | no _ = filter⁺ xs↭ys + filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | no ¬Px | yes Py with P? z | P? w - ... | _ | no ¬Pw = contradiction (P≈ (≈-sym w≈y) Py) ¬Pw - ... | yes Pz | _ = contradiction (P≈ (≈-sym x≈z) Pz) ¬Px - ... | no _ | yes _ = prep w≈y (filter⁺ xs↭ys) - filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | yes Px | no ¬Py + ... | _ | no ¬Pw = contradiction (P≈ (≈-sym w≈y) Py) ¬Pw + ... | yes Pz | _ = contradiction (P≈ (≈-sym x≈z) Pz) ¬Px + ... | no _ | yes _ = prep w≈y (filter⁺ xs↭ys) + filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | yes Px | no ¬Py with P? z | P? w - ... | no ¬Pz | _ = contradiction (P≈ x≈z Px) ¬Pz - ... | _ | yes Pw = contradiction (P≈ w≈y Pw) ¬Py - ... | yes _ | no _ = prep x≈z (filter⁺ xs↭ys) - filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | yes Px | yes Py + ... | no ¬Pz | _ = contradiction (P≈ x≈z Px) ¬Pz + ... | _ | yes Pw = contradiction (P≈ w≈y Pw) ¬Py + ... | yes _ | no _ = prep x≈z (filter⁺ xs↭ys) + filter⁺ {x w xs} {y z ys} (swap x≈z w≈y xs↭ys) | yes Px | yes Py with P? z | P? w - ... | no ¬Pz | _ = contradiction (P≈ x≈z Px) ¬Pz - ... | _ | no ¬Pw = contradiction (P≈ (≈-sym w≈y) Py) ¬Pw - ... | yes _ | yes _ = swap x≈z w≈y (filter⁺ xs↭ys) + ... | no ¬Pz | _ = contradiction (P≈ x≈z Px) ¬Pz + ... | _ | no ¬Pw = contradiction (P≈ (≈-sym w≈y) Py) ¬Pw + ... | yes _ | yes _ = swap x≈z w≈y (filter⁺ xs↭ys) ------------------------------------------------------------------------ -- partition -module _ {p} {P : Pred A p} (P? : Decidable P) where +module _ {p} {P : Pred A p} (P? : Decidable P) where partition-↭ : xs (let ys , zs = partition P? xs) xs ys ++ zs partition-↭ [] = ↭-refl - partition-↭ (x xs) with does (P? x) + partition-↭ (x xs) with does (P? x) ... | true = ↭-prep x (partition-↭ xs) ... | false = ↭-trans (↭-prep x (partition-↭ xs)) (↭-sym (↭-shift _ _)) where open PermutationReasoning @@ -445,14 +445,14 @@ ------------------------------------------------------------------------ -- merge -module _ {} {R : Rel A } (R? : B.Decidable R) where +module _ {} {R : Rel A } (R? : B.Decidable R) where merge-↭ : xs ys merge R? xs ys xs ++ ys merge-↭ [] [] = ↭-refl merge-↭ [] (y ys) = ↭-refl merge-↭ (x xs) [] = ↭-sym (++-identityʳ (x xs)) merge-↭ (x xs) (y ys) - with does (R? x y) | merge-↭ xs (y ys) | merge-↭ (x xs) ys + with does (R? x y) | merge-↭ xs (y ys) | merge-↭ (x xs) ys ... | true | rec | _ = ↭-prep x rec ... | false | _ | rec = begin y merge R? (x xs) ys <⟨ rec diff --git a/master/Data.List.Relation.Binary.Permutation.Setoid.html b/master/Data.List.Relation.Binary.Permutation.Setoid.html index 2f65ed0446..b227070a57 100644 --- a/master/Data.List.Relation.Binary.Permutation.Setoid.html +++ b/master/Data.List.Relation.Binary.Permutation.Setoid.html @@ -12,7 +12,7 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.Reasoning.Syntax module Data.List.Relation.Binary.Permutation.Setoid @@ -69,13 +69,13 @@ ↭-reflexive : _≡_ _↭_ ↭-reflexive refl = refl (Pointwise.refl Eq.refl) -↭-refl : Reflexive _↭_ +↭-refl : Reflexive _↭_ ↭-refl = ↭-reflexive refl -↭-sym : Symmetric _↭_ +↭-sym : Symmetric _↭_ ↭-sym = Homogeneous.sym Eq.sym -↭-trans : Transitive _↭_ +↭-trans : Transitive _↭_ ↭-trans = trans ↭-isEquivalence : IsEquivalence _↭_ diff --git a/master/Data.List.Relation.Binary.Pointwise.Properties.html b/master/Data.List.Relation.Binary.Pointwise.Properties.html index 08d094ca53..3df66154f4 100644 --- a/master/Data.List.Relation.Binary.Pointwise.Properties.html +++ b/master/Data.List.Relation.Binary.Pointwise.Properties.html @@ -15,7 +15,7 @@ open import Relation.Binary.Core using (REL; _⇒_) open import Relation.Binary.Definitions import Relation.Binary.PropositionalEquality.Core as -open import Relation.Nullary using (yes; no; _×-dec_) +open import Relation.Nullary using (yes; no; _×-dec_) import Relation.Nullary.Decidable as Dec open import Data.List.Relation.Binary.Pointwise.Base @@ -34,45 +34,45 @@ reflexive : R S Pointwise R Pointwise S reflexive = map -refl : Reflexive R Reflexive (Pointwise R) +refl : Reflexive R Reflexive (Pointwise R) refl rfl {[]} = [] refl rfl {x xs} = rfl refl rfl -symmetric : Sym R S Sym (Pointwise R) (Pointwise S) +symmetric : Sym R S Sym (Pointwise R) (Pointwise S) symmetric sym [] = [] symmetric sym (x∼y xs∼ys) = sym x∼y symmetric sym xs∼ys -transitive : Trans R S T - Trans (Pointwise R) (Pointwise S) (Pointwise T) +transitive : Trans R S T + Trans (Pointwise R) (Pointwise S) (Pointwise T) transitive trans [] [] = [] transitive trans (x∼y xs∼ys) (y∼z ys∼zs) = trans x∼y y∼z transitive trans xs∼ys ys∼zs -antisymmetric : Antisym R S T - Antisym (Pointwise R) (Pointwise S) (Pointwise T) +antisymmetric : Antisym R S T + Antisym (Pointwise R) (Pointwise S) (Pointwise T) antisymmetric antisym [] [] = [] antisymmetric antisym (x∼y xs∼ys) (y∼x ys∼xs) = antisym x∼y y∼x antisymmetric antisym xs∼ys ys∼xs -respʳ : R Respectsʳ S (Pointwise R) Respectsʳ (Pointwise S) +respʳ : R Respectsʳ S (Pointwise R) Respectsʳ (Pointwise S) respʳ resp [] [] = [] respʳ resp (x≈y xs≈ys) (z∼x zs∼xs) = resp x≈y z∼x respʳ resp xs≈ys zs∼xs -respˡ : R Respectsˡ S (Pointwise R) Respectsˡ (Pointwise S) +respˡ : R Respectsˡ S (Pointwise R) Respectsˡ (Pointwise S) respˡ resp [] [] = [] respˡ resp (x≈y xs≈ys) (x∼z xs∼zs) = resp x≈y x∼z respˡ resp xs≈ys xs∼zs -respects₂ : R Respects₂ S (Pointwise R) Respects₂ (Pointwise S) +respects₂ : R Respects₂ S (Pointwise R) Respects₂ (Pointwise S) respects₂ ( , ) = respʳ , respˡ -decidable : Decidable R Decidable (Pointwise R) -decidable _ [] [] = yes [] -decidable _ [] (y ys) = no λ() -decidable _ (x xs) [] = no λ() -decidable R? (x xs) (y ys) = Dec.map′ (uncurry _∷_) uncons - (R? x y ×-dec decidable R? xs ys) +decidable : Decidable R Decidable (Pointwise R) +decidable _ [] [] = yes [] +decidable _ [] (y ys) = no λ() +decidable _ (x xs) [] = no λ() +decidable R? (x xs) (y ys) = Dec.map′ (uncurry _∷_) uncons + (R? x y ×-dec decidable R? xs ys) -irrelevant : Irrelevant R Irrelevant (Pointwise R) +irrelevant : Irrelevant R Irrelevant (Pointwise R) irrelevant irr [] [] = ≡.refl irrelevant irr (r rs) (r₁ rs₁) = ≡.cong₂ _∷_ (irr r r₁) (irrelevant irr rs rs₁) diff --git a/master/Data.List.Relation.Binary.Pointwise.html b/master/Data.List.Relation.Binary.Pointwise.html index 4595dc9709..82e61e303c 100644 --- a/master/Data.List.Relation.Binary.Pointwise.html +++ b/master/Data.List.Relation.Binary.Pointwise.html @@ -23,11 +23,11 @@ open import Data.Nat.Base using (; zero; suc) open import Data.Nat.Properties open import Level -open import Relation.Nullary hiding (Irrelevant) -import Relation.Nullary.Decidable as Dec using (map′) -open import Relation.Unary as U using (Pred) +open import Relation.Nullary hiding (Irrelevant) +import Relation.Nullary.Decidable as Dec using (map′) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core renaming (Rel to Rel₂) -open import Relation.Binary.Definitions using (_Respects_; _Respects₂_) +open import Relation.Binary.Definitions using (_Respects_; _Respects₂_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Preorder; Poset) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsPartialOrder; IsPreorder) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -105,20 +105,20 @@ -- Relationships to other list predicates ------------------------------------------------------------------------ -All-resp-Pointwise : {P : Pred A p} P Respects R - (All P) Respects (Pointwise R) +All-resp-Pointwise : {P : Pred A p} P Respects R + (All P) Respects (Pointwise R) All-resp-Pointwise resp [] [] = [] All-resp-Pointwise resp (x∼y xs) (px pxs) = resp x∼y px All-resp-Pointwise resp xs pxs -Any-resp-Pointwise : {P : Pred A p} P Respects R - (Any P) Respects (Pointwise R) +Any-resp-Pointwise : {P : Pred A p} P Respects R + (Any P) Respects (Pointwise R) Any-resp-Pointwise resp (x∼y xs) (here px) = here (resp x∼y px) Any-resp-Pointwise resp (x∼y xs) (there pxs) = there (Any-resp-Pointwise resp xs pxs) -AllPairs-resp-Pointwise : R Respects₂ S - (AllPairs R) Respects (Pointwise S) +AllPairs-resp-Pointwise : R Respects₂ S + (AllPairs R) Respects (Pointwise S) AllPairs-resp-Pointwise _ [] [] = [] AllPairs-resp-Pointwise resp@(respₗ , respᵣ) (x∼y xs) (px pxs) = All-resp-Pointwise respₗ xs (All.map (respᵣ x∼y) px) @@ -163,9 +163,9 @@ ++-cancelʳ (y ys) (z zs) (y∼z ys∼zs) = y∼z (++-cancelʳ ys zs ys∼zs) -- Impossible cases ++-cancelʳ {xs = xs} [] (z zs) eq = - contradiction (≡.trans (Pointwise-length eq) (length-++ (z zs))) (m≢1+n+m (length xs)) + contradiction (≡.trans (Pointwise-length eq) (length-++ (z zs))) (m≢1+n+m (length xs)) ++-cancelʳ {xs = xs} (y ys) [] eq = - contradiction (≡.trans (≡.sym (length-++ (y ys))) (Pointwise-length eq)) (m≢1+n+m (length xs) ≡.sym) + contradiction (≡.trans (≡.sym (length-++ (y ys))) (Pointwise-length eq)) (m≢1+n+m (length xs) ≡.sym) ------------------------------------------------------------------------ -- concat @@ -218,8 +218,8 @@ ------------------------------------------------------------------------ -- filter -module _ {P : Pred A p} {Q : Pred B q} - (P? : U.Decidable P) (Q? : U.Decidable Q) +module _ {P : Pred A p} {Q : Pred B q} + (P? : U.Decidable P) (Q? : U.Decidable Q) (P⇒Q : {a b} R a b P a Q b) (Q⇒P : {a b} R a b Q b P a) where @@ -228,10 +228,10 @@ Pointwise R (filter P? xs) (filter Q? ys) filter⁺ [] = [] filter⁺ {x _} {y _} (r rs) with P? x | Q? y - ... | true because _ | true because _ = r filter⁺ rs - ... | false because _ | false because _ = filter⁺ rs - ... | yes p | no ¬q = contradiction (P⇒Q r p) ¬q - ... | no ¬p | yes q = contradiction (Q⇒P r q) ¬p + ... | true because _ | true because _ = r filter⁺ rs + ... | false because _ | false because _ = filter⁺ rs + ... | yes p | no ¬q = contradiction (P⇒Q r p) ¬q + ... | no ¬p | yes q = contradiction (Q⇒P r q) ¬p ------------------------------------------------------------------------ -- replicate diff --git a/master/Data.List.Relation.Binary.Prefix.Heterogeneous.Properties.html b/master/Data.List.Relation.Binary.Prefix.Heterogeneous.Properties.html index 388dd97feb..d6d6ec6373 100644 --- a/master/Data.List.Relation.Binary.Prefix.Heterogeneous.Properties.html +++ b/master/Data.List.Relation.Binary.Prefix.Heterogeneous.Properties.html @@ -23,12 +23,12 @@ open import Data.Product.Base as Product using (_×_; _,_; proj₁; proj₂; uncurry) open import Function.Base -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Decidable as Dec using (_×-dec_; yes; no; _because_) -open import Relation.Unary as U using (Pred) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Decidable as Dec using (_×-dec_; yes; no; _because_) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core using (Rel; REL; _⇒_) open import Relation.Binary.Definitions - using (Trans; Antisym; Irrelevant; Decidable) + using (Trans; Antisym; Irrelevant; Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; cong₂) private @@ -54,14 +54,14 @@ module _ {a b c r s t} {A : Set a} {B : Set b} {C : Set c} {R : REL A B r} {S : REL B C s} {T : REL A C t} where - trans : Trans R S T Trans (Prefix R) (Prefix S) (Prefix T) + trans : Trans R S T Trans (Prefix R) (Prefix S) (Prefix T) trans rs⇒t [] ss = [] trans rs⇒t (r rs) (s ss) = rs⇒t r s trans rs⇒t rs ss module _ {a b r s e} {A : Set a} {B : Set b} {R : REL A B r} {S : REL B A s} {E : REL A B e} where - antisym : Antisym R S E Antisym (Prefix R) (Prefix S) (Pointwise E) + antisym : Antisym R S E Antisym (Prefix R) (Prefix S) (Pointwise E) antisym rs⇒e [] [] = [] antisym rs⇒e (r rs) (s ss) = rs⇒e r s antisym rs⇒e rs ss @@ -106,17 +106,17 @@ ------------------------------------------------------------------------ -- filter -module _ {p q} {P : Pred A p} {Q : Pred B q} (P? : U.Decidable P) (Q? : U.Decidable Q) +module _ {p q} {P : Pred A p} {Q : Pred B q} (P? : U.Decidable P) (Q? : U.Decidable Q) (P⇒Q : {a b} R a b P a Q b) (Q⇒P : {a b} R a b Q b P a) where filter⁺ : {as bs} Prefix R as bs Prefix R (filter P? as) (filter Q? bs) filter⁺ [] = [] filter⁺ {a as} {b bs} (r rs) with P? a | Q? b - ... | true because _ | true because _ = r filter⁺ rs - ... | yes pa | no ¬qb = ⊥-elim (¬qb (P⇒Q r pa)) - ... | no ¬pa | yes qb = ⊥-elim (¬pa (Q⇒P r qb)) - ... | false because _ | false because _ = filter⁺ rs + ... | true because _ | true because _ = r filter⁺ rs + ... | yes pa | no ¬qb = ⊥-elim (¬qb (P⇒Q r pa)) + ... | no ¬pa | yes qb = ⊥-elim (¬pa (Q⇒P r qb)) + ... | false because _ | false because _ = filter⁺ rs ------------------------------------------------------------------------ -- take @@ -208,7 +208,7 @@ module _ {a b r} {A : Set a} {B : Set b} {R : REL A B r} where - irrelevant : Irrelevant R Irrelevant (Prefix R) + irrelevant : Irrelevant R Irrelevant (Prefix R) irrelevant R-irr [] [] = refl irrelevant R-irr (r rs) (r′ rs′) = cong₂ _∷_ (R-irr r r′) (irrelevant R-irr rs rs′) @@ -216,9 +216,9 @@ ------------------------------------------------------------------------ -- Decidability - prefix? : Decidable R Decidable (Prefix R) - prefix? R? [] bs = yes [] - prefix? R? (a as) [] = no ()) - prefix? R? (a as) (b bs) = Dec.map′ (uncurry _∷_) uncons - $ R? a b ×-dec prefix? R? as bs + prefix? : Decidable R Decidable (Prefix R) + prefix? R? [] bs = yes [] + prefix? R? (a as) [] = no ()) + prefix? R? (a as) (b bs) = Dec.map′ (uncurry _∷_) uncons + $ R? a b ×-dec prefix? R? as bs \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Sublist.DecPropositional.Solver.html b/master/Data.List.Relation.Binary.Sublist.DecPropositional.Solver.html index b6eaf20adb..d6446cf303 100644 --- a/master/Data.List.Relation.Binary.Sublist.DecPropositional.Solver.html +++ b/master/Data.List.Relation.Binary.Sublist.DecPropositional.Solver.html @@ -8,10 +8,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Relation.Binary.Sublist.DecPropositional.Solver - {a} {A : Set a} (_≟_ : DecidableEquality A) + {a} {A : Set a} (_≟_ : DecidableEquality A) where open import Relation.Binary.PropositionalEquality.Properties using (decSetoid) diff --git a/master/Data.List.Relation.Binary.Sublist.DecPropositional.html b/master/Data.List.Relation.Binary.Sublist.DecPropositional.html index b0e03ed2af..8b641b8a9e 100644 --- a/master/Data.List.Relation.Binary.Sublist.DecPropositional.html +++ b/master/Data.List.Relation.Binary.Sublist.DecPropositional.html @@ -9,10 +9,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Relation.Binary.Sublist.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) + {a} {A : Set a} (_≟_ : DecidableEquality A) where open import Data.List.Relation.Binary.Equality.DecPropositional _≟_ diff --git a/master/Data.List.Relation.Binary.Sublist.DecSetoid.html b/master/Data.List.Relation.Binary.Sublist.DecSetoid.html index 485a395d85..70bbc94b31 100644 --- a/master/Data.List.Relation.Binary.Sublist.DecSetoid.html +++ b/master/Data.List.Relation.Binary.Sublist.DecSetoid.html @@ -12,7 +12,7 @@ open import Relation.Binary.Bundles using (DecSetoid; DecPoset) open import Relation.Binary.Structures using (IsDecPartialOrder) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) module Data.List.Relation.Binary.Sublist.DecSetoid {c } (S : DecSetoid c ) where @@ -36,7 +36,7 @@ ------------------------------------------------------------------------ -- Additional relational properties -_⊆?_ : Decidable _⊆_ +_⊆?_ : Decidable _⊆_ _⊆?_ = HeterogeneousProperties.sublist? _≟_ ⊆-isDecPartialOrder : IsDecPartialOrder _≋_ _⊆_ diff --git a/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Properties.html b/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Properties.html index 4c9893400a..1e43462735 100644 --- a/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Properties.html +++ b/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Properties.html @@ -29,14 +29,14 @@ open import Function.Base open import Function.Bundles using (_⤖_; _⇔_ ; mk⤖; mk⇔) open import Function.Consequences.Propositional using (strictlySurjective⇒surjective) -open import Relation.Nullary.Decidable as Dec using (Dec; does; _because_; yes; no; ¬?) -open import Relation.Nullary.Negation using (¬_; contradiction) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Unary as U using (Pred) +open import Relation.Nullary.Decidable as Dec using (Dec; does; _because_; yes; no; ¬?) +open import Relation.Nullary.Negation using (¬_; contradiction) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core using (Rel; REL; _⇒_) open import Relation.Binary.Bundles using (Preorder; Poset; DecPoset) open import Relation.Binary.Definitions - using (Reflexive; Trans; Antisym; Decidable; Irrelevant; Irreflexive) + using (Reflexive; Trans; Antisym; Decidable; Irrelevant; Irreflexive) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsDecPartialOrder) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -92,7 +92,7 @@ toPointwise {bs = []} eq [] = [] toPointwise {bs = b bs} eq (r rs) = r toPointwise (ℕ.suc-injective eq) rs toPointwise {bs = b bs} eq (b ∷ʳ rs) = - contradiction (s≤s (length-mono-≤ rs)) (ℕ.<-irrefl eq) + contradiction (s≤s (length-mono-≤ rs)) (ℕ.<-irrefl eq) ------------------------------------------------------------------------ -- Various functions' outputs are sublists @@ -122,26 +122,26 @@ drop-Sublist (suc n) [] = [] drop-Sublist (suc n) (r rs) = _ ∷ʳ drop-Sublist n rs -module _ {R : REL A B r} {P : Pred A p} (P? : U.Decidable P) where +module _ {R : REL A B r} {P : Pred A p} (P? : U.Decidable P) where takeWhile-Sublist : Sublist R as bs Sublist R (takeWhile P? as) bs takeWhile-Sublist [] = [] takeWhile-Sublist (y ∷ʳ rs) = y ∷ʳ takeWhile-Sublist rs - takeWhile-Sublist {a as} (r rs) with does (P? a) + takeWhile-Sublist {a as} (r rs) with does (P? a) ... | true = r takeWhile-Sublist rs ... | false = minimum _ dropWhile-Sublist : Sublist R as bs Sublist R (dropWhile P? as) bs dropWhile-Sublist [] = [] dropWhile-Sublist (y ∷ʳ rs) = y ∷ʳ dropWhile-Sublist rs - dropWhile-Sublist {a as} (r rs) with does (P? a) + dropWhile-Sublist {a as} (r rs) with does (P? a) ... | true = _ ∷ʳ dropWhile-Sublist rs ... | false = r rs filter-Sublist : Sublist R as bs Sublist R (filter P? as) bs filter-Sublist [] = [] filter-Sublist (y ∷ʳ rs) = y ∷ʳ filter-Sublist rs - filter-Sublist {a as} (r rs) with does (P? a) + filter-Sublist {a as} (r rs) with does (P? a) ... | true = r filter-Sublist rs ... | false = _ ∷ʳ filter-Sublist rs @@ -160,10 +160,10 @@ ∷ˡ⁻ (y ∷ʳ rs) = y ∷ʳ ∷ˡ⁻ rs ∷ˡ⁻ (r rs) = _ ∷ʳ rs - ∷ʳ⁻ : ¬ R x y Sublist R (x xs) (y ys) + ∷ʳ⁻ : ¬ R x y Sublist R (x xs) (y ys) Sublist R (x xs) ys ∷ʳ⁻ ¬r (y ∷ʳ rs) = rs - ∷ʳ⁻ ¬r (r rs) = contradiction r ¬r + ∷ʳ⁻ ¬r (r rs) = contradiction r ¬r ∷⁻ : Sublist R (x xs) (y ys) Sublist R xs ys ∷⁻ (y ∷ʳ rs) = ∷ˡ⁻ rs @@ -247,54 +247,54 @@ Sublist R (drop m as) (drop m bs) drop⁺-⊆ m = drop⁺ (ℕ.≤-refl {m}) -module _ {R : REL A B r} {P : Pred A p} {Q : Pred B q} - (P? : U.Decidable P) (Q? : U.Decidable Q) where +module _ {R : REL A B r} {P : Pred A p} {Q : Pred B q} + (P? : U.Decidable P) (Q? : U.Decidable Q) where ⊆-takeWhile-Sublist : (∀ {a b} R a b P a Q b) Pointwise R as bs Sublist R (takeWhile P? as) (takeWhile Q? bs) ⊆-takeWhile-Sublist rp⇒q [] = [] ⊆-takeWhile-Sublist {a as} {b bs} rp⇒q (p ps) with P? a | Q? b - ... | false because _ | _ = minimum _ - ... | true because _ | true because _ = p ⊆-takeWhile-Sublist rp⇒q ps - ... | yes pa | no ¬qb = contradiction (rp⇒q p pa) ¬qb + ... | false because _ | _ = minimum _ + ... | true because _ | true because _ = p ⊆-takeWhile-Sublist rp⇒q ps + ... | yes pa | no ¬qb = contradiction (rp⇒q p pa) ¬qb ⊇-dropWhile-Sublist : (∀ {a b} R a b Q b P a) Pointwise R as bs Sublist R (dropWhile P? as) (dropWhile Q? bs) ⊇-dropWhile-Sublist rq⇒p [] = [] ⊇-dropWhile-Sublist {a as} {b bs} rq⇒p (p ps) with P? a | Q? b - ... | true because _ | true because _ = ⊇-dropWhile-Sublist rq⇒p ps - ... | true because _ | false because _ = + ... | true because _ | true because _ = ⊇-dropWhile-Sublist rq⇒p ps + ... | true because _ | false because _ = b ∷ʳ dropWhile-Sublist P? (fromPointwise ps) - ... | false because _ | false because _ = p fromPointwise ps - ... | no ¬pa | yes qb = contradiction (rq⇒p p qb) ¬pa + ... | false because _ | false because _ = p fromPointwise ps + ... | no ¬pa | yes qb = contradiction (rq⇒p p qb) ¬pa ⊆-filter-Sublist : (∀ {a b} R a b P a Q b) Sublist R as bs Sublist R (filter P? as) (filter Q? bs) ⊆-filter-Sublist rp⇒q [] = [] - ⊆-filter-Sublist rp⇒q (y ∷ʳ rs) with does (Q? y) + ⊆-filter-Sublist rp⇒q (y ∷ʳ rs) with does (Q? y) ... | true = y ∷ʳ ⊆-filter-Sublist rp⇒q rs ... | false = ⊆-filter-Sublist rp⇒q rs ⊆-filter-Sublist {a as} {b bs} rp⇒q (r rs) with P? a | Q? b - ... | true because _ | true because _ = r ⊆-filter-Sublist rp⇒q rs - ... | false because _ | true because _ = _ ∷ʳ ⊆-filter-Sublist rp⇒q rs - ... | false because _ | false because _ = ⊆-filter-Sublist rp⇒q rs - ... | yes pa | no ¬qb = contradiction (rp⇒q r pa) ¬qb + ... | true because _ | true because _ = r ⊆-filter-Sublist rp⇒q rs + ... | false because _ | true because _ = _ ∷ʳ ⊆-filter-Sublist rp⇒q rs + ... | false because _ | false because _ = ⊆-filter-Sublist rp⇒q rs + ... | yes pa | no ¬qb = contradiction (rp⇒q r pa) ¬qb -module _ {R : Rel A r} {P : Pred A p} (P? : U.Decidable P) where +module _ {R : Rel A r} {P : Pred A p} (P? : U.Decidable P) where takeWhile-filter : Pointwise R as as Sublist R (takeWhile P? as) (filter P? as) takeWhile-filter [] = [] - takeWhile-filter {a as} (p ps) with does (P? a) + takeWhile-filter {a as} (p ps) with does (P? a) ... | true = p takeWhile-filter ps ... | false = minimum _ filter-dropWhile : Pointwise R as as - Sublist R (filter P? as) (dropWhile (¬? P?) as) + Sublist R (filter P? as) (dropWhile (¬? P?) as) filter-dropWhile [] = [] - filter-dropWhile {a as} (p ps) with does (P? a) + filter-dropWhile {a as} (p ps) with does (P? a) ... | true = p filter-Sublist P? (fromPointwise ps) ... | false = filter-dropWhile ps @@ -328,7 +328,7 @@ ∷⁻¹ : R x y Sublist R xs ys Sublist R (x xs) (y ys) ∷⁻¹ r = mk⇔ (r ∷_) ∷⁻ - ∷ʳ⁻¹ : ¬ R x y Sublist R (x xs) ys Sublist R (x xs) (y ys) + ∷ʳ⁻¹ : ¬ R x y Sublist R (x xs) ys Sublist R (x xs) (y ys) ∷ʳ⁻¹ ¬r = mk⇔ (_ ∷ʳ_) (∷ʳ⁻ ¬r) ------------------------------------------------------------------------ @@ -336,7 +336,7 @@ module _ {R : REL A B r} where - Sublist-[]-irrelevant : U.Irrelevant (Sublist R []) + Sublist-[]-irrelevant : U.Irrelevant (Sublist R []) Sublist-[]-irrelevant [] [] = ≡.refl Sublist-[]-irrelevant (y ∷ʳ p) (.y ∷ʳ q) = ≡.cong (y ∷ʳ_) (Sublist-[]-irrelevant p q) @@ -367,21 +367,21 @@ module Reflexivity {R : Rel A r} - (R-refl : Reflexive R) where + (R-refl : Reflexive R) where reflexive : _≡_ Sublist R reflexive ≡.refl = fromPointwise (Pw.refl R-refl) - refl : Reflexive (Sublist R) + refl : Reflexive (Sublist R) refl = reflexive ≡.refl open Reflexivity public module Transitivity {R : REL A B r} {S : REL B C s} {T : REL A C t} - (rs⇒t : Trans R S T) where + (rs⇒t : Trans R S T) where - trans : Trans (Sublist R) (Sublist S) (Sublist T) + trans : Trans (Sublist R) (Sublist S) (Sublist T) trans rs (y ∷ʳ ss) = y ∷ʳ trans rs ss trans (y ∷ʳ rs) (s ss) = _ ∷ʳ trans rs ss trans (r rs) (s ss) = rs⇒t r s trans rs ss @@ -391,43 +391,43 @@ module Antisymmetry {R : REL A B r} {S : REL B A s} {E : REL A B e} - (rs⇒e : Antisym R S E) where + (rs⇒e : Antisym R S E) where open ℕ.≤-Reasoning - antisym : Antisym (Sublist R) (Sublist S) (Pointwise E) + antisym : Antisym (Sublist R) (Sublist S) (Pointwise E) antisym [] [] = [] antisym (r rs) (s ss) = rs⇒e r s antisym rs ss -- impossible cases antisym (_∷ʳ_ {xs} {ys₁} y rs) (_∷ʳ_ {ys₂} {zs} z ss) = - contradiction (begin + contradiction (begin length (y ys₁) ≤⟨ length-mono-≤ ss length zs ≤⟨ ℕ.n≤1+n (length zs) length (z zs) ≤⟨ length-mono-≤ rs length ys₁ ) $ ℕ.<-irrefl ≡.refl antisym (_∷ʳ_ {xs} {ys₁} y rs) (_∷_ {y} {ys₂} {z} {zs} s ss) = - contradiction (begin + contradiction (begin length (z zs) ≤⟨ length-mono-≤ rs length ys₁ ≤⟨ length-mono-≤ ss length zs ) $ ℕ.<-irrefl ≡.refl antisym (_∷_ {x} {xs} {y} {ys₁} r rs) (_∷ʳ_ {ys₂} {zs} z ss) = - contradiction (begin + contradiction (begin length (y ys₁) ≤⟨ length-mono-≤ ss length xs ≤⟨ length-mono-≤ rs length ys₁ ) $ ℕ.<-irrefl ≡.refl open Antisymmetry public -module _ {R : REL A B r} (R? : Decidable R) where +module _ {R : REL A B r} (R? : Decidable R) where - sublist? : Decidable (Sublist R) - sublist? [] ys = yes (minimum ys) - sublist? (x xs) [] = no λ () + sublist? : Decidable (Sublist R) + sublist? [] ys = yes (minimum ys) + sublist? (x xs) [] = no λ () sublist? (x xs) (y ys) with R? x y - ... | true because [r] = - Dec.map (∷⁻¹ (invert [r])) (sublist? xs ys) - ... | false because [¬r] = - Dec.map (∷ʳ⁻¹ (invert [¬r])) (sublist? (x xs) ys) + ... | true because [r] = + Dec.map (∷⁻¹ (invert [r])) (sublist? xs ys) + ... | false because [¬r] = + Dec.map (∷ʳ⁻¹ (invert [¬r])) (sublist? (x xs) ys) module _ {E : Rel A e} {R : Rel A r} where @@ -496,22 +496,22 @@ -- Disjoint is decidable - ⊆-disjoint? : {xs ys zs} (τ₁ : xs zs) (τ₂ : ys zs) Dec (Disjoint τ₁ τ₂) - ⊆-disjoint? [] [] = yes [] + ⊆-disjoint? : {xs ys zs} (τ₁ : xs zs) (τ₂ : ys zs) Dec (Disjoint τ₁ τ₂) + ⊆-disjoint? [] [] = yes [] -- Present in both sublists: not disjoint. - ⊆-disjoint? (x≈z τ₁) (y≈z τ₂) = no λ() + ⊆-disjoint? (x≈z τ₁) (y≈z τ₂) = no λ() -- Present in either sublist: ok. ⊆-disjoint? (y ∷ʳ τ₁) (x≈y τ₂) = - Dec.map′ (x≈y ∷ᵣ_) (λ{ (_ ∷ᵣ d) d }) (⊆-disjoint? τ₁ τ₂) + Dec.map′ (x≈y ∷ᵣ_) (λ{ (_ ∷ᵣ d) d }) (⊆-disjoint? τ₁ τ₂) ⊆-disjoint? (x≈y τ₁) (y ∷ʳ τ₂) = - Dec.map′ (x≈y ∷ₗ_) (λ{ (_ ∷ₗ d) d }) (⊆-disjoint? τ₁ τ₂) + Dec.map′ (x≈y ∷ₗ_) (λ{ (_ ∷ₗ d) d }) (⊆-disjoint? τ₁ τ₂) -- Present in neither sublist: ok. ⊆-disjoint? (y ∷ʳ τ₁) (.y ∷ʳ τ₂) = - Dec.map′ (y ∷ₙ_) (λ{ (_ ∷ₙ d) d }) (⊆-disjoint? τ₁ τ₂) + Dec.map′ (y ∷ₙ_) (λ{ (_ ∷ₙ d) d }) (⊆-disjoint? τ₁ τ₂) -- Disjoint is proof-irrelevant - Disjoint-irrelevant : ∀{xs ys zs} Irrelevant (Disjoint {R = R} {xs} {ys} {zs}) + Disjoint-irrelevant : ∀{xs ys zs} Irrelevant (Disjoint {R = R} {xs} {ys} {zs}) Disjoint-irrelevant [] [] = ≡.refl Disjoint-irrelevant (y ∷ₙ d₁) (.y ∷ₙ d₂) = ≡.cong (y ∷ₙ_) (Disjoint-irrelevant d₁ d₂) Disjoint-irrelevant (x≈y ∷ₗ d₁) (.x≈y ∷ₗ d₂) = ≡.cong (x≈y ∷ₗ_) (Disjoint-irrelevant d₁ d₂) @@ -530,7 +530,7 @@ Disjoint-irrefl′ [] = [] Disjoint-irrefl′ (y ∷ₙ d) = Disjoint-irrefl′ d - Disjoint-irrefl : ∀{x xs ys} Irreflexive {A = x xs ys } _≡_ Disjoint + Disjoint-irrefl : ∀{x xs ys} Irreflexive {A = x xs ys } _≡_ Disjoint Disjoint-irrefl ≡.refl x with Disjoint-irrefl′ x ... | () _ @@ -677,7 +677,7 @@ module DisjointnessMonotonicity {R : REL A B r} {S : REL B C s} {T : REL A C t} - (rs⇒t : Trans R S T) where + (rs⇒t : Trans R S T) where -- We can enlarge and convert the target list of a disjoint union. diff --git a/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Solver.html b/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Solver.html index 099406ce59..37e3f59a59 100644 --- a/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Solver.html +++ b/master/Data.List.Relation.Binary.Sublist.Heterogeneous.Solver.html @@ -8,11 +8,11 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Reflexive; Decidable) +open import Relation.Binary.Definitions using (Reflexive; Decidable) module Data.List.Relation.Binary.Sublist.Heterogeneous.Solver {a r} {A : Set a} (R : Rel A r) - (R-refl : Reflexive R) (R? : Decidable R) + (R-refl : Reflexive R) (R? : Decidable R) where -- Note that we only need the above two constraints to define the diff --git a/master/Data.List.Relation.Binary.Sublist.Heterogeneous.html b/master/Data.List.Relation.Binary.Sublist.Heterogeneous.html index 80992d0e7e..c1c0a8d7e1 100644 --- a/master/Data.List.Relation.Binary.Sublist.Heterogeneous.html +++ b/master/Data.List.Relation.Binary.Sublist.Heterogeneous.html @@ -13,8 +13,8 @@ open import Data.List.Relation.Unary.Any using (Any; here; there) open import Level using (_⊔_) open import Relation.Binary.Core using (REL; _⇒_) -open import Relation.Binary.Definitions using (_⟶_Respects_; Min) -open import Relation.Unary using (Pred) +open import Relation.Binary.Definitions using (_⟶_Respects_; Min) +open import Relation.Unary using (Pred) module Data.List.Relation.Binary.Sublist.Heterogeneous {a b r} {A : Set a} {B : Set b} {R : REL A B r} @@ -35,7 +35,7 @@ map f (y ∷ʳ rs) = y ∷ʳ map f rs map f (r rs) = f r map f rs -minimum : Min (Sublist R) [] +minimum : Min (Sublist R) [] minimum [] = [] minimum (x xs) = x ∷ʳ minimum xs @@ -54,7 +54,7 @@ ------------------------------------------------------------------------ -- Generalised lookup based on a proof of Any -module _ {p q} {P : Pred A p} {Q : Pred B q} (resp : P Q Respects R) where +module _ {p q} {P : Pred A p} {Q : Pred B q} (resp : P Q Respects R) where lookup : {xs ys} Sublist R xs ys Any P xs Any Q ys lookup (y ∷ʳ p) k = there (lookup p k) diff --git a/master/Data.List.Relation.Binary.Sublist.Propositional.Properties.html b/master/Data.List.Relation.Binary.Sublist.Propositional.Properties.html index c3b493a776..096658a999 100644 --- a/master/Data.List.Relation.Binary.Sublist.Propositional.Properties.html +++ b/master/Data.List.Relation.Binary.Sublist.Propositional.Properties.html @@ -23,12 +23,12 @@ open import Data.Product.Base using (; _,_; proj₂) open import Function.Base using (id; _∘_; _∘′_) open import Level using (Level) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; refl; cong; _≗_; trans) open import Relation.Binary.PropositionalEquality.Properties using (setoid; subst-injective; trans-reflʳ; trans-assoc) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable @@ -89,14 +89,14 @@ -- All P is a contravariant functor from _⊆_ to Set. -All-resp-⊆ : {P : Pred A } (All P) Respects _⊇_ +All-resp-⊆ : {P : Pred A } (All P) Respects _⊇_ All-resp-⊆ [] [] = [] All-resp-⊆ (_ ∷ʳ p) (_ xs) = All-resp-⊆ p xs All-resp-⊆ (refl p) (x xs) = x All-resp-⊆ p xs -- Any P is a covariant functor from _⊆_ to Set. -Any-resp-⊆ : {P : Pred A } (Any P) Respects _⊆_ +Any-resp-⊆ : {P : Pred A } (Any P) Respects _⊆_ Any-resp-⊆ = lookup ------------------------------------------------------------------------ @@ -104,14 +104,14 @@ -- First functor law: identity. -All-resp-⊆-refl : {P : Pred A } {xs : List A} +All-resp-⊆-refl : {P : Pred A } {xs : List A} All-resp-⊆ ⊆-refl id {A = All P xs} All-resp-⊆-refl [] = refl All-resp-⊆-refl (p ps) = cong (p ∷_) (All-resp-⊆-refl ps) -- Second functor law: composition. -All-resp-⊆-trans : {P : Pred A } {xs ys zs} {τ : xs ys} (τ′ : ys zs) +All-resp-⊆-trans : {P : Pred A } {xs ys zs} {τ : xs ys} (τ′ : ys zs) All-resp-⊆ {P = P} (⊆-trans τ τ′) All-resp-⊆ τ All-resp-⊆ τ′ All-resp-⊆-trans (_ ∷ʳ τ′) (p ps) = All-resp-⊆-trans τ′ ps All-resp-⊆-trans {τ = _ ∷ʳ _ } (refl τ′) (p ps) = All-resp-⊆-trans τ′ ps @@ -123,7 +123,7 @@ -- First functor law: identity. -Any-resp-⊆-refl : {P : Pred A } {xs} +Any-resp-⊆-refl : {P : Pred A } {xs} Any-resp-⊆ ⊆-refl id {A = Any P xs} Any-resp-⊆-refl (here p) = refl Any-resp-⊆-refl (there i) = cong there (Any-resp-⊆-refl i) @@ -132,7 +132,7 @@ -- Second functor law: composition. -Any-resp-⊆-trans : {P : Pred A } {xs ys zs} {τ : xs ys} (τ′ : ys zs) +Any-resp-⊆-trans : {P : Pred A } {xs ys zs} {τ : xs ys} (τ′ : ys zs) Any-resp-⊆ {P = P} (⊆-trans τ τ′) Any-resp-⊆ τ′ Any-resp-⊆ τ Any-resp-⊆-trans (_ ∷ʳ τ′) i = cong there (Any-resp-⊆-trans τ′ i) Any-resp-⊆-trans {τ = _ ∷ʳ _} (_ τ′) i = cong there (Any-resp-⊆-trans τ′ i) @@ -148,7 +148,7 @@ -- Note: `lookup` can be seen as a strictly increasing reindexing -- function for indices into `xs`, producing indices into `ys`. -lookup-injective : {P : Pred A } {xs ys} {τ : xs ys} {i j : Any P xs} +lookup-injective : {P : Pred A } {xs ys} {τ : xs ys} {i j : Any P xs} lookup τ i lookup τ j i j lookup-injective {τ = _ ∷ʳ _} = lookup-injective ∘′ there-injective lookup-injective {τ = x≡y _} {here _} {here _} = cong here ∘′ subst-injective x≡y ∘′ here-injective diff --git a/master/Data.List.Relation.Binary.Sublist.Propositional.html b/master/Data.List.Relation.Binary.Sublist.Propositional.html index 76af230db7..4882becddf 100644 --- a/master/Data.List.Relation.Binary.Sublist.Propositional.html +++ b/master/Data.List.Relation.Binary.Sublist.Propositional.html @@ -18,12 +18,12 @@ open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Preorder; Poset) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder) -open import Relation.Binary.Definitions using (Antisymmetric) +open import Relation.Binary.Definitions using (Antisymmetric) open import Relation.Binary.PropositionalEquality.Core using (subst; _≡_; refl) open import Relation.Binary.PropositionalEquality.Properties using (setoid; isEquivalence) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) ------------------------------------------------------------------------ -- Re-export definition and operations from setoid sublists @@ -38,7 +38,7 @@ ------------------------------------------------------------------------ -- Additional operations -module _ {p} {P : Pred A p} where +module _ {p} {P : Pred A p} where lookup : {xs ys} xs ys Any P xs Any P ys lookup = SetoidSublist.lookup (setoid A) (subst _) @@ -49,7 +49,7 @@ ⊆-reflexive : _≡_ _⊆_ ⊆-reflexive refl = ⊆-refl -⊆-antisym : Antisymmetric _≡_ _⊆_ +⊆-antisym : Antisymmetric _≡_ _⊆_ ⊆-antisym xs⊆ys ys⊆xs = ≋⇒≡ (SetoidSublist.⊆-antisym (setoid A) xs⊆ys ys⊆xs) ⊆-isPreorder : IsPreorder _≡_ _⊆_ diff --git a/master/Data.List.Relation.Binary.Sublist.Setoid.Properties.html b/master/Data.List.Relation.Binary.Sublist.Setoid.Properties.html index d64eedb792..0773603961 100644 --- a/master/Data.List.Relation.Binary.Sublist.Setoid.Properties.html +++ b/master/Data.List.Relation.Binary.Sublist.Setoid.Properties.html @@ -22,12 +22,12 @@ open import Function.Base open import Function.Bundles using (_⇔_; _⤖_) open import Level -open import Relation.Binary.Definitions using () renaming (Decidable to Decidable₂) +open import Relation.Binary.Definitions using () renaming (Decidable to Decidable₂) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; refl; cong; cong₂) open import Relation.Binary.Structures using (IsDecTotalOrder) -open import Relation.Unary using (Pred; Decidable; Irrelevant) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Decidable using (¬?; yes; no) +open import Relation.Unary using (Pred; Decidable; Irrelevant) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Decidable using (¬?; yes; no) import Data.List.Relation.Binary.Equality.Setoid as SetoidEquality import Data.List.Relation.Binary.Sublist.Setoid as SetoidSublist @@ -45,8 +45,8 @@ p q r s t : Level a b x y : A as bs cs ds xs ys : List A - P : Pred A p - Q : Pred A q + P : Pred A p + Q : Pred A q m n : @@ -110,7 +110,7 @@ drop-⊆ : n xs drop n xs xs drop-⊆ n xs = HeteroProperties.drop-Sublist n ⊆-refl -module _ (P? : Decidable P) where +module _ (P? : Decidable P) where takeWhile-⊆ : xs takeWhile P? xs xs takeWhile-⊆ xs = HeteroProperties.takeWhile-Sublist P? ⊆-refl @@ -121,12 +121,12 @@ filter-⊆ : xs filter P? xs xs filter-⊆ xs = HeteroProperties.filter-Sublist P? ⊆-refl -module _ (P? : Decidable P) where +module _ (P? : Decidable P) where takeWhile⊆filter : xs takeWhile P? xs filter P? xs takeWhile⊆filter xs = HeteroProperties.takeWhile-filter P? {xs} ≋-refl - filter⊆dropWhile : xs filter P? xs dropWhile (¬? P?) xs + filter⊆dropWhile : xs filter P? xs dropWhile (¬? P?) xs filter⊆dropWhile xs = HeteroProperties.filter-dropWhile P? {xs} ≋-refl ------------------------------------------------------------------------ @@ -140,7 +140,7 @@ ∷ˡ⁻ : a as bs as bs ∷ˡ⁻ = HeteroProperties.∷ˡ⁻ - ∷ʳ⁻ : ¬ (a b) a as b bs a as bs + ∷ʳ⁻ : ¬ (a b) a as b bs a as bs ∷ʳ⁻ = HeteroProperties.∷ʳ⁻ ∷⁻ : a as b bs as bs @@ -205,7 +205,7 @@ ------------------------------------------------------------------------ -- takeWhile / dropWhile -module _ (P? : Decidable P) (Q? : Decidable Q) where +module _ (P? : Decidable P) (Q? : Decidable Q) where takeWhile⁺ : {xs} (∀ {a b} a b P a Q b) takeWhile P? xs takeWhile Q? xs @@ -218,7 +218,7 @@ ------------------------------------------------------------------------ -- filter -module _ (P? : Decidable P) (Q? : Decidable Q) where +module _ (P? : Decidable P) (Q? : Decidable Q) where filter⁺ : (∀ {a b} a b P a Q b) as bs filter P? as filter Q? bs @@ -254,8 +254,8 @@ ⊆-mergeˡ (x xs) (y ys) with x ≤? y | ⊆-mergeˡ xs (y ys) | ⊆-mergeˡ (x xs) ys - ... | yes x≤y | rec | _ = ≈-refl rec - ... | no x≰y | _ | rec = y ∷ʳ rec + ... | yes x≤y | rec | _ = ≈-refl rec + ... | no x≰y | _ | rec = y ∷ʳ rec ⊆-mergeʳ : xs ys ys merge _≤?_ xs ys ⊆-mergeʳ [] ys = ⊆-refl @@ -263,8 +263,8 @@ ⊆-mergeʳ (x xs) (y ys) with x ≤? y | ⊆-mergeʳ xs (y ys) | ⊆-mergeʳ (x xs) ys - ... | yes x≤y | rec | _ = x ∷ʳ rec - ... | no x≰y | _ | rec = ≈-refl rec + ... | yes x≤y | rec | _ = x ∷ʳ rec + ... | no x≰y | _ | rec = ≈-refl rec ------------------------------------------------------------------------ -- Inversion lemmas @@ -275,7 +275,7 @@ ∷⁻¹ : a b as bs a as b bs ∷⁻¹ = HeteroProperties.∷⁻¹ - ∷ʳ⁻¹ : ¬ (a b) a as bs a as b bs + ∷ʳ⁻¹ : ¬ (a b) a as bs a as b bs ∷ʳ⁻¹ = HeteroProperties.∷ʳ⁻¹ ------------------------------------------------------------------------ @@ -296,7 +296,7 @@ ------------------------------------------------------------------------ -- Irrelevant special case - []⊆-irrelevant : Irrelevant ([] ⊆_) + []⊆-irrelevant : Irrelevant ([] ⊆_) []⊆-irrelevant = HeteroProperties.Sublist-[]-irrelevant ------------------------------------------------------------------------ diff --git a/master/Data.List.Relation.Binary.Sublist.Setoid.html b/master/Data.List.Relation.Binary.Sublist.Setoid.html index e21ae3d6ba..10d7e3a583 100644 --- a/master/Data.List.Relation.Binary.Sublist.Setoid.html +++ b/master/Data.List.Relation.Binary.Sublist.Setoid.html @@ -31,7 +31,7 @@ open import Relation.Binary.Bundles using (Preorder; Poset) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) -open import Relation.Nullary using (¬_; Dec; yes; no) +open import Relation.Nullary using (¬_; Dec; yes; no) open Setoid S renaming (Carrier to A) open SetoidEquality S @@ -48,22 +48,22 @@ xs ys = ys xs _⊂_ : Rel (List A) (c ) -xs ys = xs ys × ¬ (xs ys) +xs ys = xs ys × ¬ (xs ys) _⊃_ : Rel (List A) (c ) xs ys = ys xs _⊈_ : Rel (List A) (c ) -xs ys = ¬ (xs ys) +xs ys = ¬ (xs ys) _⊉_ : Rel (List A) (c ) -xs ys = ¬ (xs ys) +xs ys = ¬ (xs ys) _⊄_ : Rel (List A) (c ) -xs ys = ¬ (xs ys) +xs ys = ¬ (xs ys) _⊅_ : Rel (List A) (c ) -xs ys = ¬ (xs ys) +xs ys = ¬ (xs ys) ------------------------------------------------------------------------ -- Re-export definitions and operations from heterogeneous sublists diff --git a/master/Data.List.Relation.Binary.Subset.DecPropositional.html b/master/Data.List.Relation.Binary.Subset.DecPropositional.html index 260003ea97..de5e23958f 100644 --- a/master/Data.List.Relation.Binary.Subset.DecPropositional.html +++ b/master/Data.List.Relation.Binary.Subset.DecPropositional.html @@ -7,10 +7,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Relation.Binary.Subset.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) + {a} {A : Set a} (_≟_ : DecidableEquality A) where ------------------------------------------------------------------------ diff --git a/master/Data.List.Relation.Binary.Subset.DecSetoid.html b/master/Data.List.Relation.Binary.Subset.DecSetoid.html index adbb23f3de..6afab163e6 100644 --- a/master/Data.List.Relation.Binary.Subset.DecSetoid.html +++ b/master/Data.List.Relation.Binary.Subset.DecSetoid.html @@ -14,8 +14,8 @@ open import Function.Base using (_∘_) open import Data.List.Base using ([]; _∷_) open import Data.List.Relation.Unary.Any using (here; there; map) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary using (yes; no) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary using (yes; no) open DecSetoid S open import Data.List.Relation.Binary.Equality.DecSetoid S open import Data.List.Membership.DecSetoid S @@ -24,12 +24,12 @@ open import Data.List.Relation.Binary.Subset.Setoid setoid public infix 4 _⊆?_ -_⊆?_ : Decidable _⊆_ -[] ⊆? _ = yes λ () +_⊆?_ : Decidable _⊆_ +[] ⊆? _ = yes λ () (x xs) ⊆? ys with x ∈? ys -... | no x∉ys = no λ xs⊆ys x∉ys (xs⊆ys (here refl)) -... | yes x∈ys with xs ⊆? ys -... | no xs⊈ys = no λ xs⊆ys xs⊈ys (xs⊆ys there) -... | yes xs⊆ys = yes λ where (here refl) map (trans refl) x∈ys +... | no x∉ys = no λ xs⊆ys x∉ys (xs⊆ys (here refl)) +... | yes x∈ys with xs ⊆? ys +... | no xs⊈ys = no λ xs⊆ys xs⊈ys (xs⊆ys there) +... | yes xs⊆ys = yes λ where (here refl) map (trans refl) x∈ys (there x∈) xs⊆ys x∈ \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Subset.Propositional.Properties.html b/master/Data.List.Relation.Binary.Subset.Propositional.Properties.html index 5bce6080ed..95782ebc06 100644 --- a/master/Data.List.Relation.Binary.Subset.Propositional.Properties.html +++ b/master/Data.List.Relation.Binary.Subset.Propositional.Properties.html @@ -34,11 +34,11 @@ open import Function.Base using (_∘_; _∘′_; id; _$_) open import Function.Bundles using (_↔_; Inverse; Equivalence) open import Level using (Level) -open import Relation.Nullary using (¬_; yes; no) -open import Relation.Unary using (Decidable; Pred) renaming (_⊆_ to _⋐_) +open import Relation.Nullary using (¬_; yes; no) +open import Relation.Unary using (Decidable; Pred) renaming (_⊆_ to _⋐_) open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Preorder) -open import Relation.Binary.Definitions hiding (Decidable) +open import Relation.Binary.Definitions hiding (Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≗_; subst; resp; refl) open import Relation.Binary.PropositionalEquality.Properties @@ -62,10 +62,10 @@ ⊆-reflexive : _≡_ {A = List A} _⊆_ ⊆-reflexive refl = id -⊆-refl : Reflexive {A = List A} _⊆_ +⊆-refl : Reflexive {A = List A} _⊆_ ⊆-refl x∈xs = x∈xs -⊆-trans : Transitive {A = List A} _⊆_ +⊆-trans : Transitive {A = List A} _⊆_ ⊆-trans xs⊆ys ys⊆zs = ys⊆zs xs⊆ys module _ (A : Set a) where @@ -90,10 +90,10 @@ ⊆-reflexive-↭ : _↭_ {A = A} _⊆_ ⊆-reflexive-↭ xs↭ys = Permutation.∈-resp-↭ xs↭ys -⊆-respʳ-↭ : _⊆_ {A = A} Respectsʳ _↭_ +⊆-respʳ-↭ : _⊆_ {A = A} Respectsʳ _↭_ ⊆-respʳ-↭ xs↭ys = Permutation.∈-resp-↭ xs↭ys ∘_ -⊆-respˡ-↭ : _⊆_ {A = A} Respectsˡ _↭_ +⊆-respˡ-↭ : _⊆_ {A = A} Respectsˡ _↭_ ⊆-respˡ-↭ xs↭ys = _∘ Permutation.∈-resp-↭ (↭-sym xs↭ys) module _ (A : Set a) where @@ -122,10 +122,10 @@ -- Properties of _⊆_ and various list predicates ------------------------------------------------------------------------ -Any-resp-⊆ : {P : Pred A p} (Any P) Respects _⊆_ +Any-resp-⊆ : {P : Pred A p} (Any P) Respects _⊆_ Any-resp-⊆ = Subset.Any-resp-⊆ (setoid _) (subst _) -All-resp-⊇ : {P : Pred A p} (All P) Respects _⊇_ +All-resp-⊇ : {P : Pred A p} (All P) Respects _⊇_ All-resp-⊇ = Subset.All-resp-⊇ (setoid _) (subst _) ------------------------------------------------------------------------ @@ -251,12 +251,12 @@ ------------------------------------------------------------------------ -- filter -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where filter-⊆ : xs filter P? xs xs filter-⊆ = Subset.filter-⊆ (setoid A) P? - module _ {Q : Pred A q} (Q? : Decidable Q) where + module _ {Q : Pred A q} (Q? : Decidable Q) where filter⁺′ : P Q {xs ys} xs ys filter P? xs filter Q? ys filter⁺′ = Subset.filter⁺′ (setoid A) P? (resp P) Q? (resp Q) diff --git a/master/Data.List.Relation.Binary.Subset.Setoid.Properties.html b/master/Data.List.Relation.Binary.Subset.Setoid.Properties.html index cf38e2c45a..782e69218b 100644 --- a/master/Data.List.Relation.Binary.Subset.Setoid.Properties.html +++ b/master/Data.List.Relation.Binary.Subset.Setoid.Properties.html @@ -25,12 +25,12 @@ open import Data.Product.Base using (_,_) open import Function.Base using (_∘_; _∘₂_; _$_) open import Level using (Level) -open import Relation.Nullary using (¬_; does; yes; no) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Unary using (Pred; Decidable) renaming (_⊆_ to _⋐_) +open import Relation.Nullary using (¬_; does; yes; no) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary using (Pred; Decidable) renaming (_⊆_ to _⋐_) open import Relation.Binary.Core using (_⇒_; _Preserves_⟶_) open import Relation.Binary.Definitions - using (Reflexive; Transitive; _Respectsʳ_; _Respectsˡ_; _Respects_) + using (Reflexive; Transitive; _Respectsʳ_; _Respectsˡ_; _Respects_) open import Relation.Binary.Bundles using (Setoid; Preorder) open import Relation.Binary.Structures using (IsPreorder) import Relation.Binary.Reasoning.Preorder as ≲-Reasoning @@ -56,16 +56,16 @@ ⊆-reflexive : _≋_ _⊆_ ⊆-reflexive xs≋ys = ∈-resp-≋ S xs≋ys - ⊆-refl : Reflexive _⊆_ + ⊆-refl : Reflexive _⊆_ ⊆-refl x∈xs = x∈xs - ⊆-trans : Transitive _⊆_ + ⊆-trans : Transitive _⊆_ ⊆-trans xs⊆ys ys⊆zs x∈xs = ys⊆zs (xs⊆ys x∈xs) - ⊆-respʳ-≋ : _⊆_ Respectsʳ _≋_ + ⊆-respʳ-≋ : _⊆_ Respectsʳ _≋_ ⊆-respʳ-≋ xs≋ys = ∈-resp-≋ S xs≋ys ∘_ - ⊆-respˡ-≋ : _⊆_ Respectsˡ _≋_ + ⊆-respˡ-≋ : _⊆_ Respectsˡ _≋_ ⊆-respˡ-≋ xs≋ys = _∘ ∈-resp-≋ S (≋-sym xs≋ys) ⊆-isPreorder : IsPreorder _≋_ _⊆_ @@ -93,10 +93,10 @@ ⊆-reflexive-↭ : _↭_ _⊆_ ⊆-reflexive-↭ xs↭ys = Permutationₚ.∈-resp-↭ S xs↭ys - ⊆-respʳ-↭ : _⊆_ Respectsʳ _↭_ + ⊆-respʳ-↭ : _⊆_ Respectsʳ _↭_ ⊆-respʳ-↭ xs↭ys = Permutationₚ.∈-resp-↭ S xs↭ys ∘_ - ⊆-respˡ-↭ : _⊆_ Respectsˡ _↭_ + ⊆-respˡ-↭ : _⊆_ Respectsˡ _↭_ ⊆-respˡ-↭ xs↭ys = _∘ Permutationₚ.∈-resp-↭ S (↭-sym xs↭ys) ⊆-↭-isPreorder : IsPreorder _↭_ _⊆_ @@ -153,11 +153,11 @@ open Subset S open Membership S - Any-resp-⊆ : {P : Pred A p} P Respects _≈_ (Any P) Respects _⊆_ + Any-resp-⊆ : {P : Pred A p} P Respects _≈_ (Any P) Respects _⊆_ Any-resp-⊆ resp pxs with find pxs ... | (x , x∈xs , px) = lose resp ( x∈xs) px - All-resp-⊇ : {P : Pred A p} P Respects _≈_ (All P) Respects _⊇_ + All-resp-⊇ : {P : Pred A p} P Respects _≈_ (All P) Respects _⊇_ All-resp-⊇ resp pxs = All.tabulateₛ S (All.lookupₛ S resp pxs ) ------------------------------------------------------------------------ @@ -273,9 +273,9 @@ open Subset S open Membershipₚ - filter-⊆ : {P : Pred A p} (P? : Decidable P) + filter-⊆ : {P : Pred A p} (P? : Decidable P) xs filter P? xs xs - filter-⊆ P? (x xs) y∈f[x∷xs] with does (P? x) + filter-⊆ P? (x xs) y∈f[x∷xs] with does (P? x) ... | false = there (filter-⊆ P? xs y∈f[x∷xs]) ... | true with y∈f[x∷xs] ... | here y≈x = here y≈x @@ -285,8 +285,8 @@ -- to be called this so for backwards compatability reasons, the -- correct name will have to wait until the deprecated name is -- removed. - filter⁺′ : {P : Pred A p} (P? : Decidable P) P Respects _≈_ - {Q : Pred A q} (Q? : Decidable Q) Q Respects _≈_ + filter⁺′ : {P : Pred A p} (P? : Decidable P) P Respects _≈_ + {Q : Pred A q} (Q? : Decidable Q) Q Respects _≈_ P Q {xs ys} xs ys filter P? xs filter Q? ys filter⁺′ P? P-resp Q? Q-resp P⋐Q xs⊆ys v∈fxs with ∈-filter⁻ S P? P-resp v∈fxs ... | v∈xs , Pv = ∈-filter⁺ S Q? Q-resp (xs⊆ys v∈xs) (P⋐Q Pv) diff --git a/master/Data.List.Relation.Binary.Subset.Setoid.html b/master/Data.List.Relation.Binary.Subset.Setoid.html index 29758d8490..29622be7d0 100644 --- a/master/Data.List.Relation.Binary.Subset.Setoid.html +++ b/master/Data.List.Relation.Binary.Subset.Setoid.html @@ -17,7 +17,7 @@ open import Data.List.Membership.Setoid S using (_∈_) open import Function.Base using (flip) open import Level using (_⊔_) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open Setoid S renaming (Carrier to A) @@ -33,8 +33,8 @@ _⊇_ = flip _⊆_ _⊈_ : Rel (List A) (c ) -xs ys = ¬ xs ys +xs ys = ¬ xs ys _⊉_ : Rel (List A) (c ) -xs ys = ¬ xs ys +xs ys = ¬ xs ys \ No newline at end of file diff --git a/master/Data.List.Relation.Binary.Suffix.Heterogeneous.Properties.html b/master/Data.List.Relation.Binary.Suffix.Heterogeneous.Properties.html index 806c0d385f..6a3da798ee 100644 --- a/master/Data.List.Relation.Binary.Suffix.Heterogeneous.Properties.html +++ b/master/Data.List.Relation.Binary.Suffix.Heterogeneous.Properties.html @@ -21,13 +21,13 @@ open import Data.Nat.Base open import Data.Nat.Properties open import Function.Base using (_$_; flip) -open import Relation.Nullary using (Dec; does; ¬_) +open import Relation.Nullary using (Dec; does; ¬_) import Relation.Nullary.Decidable as Dec -open import Relation.Unary as U using (Pred) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary as U using (Pred) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Definitions as B - using (Trans; Antisym; Irrelevant) + using (Trans; Antisym; Irrelevant) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; sym; cong; subst; subst₂) @@ -93,7 +93,7 @@ toPointwise : {as bs} length as length bs Suffix R as bs Pointwise R as bs toPointwise eq (here rs) = rs - toPointwise eq (there suf) = contradiction eq (S[as][bs]⇒∣as∣≢1+∣bs∣ suf) + toPointwise eq (there suf) = contradiction eq (S[as][bs]⇒∣as∣≢1+∣bs∣ suf) ------------------------------------------------------------------------ -- Suffix as a partial order @@ -101,7 +101,7 @@ module _ {a b c r s t} {A : Set a} {B : Set b} {C : Set c} {R : REL A B r} {S : REL B C s} {T : REL A C t} where - trans : Trans R S T Trans (Suffix R) (Suffix S) (Suffix T) + trans : Trans R S T Trans (Suffix R) (Suffix S) (Suffix T) trans rs⇒t (here rs) (here ss) = here (Pw.transitive rs⇒t rs ss) trans rs⇒t (here rs) (there ssuf) = there (trans rs⇒t (here rs) ssuf) trans rs⇒t (there rsuf) ssuf = trans rs⇒t rsuf (tail ssuf) @@ -109,7 +109,7 @@ module _ {a b e r s} {A : Set a} {B : Set b} {R : REL A B r} {S : REL B A s} {E : REL A B e} where - antisym : Antisym R S E Antisym (Suffix R) (Suffix S) (Pointwise E) + antisym : Antisym R S E Antisym (Suffix R) (Suffix S) (Pointwise E) antisym rs⇒e rsuf ssuf = Pw.antisymmetric rs⇒e (toPointwise eq rsuf) @@ -131,7 +131,7 @@ ++⁻ {_ _} {_} {_} {_} eq suf = ++⁻ eq (tail suf) ++⁻ {[]} {[]} {_} {_} eq suf = toPointwise eq suf ++⁻ {[]} {b bs} {_} {_} eq (there suf) = ++⁻ eq suf - ++⁻ {[]} {b bs} {cs} {ds} eq (here rs) = contradiction (sym eq) (<⇒≢ ds<cs) + ++⁻ {[]} {b bs} {cs} {ds} eq (here rs) = contradiction (sym eq) (<⇒≢ ds<cs) where open ≤-Reasoning ds<cs : length ds < length cs @@ -159,15 +159,15 @@ Suffix a b R (f a) (g b)) as bs map⁻ {as} {b bs} f g (here rs) = here (Pw.map⁻ f g rs) map⁻ {as} {b bs} f g (there suf) = there (map⁻ f g suf) - map⁻ {x as} {[]} f g suf = contradiction (length-mono suf) λ() + map⁻ {x as} {[]} f g suf = contradiction (length-mono suf) λ() map⁻ {[]} {[]} f g suf = here [] ------------------------------------------------------------------------ -- filter module _ {a b r p q} {A : Set a} {B : Set b} {R : REL A B r} - {P : Pred A p} {Q : Pred B q} - (P? : U.Decidable P) (Q? : U.Decidable Q) + {P : Pred A p} {Q : Pred B q} + (P? : U.Decidable P) (Q? : U.Decidable Q) (P⇒Q : {a b} R a b P a Q b) (Q⇒P : {a b} R a b Q b P a) where @@ -175,7 +175,7 @@ filter⁺ : {as bs} Suffix R as bs Suffix R (filter P? as) (filter Q? bs) filter⁺ (here rs) = here (Pw.filter⁺ P? Q? P⇒Q Q⇒P rs) - filter⁺ (there {a} suf) with does (Q? a) + filter⁺ (there {a} suf) with does (Q? a) ... | true = there (filter⁺ suf) ... | false = filter⁺ suf @@ -197,16 +197,16 @@ module _ {a b r} {A : Set a} {B : Set b} {R : REL A B r} where - irrelevant : Irrelevant R Irrelevant (Suffix R) + irrelevant : Irrelevant R Irrelevant (Suffix R) irrelevant irr (here rs) (here rs₁) = cong here $ Pw.irrelevant irr rs rs₁ - irrelevant irr (here rs) (there rsuf) = contradiction (Pointwise-length rs) (S[as][bs]⇒∣as∣≢1+∣bs∣ rsuf) - irrelevant irr (there rsuf) (here rs) = contradiction (Pointwise-length rs) (S[as][bs]⇒∣as∣≢1+∣bs∣ rsuf) + irrelevant irr (here rs) (there rsuf) = contradiction (Pointwise-length rs) (S[as][bs]⇒∣as∣≢1+∣bs∣ rsuf) + irrelevant irr (there rsuf) (here rs) = contradiction (Pointwise-length rs) (S[as][bs]⇒∣as∣≢1+∣bs∣ rsuf) irrelevant irr (there rsuf) (there rsuf₁) = cong there $ irrelevant irr rsuf rsuf₁ ------------------------------------------------------------------------ -- Decidability - suffix? : B.Decidable R B.Decidable (Suffix R) - suffix? R? as bs = Dec.map′ fromPrefix-rev toPrefix-rev + suffix? : B.Decidable R B.Decidable (Suffix R) + suffix? R? as bs = Dec.map′ fromPrefix-rev toPrefix-rev $ Prefix.prefix? R? (reverse as) (reverse bs) \ No newline at end of file diff --git a/master/Data.List.Relation.Ternary.Appending.Properties.html b/master/Data.List.Relation.Ternary.Appending.Properties.html index 1a95c9c9d5..24c6fbb8c9 100644 --- a/master/Data.List.Relation.Ternary.Appending.Properties.html +++ b/master/Data.List.Relation.Ternary.Appending.Properties.html @@ -18,7 +18,7 @@ open import Data.List.Relation.Binary.Pointwise.Properties as Pw using (transitive) open import Level using (Level) open import Relation.Binary.Core using (REL; Rel; _⇒_) -open import Relation.Binary.Definitions using (Trans) +open import Relation.Binary.Definitions using (Trans) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) open import Relation.Binary.Construct.Composition using (_;_) @@ -29,14 +29,14 @@ R S T U V W X Y : REL A B as bs cs ds : List A -module _ (RST : Trans R S T) (USV : Trans U S V) where +module _ (RST : Trans R S T) (USV : Trans U S V) where respʳ-≋ : Appending R U as bs cs Pointwise S cs ds Appending T V as bs ds respʳ-≋ ([]++ rs) es = []++ Pw.transitive USV rs es respʳ-≋ (l lrs) (e es) = RST l e respʳ-≋ lrs es -module _ {T : REL A B l} (RST : Trans R S T) - {W : REL A B r} (ERW : Trans U V W) +module _ {T : REL A B l} (RST : Trans R S T) + {W : REL A B r} (ERW : Trans U V W) where respˡ-≋ : {as′ bs′} Pointwise R as′ as Pointwise U bs′ bs diff --git a/master/Data.List.Relation.Ternary.Interleaving.Setoid.Properties.html b/master/Data.List.Relation.Ternary.Interleaving.Setoid.Properties.html index 6d3020b9cf..4994d85da3 100644 --- a/master/Data.List.Relation.Ternary.Interleaving.Setoid.Properties.html +++ b/master/Data.List.Relation.Ternary.Interleaving.Setoid.Properties.html @@ -14,9 +14,9 @@ open import Data.List.Base using (List; []; _∷_; filter; _++_) open import Data.Bool.Base using (true; false) -open import Relation.Unary using (Decidable) -open import Relation.Nullary.Decidable using (does) -open import Relation.Nullary.Decidable using (¬?) +open import Relation.Unary using (Decidable) +open import Relation.Nullary.Decidable using (does) +open import Relation.Nullary.Decidable using (¬?) open import Function.Base using (_∘_) open import Data.List.Relation.Binary.Equality.Setoid S using (≋-refl) @@ -37,11 +37,11 @@ ------------------------------------------------------------------------ -- filter -module _ {p} {P : A Set p} (P? : Decidable P) where +module _ {p} {P : A Set p} (P? : Decidable P) where - filter⁺ : xs Interleaving (filter P? xs) (filter (¬? P?) xs) xs + filter⁺ : xs Interleaving (filter P? xs) (filter (¬? P?) xs) xs filter⁺ [] = [] - filter⁺ (x xs) with does (P? x) + filter⁺ (x xs) with does (P? x) ... | true = refl ∷ˡ filter⁺ xs ... | false = refl ∷ʳ filter⁺ xs \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.All.Properties.html b/master/Data.List.Relation.Unary.All.Properties.html index 26f8c42b39..9e7fd8721e 100644 --- a/master/Data.List.Relation.Unary.All.Properties.html +++ b/master/Data.List.Relation.Unary.All.Properties.html @@ -43,12 +43,12 @@ import Relation.Binary.Definitions as B open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂; _≗_) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) open import Relation.Nullary.Decidable - using (Dec; does; yes; no; _because_; ¬?; decidable-stable) + using (Dec; does; yes; no; _because_; ¬?; decidable-stable) open import Relation.Unary - using (Decidable; Pred; Universal; ; _∩_; _⟨×⟩_) renaming (_⊆_ to _⋐_) + using (Decidable; Pred; Universal; ; _∩_; _⟨×⟩_) renaming (_⊆_ to _⋐_) open import Relation.Unary.Properties using (∁?) private @@ -57,9 +57,9 @@ A : Set a B : Set b C : Set c - P : Pred A p - Q : Pred B q - R : Pred C r + P : Pred A p + Q : Pred B q + R : Pred C r x y : A xs ys : List A @@ -90,28 +90,28 @@ ------------------------------------------------------------------------ -- Lemmas relating Any, All and negation. -¬Any⇒All¬ : xs ¬ Any P xs All (¬_ P) xs +¬Any⇒All¬ : xs ¬ Any P xs All (¬_ P) xs ¬Any⇒All¬ [] ¬p = [] ¬Any⇒All¬ (x xs) ¬p = ¬p here ¬Any⇒All¬ xs (¬p there) -All¬⇒¬Any : {xs} All (¬_ P) xs ¬ Any P xs +All¬⇒¬Any : {xs} All (¬_ P) xs ¬ Any P xs All¬⇒¬Any (¬p _) (here p) = ¬p p All¬⇒¬Any (_ ¬p) (there p) = All¬⇒¬Any ¬p p -¬All⇒Any¬ : Decidable P xs ¬ All P xs Any (¬_ P) xs +¬All⇒Any¬ : Decidable P xs ¬ All P xs Any (¬_ P) xs ¬All⇒Any¬ dec [] ¬∀ = ⊥-elim (¬∀ []) ¬All⇒Any¬ dec (x xs) ¬∀ with dec x -... | true because [p] = there (¬All⇒Any¬ dec xs (¬∀ _∷_ (invert [p]))) -... | false because [¬p] = here (invert [¬p]) +... | true because [p] = there (¬All⇒Any¬ dec xs (¬∀ _∷_ (invert [p]))) +... | false because [¬p] = here (invert [¬p]) -Any¬⇒¬All : {xs} Any (¬_ P) xs ¬ All P xs +Any¬⇒¬All : {xs} Any (¬_ P) xs ¬ All P xs Any¬⇒¬All (here ¬p) = ¬p All.head Any¬⇒¬All (there ¬p) = Any¬⇒¬All ¬p All.tail -¬Any↠All¬ : {xs} (¬ Any P xs) All (¬_ P) xs +¬Any↠All¬ : {xs} (¬ Any P xs) All (¬_ P) xs ¬Any↠All¬ = mk↠ₛ {to = ¬Any⇒All¬ _} y All¬⇒¬Any y , to∘from y) where - to∘from : {xs} (¬p : All (¬_ P) xs) ¬Any⇒All¬ xs (All¬⇒¬Any ¬p) ¬p + to∘from : {xs} (¬p : All (¬_ P) xs) ¬Any⇒All¬ xs (All¬⇒¬Any ¬p) ¬p to∘from [] = refl to∘from (¬p ¬ps) = cong₂ _∷_ refl (to∘from ¬ps) @@ -119,21 +119,21 @@ -- could be strengthened to a bijection. from∘to : Extensionality _ _ - xs (¬p : ¬ Any P xs) All¬⇒¬Any (¬Any⇒All¬ xs ¬p) ¬p + xs (¬p : ¬ Any P xs) All¬⇒¬Any (¬Any⇒All¬ xs ¬p) ¬p from∘to ext [] ¬p = ext λ () from∘to ext (x xs) ¬p = ext λ { (here p) refl ; (there p) cong f f p) $ from∘to ext xs (¬p there) } -Any¬⇔¬All : {xs} Decidable P Any (¬_ P) xs (¬ All P xs) +Any¬⇔¬All : {xs} Decidable P Any (¬_ P) xs (¬ All P xs) Any¬⇔¬All dec = mk⇔ Any¬⇒¬All (¬All⇒Any¬ dec _) private -- If equality of functions were extensional, then the logical -- equivalence could be strengthened to a surjection. - to∘from : Extensionality _ _ (dec : Decidable P) - (¬∀ : ¬ All P xs) Any¬⇒¬All (¬All⇒Any¬ dec xs ¬∀) ¬∀ + to∘from : Extensionality _ _ (dec : Decidable P) + (¬∀ : ¬ All P xs) Any¬⇒¬All (¬All⇒Any¬ dec xs ¬∀) ¬∀ to∘from ext P ¬∀ = ext (⊥-elim ¬∀) module _ {_~_ : REL A B } where @@ -354,11 +354,11 @@ -- uncons -uncons⁺ : All P xs Maybe.All (P ⟨×⟩ All P) (uncons xs) +uncons⁺ : All P xs Maybe.All (P ⟨×⟩ All P) (uncons xs) uncons⁺ [] = nothing uncons⁺ (px pxs) = just (px , pxs) -uncons⁻ : Maybe.All (P ⟨×⟩ All P) (uncons xs) All P xs +uncons⁻ : Maybe.All (P ⟨×⟩ All P) (uncons xs) All P xs uncons⁻ {xs = []} nothing = [] uncons⁻ {xs = x xs} (just (px , pxs)) = px pxs @@ -454,12 +454,12 @@ -- unsnoc -unsnoc⁺ : All P xs Maybe.All (All P ⟨×⟩ P) (unsnoc xs) +unsnoc⁺ : All P xs Maybe.All (All P ⟨×⟩ P) (unsnoc xs) unsnoc⁺ {xs = xs} pxs with initLast xs unsnoc⁺ {xs = .[]} pxs | [] = nothing unsnoc⁺ {xs = .(xs ∷ʳ x)} pxs | xs ∷ʳ′ x = just (∷ʳ⁻ pxs) -unsnoc⁻ : Maybe.All (All P ⟨×⟩ P) (unsnoc xs) All P xs +unsnoc⁻ : Maybe.All (All P ⟨×⟩ P) (unsnoc xs) All P xs unsnoc⁻ {xs = xs} pxs with initLast xs unsnoc⁻ {xs = .[]} nothing | [] = [] unsnoc⁻ {xs = .(xs ∷ʳ x)} (just (pxs , px)) | xs ∷ʳ′ x = ∷ʳ⁺ pxs px @@ -492,47 +492,47 @@ drop⁺ (suc n) [] = [] drop⁺ (suc n) (px pxs) = drop⁺ n pxs -dropWhile⁺ : (Q? : Decidable Q) All P xs All P (dropWhile Q? xs) +dropWhile⁺ : (Q? : Decidable Q) All P xs All P (dropWhile Q? xs) dropWhile⁺ Q? [] = [] -dropWhile⁺ {xs = x xs} Q? (px pxs) with does (Q? x) +dropWhile⁺ {xs = x xs} Q? (px pxs) with does (Q? x) ... | true = dropWhile⁺ Q? pxs ... | false = px pxs -dropWhile⁻ : (P? : Decidable P) dropWhile P? xs [] All P xs +dropWhile⁻ : (P? : Decidable P) dropWhile P? xs [] All P xs dropWhile⁻ {xs = []} P? eq = [] dropWhile⁻ {xs = x xs} P? eq with P? x -... | yes px = px (dropWhile⁻ P? eq) -... | no ¬px = case eq of λ () +... | yes px = px (dropWhile⁻ P? eq) +... | no ¬px = case eq of λ () -all-head-dropWhile : (P? : Decidable P) - xs Maybe.All ( P) (head (dropWhile P? xs)) +all-head-dropWhile : (P? : Decidable P) + xs Maybe.All ( P) (head (dropWhile P? xs)) all-head-dropWhile P? [] = nothing all-head-dropWhile P? (x xs) with P? x -... | yes px = all-head-dropWhile P? xs -... | no ¬px = just ¬px +... | yes px = all-head-dropWhile P? xs +... | no ¬px = just ¬px take⁺ : n All P xs All P (take n xs) take⁺ zero pxs = [] take⁺ (suc n) [] = [] take⁺ (suc n) (px pxs) = px take⁺ n pxs -takeWhile⁺ : (Q? : Decidable Q) All P xs All P (takeWhile Q? xs) +takeWhile⁺ : (Q? : Decidable Q) All P xs All P (takeWhile Q? xs) takeWhile⁺ Q? [] = [] -takeWhile⁺ {xs = x xs} Q? (px pxs) with does (Q? x) +takeWhile⁺ {xs = x xs} Q? (px pxs) with does (Q? x) ... | true = px takeWhile⁺ Q? pxs ... | false = [] -takeWhile⁻ : (P? : Decidable P) takeWhile P? xs xs All P xs +takeWhile⁻ : (P? : Decidable P) takeWhile P? xs xs All P xs takeWhile⁻ {xs = []} P? eq = [] takeWhile⁻ {xs = x xs} P? eq with P? x -... | yes px = px takeWhile⁻ P? (Listₚ.∷-injectiveʳ eq) -... | no ¬px = case eq of λ () +... | yes px = px takeWhile⁻ P? (Listₚ.∷-injectiveʳ eq) +... | no ¬px = case eq of λ () -all-takeWhile : (P? : Decidable P) xs All P (takeWhile P? xs) +all-takeWhile : (P? : Decidable P) xs All P (takeWhile P? xs) all-takeWhile P? [] = [] all-takeWhile P? (x xs) with P? x -... | yes px = px all-takeWhile P? xs -... | no ¬px = [] +... | yes px = px all-takeWhile P? xs +... | no ¬px = [] ------------------------------------------------------------------------ -- applyUpTo @@ -592,73 +592,73 @@ ------------------------------------------------------------------------ -- filter -module _ (P? : Decidable P) where +module _ (P? : Decidable P) where all-filter : xs All P (filter P? xs) all-filter [] = [] all-filter (x xs) with P? x - ... | true because [Px] = invert [Px] all-filter xs - ... | false because _ = all-filter xs + ... | true because [Px] = invert [Px] all-filter xs + ... | false because _ = all-filter xs filter⁺ : All Q xs All Q (filter P? xs) filter⁺ {xs = _} [] = [] - filter⁺ {xs = x _} (Qx Qxs) with does (P? x) + filter⁺ {xs = x _} (Qx Qxs) with does (P? x) ... | false = filter⁺ Qxs ... | true = Qx filter⁺ Qxs - filter⁻ : All Q (filter P? xs) All Q (filter (¬? P?) xs) All Q xs + filter⁻ : All Q (filter P? xs) All Q (filter (¬? P?) xs) All Q xs filter⁻ {xs = []} [] [] = [] - filter⁻ {xs = x xs} all⁺ all⁻ with P? x | ¬? (P? x) - filter⁻ {xs = x xs} all⁺ all⁻ | yes Px | yes ¬Px = contradiction Px ¬Px - filter⁻ {xs = x xs} (qx all⁺) all⁻ | yes Px | no ¬¬Px = qx filter⁻ all⁺ all⁻ - filter⁻ {xs = x xs} all⁺ (qx all⁻) | no _ | yes ¬Px = qx filter⁻ all⁺ all⁻ - filter⁻ {xs = x xs} all⁺ all⁻ | no ¬Px | no ¬¬Px = contradiction ¬Px ¬¬Px + filter⁻ {xs = x xs} all⁺ all⁻ with P? x | ¬? (P? x) + filter⁻ {xs = x xs} all⁺ all⁻ | yes Px | yes ¬Px = contradiction Px ¬Px + filter⁻ {xs = x xs} (qx all⁺) all⁻ | yes Px | no ¬¬Px = qx filter⁻ all⁺ all⁻ + filter⁻ {xs = x xs} all⁺ (qx all⁻) | no _ | yes ¬Px = qx filter⁻ all⁺ all⁻ + filter⁻ {xs = x xs} all⁺ all⁻ | no ¬Px | no ¬¬Px = contradiction ¬Px ¬¬Px ------------------------------------------------------------------------ -- partition -module _ {P : A Set p} (P? : Decidable P) where +module _ {P : A Set p} (P? : Decidable P) where partition-All : xs (let ys , zs = partition P? xs) - All P ys × All ( P) zs + All P ys × All ( P) zs partition-All xs rewrite partition-defn P? xs = all-filter P? xs , all-filter (∁? P?) xs ------------------------------------------------------------------------ -- derun and deduplicate -module _ {R : A A Set q} (R? : B.Decidable R) where +module _ {R : A A Set q} (R? : B.Decidable R) where derun⁺ : All P xs All P (derun R? xs) derun⁺ {xs = []} [] = [] derun⁺ {xs = x []} (px []) = px [] - derun⁺ {xs = x y xs} (px all[P,y∷xs]) with does (R? x y) + derun⁺ {xs = x y xs} (px all[P,y∷xs]) with does (R? x y) ... | false = px derun⁺ all[P,y∷xs] ... | true = derun⁺ all[P,y∷xs] deduplicate⁺ : All P xs All P (deduplicate R? xs) deduplicate⁺ [] = [] - deduplicate⁺ (px pxs) = px filter⁺ (¬? R? _) (deduplicate⁺ pxs) + deduplicate⁺ (px pxs) = px filter⁺ (¬? R? _) (deduplicate⁺ pxs) - derun⁻ : P B.Respects (flip R) xs All P (derun R? xs) All P xs + derun⁻ : P B.Respects (flip R) xs All P (derun R? xs) All P xs derun⁻ {P = P} P-resp-R [] [] = [] derun⁻ {P = P} P-resp-R (x xs) all[P,x∷xs] = aux x xs all[P,x∷xs] where aux : x xs All P (derun R? (x xs)) All P (x xs) aux x [] (px []) = px [] aux x (y xs) all[P,x∷y∷xs] with R? x y - aux x (y xs) all[P,y∷xs] | yes Rxy with aux y xs all[P,y∷xs] - aux x (y xs) all[P,y∷xs] | yes Rxy | r@(py _) = P-resp-R Rxy py r - aux x (y xs) (px all[P,y∷xs]) | no _ = px aux y xs all[P,y∷xs] + aux x (y xs) all[P,y∷xs] | yes Rxy with aux y xs all[P,y∷xs] + aux x (y xs) all[P,y∷xs] | yes Rxy | r@(py _) = P-resp-R Rxy py r + aux x (y xs) (px all[P,y∷xs]) | no _ = px aux y xs all[P,y∷xs] - deduplicate⁻ : P B.Respects R xs All P (deduplicate R? xs) All P xs + deduplicate⁻ : P B.Respects R xs All P (deduplicate R? xs) All P xs deduplicate⁻ {P = P} resp [] [] = [] deduplicate⁻ {P = P} resp (x xs) (px pxs!) = - px deduplicate⁻ resp xs (filter⁻ (¬? R? x) pxs! (All.tabulate aux)) + px deduplicate⁻ resp xs (filter⁻ (¬? R? x) pxs! (All.tabulate aux)) where - aux : {z} z filter (¬? ¬? R? x) (deduplicate R? xs) P z - aux {z = z} z∈filter = resp (decidable-stable (R? x z) - (Product.proj₂ (∈-filter⁻ (¬? ¬? R? x) {z} {deduplicate R? xs} z∈filter))) px + aux : {z} z filter (¬? ¬? R? x) (deduplicate R? xs) P z + aux {z = z} z∈filter = resp (decidable-stable (R? x z) + (Product.proj₂ (∈-filter⁻ (¬? ¬? R? x) {z} {deduplicate R? xs} z∈filter))) px ------------------------------------------------------------------------ -- zipWith @@ -747,7 +747,7 @@ open Setoid S open ListEq S - respects : P B.Respects _≈_ (All P) B.Respects _≋_ + respects : P B.Respects _≈_ (All P) B.Respects _≋_ respects p≈ [] [] = [] respects p≈ (x≈y xs≈ys) (px pxs) = p≈ x≈y px respects p≈ xs≈ys pxs diff --git a/master/Data.List.Relation.Unary.All.html b/master/Data.List.Relation.Unary.All.html index 5d0f4c9107..0dc85f16d3 100644 --- a/master/Data.List.Relation.Unary.All.html +++ b/master/Data.List.Relation.Unary.All.html @@ -21,11 +21,11 @@ open import Data.Sum.Base as Sum using (inj₁; inj₂) open import Function.Base using (_∘_; _∘′_; id; const) open import Level using (Level; _⊔_) -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) import Relation.Nullary.Decidable as Dec -open import Relation.Unary hiding (_∈_) +open import Relation.Unary hiding (_∈_) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) open import Relation.Binary.PropositionalEquality.Core as import Relation.Binary.PropositionalEquality.Properties as @@ -34,7 +34,7 @@ a b p q r : Level A : Set a B : Set b - P Q R : Pred A p + P Q R : Pred A p x : A xs : List A @@ -46,7 +46,7 @@ infixr 5 _∷_ -data All {A : Set a} (P : Pred A p) : Pred (List A) (a p) where +data All {A : Set a} (P : Pred A p) : Pred (List A) (a p) where [] : All P [] _∷_ : {x xs} (px : P x) (pxs : All P xs) All P (x xs) @@ -56,7 +56,7 @@ infix 4 _[_]=_ -data _[_]=_ {A : Set a} {P : Pred A p} : +data _[_]=_ {A : Set a} {P : Pred A p} : {x xs} All P xs x ∈ₚ xs P x Set (a p) where here : {x xs} {px : P x} {pxs : All P xs} @@ -68,7 +68,7 @@ -- A list is empty if having an element is impossible. -Null : Pred (List A) _ +Null : Pred (List A) _ Null = All _ ) ------------------------------------------------------------------------ @@ -98,25 +98,25 @@ toList : All P xs List ( P) toList pxs = reduce {x} px x , px) pxs -map : P Q All P All Q +map : P Q All P All Q map g [] = [] map g (px pxs) = g px map g pxs -zipWith : P Q R All P All Q All R +zipWith : P Q R All P All Q All R zipWith f ([] , []) = [] zipWith f (px pxs , qx qxs) = f (px , qx) zipWith f (pxs , qxs) -unzipWith : R P Q All R All P All Q +unzipWith : R P Q All R All P All Q unzipWith f [] = [] , [] unzipWith f (rx rxs) = Product.zip _∷_ _∷_ (f rx) (unzipWith f rxs) -zip : All P All Q All (P Q) +zip : All P All Q All (P Q) zip = zipWith id -unzip : All (P Q) All P All Q +unzip : All (P Q) All P All Q unzip = unzipWith id -module _(S : Setoid a ) {P : Pred (Setoid.Carrier S) p} where +module _(S : Setoid a ) {P : Pred (Setoid.Carrier S) p} where open Setoid S renaming (Carrier to C; refl to refl₁) open SetoidMembership S @@ -149,82 +149,82 @@ ------------------------------------------------------------------------ -- Traversable-like functions -module _ (p : Level) {A : Set a} {P : Pred A (a p)} +module _ (p : Level) {A : Set a} {P : Pred A (a p)} {F : Set (a p) Set (a p)} (App : RawApplicative F) where open RawApplicative App - sequenceA : All (F ∘′ P) F ∘′ All P + sequenceA : All (F ∘′ P) F ∘′ All P sequenceA [] = pure [] sequenceA (x xs) = _∷_ <$> x <*> sequenceA xs - mapA : {Q : Pred A q} (Q F ∘′ P) All Q (F ∘′ All P) + mapA : {Q : Pred A q} (Q F ∘′ P) All Q (F ∘′ All P) mapA f = sequenceA ∘′ map f - forA : {Q : Pred A q} All Q xs (Q F ∘′ P) F (All P xs) + forA : {Q : Pred A q} All Q xs (Q F ∘′ P) F (All P xs) forA qxs f = mapA f qxs -module _ (p : Level) {A : Set a} {P : Pred A (a p)} +module _ (p : Level) {A : Set a} {P : Pred A (a p)} {M : Set (a p) Set (a p)} (Mon : RawMonad M) where private App = RawMonad.rawApplicative Mon - sequenceM : All (M ∘′ P) M ∘′ All P + sequenceM : All (M ∘′ P) M ∘′ All P sequenceM = sequenceA p App - mapM : {Q : Pred A q} (Q M ∘′ P) All Q (M ∘′ All P) + mapM : {Q : Pred A q} (Q M ∘′ P) All Q (M ∘′ All P) mapM = mapA p App - forM : {Q : Pred A q} All Q xs (Q M ∘′ P) M (All P xs) + forM : {Q : Pred A q} All Q xs (Q M ∘′ P) M (All P xs) forM = forA p App ------------------------------------------------------------------------ -- Generalised lookup based on a proof of Any -lookupAny : All P xs (i : Any Q xs) (P Q) (Any.lookup i) +lookupAny : All P xs (i : Any Q xs) (P Q) (Any.lookup i) lookupAny (px pxs) (here qx) = px , qx lookupAny (px pxs) (there i) = lookupAny pxs i -lookupWith : ∀[ P Q R ] All P xs (i : Any Q xs) R (Any.lookup i) +lookupWith : ∀[ P Q R ] All P xs (i : Any Q xs) R (Any.lookup i) lookupWith f pxs i = Product.uncurry f (lookupAny pxs i) lookup : All P xs (∀ {x} x ∈ₚ xs P x) lookup pxs = lookupWith { px refl px }) pxs -module _(S : Setoid a ) {P : Pred (Setoid.Carrier S) p} where +module _(S : Setoid a ) {P : Pred (Setoid.Carrier S) p} where open Setoid S renaming (sym to sym₁) open SetoidMembership S - lookupₛ : P Respects _≈_ All P xs (∀ {x} x xs P x) + lookupₛ : P Respects _≈_ All P xs (∀ {x} x xs P x) lookupₛ resp pxs = lookupWith py x=y resp (sym₁ x=y) py) pxs ------------------------------------------------------------------------ -- Properties of predicates preserved by All -all? : Decidable P Decidable (All P) -all? p [] = yes [] -all? p (x xs) = Dec.map′ (uncurry _∷_) uncons (p x ×-dec all? p xs) +all? : Decidable P Decidable (All P) +all? p [] = yes [] +all? p (x xs) = Dec.map′ (uncurry _∷_) uncons (p x ×-dec all? p xs) -universal : Universal P Universal (All P) +universal : Universal P Universal (All P) universal u [] = [] universal u (x xs) = u x universal u xs -irrelevant : Irrelevant P Irrelevant (All P) +irrelevant : Irrelevant P Irrelevant (All P) irrelevant irr [] [] = ≡.refl irrelevant irr (px₁ pxs₁) (px₂ pxs₂) = ≡.cong₂ _∷_ (irr px₁ px₂) (irrelevant irr pxs₁ pxs₂) -satisfiable : Satisfiable (All P) +satisfiable : Satisfiable (All P) satisfiable = [] , [] ------------------------------------------------------------------------ -- Generalised decidability procedure -decide : Π[ P Q ] Π[ All P Any Q ] +decide : Π[ P Q ] Π[ All P Any Q ] decide p∪q [] = inj₁ [] decide p∪q (x xs) with p∪q x ... | inj₂ qx = inj₂ (here qx) diff --git a/master/Data.List.Relation.Unary.AllPairs.Properties.html b/master/Data.List.Relation.Unary.AllPairs.Properties.html index c8223a2222..46631fd667 100644 --- a/master/Data.List.Relation.Unary.AllPairs.Properties.html +++ b/master/Data.List.Relation.Unary.AllPairs.Properties.html @@ -26,8 +26,8 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (DecSetoid) open import Relation.Binary.PropositionalEquality.Core using (_≢_) -open import Relation.Unary using (Pred; Decidable; _⊆_) -open import Relation.Nullary.Decidable.Core using (does) +open import Relation.Unary using (Pred; Decidable; _⊆_) +open import Relation.Nullary.Decidable.Core using (does) private variable @@ -133,11 +133,11 @@ ------------------------------------------------------------------------ -- filter -module _ {R : Rel A } {P : Pred A p} (P? : Decidable P) where +module _ {R : Rel A } {P : Pred A p} (P? : Decidable P) where filter⁺ : {xs} AllPairs R xs AllPairs R (filter P? xs) filter⁺ {_} [] = [] - filter⁺ {x xs} (x∉xs xs!) with does (P? x) + filter⁺ {x xs} (x∉xs xs!) with does (P? x) ... | false = filter⁺ xs! ... | true = All.filter⁺ P? x∉xs filter⁺ xs! diff --git a/master/Data.List.Relation.Unary.AllPairs.html b/master/Data.List.Relation.Unary.AllPairs.html index a8b9a8fc8c..1ee93a686a 100644 --- a/master/Data.List.Relation.Unary.AllPairs.html +++ b/master/Data.List.Relation.Unary.AllPairs.html @@ -20,8 +20,8 @@ open import Relation.Binary.Definitions as B open import Relation.Binary.Construct.Intersection renaming (_∩_ to _∩ᵇ_) open import Relation.Binary.PropositionalEquality.Core using (refl; cong₂) -open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) -open import Relation.Nullary.Decidable as Dec using (_×-dec_; yes; no) +open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) +open import Relation.Nullary.Decidable as Dec using (_×-dec_; yes; no) ------------------------------------------------------------------------ -- Definition @@ -42,41 +42,41 @@ module _ {q} {S : Rel A q} where - map : R S AllPairs R AllPairs S + map : R S AllPairs R AllPairs S map ~₁⇒~₂ [] = [] map ~₁⇒~₂ (x~xs pxs) = All.map ~₁⇒~₂ x~xs (map ~₁⇒~₂ pxs) module _ {s t} {S : Rel A s} {T : Rel A t} where - zipWith : R ∩ᵇ S T AllPairs R ∩ᵘ AllPairs S AllPairs T + zipWith : R ∩ᵇ S T AllPairs R ∩ᵘ AllPairs S AllPairs T zipWith f ([] , []) = [] zipWith f (px pxs , qx qxs) = All.zipWith f (px , qx) zipWith f (pxs , qxs) - unzipWith : T R ∩ᵇ S AllPairs T AllPairs R ∩ᵘ AllPairs S + unzipWith : T R ∩ᵇ S AllPairs T AllPairs R ∩ᵘ AllPairs S unzipWith f [] = [] , [] unzipWith f (rx rxs) = Prod.zip _∷_ _∷_ (All.unzipWith f rx) (unzipWith f rxs) module _ {s} {S : Rel A s} where - zip : AllPairs R ∩ᵘ AllPairs S AllPairs (R ∩ᵇ S) + zip : AllPairs R ∩ᵘ AllPairs S AllPairs (R ∩ᵇ S) zip = zipWith id - unzip : AllPairs (R ∩ᵇ S) AllPairs R ∩ᵘ AllPairs S + unzip : AllPairs (R ∩ᵇ S) AllPairs R ∩ᵘ AllPairs S unzip = unzipWith id ------------------------------------------------------------------------ -- Properties of predicates preserved by AllPairs -allPairs? : B.Decidable R U.Decidable (AllPairs R) -allPairs? R? [] = yes [] +allPairs? : B.Decidable R U.Decidable (AllPairs R) +allPairs? R? [] = yes [] allPairs? R? (x xs) = - Dec.map′ (uncurry _∷_) uncons (All.all? (R? x) xs ×-dec allPairs? R? xs) + Dec.map′ (uncurry _∷_) uncons (All.all? (R? x) xs ×-dec allPairs? R? xs) -irrelevant : B.Irrelevant R U.Irrelevant (AllPairs R) +irrelevant : B.Irrelevant R U.Irrelevant (AllPairs R) irrelevant irr [] [] = refl irrelevant irr (px₁ pxs₁) (px₂ pxs₂) = cong₂ _∷_ (All.irrelevant irr px₁ px₂) (irrelevant irr pxs₁ pxs₂) -satisfiable : U.Satisfiable (AllPairs R) +satisfiable : U.Satisfiable (AllPairs R) satisfiable = [] , [] \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Any.Properties.html b/master/Data.List.Relation.Unary.Any.Properties.html index a3edce3e21..63ac5cade6 100644 --- a/master/Data.List.Relation.Unary.Any.Properties.html +++ b/master/Data.List.Relation.Unary.Any.Properties.html @@ -45,10 +45,10 @@ open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) open import Relation.Unary as U - using (Pred; _⟨×⟩_; _⟨→⟩_) renaming (_⊆_ to _⋐_) -open import Relation.Nullary using (¬_; _because_; does; ofʸ; ofⁿ; yes; no) -open import Relation.Nullary.Decidable using (¬?; decidable-stable) -open import Relation.Nullary.Negation using (contradiction) + using (Pred; _⟨×⟩_; _⟨→⟩_) renaming (_⊆_ to _⋐_) +open import Relation.Nullary using (¬_; _because_; does; ofʸ; ofⁿ; yes; no) +open import Relation.Nullary.Decidable using (¬?; decidable-stable) +open import Relation.Nullary.Negation using (contradiction) private open module ListMonad {} = RawMonad (monad { = }) @@ -57,15 +57,15 @@ variable a b c p q r : Level A B C : Set a - P Q R : Pred A p + P Q R : Pred A p x y : A xs ys : List A ------------------------------------------------------------------------ -- Equality properties -lift-resp : {_≈_ : Rel A } P Respects _≈_ - (Any P) Respects (Pointwise _≈_) +lift-resp : {_≈_ : Rel A } P Respects _≈_ + (Any P) Respects (Pointwise _≈_) lift-resp resp (x≈y xs≈ys) (here px) = here (resp x≈y px) lift-resp resp (x≈y xs≈ys) (there pxs) = there (lift-resp resp xs≈ys pxs) @@ -78,7 +78,7 @@ ------------------------------------------------------------------------ -- Misc -¬Any[] : ¬ Any P [] +¬Any[] : ¬ Any P [] ¬Any[] () ------------------------------------------------------------------------ @@ -318,7 +318,7 @@ map⁺∘map⁻ {xs = x xs} (here p) = refl map⁺∘map⁻ {xs = x xs} (there p) = cong there (map⁺∘map⁻ p) - map⁻∘map⁺ : (P : Pred B p) + map⁻∘map⁺ : (P : Pred B p) (p : Any (P f) xs) map⁻ {P = P} (map⁺ p) p map⁻∘map⁺ P (here p) = refl map⁻∘map⁺ P (there p) = cong there (map⁻∘map⁺ P p) @@ -469,10 +469,10 @@ -- cartesianProduct cartesianProduct⁺ : Any P xs Any Q ys - Any (P ⟨×⟩ Q) (cartesianProduct xs ys) + Any (P ⟨×⟩ Q) (cartesianProduct xs ys) cartesianProduct⁺ = cartesianProductWith⁺ _,_ _,_ -cartesianProduct⁻ : xs ys Any (P ⟨×⟩ Q) (cartesianProduct xs ys) +cartesianProduct⁻ : xs ys Any (P ⟨×⟩ Q) (cartesianProduct xs ys) Any P xs × Any Q ys cartesianProduct⁻ = cartesianProductWith⁻ _,_ id @@ -495,8 +495,8 @@ applyDownFrom⁺ : f {i n} P (f i) i < n Any P (applyDownFrom f n) applyDownFrom⁺ f {i} {suc n} p (s≤s i≤n) with i n -... | yes refl = here p -... | no i≢n = there (applyDownFrom⁺ f p (≤∧≢⇒< i≤n i≢n)) +... | yes refl = here p +... | no i≢n = there (applyDownFrom⁺ f p (≤∧≢⇒< i≤n i≢n)) applyDownFrom⁻ : f {n} Any P (applyDownFrom f n) λ i i < n × P (f i) @@ -518,18 +518,18 @@ ------------------------------------------------------------------------ -- filter -module _ (Q? : U.Decidable Q) where +module _ (Q? : U.Decidable Q) where - filter⁺ : (p : Any P xs) Any P (filter Q? xs) ¬ Q (Any.lookup p) + filter⁺ : (p : Any P xs) Any P (filter Q? xs) ¬ Q (Any.lookup p) filter⁺ {xs = x _} (here px) with Q? x - ... | true because _ = inj₁ (here px) - ... | false because ofⁿ ¬Qx = inj₂ ¬Qx - filter⁺ {xs = x _} (there p) with does (Q? x) + ... | true because _ = inj₁ (here px) + ... | false because ofⁿ ¬Qx = inj₂ ¬Qx + filter⁺ {xs = x _} (there p) with does (Q? x) ... | true = Sum.map₁ there (filter⁺ p) ... | false = filter⁺ p filter⁻ : Any P (filter Q? xs) Any P xs - filter⁻ {xs = x xs} p with does (Q? x) | p + filter⁻ {xs = x xs} p with does (Q? x) | p ... | true | here px = here px ... | true | there pxs = there (filter⁻ pxs) ... | false | pxs = there (filter⁻ pxs) @@ -537,33 +537,33 @@ ------------------------------------------------------------------------ -- derun and deduplicate -module _ {R : A A Set r} (R? : B.Decidable R) where +module _ {R : A A Set r} (R? : B.Decidable R) where private - derun⁺-aux : x xs P Respects R P x Any P (derun R? (x xs)) + derun⁺-aux : x xs P Respects R P x Any P (derun R? (x xs)) derun⁺-aux x [] resp Px = here Px derun⁺-aux x (y xs) resp Px with R? x y - ... | true because ofʸ Rxy = derun⁺-aux y xs resp (resp Rxy Px) - ... | false because _ = here Px + ... | true because ofʸ Rxy = derun⁺-aux y xs resp (resp Rxy Px) + ... | false because _ = here Px - derun⁺ : P Respects R Any P xs Any P (derun R? xs) + derun⁺ : P Respects R Any P xs Any P (derun R? xs) derun⁺ {xs = x xs} resp (here px) = derun⁺-aux x xs resp px - derun⁺ {xs = x y xs} resp (there pxs) with does (R? x y) + derun⁺ {xs = x y xs} resp (there pxs) with does (R? x y) ... | true = derun⁺ resp pxs ... | false = there (derun⁺ resp pxs) - deduplicate⁺ : {xs} P Respects (flip R) Any P xs Any P (deduplicate R? xs) + deduplicate⁺ : {xs} P Respects (flip R) Any P xs Any P (deduplicate R? xs) deduplicate⁺ {xs = x xs} resp (here px) = here px deduplicate⁺ {xs = x xs} resp (there pxs) - with filter⁺ (¬? R? x) (deduplicate⁺ resp pxs) + with filter⁺ (¬? R? x) (deduplicate⁺ resp pxs) ... | inj₁ p = there p - ... | inj₂ ¬¬q with decidable-stable (R? x (Any.lookup (deduplicate⁺ resp pxs))) ¬¬q + ... | inj₂ ¬¬q with decidable-stable (R? x (Any.lookup (deduplicate⁺ resp pxs))) ¬¬q ... | q = here (resp q (lookup-result (deduplicate⁺ resp pxs))) private derun⁻-aux : Any P (derun R? (x xs)) Any P (x xs) derun⁻-aux {x = x} {[]} (here px) = here px - derun⁻-aux {x = x} {y _} p[x∷y∷xs] with does (R? x y) | p[x∷y∷xs] + derun⁻-aux {x = x} {y _} p[x∷y∷xs] with does (R? x y) | p[x∷y∷xs] ... | true | p[y∷xs] = there (derun⁻-aux p[y∷xs]) ... | false | here px = here px ... | false | there p[y∷xs]! = there (derun⁻-aux p[y∷xs]!) @@ -573,7 +573,7 @@ deduplicate⁻ : Any P (deduplicate R? xs) Any P xs deduplicate⁻ {xs = x _} (here px) = here px - deduplicate⁻ {xs = x _} (there pxs!) = there (deduplicate⁻ (filter⁻ (¬? R? x) pxs!)) + deduplicate⁻ {xs = x _} (there pxs!) = there (deduplicate⁻ (filter⁻ (¬? R? x) pxs!)) ------------------------------------------------------------------------ -- mapWith∈. @@ -655,7 +655,7 @@ ------------------------------------------------------------------------ -- _∷_ -∷↔ : (P : Pred A p) (P x Any P xs) Any P (x xs) +∷↔ : (P : Pred A p) (P x Any P xs) Any P (x xs) ∷↔ {x = x} {xs} P = (P x Any P xs) ↔⟨ pure↔ ⊎-cong (Any P xs ) (Any P [ x ] Any P xs) ↔⟨ ++↔ @@ -690,8 +690,8 @@ -- An alternative introduction rule for _⊛_ -⊛⁺′ : {P : Pred A } {Q : Pred B } {fs : List (A B)} {xs} - Any (P ⟨→⟩ Q) fs Any P xs Any Q (fs xs) +⊛⁺′ : {P : Pred A } {Q : Pred B } {fs : List (A B)} {xs} + Any (P ⟨→⟩ Q) fs Any P xs Any Q (fs xs) ⊛⁺′ pq p = Inverse.to ⊛↔ (Any.map pq Any.map {x} pq {x}) p) pq) ------------------------------------------------------------------------ @@ -708,11 +708,11 @@ where open Related.EquationalReasoning ⊗↔′ : {P : A Set } {Q : B Set } {xs : List A} {ys : List B} - (Any P xs × Any Q ys) Any (P ⟨×⟩ Q) (xs ys) + (Any P xs × Any Q ys) Any (P ⟨×⟩ Q) (xs ys) ⊗↔′ {P = P} {Q} {xs} {ys} = (Any P xs × Any Q ys) ↔⟨ ×↔ Any x Any y P x × Q y) ys) xs ↔⟨ ⊗↔ - Any (P ⟨×⟩ Q) (xs ys) + Any (P ⟨×⟩ Q) (xs ys) where open Related.EquationalReasoning map-with-∈⁺ = mapWith∈⁺ diff --git a/master/Data.List.Relation.Unary.Any.html b/master/Data.List.Relation.Unary.Any.html index 0a8c56e533..1113a8f8c9 100644 --- a/master/Data.List.Relation.Unary.Any.html +++ b/master/Data.List.Relation.Unary.Any.html @@ -15,16 +15,16 @@ open import Data.Product.Base as Product using (; _,_) open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂) open import Level using (Level; _⊔_) -open import Relation.Nullary using (¬_; yes; no; _⊎-dec_) +open import Relation.Nullary using (¬_; yes; no; _⊎-dec_) import Relation.Nullary.Decidable as Dec -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Unary hiding (_∈_) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary hiding (_∈_) private variable a p q : Level A : Set a - P Q : Pred A p + P Q : Pred A p x : A xs : List A @@ -35,22 +35,22 @@ -- in xs satisfies P. See `Relation.Unary` for an explanation of -- predicates. -data Any {A : Set a} (P : Pred A p) : Pred (List A) (a p) where +data Any {A : Set a} (P : Pred A p) : Pred (List A) (a p) where here : {x xs} (px : P x) Any P (x xs) there : {x xs} (pxs : Any P xs) Any P (x xs) ------------------------------------------------------------------------ -- Operations on Any -head : ¬ Any P xs Any P (x xs) P x +head : ¬ Any P xs Any P (x xs) P x head ¬pxs (here px) = px -head ¬pxs (there pxs) = contradiction pxs ¬pxs +head ¬pxs (there pxs) = contradiction pxs ¬pxs -tail : ¬ P x Any P (x xs) Any P xs +tail : ¬ P x Any P (x xs) Any P xs tail ¬px (here px) = ⊥-elim (¬px px) tail ¬px (there pxs) = pxs -map : P Q Any P Any Q +map : P Q Any P Any Q map g (here px) = here (g px) map g (there pxs) = there (map g pxs) @@ -60,16 +60,16 @@ index (here px) = zero index (there pxs) = suc (index pxs) -lookup : {P : Pred A p} Any P xs A +lookup : {P : Pred A p} Any P xs A lookup {xs = xs} p = List.lookup xs (index p) infixr 5 _∷=_ -_∷=_ : {P : Pred A p} Any P xs A List A +_∷=_ : {P : Pred A p} Any P xs A List A _∷=_ {xs = xs} x∈xs v = xs List.[ index x∈xs ]∷= v infixl 4 _─_ -_─_ : {P : Pred A p} xs Any P xs List A +_─_ : {P : Pred A p} xs Any P xs List A xs x∈xs = removeAt xs (index x∈xs) -- If any element satisfies P, then P is satisfied. @@ -89,11 +89,11 @@ ------------------------------------------------------------------------ -- Properties of predicates preserved by Any -any? : Decidable P Decidable (Any P) -any? P? [] = no λ() -any? P? (x xs) = Dec.map′ fromSum toSum (P? x ⊎-dec any? P? xs) +any? : Decidable P Decidable (Any P) +any? P? [] = no λ() +any? P? (x xs) = Dec.map′ fromSum toSum (P? x ⊎-dec any? P? xs) -satisfiable : Satisfiable P Satisfiable (Any P) +satisfiable : Satisfiable P Satisfiable (Any P) satisfiable (x , Px) = [ x ] , here Px diff --git a/master/Data.List.Relation.Unary.First.Properties.html b/master/Data.List.Relation.Unary.First.Properties.html index 87ed2bfe01..cdee65c0f6 100644 --- a/master/Data.List.Relation.Unary.First.Properties.html +++ b/master/Data.List.Relation.Unary.First.Properties.html @@ -17,26 +17,26 @@ import Data.Sum as Sum open import Function.Base using (_∘′_; _$_; _∘_; id) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; refl; _≗_) -open import Relation.Unary using (Pred; _⊆_; ; Irrelevant; Decidable) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary using (Pred; _⊆_; ; Irrelevant; Decidable) +open import Relation.Nullary.Negation using (contradiction) ------------------------------------------------------------------------ -- map -module _ {a b p q} {A : Set a} {B : Set b} {P : Pred B p} {Q : Pred B q} where +module _ {a b p q} {A : Set a} {B : Set b} {P : Pred B p} {Q : Pred B q} where - map⁺ : {f : A B} First (P ∘′ f) (Q ∘′ f) First P Q ∘′ List.map f + map⁺ : {f : A B} First (P ∘′ f) (Q ∘′ f) First P Q ∘′ List.map f map⁺ [ qfx ] = [ qfx ] map⁺ (pfxs pqfxs) = pfxs map⁺ pqfxs - map⁻ : {f : A B} First P Q ∘′ List.map f First (P ∘′ f) (Q ∘′ f) + map⁻ : {f : A B} First P Q ∘′ List.map f First (P ∘′ f) (Q ∘′ f) map⁻ {f} {x xs} [ qfx ] = [ qfx ] map⁻ {f} {x xs} (pfx pqfxs) = pfx map⁻ pqfxs ------------------------------------------------------------------------ -- (++) -module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where +module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where ++⁺ : {xs ys} All P xs First P Q ys First P Q (xs List.++ ys) ++⁺ [] pqys = pqys @@ -49,43 +49,43 @@ ------------------------------------------------------------------------ -- Relationship to All -module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where +module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where - All⇒¬First : P Q All P (First P Q) - All⇒¬First p⇒¬q (px pxs) [ qx ] = contradiction qx (p⇒¬q px) + All⇒¬First : P Q All P (First P Q) + All⇒¬First p⇒¬q (px pxs) [ qx ] = contradiction qx (p⇒¬q px) All⇒¬First p⇒¬q (_ pxs) (_ hf) = All⇒¬First p⇒¬q pxs hf - First⇒¬All : Q P First P Q (All P) + First⇒¬All : Q P First P Q (All P) First⇒¬All q⇒¬p [ qx ] (px pxs) = q⇒¬p qx px First⇒¬All q⇒¬p (_ pqxs) (_ pxs) = First⇒¬All q⇒¬p pqxs pxs ------------------------------------------------------------------------ -- Irrelevance - unique-index : {xs} P Q (f₁ f₂ : First P Q xs) index f₁ index f₂ + unique-index : {xs} P Q (f₁ f₂ : First P Q xs) index f₁ index f₂ unique-index p⇒¬q [ _ ] [ _ ] = refl - unique-index p⇒¬q [ qx ] (px _) = contradiction qx (p⇒¬q px) - unique-index p⇒¬q (px _) [ qx ] = contradiction qx (p⇒¬q px) + unique-index p⇒¬q [ qx ] (px _) = contradiction qx (p⇒¬q px) + unique-index p⇒¬q (px _) [ qx ] = contradiction qx (p⇒¬q px) unique-index p⇒¬q (_ f₁) (_ f₂) = ≡.cong suc (unique-index p⇒¬q f₁ f₂) - irrelevant : P Q Irrelevant P Irrelevant Q Irrelevant (First P Q) + irrelevant : P Q Irrelevant P Irrelevant Q Irrelevant (First P Q) irrelevant p⇒¬q p-irr q-irr [ px ] [ qx ] = ≡.cong [_] (q-irr px qx) - irrelevant p⇒¬q p-irr q-irr [ qx ] (px _) = contradiction qx (p⇒¬q px) - irrelevant p⇒¬q p-irr q-irr (px _) [ qx ] = contradiction qx (p⇒¬q px) + irrelevant p⇒¬q p-irr q-irr [ qx ] (px _) = contradiction qx (p⇒¬q px) + irrelevant p⇒¬q p-irr q-irr (px _) [ qx ] = contradiction qx (p⇒¬q px) irrelevant p⇒¬q p-irr q-irr (px f) (qx g) = ≡.cong₂ _∷_ (p-irr px qx) (irrelevant p⇒¬q p-irr q-irr f g) ------------------------------------------------------------------------ -- Decidability -module _ {a p} {A : Set a} {P : Pred A p} where +module _ {a p} {A : Set a} {P : Pred A p} where - first? : Decidable P Decidable (First P ( P)) + first? : Decidable P Decidable (First P ( P)) first? P? xs = Sum.toDec - $ Sum.map₂ (All⇒¬First contradiction) + $ Sum.map₂ (All⇒¬First contradiction) $ first (Sum.fromDec P?) xs - cofirst? : Decidable P Decidable (First ( P) P) + cofirst? : Decidable P Decidable (First ( P) P) cofirst? P? xs = Sum.toDec $ Sum.map₂ (All⇒¬First id) $ first (Sum.swap Sum.fromDec P?) xs @@ -93,7 +93,7 @@ ------------------------------------------------------------------------ -- Conversion to Any -module _ {a p} {A : Set a} {P : Pred A p} where +module _ {a p} {A : Set a} {P : Pred A p} where fromAny∘toAny≗id : {xs} fromAny {Q = P} {x = xs} ∘′ toAny id fromAny∘toAny≗id [ qx ] = refl @@ -106,7 +106,7 @@ ------------------------------------------------------------------------ -- Equivalence between the inductive definition and the view -module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where +module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where toView : {as} First P Q as FirstView P Q as toView [ qx ] = [] ++ qx _ diff --git a/master/Data.List.Relation.Unary.First.html b/master/Data.List.Relation.Unary.First.html index 0f784ed126..226b833e34 100644 --- a/master/Data.List.Relation.Unary.First.html +++ b/master/Data.List.Relation.Unary.First.html @@ -25,54 +25,54 @@ ------------------------------------------------------------------------ -- Basic type. -module _ {p q} (P : Pred A p) (Q : Pred A q) where +module _ {p q} (P : Pred A p) (Q : Pred A q) where infix 1 _++_∷_ infixr 5 _∷_ - data First : Pred (List A) (a p q) where + data First : Pred (List A) (a p q) where [_] : {x xs} Q x First (x xs) _∷_ : {x xs} P x First xs First (x xs) - data FirstView : Pred (List A) (a p q) where + data FirstView : Pred (List A) (a p q) where _++_∷_ : {xs y} All P xs Q y ys FirstView (xs List.++ y ys) ------------------------------------------------------------------------ -- map -module _ {p q r s} {P : Pred A p} {Q : Pred A q} {R : Pred A r} {S : Pred A s} where +module _ {p q r s} {P : Pred A p} {Q : Pred A q} {R : Pred A r} {S : Pred A s} where - map : P R Q S First P Q First R S + map : P R Q S First P Q First R S map p⇒r q⇒r [ qx ] = [ q⇒r qx ] map p⇒r q⇒r (px pqxs) = p⇒r px map p⇒r q⇒r pqxs -module _ {p q r} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where +module _ {p q r} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where - map₁ : P R First P Q First R Q + map₁ : P R First P Q First R Q map₁ p⇒r = map p⇒r id - map₂ : Q R First P Q First P R + map₂ : Q R First P Q First P R map₂ = map id - refine : P Q R First P Q First R Q + refine : P Q R First P Q First R Q refine f [ qx ] = [ qx ] refine f (px pqxs) with f px ... | inj₁ qx = [ qx ] ... | inj₂ rx = rx refine f pqxs -module _ {p q} {P : Pred A p} {Q : Pred A q} where +module _ {p q} {P : Pred A p} {Q : Pred A q} where ------------------------------------------------------------------------ -- Operations - empty : ¬ First P Q [] + empty : ¬ First P Q [] empty () - tail : {x xs} ¬ Q x First P Q (x xs) First P Q xs + tail : {x xs} ¬ Q x First P Q (x xs) First P Q xs tail ¬qx [ qx ] = ⊥-elim (¬qx qx) tail ¬qx (px pqxs) = pqxs - index : First P Q (Fin ∘′ List.length) + index : First P Q (Fin ∘′ List.length) index [ qx ] = zero index (_ pqxs) = suc (index pqxs) @@ -83,13 +83,13 @@ satisfied : {xs} First P Q xs Q satisfied pqxs = -, index-satisfied pqxs - satisfiable : Satisfiable Q Satisfiable (First P Q) + satisfiable : Satisfiable Q Satisfiable (First P Q) satisfiable (x , qx) = List.[ x ] , [ qx ] ------------------------------------------------------------------------ -- Decidability results - first : Π[ P Q ] Π[ First P Q All P ] + first : Π[ P Q ] Π[ First P Q All P ] first p⊎q [] = inj₂ [] first p⊎q (x xs) with p⊎q x ... | inj₁ px = Sum.map (px ∷_) (px ∷_) (first p⊎q xs) @@ -98,13 +98,13 @@ ------------------------------------------------------------------------ -- Relationship with Any -module _ {q} {Q : Pred A q} where +module _ {q} {Q : Pred A q} where - fromAny : Any Q First U Q + fromAny : Any Q First U Q fromAny (here qx) = [ qx ] fromAny (there any) = _ fromAny any - toAny : {p} {P : Pred A p} First P Q Any Q + toAny : {p} {P : Pred A p} First P Q Any Q toAny [ qx ] = here qx toAny (_ pqxs) = there (toAny pqxs) \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Grouped.Properties.html b/master/Data.List.Relation.Unary.Grouped.Properties.html index d2e9339ce7..b6b04e0ee5 100644 --- a/master/Data.List.Relation.Unary.Grouped.Properties.html +++ b/master/Data.List.Relation.Unary.Grouped.Properties.html @@ -20,9 +20,9 @@ open import Level using (Level) open import Relation.Binary.Definitions as B open import Relation.Binary.Core using (_⇔_; REL; Rel) -open import Relation.Unary as U using (Pred) -open import Relation.Nullary.Decidable.Core using (does; yes; no) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Unary as U using (Pred) +open import Relation.Nullary.Decidable.Core using (does; yes; no) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) private variable @@ -56,15 +56,15 @@ ------------------------------------------------------------------------ -- derun -module _ {P : Rel A p} (P? : B.Decidable P) where +module _ {P : Rel A p} (P? : B.Decidable P) where - grouped[xs]⇒unique[derun[xs]] : xs Grouped P xs AllPairs x y ¬ P x y) (derun P? xs) + grouped[xs]⇒unique[derun[xs]] : xs Grouped P xs AllPairs x y ¬ P x y) (derun P? xs) grouped[xs]⇒unique[derun[xs]] [] [] = [] grouped[xs]⇒unique[derun[xs]] (x []) ([] ∷≉ []) = [] [] grouped[xs]⇒unique[derun[xs]] (x y xs) (all[¬Px,y∷xs]@(¬Pxy _) ∷≉ grouped[y∷xs]) with P? x y - ... | yes Pxy = contradiction Pxy ¬Pxy - ... | no _ = All.derun⁺ P? all[¬Px,y∷xs] grouped[xs]⇒unique[derun[xs]] (y xs) grouped[y∷xs] + ... | yes Pxy = contradiction Pxy ¬Pxy + ... | no _ = All.derun⁺ P? all[¬Px,y∷xs] grouped[xs]⇒unique[derun[xs]] (y xs) grouped[y∷xs] grouped[xs]⇒unique[derun[xs]] (x y xs) (Pxy ∷≈ grouped[xs]) with P? x y - ... | yes _ = grouped[xs]⇒unique[derun[xs]] (y xs) grouped[xs] - ... | no ¬Pxy = contradiction Pxy ¬Pxy + ... | yes _ = grouped[xs]⇒unique[derun[xs]] (y xs) grouped[xs] + ... | no ¬Pxy = contradiction Pxy ¬Pxy \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Grouped.html b/master/Data.List.Relation.Unary.Grouped.html index ce764c7171..3b8a71a843 100644 --- a/master/Data.List.Relation.Unary.Grouped.html +++ b/master/Data.List.Relation.Unary.Grouped.html @@ -15,9 +15,9 @@ open import Data.Product.Base using (_×_; _,_) open import Relation.Binary.Core using (REL; Rel) open import Relation.Binary.Definitions as B -open import Relation.Unary as U using (Pred) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Decidable as Dec using (yes; ¬?; _⊎-dec_; _×-dec_) +open import Relation.Unary as U using (Pred) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Decidable as Dec using (yes; ¬?; _⊎-dec_; _×-dec_) open import Level using (Level; _⊔_) private @@ -32,9 +32,9 @@ infixr 5 _∷≉_ _∷≈_ -data Grouped {A : Set a} (_≈_ : Rel A ) : Pred (List A) (a ) where +data Grouped {A : Set a} (_≈_ : Rel A ) : Pred (List A) (a ) where [] : Grouped _≈_ [] - _∷≉_ : All y ¬ (x y)) xs Grouped _≈_ xs Grouped _≈_ (x xs) + _∷≉_ : All y ¬ (x y)) xs Grouped _≈_ xs Grouped _≈_ (x xs) _∷≈_ : x y Grouped _≈_ (y xs) Grouped _≈_ (x y xs) ------------------------------------------------------------------------ @@ -42,17 +42,17 @@ module _ {_≈_ : Rel A } where - grouped? : B.Decidable _≈_ U.Decidable (Grouped _≈_) - grouped? _≟_ [] = yes [] - grouped? _≟_ (x []) = yes ([] ∷≉ []) + grouped? : B.Decidable _≈_ U.Decidable (Grouped _≈_) + grouped? _≟_ [] = yes [] + grouped? _≟_ (x []) = yes ([] ∷≉ []) grouped? _≟_ (x y xs) = - Dec.map′ from to ((x y ⊎-dec all? z ¬? (x z)) (y xs)) ×-dec (grouped? _≟_ (y xs))) + Dec.map′ from to ((x y ⊎-dec all? z ¬? (x z)) (y xs)) ×-dec (grouped? _≟_ (y xs))) where - from : ((x y) All z ¬ (x z)) (y xs)) × Grouped _≈_ (y xs) Grouped _≈_ (x y xs) + from : ((x y) All z ¬ (x z)) (y xs)) × Grouped _≈_ (y xs) Grouped _≈_ (x y xs) from (inj₁ x≈y , grouped[y∷xs]) = x≈y ∷≈ grouped[y∷xs] from (inj₂ all[x≉,y∷xs] , grouped[y∷xs]) = all[x≉,y∷xs] ∷≉ grouped[y∷xs] - to : Grouped _≈_ (x y xs) ((x y) All z ¬ (x z)) (y xs)) × Grouped _≈_ (y xs) + to : Grouped _≈_ (x y xs) ((x y) All z ¬ (x z)) (y xs)) × Grouped _≈_ (y xs) to (all[x≉,y∷xs] ∷≉ grouped[y∷xs]) = inj₂ all[x≉,y∷xs] , grouped[y∷xs] to (x≈y ∷≈ grouped[y∷xs]) = inj₁ x≈y , grouped[y∷xs] \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Linked.Properties.html b/master/Data.List.Relation.Unary.Linked.Properties.html index 54343cf074..18e6f52392 100644 --- a/master/Data.List.Relation.Unary.Linked.Properties.html +++ b/master/Data.List.Relation.Unary.Linked.Properties.html @@ -25,10 +25,10 @@ open import Function.Base using (_∘_; flip; _on_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (DecSetoid) -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) open import Relation.Binary.PropositionalEquality.Core using (_≢_) -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Decidable using (yes; no; does) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Decidable using (yes; no; does) private variable @@ -48,7 +48,7 @@ AllPairs⇒Linked ((px _) py pxs) = px (AllPairs⇒Linked (py pxs)) -module _ {R : Rel A } (trans : Transitive R) where +module _ {R : Rel A } (trans : Transitive R) where Linked⇒All : {v x xs} R v x Linked R (x xs) All (R v) (x xs) @@ -128,26 +128,26 @@ ------------------------------------------------------------------------ -- filter -module _ {P : Pred A p} (P? : Decidable P) - {R : Rel A } (trans : Transitive R) +module _ {P : Pred A p} (P? : Decidable P) + {R : Rel A } (trans : Transitive R) where ∷-filter⁺ : {x xs} Linked R (x xs) Linked R (x filter P? xs) ∷-filter⁺ [-] = [-] - ∷-filter⁺ {xs = y _} (r [-]) with does (P? y) + ∷-filter⁺ {xs = y _} (r [-]) with does (P? y) ... | false = [-] ... | true = r [-] ∷-filter⁺ {x = x} {xs = y ys} (r r′ rs) - with does (P? y) | ∷-filter⁺ {xs = ys} | ∷-filter⁺ (r′ rs) + with does (P? y) | ∷-filter⁺ {xs = ys} | ∷-filter⁺ (r′ rs) ... | false | ihf | _ = ihf (trans r r′ rs) ... | true | _ | iht = r iht filter⁺ : {xs} Linked R xs Linked R (filter P? xs) filter⁺ [] = [] - filter⁺ {xs = x []} [-] with does (P? x) + filter⁺ {xs = x []} [-] with does (P? x) ... | false = [] ... | true = [-] - filter⁺ {xs = x _} (r rs) with does (P? x) + filter⁺ {xs = x _} (r rs) with does (P? x) ... | false = filter⁺ rs ... | true = ∷-filter⁺ (r rs) \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Linked.html b/master/Data.List.Relation.Unary.Linked.html index c3364d4c80..5d62e3e26b 100644 --- a/master/Data.List.Relation.Unary.Linked.html +++ b/master/Data.List.Relation.Unary.Linked.html @@ -21,8 +21,8 @@ open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Construct.Intersection renaming (_∩_ to _∩ᵇ_) open import Relation.Binary.PropositionalEquality.Core using (refl; cong₂) -open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) -open import Relation.Nullary.Decidable using (yes; no; map′; _×-dec_) +open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) +open import Relation.Nullary.Decidable using (yes; no; map′; _×-dec_) private variable @@ -68,29 +68,29 @@ module _ {R : Rel A p} {S : Rel A q} where - map : R S Linked R Linked S + map : R S Linked R Linked S map R⇒S [] = [] map R⇒S [-] = [-] map R⇒S (x~xs pxs) = R⇒S x~xs map R⇒S pxs module _ {P : Rel A p} {Q : Rel A q} {R : Rel A r} where - zipWith : P ∩ᵇ Q R Linked P ∩ᵘ Linked Q Linked R + zipWith : P ∩ᵇ Q R Linked P ∩ᵘ Linked Q Linked R zipWith f ([] , []) = [] zipWith f ([-] , [-]) = [-] zipWith f (px pxs , qx qxs) = f (px , qx) zipWith f (pxs , qxs) - unzipWith : R P ∩ᵇ Q Linked R Linked P ∩ᵘ Linked Q + unzipWith : R P ∩ᵇ Q Linked R Linked P ∩ᵘ Linked Q unzipWith f [] = [] , [] unzipWith f [-] = [-] , [-] unzipWith f (rx rxs) = Prod.zip _∷_ _∷_ (f rx) (unzipWith f rxs) module _ {P : Rel A p} {Q : Rel A q} where - zip : Linked P ∩ᵘ Linked Q Linked (P ∩ᵇ Q) + zip : Linked P ∩ᵘ Linked Q Linked (P ∩ᵇ Q) zip = zipWith id - unzip : Linked (P ∩ᵇ Q) Linked P ∩ᵘ Linked Q + unzip : Linked (P ∩ᵇ Q) Linked P ∩ᵘ Linked Q unzip = unzipWith id ------------------------------------------------------------------------ @@ -98,18 +98,18 @@ module _ {R : Rel A } where - linked? : B.Decidable R U.Decidable (Linked R) - linked? R? [] = yes [] - linked? R? (x []) = yes [-] + linked? : B.Decidable R U.Decidable (Linked R) + linked? R? [] = yes [] + linked? R? (x []) = yes [-] linked? R? (x y xs) = - map′ (uncurry _∷_) < head , tail > (R? x y ×-dec linked? R? (y xs)) + map′ (uncurry _∷_) < head , tail > (R? x y ×-dec linked? R? (y xs)) - irrelevant : B.Irrelevant R U.Irrelevant (Linked R) + irrelevant : B.Irrelevant R U.Irrelevant (Linked R) irrelevant irr [] [] = refl irrelevant irr [-] [-] = refl irrelevant irr (px₁ pxs₁) (px₂ pxs₂) = cong₂ _∷_ (irr px₁ px₂) (irrelevant irr pxs₁ pxs₂) - satisfiable : U.Satisfiable (Linked R) + satisfiable : U.Satisfiable (Linked R) satisfiable = [] , [] \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Sorted.TotalOrder.Properties.html b/master/Data.List.Relation.Unary.Sorted.TotalOrder.Properties.html index 70df38de85..f55e274d65 100644 --- a/master/Data.List.Relation.Unary.Sorted.TotalOrder.Properties.html +++ b/master/Data.List.Relation.Unary.Sorted.TotalOrder.Properties.html @@ -27,8 +27,8 @@ open import Relation.Binary.Core using (_Preserves_⟶_) open import Relation.Binary.Bundles using (TotalOrder; DecTotalOrder; Preorder) import Relation.Binary.Properties.TotalOrder as TotalOrderProperties -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Decidable using (yes; no) private variable @@ -119,8 +119,8 @@ merge-con {xs = []} cxs cys = cys merge-con {xs = x xs} {[]} cxs cys = cxs merge-con {xs = x xs} {y ys} cxs cys with x ≤? y - ... | yes x≤y = cxs - ... | no x≰y = cys + ... | yes x≤y = cxs + ... | no x≰y = cys merge⁺ : {xs ys} Sorted O xs Sorted O ys Sorted O (merge _≤?_ xs ys) merge⁺ {[]} rxs rys = rys @@ -128,8 +128,8 @@ merge⁺ {x xs} {y ys} rxs rys with x ≤? y | merge⁺ (Linked.tail rxs) rys | merge⁺ rxs (Linked.tail rys) - ... | yes x≤y | rec | _ = merge-con (head′ rxs) (just x≤y) ∷′ rec - ... | no x≰y | _ | rec = merge-con (just (≰⇒≥ x≰y)) (head′ rys) ∷′ rec + ... | yes x≤y | rec | _ = merge-con (head′ rxs) (just x≤y) ∷′ rec + ... | no x≰y | _ | rec = merge-con (just (≰⇒≥ x≰y)) (head′ rys) ∷′ rec -- Reexport ⊆-mergeˡʳ @@ -146,7 +146,7 @@ ------------------------------------------------------------------------ -- filter -module _ (O : TotalOrder a ℓ₁ ℓ₂) {P : Pred _ p} (P? : Decidable P) where +module _ (O : TotalOrder a ℓ₁ ℓ₂) {P : Pred _ p} (P? : Decidable P) where open TotalOrder O filter⁺ : {xs} Sorted O xs Sorted O (filter P? xs) diff --git a/master/Data.List.Relation.Unary.Sorted.TotalOrder.html b/master/Data.List.Relation.Unary.Sorted.TotalOrder.html index 682b9830b5..dd627cc656 100644 --- a/master/Data.List.Relation.Unary.Sorted.TotalOrder.html +++ b/master/Data.List.Relation.Unary.Sorted.TotalOrder.html @@ -17,13 +17,13 @@ open import Data.List.Base using (List; []; _∷_) open import Data.List.Relation.Unary.Linked as Linked using (Linked) open import Level using (_⊔_) -open import Relation.Unary as U using (Pred; _⊆_) +open import Relation.Unary as U using (Pred; _⊆_) open import Relation.Binary.Definitions as B ------------------------------------------------------------------------ -- Definition -Sorted : Pred (List A) (a ℓ₂) +Sorted : Pred (List A) (a ℓ₂) Sorted xs = Linked _≤_ xs ------------------------------------------------------------------------ @@ -40,12 +40,12 @@ ------------------------------------------------------------------------ -- Properties of predicates preserved by Sorted -sorted? : B.Decidable _≤_ U.Decidable Sorted +sorted? : B.Decidable _≤_ U.Decidable Sorted sorted? = Linked.linked? -irrelevant : B.Irrelevant _≤_ U.Irrelevant Sorted +irrelevant : B.Irrelevant _≤_ U.Irrelevant Sorted irrelevant = Linked.irrelevant -satisfiable : U.Satisfiable Sorted +satisfiable : U.Satisfiable Sorted satisfiable = Linked.satisfiable \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Unique.DecPropositional.Properties.html b/master/Data.List.Relation.Unary.Unique.DecPropositional.Properties.html index 969022356f..d2582ef5e5 100644 --- a/master/Data.List.Relation.Unary.Unique.DecPropositional.Properties.html +++ b/master/Data.List.Relation.Unary.Unique.DecPropositional.Properties.html @@ -7,10 +7,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.List.Relation.Unary.Unique.DecPropositional.Properties - {a} {A : Set a} (_≟_ : DecidableEquality A) where + {a} {A : Set a} (_≟_ : DecidableEquality A) where open import Data.List.Base using (deduplicate) open import Data.List.Relation.Unary.All.Properties using (all-filter) diff --git a/master/Data.List.Relation.Unary.Unique.DecPropositional.html b/master/Data.List.Relation.Unary.Unique.DecPropositional.html index 9359fce90f..a5eae7bec6 100644 --- a/master/Data.List.Relation.Unary.Unique.DecPropositional.html +++ b/master/Data.List.Relation.Unary.Unique.DecPropositional.html @@ -8,11 +8,11 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Bundles using (DecSetoid) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Properties using (decSetoid) module Data.List.Relation.Unary.Unique.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) where + {a} {A : Set a} (_≟_ : DecidableEquality A) where ------------------------------------------------------------------------ -- Re-export setoid definition diff --git a/master/Data.List.Relation.Unary.Unique.DecSetoid.html b/master/Data.List.Relation.Unary.Unique.DecSetoid.html index 4da0bd9f0e..d0a7621ee4 100644 --- a/master/Data.List.Relation.Unary.Unique.DecSetoid.html +++ b/master/Data.List.Relation.Unary.Unique.DecSetoid.html @@ -9,8 +9,8 @@ open import Relation.Binary.Bundles using (DecSetoid) import Data.List.Relation.Unary.AllPairs as AllPairs -open import Relation.Unary using (Decidable) -open import Relation.Nullary.Decidable using (¬?) +open import Relation.Unary using (Decidable) +open import Relation.Nullary.Decidable using (¬?) module Data.List.Relation.Unary.Unique.DecSetoid {a } (DS : DecSetoid a ) where @@ -25,6 +25,6 @@ ------------------------------------------------------------------------ -- Additional properties -unique? : Decidable Unique -unique? = AllPairs.allPairs? x y ¬? (x y)) +unique? : Decidable Unique +unique? = AllPairs.allPairs? x y ¬? (x y)) \ No newline at end of file diff --git a/master/Data.List.Relation.Unary.Unique.Propositional.Properties.html b/master/Data.List.Relation.Unary.Unique.Propositional.Properties.html index 5f072c3992..32d67438d9 100644 --- a/master/Data.List.Relation.Unary.Unique.Propositional.Properties.html +++ b/master/Data.List.Relation.Unary.Unique.Propositional.Properties.html @@ -30,8 +30,8 @@ open import Relation.Binary.PropositionalEquality.Core using (refl; _≡_; _≢_; sym) open import Relation.Binary.PropositionalEquality.Properties using (setoid) -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Negation using (¬_) private variable @@ -151,7 +151,7 @@ ------------------------------------------------------------------------ -- filter -module _ {A : Set a} {P : Pred _ p} (P? : Decidable P) where +module _ {A : Set a} {P : Pred _ p} (P? : Decidable P) where filter⁺ : {xs} Unique xs Unique (filter P? xs) filter⁺ = Setoid.filter⁺ (setoid A) P? diff --git a/master/Data.List.Relation.Unary.Unique.Setoid.Properties.html b/master/Data.List.Relation.Unary.Unique.Setoid.Properties.html index 5cd9e60ace..a941f6c82c 100644 --- a/master/Data.List.Relation.Unary.Unique.Setoid.Properties.html +++ b/master/Data.List.Relation.Unary.Unique.Setoid.Properties.html @@ -27,9 +27,9 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core using (_≡_) -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Negation using (contraposition) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (contraposition) private variable @@ -47,7 +47,7 @@ map⁺ : {f} (∀ {x y} f x ≈₂ f y x ≈₁ y) {xs} Unique S xs Unique R (map f xs) - map⁺ inj xs! = AllPairs.map⁺ (AllPairs.map (contraposition inj) xs!) + map⁺ inj xs! = AllPairs.map⁺ (AllPairs.map (contraposition inj) xs!) ------------------------------------------------------------------------ -- ++ @@ -153,7 +153,7 @@ ------------------------------------------------------------------------ -- filter -module _ (S : Setoid a ) {P : Pred _ p} (P? : Decidable P) where +module _ (S : Setoid a ) {P : Pred _ p} (P? : Decidable P) where filter⁺ : {xs} Unique S xs Unique S (filter P? xs) filter⁺ = AllPairs.filter⁺ P? diff --git a/master/Data.List.Relation.Unary.Unique.Setoid.html b/master/Data.List.Relation.Unary.Unique.Setoid.html index b53c00bb13..58924fc28d 100644 --- a/master/Data.List.Relation.Unary.Unique.Setoid.html +++ b/master/Data.List.Relation.Unary.Unique.Setoid.html @@ -9,7 +9,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) module Data.List.Relation.Unary.Unique.Setoid {a } (S : Setoid a ) where @@ -20,7 +20,7 @@ private Distinct : Rel A - Distinct x y = ¬ (x y) + Distinct x y = ¬ (x y) open import Data.List.Relation.Unary.AllPairs.Core Distinct public renaming (AllPairs to Unique) diff --git a/master/Data.List.Sort.MergeSort.html b/master/Data.List.Sort.MergeSort.html index 81c3826b60..25317fae94 100644 --- a/master/Data.List.Sort.MergeSort.html +++ b/master/Data.List.Sort.MergeSort.html @@ -31,8 +31,8 @@ open import Data.Nat.Properties using (m<n⇒m<1+n) open import Data.Product.Base as Product using (_,_) open import Function.Base using (_∘_) -open import Relation.Nullary.Negation.Core using (¬_) -open import Relation.Nullary.Decidable.Core using (does) +open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Decidable.Core using (does) open DecTotalOrder O renaming (Carrier to A) diff --git a/master/Data.Maybe.Base.html b/master/Data.Maybe.Base.html index cc21ea7d5f..747122ac72 100644 --- a/master/Data.Maybe.Base.html +++ b/master/Data.Maybe.Base.html @@ -17,8 +17,8 @@ open import Data.These.Base using (These; this; that; these) open import Data.Product.Base as Prod using (_×_; _,_) open import Function.Base using (const; _∘_; id) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary.Decidable.Core using (Dec; _because_) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary.Decidable.Core using (Dec; _because_) private variable @@ -47,9 +47,9 @@ is-nothing : Maybe A Bool is-nothing = not is-just -decToMaybe : Dec A Maybe A -decToMaybe ( true because [a]) = just (invert [a]) -decToMaybe (false because _ ) = nothing +decToMaybe : Dec A Maybe A +decToMaybe ( true because [a]) = just (invert [a]) +decToMaybe (false because _ ) = nothing -- A dependent eliminator. diff --git a/master/Data.Maybe.Properties.html b/master/Data.Maybe.Properties.html index a5c7b1ae05..cb18c6ad44 100644 --- a/master/Data.Maybe.Properties.html +++ b/master/Data.Maybe.Properties.html @@ -23,9 +23,9 @@ using (_≡_; refl; cong; cong₂; _≗_) open import Relation.Binary.PropositionalEquality.Properties using (isEquivalence) -open import Relation.Binary.Definitions using (DecidableEquality) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Decidable using (map′) +open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Decidable using (map′) private variable @@ -40,11 +40,11 @@ just-injective : {x y} (Maybe A just x) just y x y just-injective refl = refl -≡-dec : DecidableEquality A DecidableEquality (Maybe A) -≡-dec _≟_ nothing nothing = yes refl -≡-dec _≟_ (just x) nothing = no λ() -≡-dec _≟_ nothing (just y) = no λ() -≡-dec _≟_ (just x) (just y) = map′ (cong just) just-injective (x y) +≡-dec : DecidableEquality A DecidableEquality (Maybe A) +≡-dec _≟_ nothing nothing = yes refl +≡-dec _≟_ (just x) nothing = no λ() +≡-dec _≟_ nothing (just y) = no λ() +≡-dec _≟_ (just x) (just y) = map′ (cong just) just-injective (x y) ------------------------------------------------------------------------ -- map diff --git a/master/Data.Maybe.Relation.Binary.Connected.html b/master/Data.Maybe.Relation.Binary.Connected.html index ce9a264222..d1db6c96ad 100644 --- a/master/Data.Maybe.Relation.Binary.Connected.html +++ b/master/Data.Maybe.Relation.Binary.Connected.html @@ -13,7 +13,7 @@ open import Data.Maybe.Base using (Maybe; just; nothing) open import Function.Bundles using (_⇔_; mk⇔) open import Relation.Binary.Core using (REL; _⇒_) -open import Relation.Binary.Definitions using (Reflexive; Sym; Decidable) +open import Relation.Binary.Definitions using (Reflexive; Sym; Decidable) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Nullary import Relation.Nullary.Decidable as Dec @@ -48,22 +48,22 @@ ------------------------------------------------------------------------ -- Relational properties -refl : Reflexive R Reflexive (Connected R) +refl : Reflexive R Reflexive (Connected R) refl R-refl {just _} = just R-refl refl R-refl {nothing} = nothing reflexive : _≡_ R _≡_ Connected R reflexive reflexive ≡.refl = refl (reflexive ≡.refl) -sym : Sym R S Sym (Connected R) (Connected S) +sym : Sym R S Sym (Connected R) (Connected S) sym R-sym (just p) = just (R-sym p) sym R-sym nothing-just = just-nothing sym R-sym just-nothing = nothing-just sym R-sym nothing = nothing -connected? : Decidable R Decidable (Connected R) -connected? R? (just x) (just y) = Dec.map just-equivalence (R? x y) -connected? R? (just x) nothing = yes just-nothing -connected? R? nothing (just y) = yes nothing-just -connected? R? nothing nothing = yes nothing +connected? : Decidable R Decidable (Connected R) +connected? R? (just x) (just y) = Dec.map just-equivalence (R? x y) +connected? R? (just x) nothing = yes just-nothing +connected? R? nothing (just y) = yes nothing-just +connected? R? nothing nothing = yes nothing \ No newline at end of file diff --git a/master/Data.Maybe.Relation.Binary.Pointwise.html b/master/Data.Maybe.Relation.Binary.Pointwise.html index ff1a0296ca..e5e792581e 100644 --- a/master/Data.Maybe.Relation.Binary.Pointwise.html +++ b/master/Data.Maybe.Relation.Binary.Pointwise.html @@ -16,11 +16,11 @@ open import Function.Bundles using (_⇔_; mk⇔) open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid) -open import Relation.Binary.Definitions using (Reflexive; Sym; Trans; Decidable) +open import Relation.Binary.Definitions using (Reflexive; Sym; Trans; Decidable) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Nullary -open import Relation.Unary using (_⊆_) +open import Relation.Unary using (_⊆_) import Relation.Nullary.Decidable as Dec ------------------------------------------------------------------------ @@ -54,7 +54,7 @@ module _ {a r} {A : Set a} {R : Rel A r} where - refl : Reflexive R Reflexive (Pointwise R) + refl : Reflexive R Reflexive (Pointwise R) refl R-refl {just _} = just R-refl refl R-refl {nothing} = nothing @@ -64,24 +64,24 @@ module _ {a b r₁ r₂} {A : Set a} {B : Set b} {R : REL A B r₁} {S : REL B A r₂} where - sym : Sym R S Sym (Pointwise R) (Pointwise S) + sym : Sym R S Sym (Pointwise R) (Pointwise S) sym R-sym (just p) = just (R-sym p) sym R-sym nothing = nothing module _ {a b c r₁ r₂ r₃} {A : Set a} {B : Set b} {C : Set c} {R : REL A B r₁} {S : REL B C r₂} {T : REL A C r₃} where - trans : Trans R S T Trans (Pointwise R) (Pointwise S) (Pointwise T) + trans : Trans R S T Trans (Pointwise R) (Pointwise S) (Pointwise T) trans R-trans (just p) (just q) = just (R-trans p q) trans R-trans nothing nothing = nothing module _ {a r} {A : Set a} {R : Rel A r} where - dec : Decidable R Decidable (Pointwise R) - dec R-dec (just x) (just y) = Dec.map just-equivalence (R-dec x y) - dec R-dec (just x) nothing = no ()) - dec R-dec nothing (just y) = no ()) - dec R-dec nothing nothing = yes nothing + dec : Decidable R Decidable (Pointwise R) + dec R-dec (just x) (just y) = Dec.map just-equivalence (R-dec x y) + dec R-dec (just x) nothing = no ()) + dec R-dec nothing (just y) = no ()) + dec R-dec nothing nothing = yes nothing isEquivalence : IsEquivalence R IsEquivalence (Pointwise R) isEquivalence R-isEquivalence = record @@ -96,7 +96,7 @@ ; _≟_ = dec R._≟_ } where module R = IsDecEquivalence R-isDecEquivalence - pointwise⊆any : {x} Pointwise R (just x) Any (R x) + pointwise⊆any : {x} Pointwise R (just x) Any (R x) pointwise⊆any (just Rxy) = just Rxy module _ {c } where diff --git a/master/Data.Maybe.Relation.Unary.All.Properties.html b/master/Data.Maybe.Relation.Unary.All.Properties.html index 157b584daf..05cc9171ee 100644 --- a/master/Data.Maybe.Relation.Unary.All.Properties.html +++ b/master/Data.Maybe.Relation.Unary.All.Properties.html @@ -24,8 +24,8 @@ a b p q : Level A : Set a B : Set b - P : Pred A p - Q : Pred B q + P : Pred A p + Q : Pred B q ------------------------------------------------------------------------ -- Relationship with other combinators @@ -56,7 +56,7 @@ -- A variant of All.map. -gmap : {f : A B} P Q f All P All Q map f +gmap : {f : A B} P Q f All P All Q map f gmap g = map⁺ All.map g ------------------------------------------------------------------------ diff --git a/master/Data.Maybe.Relation.Unary.All.html b/master/Data.Maybe.Relation.Unary.All.html index 4a08fbd5b9..6615aedc20 100644 --- a/master/Data.Maybe.Relation.Unary.All.html +++ b/master/Data.Maybe.Relation.Unary.All.html @@ -19,20 +19,20 @@ open import Level open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) open import Relation.Unary -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) import Relation.Nullary.Decidable as Dec ------------------------------------------------------------------------ -- Definition -data All {a p} {A : Set a} (P : Pred A p) : Pred (Maybe A) (a p) where +data All {a p} {A : Set a} (P : Pred A p) : Pred (Maybe A) (a p) where just : {x} P x All P (just x) nothing : All P nothing ------------------------------------------------------------------------ -- Basic operations -module _ {a p} {A : Set a} {P : Pred A p} where +module _ {a p} {A : Set a} {P : Pred A p} where drop-just : {x} All P (just x) P x drop-just (just px) = px @@ -40,83 +40,83 @@ just-equivalence : {x} P x All P (just x) just-equivalence = mk⇔ just drop-just - map : {q} {Q : Pred A q} P Q All P All Q + map : {q} {Q : Pred A q} P Q All P All Q map f (just px) = just (f px) map f nothing = nothing - fromAny : Any P All P + fromAny : Any P All P fromAny (just px) = just px ------------------------------------------------------------------------ -- (un/)zip(/With) -module _ {a p q r} {A : Set a} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where +module _ {a p q r} {A : Set a} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where - zipWith : P Q R All P All Q All R + zipWith : P Q R All P All Q All R zipWith f (just px , just qx) = just (f (px , qx)) zipWith f (nothing , nothing) = nothing - unzipWith : P Q R All P All Q All R + unzipWith : P Q R All P All Q All R unzipWith f (just px) = Product.map just just (f px) unzipWith f nothing = nothing , nothing -module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where +module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where - zip : All P All Q All (P Q) + zip : All P All Q All (P Q) zip = zipWith id - unzip : All (P Q) All P All Q + unzip : All (P Q) All P All Q unzip = unzipWith id ------------------------------------------------------------------------ -- Traversable-like functions -module _ {a f} p {A : Set a} {P : Pred A (a p)} {F} +module _ {a f} p {A : Set a} {P : Pred A (a p)} {F} (App : RawApplicative {a p} {f} F) where open RawApplicative App - sequenceA : All (F ∘′ P) F ∘′ All P + sequenceA : All (F ∘′ P) F ∘′ All P sequenceA nothing = pure nothing sequenceA (just px) = just <$> px - mapA : {q} {Q : Pred A q} (Q F ∘′ P) All Q (F ∘′ All P) + mapA : {q} {Q : Pred A q} (Q F ∘′ P) All Q (F ∘′ All P) mapA f = sequenceA ∘′ map f - forA : {q} {Q : Pred A q} {xs} All Q xs (Q F ∘′ P) F (All P xs) + forA : {q} {Q : Pred A q} {xs} All Q xs (Q F ∘′ P) F (All P xs) forA qxs f = mapA f qxs -module _ {a f} p {A : Set a} {P : Pred A (a p)} {M} +module _ {a f} p {A : Set a} {P : Pred A (a p)} {M} (Mon : RawMonad {a p} {f} M) where private App = RawMonad.rawApplicative Mon - sequenceM : All (M ∘′ P) M ∘′ All P + sequenceM : All (M ∘′ P) M ∘′ All P sequenceM = sequenceA p App - mapM : {q} {Q : Pred A q} (Q M ∘′ P) All Q (M ∘′ All P) + mapM : {q} {Q : Pred A q} (Q M ∘′ P) All Q (M ∘′ All P) mapM = mapA p App - forM : {q} {Q : Pred A q} {xs} All Q xs (Q M ∘′ P) M (All P xs) + forM : {q} {Q : Pred A q} {xs} All Q xs (Q M ∘′ P) M (All P xs) forM = forA p App ------------------------------------------------------------------------ -- Seeing All as a predicate transformer -module _ {a p} {A : Set a} {P : Pred A p} where +module _ {a p} {A : Set a} {P : Pred A p} where - dec : Decidable P Decidable (All P) - dec P-dec nothing = yes nothing - dec P-dec (just x) = Dec.map just-equivalence (P-dec x) + dec : Decidable P Decidable (All P) + dec P-dec nothing = yes nothing + dec P-dec (just x) = Dec.map just-equivalence (P-dec x) - universal : Universal P Universal (All P) + universal : Universal P Universal (All P) universal P-universal (just x) = just (P-universal x) universal P-universal nothing = nothing - irrelevant : Irrelevant P Irrelevant (All P) + irrelevant : Irrelevant P Irrelevant (All P) irrelevant P-irrelevant (just p) (just q) = cong just (P-irrelevant p q) irrelevant P-irrelevant nothing nothing = refl - satisfiable : Satisfiable (All P) + satisfiable : Satisfiable (All P) satisfiable = nothing , nothing \ No newline at end of file diff --git a/master/Data.Maybe.Relation.Unary.Any.html b/master/Data.Maybe.Relation.Unary.Any.html index 933edd9604..0b84e47586 100644 --- a/master/Data.Maybe.Relation.Unary.Any.html +++ b/master/Data.Maybe.Relation.Unary.Any.html @@ -16,19 +16,19 @@ open import Level open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) open import Relation.Unary -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) import Relation.Nullary.Decidable as Dec ------------------------------------------------------------------------ -- Definition -data Any {a p} {A : Set a} (P : Pred A p) : Pred (Maybe A) (a p) where +data Any {a p} {A : Set a} (P : Pred A p) : Pred (Maybe A) (a p) where just : {x} P x Any P (just x) ------------------------------------------------------------------------ -- Basic operations -module _ {a p} {A : Set a} {P : Pred A p} where +module _ {a p} {A : Set a} {P : Pred A p} where drop-just : {x} Any P (just x) P x drop-just (just px) = px @@ -36,7 +36,7 @@ just-equivalence : {x} P x Any P (just x) just-equivalence = mk⇔ just drop-just - map : {q} {Q : Pred A q} P Q Any P Any Q + map : {q} {Q : Pred A q} P Q Any P Any Q map f (just px) = just (f px) satisfied : {x} Any P x P @@ -45,34 +45,34 @@ ------------------------------------------------------------------------ -- (un/)zip(/With) -module _ {a p q r} {A : Set a} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where +module _ {a p q r} {A : Set a} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where - zipWith : P Q R Any P Any Q Any R + zipWith : P Q R Any P Any Q Any R zipWith f (just px , just qx) = just (f (px , qx)) - unzipWith : P Q R Any P Any Q Any R + unzipWith : P Q R Any P Any Q Any R unzipWith f (just px) = Product.map just just (f px) -module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where +module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where - zip : Any P Any Q Any (P Q) + zip : Any P Any Q Any (P Q) zip = zipWith id - unzip : Any (P Q) Any P Any Q + unzip : Any (P Q) Any P Any Q unzip = unzipWith id ------------------------------------------------------------------------ -- Seeing Any as a predicate transformer -module _ {a p} {A : Set a} {P : Pred A p} where +module _ {a p} {A : Set a} {P : Pred A p} where - dec : Decidable P Decidable (Any P) - dec P-dec nothing = no λ () - dec P-dec (just x) = Dec.map just-equivalence (P-dec x) + dec : Decidable P Decidable (Any P) + dec P-dec nothing = no λ () + dec P-dec (just x) = Dec.map just-equivalence (P-dec x) - irrelevant : Irrelevant P Irrelevant (Any P) + irrelevant : Irrelevant P Irrelevant (Any P) irrelevant P-irrelevant (just p) (just q) = cong just (P-irrelevant p q) - satisfiable : Satisfiable P Satisfiable (Any P) + satisfiable : Satisfiable P Satisfiable (Any P) satisfiable P-satisfiable = Product.map just just P-satisfiable \ No newline at end of file diff --git a/master/Data.Nat.Base.html b/master/Data.Nat.Base.html index 077ac90d19..5ecbddb706 100644 --- a/master/Data.Nat.Base.html +++ b/master/Data.Nat.Base.html @@ -20,8 +20,8 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Unary using (Pred) ------------------------------------------------------------------------ -- Types @@ -86,16 +86,16 @@ m > n = n < m _≰_ : Rel 0ℓ -a b = ¬ a b +a b = ¬ a b _≮_ : Rel 0ℓ -a b = ¬ a < b +a b = ¬ a < b _≱_ : Rel 0ℓ -a b = ¬ a b +a b = ¬ a b _≯_ : Rel 0ℓ -a b = ¬ a > b +a b = ¬ a > b ------------------------------------------------------------------------ -- Simple predicates @@ -127,7 +127,7 @@ -- Constructors ≢-nonZero : {n} n 0 NonZero n -≢-nonZero {zero} 0≢0 = contradiction refl 0≢0 +≢-nonZero {zero} 0≢0 = contradiction refl 0≢0 ≢-nonZero {suc n} n≢0 = _ >-nonZero : {n} n > 0 NonZero n diff --git a/master/Data.Nat.Binary.Base.html b/master/Data.Nat.Binary.Base.html index c2657709ea..26a292d503 100644 --- a/master/Data.Nat.Binary.Base.html +++ b/master/Data.Nat.Binary.Base.html @@ -22,7 +22,7 @@ open import Level using (0ℓ) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) ------------------------------------------------------------------------ -- Definition @@ -56,16 +56,16 @@ x y = y x _≮_ : Rel ℕᵇ 0ℓ -x y = ¬ (x < y) +x y = ¬ (x < y) _≯_ : Rel ℕᵇ 0ℓ -x y = ¬ (x > y) +x y = ¬ (x > y) _≰_ : Rel ℕᵇ 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≱_ : Rel ℕᵇ 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) ------------------------------------------------------------------------ -- Basic operations diff --git a/master/Data.Nat.Binary.Properties.html b/master/Data.Nat.Binary.Properties.html index 51ba5760f8..c18f0933de 100644 --- a/master/Data.Nat.Binary.Properties.html +++ b/master/Data.Nat.Binary.Properties.html @@ -43,9 +43,9 @@ open import Relation.Binary.PropositionalEquality.Properties using (isDecEquivalence; setoid; decSetoid; module ≡-Reasoning; isEquivalence) -open import Relation.Nullary using (¬_; yes; no) +open import Relation.Nullary using (¬_; yes; no) import Relation.Nullary.Decidable as Dec -open import Relation.Nullary.Negation.Core using (contradiction) +open import Relation.Nullary.Negation.Core using (contradiction) open import Algebra.Definitions {A = ℕᵇ} _≡_ open import Algebra.Structures {A = ℕᵇ} _≡_ @@ -78,16 +78,16 @@ 1+[2_]-injective : Injective _≡_ _≡_ 1+[2_] 1+[2_]-injective refl = refl -_≟_ : DecidableEquality ℕᵇ -zero zero = yes refl -zero 2[1+ _ ] = no λ() -zero 1+[2 _ ] = no λ() -2[1+ _ ] zero = no λ() -2[1+ x ] 2[1+ y ] = Dec.map′ (cong 2[1+_]) 2[1+_]-injective (x y) -2[1+ _ ] 1+[2 _ ] = no λ() -1+[2 _ ] zero = no λ() -1+[2 _ ] 2[1+ _ ] = no λ() -1+[2 x ] 1+[2 y ] = Dec.map′ (cong 1+[2_]) 1+[2_]-injective (x y) +_≟_ : DecidableEquality ℕᵇ +zero zero = yes refl +zero 2[1+ _ ] = no λ() +zero 1+[2 _ ] = no λ() +2[1+ _ ] zero = no λ() +2[1+ x ] 2[1+ y ] = Dec.map′ (cong 2[1+_]) 2[1+_]-injective (x y) +2[1+ _ ] 1+[2 _ ] = no λ() +1+[2 _ ] zero = no λ() +1+[2 _ ] 2[1+ _ ] = no λ() +1+[2 x ] 1+[2 y ] = Dec.map′ (cong 1+[2_]) 1+[2_]-injective (x y) ≡-isDecEquivalence : IsDecEquivalence {A = ℕᵇ} _≡_ ≡-isDecEquivalence = isDecEquivalence _≟_ @@ -195,10 +195,10 @@ x≡y = toℕ-injective xN≡yN toℕ-injective {2[1+ x ]} {1+[2 y ]} 2[1+xN]≡1+2yN = - contradiction 2[1+xN]≡1+2yN (ℕ.even≢odd (ℕ.suc (toℕ x)) (toℕ y)) + contradiction 2[1+xN]≡1+2yN (ℕ.even≢odd (ℕ.suc (toℕ x)) (toℕ y)) toℕ-injective {1+[2 x ]} {2[1+ y ]} 1+2xN≡2[1+yN] = - contradiction (sym 1+2xN≡2[1+yN]) (ℕ.even≢odd (ℕ.suc (toℕ y)) (toℕ x)) + contradiction (sym 1+2xN≡2[1+yN]) (ℕ.even≢odd (ℕ.suc (toℕ y)) (toℕ x)) toℕ-injective {1+[2 x ]} {1+[2 y ]} 1+2xN≡1+2yN = cong 1+[2_] x≡y where @@ -258,7 +258,7 @@ x≮0 () x≢0⇒x>0 : x zero x > zero -x≢0⇒x>0 {zero} 0≢0 = contradiction refl 0≢0 +x≢0⇒x>0 {zero} 0≢0 = contradiction refl 0≢0 x≢0⇒x>0 {2[1+ _ ]} _ = 0<even x≢0⇒x>0 {1+[2 _ ]} _ = 0<odd @@ -327,8 +327,8 @@ rewrite ℕ.*-distribˡ-+ 2 1 (toℕ x) = even<odd (toℕ-cancel-< (ℕ.*-cancelˡ-< 2 _ _ (ℕ.≤-trans (s≤s (ℕ.n≤1+n _)) (s<s⁻¹ x<y)))) toℕ-cancel-< {1+[2 x ]} {2[1+ y ]} x<y with toℕ x ℕ.≟ toℕ y -... | yes x≡y = odd<even (inj₂ (toℕ-injective x≡y)) -... | no x≢y +... | yes x≡y = odd<even (inj₂ (toℕ-injective x≡y)) +... | no x≢y rewrite ℕ.+-suc (toℕ y) (toℕ y ℕ.+ 0) = odd<even (inj₁ (toℕ-cancel-< (ℕ.≤∧≢⇒< (ℕ.*-cancelˡ-≤ 2 (ℕ.+-cancelˡ-≤ 2 _ _ x<y)) x≢y))) toℕ-cancel-< {1+[2 x ]} {1+[2 y ]} x<y = @@ -356,11 +356,11 @@ ------------------------------------------------------------------------ -- Relational properties of _<_ -<-irrefl : Irreflexive _≡_ _<_ +<-irrefl : Irreflexive _≡_ _<_ <-irrefl refl (even<even x<x) = <-irrefl refl x<x <-irrefl refl (odd<odd x<x) = <-irrefl refl x<x -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans {zero} {_} {2[1+ _ ]} _ _ = 0<even <-trans {zero} {_} {1+[2 _ ]} _ _ = 0<odd <-trans (even<even x<y) (even<even y<z) = even<even (<-trans x<y y<z) @@ -376,37 +376,37 @@ <-trans (odd<odd x<y) (odd<even (inj₂ refl)) = odd<even (inj₁ x<y) <-trans (odd<odd x<y) (odd<odd y<z) = odd<odd (<-trans x<y y<z) -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym {x} {y} = trans∧irr⇒asym refl <-trans <-irrefl {x} {y} -- Should not be implemented via the morphism `toℕ` in order to -- preserve O(log n) time requirement. -<-cmp : Trichotomous _≡_ _<_ -<-cmp zero zero = tri≈ x≮0 refl x≮0 -<-cmp zero 2[1+ _ ] = tri< 0<even (λ()) x≮0 -<-cmp zero 1+[2 _ ] = tri< 0<odd (λ()) x≮0 -<-cmp 2[1+ _ ] zero = tri> (λ()) (λ()) 0<even +<-cmp : Trichotomous _≡_ _<_ +<-cmp zero zero = tri≈ x≮0 refl x≮0 +<-cmp zero 2[1+ _ ] = tri< 0<even (λ()) x≮0 +<-cmp zero 1+[2 _ ] = tri< 0<odd (λ()) x≮0 +<-cmp 2[1+ _ ] zero = tri> (λ()) (λ()) 0<even <-cmp 2[1+ x ] 2[1+ y ] with <-cmp x y -... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = even<even x<y -... | tri≈ _ refl _ = tri≈ (<-irrefl refl) refl (<-irrefl refl) -... | tri> _ _ x>y = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = even<even x>y +... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = even<even x<y +... | tri≈ _ refl _ = tri≈ (<-irrefl refl) refl (<-irrefl refl) +... | tri> _ _ x>y = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = even<even x>y <-cmp 2[1+ x ] 1+[2 y ] with <-cmp x y -... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = even<odd x<y -... | tri≈ _ refl _ = tri> (>⇒≮ gt) (>⇒≢ gt) gt +... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = even<odd x<y +... | tri≈ _ refl _ = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = subst (_< 2[1+ x ]) refl (1+[2x]<2[1+x] x) -... | tri> _ _ y<x = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = odd<even (inj₁ y<x) -<-cmp 1+[2 _ ] zero = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = 0<odd +... | tri> _ _ y<x = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = odd<even (inj₁ y<x) +<-cmp 1+[2 _ ] zero = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = 0<odd <-cmp 1+[2 x ] 2[1+ y ] with <-cmp x y -... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = odd<even (inj₁ x<y) -... | tri≈ _ x≡y _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = odd<even (inj₂ x≡y) -... | tri> _ _ x>y = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = even<odd x>y +... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = odd<even (inj₁ x<y) +... | tri≈ _ x≡y _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = odd<even (inj₂ x≡y) +... | tri> _ _ x>y = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = even<odd x>y <-cmp 1+[2 x ] 1+[2 y ] with <-cmp x y -... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = odd<odd x<y -... | tri≈ _ refl _ = tri≈ (≡⇒≮ refl) refl (≡⇒≯ refl) -... | tri> _ _ x>y = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = odd<odd x>y +... | tri< x<y _ _ = tri< lt (<⇒≢ lt) (<⇒≯ lt) where lt = odd<odd x<y +... | tri≈ _ refl _ = tri≈ (≡⇒≮ refl) refl (≡⇒≯ refl) +... | tri> _ _ x>y = tri> (>⇒≮ gt) (>⇒≢ gt) gt where gt = odd<odd x>y -_<?_ : Decidable _<_ +_<?_ : Decidable _<_ _<?_ = tri⇒dec< <-cmp ------------------------------------------------------------------------ @@ -459,27 +459,27 @@ -- Basic properties <⇒≱ : _<_ _≱_ -<⇒≱ x<y (inj₁ y<x) = contradiction y<x (<⇒≯ x<y) -<⇒≱ x<y (inj₂ y≡x) = contradiction (sym y≡x) (<⇒≢ x<y) +<⇒≱ x<y (inj₁ y<x) = contradiction y<x (<⇒≯ x<y) +<⇒≱ x<y (inj₂ y≡x) = contradiction (sym y≡x) (<⇒≢ x<y) ≤⇒≯ : _≤_ _≯_ ≤⇒≯ x≤y x>y = <⇒≱ x>y x≤y ≮⇒≥ : _≮_ _≥_ ≮⇒≥ {x} {y} x≮y with <-cmp x y -... | tri< lt _ _ = contradiction lt x≮y -... | tri≈ _ eq _ = inj₂ (sym eq) -... | tri> _ _ y<x = <⇒≤ y<x +... | tri< lt _ _ = contradiction lt x≮y +... | tri≈ _ eq _ = inj₂ (sym eq) +... | tri> _ _ y<x = <⇒≤ y<x ≰⇒> : _≰_ _>_ ≰⇒> {x} {y} x≰y with <-cmp x y -... | tri< lt _ _ = contradiction (<⇒≤ lt) x≰y -... | tri≈ _ eq _ = contradiction (inj₂ eq) x≰y -... | tri> _ _ x>y = x>y +... | tri< lt _ _ = contradiction (<⇒≤ lt) x≰y +... | tri≈ _ eq _ = contradiction (inj₂ eq) x≰y +... | tri> _ _ x>y = x>y ≤∧≢⇒< : {x y} x y x y x < y ≤∧≢⇒< (inj₁ x<y) _ = x<y -≤∧≢⇒< (inj₂ x≡y) x≢y = contradiction x≡y x≢y +≤∧≢⇒< (inj₂ x≡y) x≢y = contradiction x≡y x≢y 0≤x : x zero x 0≤x zero = inj₂ refl @@ -523,13 +523,13 @@ ------------------------------------------------------------------------ -- Relational properties of _≤_ -≤-refl : Reflexive _≤_ +≤-refl : Reflexive _≤_ ≤-refl = inj₂ refl ≤-reflexive : _≡_ _≤_ ≤-reflexive {x} {_} refl = ≤-refl {x} -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans = StrictToNonStrict.trans isEquivalence (resp₂ _<_) <-trans <-≤-trans : {x y z} x < y y z x < z @@ -540,22 +540,22 @@ ≤-<-trans (inj₁ x<y) y<z = <-trans x<y y<z ≤-<-trans (inj₂ refl) y<z = y<z -≤-antisym : Antisymmetric _≡_ _≤_ +≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym = StrictToNonStrict.antisym isEquivalence <-trans <-irrefl -≤-total : Total _≤_ +≤-total : Total _≤_ ≤-total x y with <-cmp x y -... | tri< x<y _ _ = inj₁ (<⇒≤ x<y) -... | tri≈ _ x≡y _ = inj₁ (≤-reflexive x≡y) -... | tri> _ _ y<x = inj₂ (<⇒≤ y<x) +... | tri< x<y _ _ = inj₁ (<⇒≤ x<y) +... | tri≈ _ x≡y _ = inj₁ (≤-reflexive x≡y) +... | tri> _ _ y<x = inj₂ (<⇒≤ y<x) -- Should not be implemented via the morphism `toℕ` in order to -- preserve O(log n) time requirement. -_≤?_ : Decidable _≤_ +_≤?_ : Decidable _≤_ x ≤? y with <-cmp x y -... | tri< x<y _ _ = yes (<⇒≤ x<y) -... | tri≈ _ x≡y _ = yes (≤-reflexive x≡y) -... | tri> _ _ y<x = no (<⇒≱ y<x) +... | tri< x<y _ _ = yes (<⇒≤ x<y) +... | tri≈ _ x≡y _ = yes (≤-reflexive x≡y) +... | tri> _ _ y<x = no (<⇒≱ y<x) ------------------------------------------------------------------------ @@ -911,7 +911,7 @@ x≢0⇒x+y≢0 : {x} (y : ℕᵇ) x zero x + y zero x≢0⇒x+y≢0 {2[1+ _ ]} zero _ = λ() -x≢0⇒x+y≢0 {zero} _ 0≢0 = contradiction refl 0≢0 +x≢0⇒x+y≢0 {zero} _ 0≢0 = contradiction refl 0≢0 ------------------------------------------------------------------------ -- Properties of _*_ @@ -1299,15 +1299,15 @@ double-cancel-≤ : {x y} double x double y x y double-cancel-≤ {x} {y} 2x≤2y with <-cmp x y -... | tri< x<y _ _ = <⇒≤ x<y -... | tri≈ _ x≡y _ = ≤-reflexive x≡y -... | tri> _ _ x>y = contradiction 2x≤2y (<⇒≱ (double-mono-< x>y)) +... | tri< x<y _ _ = <⇒≤ x<y +... | tri≈ _ x≡y _ = ≤-reflexive x≡y +... | tri> _ _ x>y = contradiction 2x≤2y (<⇒≱ (double-mono-< x>y)) double-cancel-< : {x y} double x < double y x < y double-cancel-< {x} {y} 2x<2y with <-cmp x y -... | tri< x<y _ _ = x<y -... | tri≈ _ refl _ = contradiction 2x<2y (<-irrefl refl) -... | tri> _ _ x>y = contradiction (double-mono-< x>y) (<⇒≯ 2x<2y) +... | tri< x<y _ _ = x<y +... | tri≈ _ refl _ = contradiction 2x<2y (<-irrefl refl) +... | tri> _ _ x>y = contradiction (double-mono-< x>y) (<⇒≯ 2x<2y) x<double[x] : x x zero x < double x x<double[x] x x≢0 = begin-strict @@ -1343,8 +1343,8 @@ suc-injective : Injective _≡_ _≡_ suc suc-injective {zero} {zero} p = refl -suc-injective {zero} {2[1+ y ]} p = contradiction 1+[2 p ]-injective (suc≢0 sym) -suc-injective {2[1+ x ]} {zero} p = contradiction 1+[2 p ]-injective suc≢0 +suc-injective {zero} {2[1+ y ]} p = contradiction 1+[2 p ]-injective (suc≢0 sym) +suc-injective {2[1+ x ]} {zero} p = contradiction 1+[2 p ]-injective suc≢0 suc-injective {2[1+ x ]} {2[1+ y ]} p = cong 2[1+_] (suc-injective 1+[2 p ]-injective) suc-injective {1+[2 x ]} {1+[2 y ]} refl = refl @@ -1458,7 +1458,7 @@ pred-suc 1+[2 x ] = refl suc-pred : x zero suc (pred x) x -suc-pred {zero} 0≢0 = contradiction refl 0≢0 +suc-pred {zero} 0≢0 = contradiction refl 0≢0 suc-pred {2[1+ _ ]} _ = refl suc-pred {1+[2 x ]} _ = sym (1+[2_]-suc-double x) diff --git a/master/Data.Nat.Binary.Subtraction.html b/master/Data.Nat.Binary.Subtraction.html index dbe40f1ea3..5310182ac0 100644 --- a/master/Data.Nat.Binary.Subtraction.html +++ b/master/Data.Nat.Binary.Subtraction.html @@ -26,14 +26,14 @@ open import Function.Base using (_∘_; _$_) open import Level using (0ℓ) open import Relation.Binary - using (Tri; tri<; tri≈; tri>; _Preserves_⟶_; _Preserves₂_⟶_⟶_) + using (Tri; tri<; tri≈; tri>; _Preserves_⟶_; _Preserves₂_⟶_⟶_) open import Relation.Binary.PropositionalEquality.Algebra using (magma) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂; sym; trans; subst; _≢_) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) -open import Relation.Nullary using (Dec; yes; no; does) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary using (Dec; yes; no; does) +open import Relation.Nullary.Negation using (contradiction) open import Algebra.Definitions {A = ℕᵇ} _≡_ open import Algebra.Properties.CommutativeSemigroup +-commutativeSemigroup @@ -54,8 +54,8 @@ x zero = x 2[1+ x ] 2[1+ y ] = double (x y) 1+[2 x ] 1+[2 y ] = double (x y) -2[1+ x ] 1+[2 y ] = if does (x <? y) then 0ᵇ else 1+[2 (x y) ] -1+[2 x ] 2[1+ y ] = if does (x ≤? y) then 0ᵇ else pred (double (x y)) +2[1+ x ] 1+[2 y ] = if does (x <? y) then 0ᵇ else 1+[2 (x y) ] +1+[2 x ] 2[1+ y ] = if does (x ≤? y) then 0ᵇ else pred (double (x y)) ------------------------------------------------------------------------ -- Properties of _∸_ and _≡_ @@ -85,8 +85,8 @@ toℕ 2[1+ x ] ℕ.∸ toℕ 2[1+ y ] where open ≡-Reasoning toℕ-homo-∸ 2[1+ x ] 1+[2 y ] with x <? y -... | yes x<y = sym (ℕ.m≤n⇒m∸n≡0 (toℕ-mono-≤ (inj₁ (even<odd x<y)))) -... | no x≮y = begin +... | yes x<y = sym (ℕ.m≤n⇒m∸n≡0 (toℕ-mono-≤ (inj₁ (even<odd x<y)))) +... | no x≮y = begin ℕ.suc (2 ℕ.* toℕ (x y)) ≡⟨ cong (ℕ.suc (2 ℕ.*_)) (toℕ-homo-∸ x y) ℕ.suc (2 ℕ.* (toℕ x ℕ.∸ toℕ y)) ≡⟨ cong ℕ.suc (ℕ.*-distribˡ-∸ 2 (toℕ x) (toℕ y)) ℕ.suc (2 ℕ.* toℕ x ℕ.∸ 2 ℕ.* toℕ y) ≡⟨ sym (ℕ.+-∸-assoc 1 (ℕ.*-monoʳ-≤ 2 (toℕ-mono-≤ (≮⇒≥ x≮y)))) @@ -95,8 +95,8 @@ where open ≡-Reasoning toℕ-homo-∸ 1+[2 x ] zero = refl toℕ-homo-∸ 1+[2 x ] 2[1+ y ] with x ≤? y -... | yes x≤y = sym (ℕ.m≤n⇒m∸n≡0 (toℕ-mono-≤ (inj₁ (odd<even x≤y)))) -... | no _ = begin +... | yes x≤y = sym (ℕ.m≤n⇒m∸n≡0 (toℕ-mono-≤ (inj₁ (odd<even x≤y)))) +... | no _ = begin toℕ (pred (double (x y))) ≡⟨ toℕ-pred (double (x y)) ℕ.pred (toℕ (double (x y))) ≡⟨ cong ℕ.pred (toℕ-double (x y)) ℕ.pred (2 ℕ.* toℕ (x y)) ≡⟨ cong (ℕ.pred (2 ℕ.*_)) (toℕ-homo-∸ x y) @@ -121,13 +121,13 @@ even∸odd-for≥ : x y 2[1+ x ] 1+[2 y ] 1+[2 (x y) ] even∸odd-for≥ {x} {y} x≥y with x <? y -... | no _ = refl -... | yes x<y = contradiction x≥y (<⇒≱ x<y) +... | no _ = refl +... | yes x<y = contradiction x≥y (<⇒≱ x<y) odd∸even-for> : x > y 1+[2 x ] 2[1+ y ] pred (double (x y)) odd∸even-for> {x} {y} x>y with x ≤? y -... | no _ = refl -... | yes x≤y = contradiction x>y (≤⇒≯ x≤y) +... | no _ = refl +... | yes x≤y = contradiction x>y (≤⇒≯ x≤y) x≤y⇒x∸y≡0 : x y x y 0ᵇ x≤y⇒x∸y≡0 {x} {y} = toℕ-injective trans (toℕ-homo-∸ x y) ℕ.m≤n⇒m∸n≡0 toℕ-mono-≤ diff --git a/master/Data.Nat.Combinatorics.Specification.html b/master/Data.Nat.Combinatorics.Specification.html index 21ea4a0801..3589b186cf 100644 --- a/master/Data.Nat.Combinatorics.Specification.html +++ b/master/Data.Nat.Combinatorics.Specification.html @@ -21,8 +21,8 @@ open import Data.Nat.Properties open import Data.Nat.Combinatorics.Base open import Data.Sum.Base using (inj₁; inj₂) -open import Relation.Nullary.Decidable using (yes; no; does) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (yes; no; does) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.PropositionalEquality.Core using (_≡_; trans; _≢_; subst; refl; sym; cong; cong₂) @@ -87,8 +87,8 @@ k!∣nP′k : {n k} k n k ! n P′ k k!∣nP′k {n} {zero} k≤n = ∣-refl k!∣nP′k n@{suc n-1} k@{suc k-1} k≤n@(s≤s k-1≤n-1) with k-1 n-1 -... | yes refl = ∣-reflexive (sym (nP′n≡n! n)) -... | no k≢n = begin +... | yes refl = ∣-reflexive (sym (nP′n≡n! n)) +... | no k≢n = begin k ! ≡⟨⟩ k * k-1 ! ∣⟨ ∣m∣n⇒∣m+n (*-monoʳ-∣ k (k!∣nP′k k-1≤n-1)) ( k!∣nP′k (≤∧≢⇒< k-1≤n-1 k≢n)) k * (n-1 P′ k-1) + (n-1 P′ k) ≡⟨ P′-rec k≤n @@ -106,11 +106,11 @@ nPk≡n!/[n∸k]! : {n k} k n n P k (n ! / (n k) !) {{(n k) !≢0}} nPk≡n!/[n∸k]! {n} {k} k≤n with k ≤ᵇ n in eq ... | true = nP′k≡n!/[n∸k]! k≤n -... | false = contradiction (≤⇒≤ᵇ k≤n) (subst T eq) +... | false = contradiction (≤⇒≤ᵇ k≤n) (subst T eq) k>n⇒nPk≡0 : {n k} k > n n P k 0 k>n⇒nPk≡0 {n} {k} k>n with k ≤ᵇ n in eq -... | true = contradiction (≤ᵇ⇒≤′ eq) (<⇒≱ k>n) +... | true = contradiction (≤ᵇ⇒≤′ eq) (<⇒≱ k>n) ... | false = refl ------------------------------------------------------------------------ @@ -151,13 +151,13 @@ nCk≡n!/k![n-k]! : {n k} k n n C k (n ! / (k ! * (n k) !)) {{k !* (n k) !≢0}} nCk≡n!/k![n-k]! {n} {k} k≤n with k ≤ᵇ n in eq2 -... | false = contradiction (≤⇒≤ᵇ k≤n) (subst T eq2) +... | false = contradiction (≤⇒≤ᵇ k≤n) (subst T eq2) ... | true with ⊓-sel k (n k) ... | inj₁ k⊓[n∸k]≡k rewrite k⊓[n∸k]≡k = nC′k≡n!/k![n-k]! k≤n ... | inj₂ k⊓[n∸k]≡n∸k rewrite k⊓[n∸k]≡n∸k = trans (C′-sym k≤n) (nC′k≡n!/k![n-k]! k≤n) k>n⇒nCk≡0 : {n k} k > n n C k 0 k>n⇒nCk≡0 {n} {k} k>n with k ≤ᵇ n in eq -... | true = contradiction (≤ᵇ⇒≤′ eq) (<⇒≱ k>n) +... | true = contradiction (≤ᵇ⇒≤′ eq) (<⇒≱ k>n) ... | false = refl \ No newline at end of file diff --git a/master/Data.Nat.Combinatorics.html b/master/Data.Nat.Combinatorics.html index 7dd71765fd..68c8cc0878 100644 --- a/master/Data.Nat.Combinatorics.html +++ b/master/Data.Nat.Combinatorics.html @@ -15,7 +15,7 @@ m/n/o≡m/[n*o]; n/n≡1; +-distrib-/-∣ˡ; m*n/m*o≡n/o) open import Data.Nat.Divisibility using (_∣_; *-monoʳ-∣) open import Data.Nat.Properties -open import Relation.Binary.Definitions using (tri>; tri≈; tri<) +open import Relation.Binary.Definitions using (tri>; tri≈; tri<) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; cong; subst) @@ -162,21 +162,21 @@ nCk+nC[k+1]≡[n+1]C[k+1] : n k n C k + n C (suc k) suc n C suc k nCk+nC[k+1]≡[n+1]C[k+1] n k with <-cmp k n {- case k>n, in which case 1+k>1+n>n -} -... | tri> _ _ k>n = begin-equality +... | tri> _ _ k>n = begin-equality n C k + n C (suc k) ≡⟨ cong (_+ (n C (suc k))) (k>n⇒nCk≡0 k>n) 0 + n C (suc k) ≡⟨⟩ n C (suc k) ≡⟨ k>n⇒nCk≡0 (m<n⇒m<1+n k>n) 0 ≡⟨ k>n⇒nCk≡0 (s<s k>n) suc n C suc k {- case k≡n, in which case 1+k≡1+n>n -} -... | tri≈ _ k≡n _ rewrite k≡n = begin-equality +... | tri≈ _ k≡n _ rewrite k≡n = begin-equality n C n + n C (suc n) ≡⟨ cong (n C n +_) (k>n⇒nCk≡0 (n<1+n n)) n C n + 0 ≡⟨ +-identityʳ (n C n) n C n ≡⟨ nCn≡1 n 1 ≡⟨ nCn≡1 (suc n) suc n C suc n {- case k<n, in which case 1+k<1+n and there's arithmetic to perform -} -... | tri< k<n _ _ = begin-equality +... | tri< k<n _ _ = begin-equality n C k + n C (suc k) ≡⟨ cong (n C k +_) (nCk≡n!/k![n-k]! k<n) n C k + (n! / d[k+1]) diff --git a/master/Data.Nat.Coprimality.html b/master/Data.Nat.Coprimality.html index 37adbe3d7b..cad4625cb8 100644 --- a/master/Data.Nat.Coprimality.html +++ b/master/Data.Nat.Coprimality.html @@ -22,9 +22,9 @@ open import Level using (0ℓ) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; _≢_; refl; trans; cong; subst) -open import Relation.Nullary as Nullary using (¬_; contradiction; map′) +open import Relation.Nullary as Nullary using (¬_; contradiction; map′) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Symmetric; Decidable) +open import Relation.Binary.Definitions using (Symmetric; Decidable) private variable d m n o p : @@ -63,11 +63,11 @@ ------------------------------------------------------------------------ -- Relational properties of Coprime -sym : Symmetric Coprime +sym : Symmetric Coprime sym c = c swap -coprime? : Decidable Coprime -coprime? m n = map′ gcd≡1⇒coprime coprime⇒gcd≡1 (gcd m n 1) +coprime? : Decidable Coprime +coprime? m n = map′ gcd≡1⇒coprime coprime⇒gcd≡1 (gcd m n 1) ------------------------------------------------------------------------ -- Other basic properties @@ -82,8 +82,8 @@ 0-coprimeTo-m⇒m≡1 : Coprime 0 m m 1 0-coprimeTo-m⇒m≡1 {m} coprime = coprime (m ∣0 , ∣-refl) -¬0-coprimeTo-2+ : .{{NonTrivial n}} ¬ Coprime 0 n -¬0-coprimeTo-2+ {n} coprime = contradiction (0-coprimeTo-m⇒m≡1 coprime) (nonTrivial⇒≢1 {n}) +¬0-coprimeTo-2+ : .{{NonTrivial n}} ¬ Coprime 0 n +¬0-coprimeTo-2+ {n} coprime = contradiction (0-coprimeTo-m⇒m≡1 coprime) (nonTrivial⇒≢1 {n}) -- If m and n are coprime, then n + m and n are also coprime. @@ -93,7 +93,7 @@ -- Recomputable recompute : .(Coprime n d) Coprime n d -recompute {n} {d} coprime = Nullary.recompute (coprime? n d) coprime +recompute {n} {d} coprime = Nullary.recompute (coprime? n d) coprime ------------------------------------------------------------------------ -- Relationship with Bezout's lemma @@ -134,5 +134,5 @@ prime⇒coprime : Prime p .{{NonZero n}} n < p Coprime p n prime⇒coprime p n<p (d∣p , d∣n) with prime⇒irreducible p d∣p ... | inj₁ d≡1 = d≡1 -... | inj₂ d≡p@refl = contradiction n<p (≤⇒≯ (∣⇒≤ d∣n)) +... | inj₂ d≡p@refl = contradiction n<p (≤⇒≯ (∣⇒≤ d∣n)) \ No newline at end of file diff --git a/master/Data.Nat.DivMod.Core.html b/master/Data.Nat.DivMod.Core.html index 61624108a5..cbbed87910 100644 --- a/master/Data.Nat.DivMod.Core.html +++ b/master/Data.Nat.DivMod.Core.html @@ -19,8 +19,8 @@ open import Data.Product.Base using (_×_; _,_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; sym; subst; trans) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Negation using (contradiction) open ≤-Reasoning @@ -157,14 +157,14 @@ divₕ-offsetEq d (suc n) zero zero j≤d k≤d (inj₂′ (refl , _)) = divₕ-offsetEq d n d d ≤-refl ≤-refl (inj₂′ (refl , a[modₕ]n<n 0 n d , ≤-refl)) divₕ-offsetEq d (suc n) zero zero j≤d k≤d (inj₃ (_ , 0<mod , mod≤0)) = - contradiction (<-≤-trans 0<mod mod≤0) λ() + contradiction (<-≤-trans 0<mod mod≤0) λ() -- (0 , suc) cases divₕ-offsetEq d (suc n) zero (suc k) j≤d k≤d (inj₁ (refl , _ , 1+k<mod)) = divₕ-offsetEq d n d k ≤-refl (<⇒≤ k≤d) (inj₃ (refl , k<1+a[modₕ]n⇒k≤a[modₕ]n 0 (suc k) n d 1+k<mod , a[modₕ]n<n 0 n d)) divₕ-offsetEq d (suc n) zero (suc k) j≤d k≤d (inj₂′ (refl , mod≤0 , _)) = divₕ-offsetEq d n d k ≤-refl (<⇒≤ k≤d) (inj₃ (refl , subst (k <_) (sym (a+1[modₕ]n≡0⇒a[modₕ]n≡n-1 0 d n (n≤0⇒n≡0 mod≤0))) k≤d , a[modₕ]n<n 0 n d)) divₕ-offsetEq d (suc n) zero (suc k) j≤d k≤d (inj₃ (_ , 1+k<mod , mod≤0)) = - contradiction (<-≤-trans 1+k<mod mod≤0) λ() + contradiction (<-≤-trans 1+k<mod mod≤0) λ() -- (suc , 0) cases divₕ-offsetEq d (suc n) (suc j) zero j≤d k≤d (inj₁ (_ , () , _)) divₕ-offsetEq d (suc n) (suc j) zero j≤d k≤d (inj₂′ (_ , _ , ())) @@ -174,8 +174,8 @@ divₕ-offsetEq d (suc n) (suc j) (suc k) j≤d k≤d (inj₁ (eq , s≤s j≤k , 1+k<mod)) = divₕ-offsetEq d n j k (<⇒≤ j≤d) (<⇒≤ k≤d) (inj₁ (eq , j≤k , k<1+a[modₕ]n⇒k≤a[modₕ]n 0 (suc k) n d 1+k<mod)) divₕ-offsetEq d (suc n) (suc j) (suc k) j≤d k≤d (inj₂′ (eq , mod≤1+j , (s≤s j≤k))) with modₕ 0 d (suc n) d 0 - ... | yes mod≡0 = divₕ-offsetEq d n j k (<⇒≤ j≤d) (<⇒≤ k≤d) (inj₁ (eq , j≤k , subst (k <_) (sym (a+1[modₕ]n≡0⇒a[modₕ]n≡n-1 0 d n mod≡0)) k≤d)) - ... | no mod≢0 = divₕ-offsetEq d n j k (<⇒≤ j≤d) (<⇒≤ k≤d) (inj₂′ (eq , 1+a[modₕ]n≤1+k⇒a[modₕ]n≤k 0 j n d (n≢0⇒n>0 mod≢0) mod≤1+j , j≤k)) + ... | yes mod≡0 = divₕ-offsetEq d n j k (<⇒≤ j≤d) (<⇒≤ k≤d) (inj₁ (eq , j≤k , subst (k <_) (sym (a+1[modₕ]n≡0⇒a[modₕ]n≡n-1 0 d n mod≡0)) k≤d)) + ... | no mod≢0 = divₕ-offsetEq d n j k (<⇒≤ j≤d) (<⇒≤ k≤d) (inj₂′ (eq , 1+a[modₕ]n≤1+k⇒a[modₕ]n≤k 0 j n d (n≢0⇒n>0 mod≢0) mod≤1+j , j≤k)) divₕ-offsetEq d (suc n) (suc j) (suc k) j≤d k≤d (inj₃ (eq , k<mod , mod≤1+j)) = divₕ-offsetEq d n j k (<⇒≤ j≤d) (<⇒≤ k≤d) (inj₃ (eq , k<1+a[modₕ]n⇒k≤a[modₕ]n 0 (suc k) n d k<mod , 1+a[modₕ]n≤1+k⇒a[modₕ]n≤k 0 j n d (≤-<-trans z≤n k<mod) mod≤1+j)) @@ -254,12 +254,12 @@ divₕ-mono-≤ {acc} k {_} {_} {suc o} {suc p} (s≤s m≤n) (s≤s p≤o) rewrite +-suc k o | +-suc k p = divₕ-mono-≤ (suc k) m≤n p≤o divₕ-mono-≤ {acc} k {suc m} {suc n} {o} {0} (s≤s m≤n) z≤n with o <? suc m -... | no o≮1+m rewrite +-identityʳ k = begin +... | no o≮1+m rewrite +-identityʳ k = begin divₕ acc (k + o) (suc m) o ≡⟨ divₕ-finish (k + o) (suc m) o (≮⇒≥ o≮1+m) acc ≤⟨ n≤1+n acc suc acc ≤⟨ acc≤divₕ[acc] k n k divₕ (suc acc) k n k -... | yes o<1+m rewrite +-identityʳ k = begin +... | yes o<1+m rewrite +-identityʳ k = begin divₕ acc (k + o) (suc m) o ≡⟨ divₕ-restart (k + o) (suc m) o o<1+m divₕ (suc acc) (k + o) (m o) (k + o) ≤⟨ divₕ-mono-≤ 0 (≤-trans (m∸n≤m m o) m≤n) (m≤m+n k o) divₕ (suc acc) k n k diff --git a/master/Data.Nat.DivMod.html b/master/Data.Nat.DivMod.html index 566737f3e1..430e0ddddb 100644 --- a/master/Data.Nat.DivMod.html +++ b/master/Data.Nat.DivMod.html @@ -22,7 +22,7 @@ open import Function.Base using (_$_; _∘_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong; cong₂; refl; trans; _≢_; sym) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Negation using (contradiction) open ≤-Reasoning @@ -243,12 +243,12 @@ m/n≡0⇒m<n : {m n} .{{_ : NonZero n}} m / n 0 m < n m/n≡0⇒m<n {m} {n@(suc _)} m/n≡0 with <-≤-connex m n ... | inj₁ m<n = m<n -... | inj₂ n≤m = contradiction m/n≡0 (≢-nonZero⁻¹ _) +... | inj₂ n≤m = contradiction m/n≡0 (≢-nonZero⁻¹ _) where instance _ = >-nonZero (m≥n⇒m/n>0 n≤m) m/n≢0⇒n≤m : {m n} .{{_ : NonZero n}} m / n 0 n m m/n≢0⇒n≤m {m} {n@(suc _)} m/n≢0 with <-≤-connex m n -... | inj₁ m<n = contradiction (m<n⇒m/n≡0 m<n) m/n≢0 +... | inj₁ m<n = contradiction (m<n⇒m/n≡0 m<n) m/n≢0 ... | inj₂ n≤m = n≤m +-distrib-/ : m n {d} .{{_ : NonZero d}} m % d + n % d < d diff --git a/master/Data.Nat.Divisibility.Core.html b/master/Data.Nat.Divisibility.Core.html index 4cf019cffe..5c38617b46 100644 --- a/master/Data.Nat.Divisibility.Core.html +++ b/master/Data.Nat.Divisibility.Core.html @@ -15,7 +15,7 @@ open import Data.Nat.Base using (; _*_; _<_; NonTrivial) open import Data.Nat.Properties -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) @@ -41,7 +41,7 @@ equality : n quotient * m _∤_ : Rel _ -m n = ¬ (m n) +m n = ¬ (m n) -- Smart constructor diff --git a/master/Data.Nat.Divisibility.html b/master/Data.Nat.Divisibility.html index 9cf12a9f81..ef7a9bc211 100644 --- a/master/Data.Nat.Divisibility.html +++ b/master/Data.Nat.Divisibility.html @@ -16,14 +16,14 @@ open import Function.Base using (_∘′_; _$_; flip) open import Function.Bundles using (_⇔_; mk⇔) open import Level using (0ℓ) -open import Relation.Nullary.Decidable as Dec using (yes; no) -open import Relation.Nullary.Negation.Core using (contradiction) +open import Relation.Nullary.Decidable as Dec using (yes; no) +open import Relation.Nullary.Negation.Core using (contradiction) open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Preorder; Poset) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder) open import Relation.Binary.Definitions - using (Reflexive; Transitive; Antisymmetric; Decidable) + using (Reflexive; Transitive; Antisymmetric; Decidable) import Relation.Binary.Reasoning.Preorder as ≲-Reasoning open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; sym; cong; subst) @@ -96,7 +96,7 @@ ∣⇒≤ {n@.(q * m)} {m} (divides-refl q@(suc p)) = m≤m+n m (p * m) >⇒∤ : .{{_ : NonZero n}} m > n m n ->⇒∤ {n@(suc _)} n<m@(s<s _) m∣n = contradiction (∣⇒≤ m∣n) (<⇒≱ n<m) +>⇒∤ {n@(suc _)} n<m@(s<s _) m∣n = contradiction (∣⇒≤ m∣n) (<⇒≱ n<m) ------------------------------------------------------------------------ -- _∣_ is a partial order @@ -106,24 +106,24 @@ ∣-reflexive : _≡_ _∣_ ∣-reflexive {n} refl = divides 1 (sym (*-identityˡ n)) -∣-refl : Reflexive _∣_ +∣-refl : Reflexive _∣_ ∣-refl = ∣-reflexive refl -∣-trans : Transitive _∣_ +∣-trans : Transitive _∣_ ∣-trans (divides-refl p) (divides-refl q) = divides (q * p) (sym (*-assoc q p _)) -∣-antisym : Antisymmetric _≡_ _∣_ +∣-antisym : Antisymmetric _≡_ _∣_ ∣-antisym {m} {zero} _ q∣p = m∣n⇒n≡m*quotient q∣p ∣-antisym {zero} {n} p∣q _ = sym (m∣n⇒n≡m*quotient p∣q) ∣-antisym {suc m} {suc n} p∣q q∣p = ≤-antisym (∣⇒≤ p∣q) (∣⇒≤ q∣p) infix 4 _∣?_ -_∣?_ : Decidable _∣_ -zero ∣? zero = yes (divides-refl 0) -zero ∣? suc m = no ((λ()) ∘′ ∣-antisym (divides-refl 0)) -n@(suc _) ∣? m = Dec.map (m%n≡0⇔n∣m m n) (m % n 0) +_∣?_ : Decidable _∣_ +zero ∣? zero = yes (divides-refl 0) +zero ∣? suc m = no ((λ()) ∘′ ∣-antisym (divides-refl 0)) +n@(suc _) ∣? m = Dec.map (m%n≡0⇔n∣m m n) (m % n 0) ∣-isPreorder : IsPreorder _≡_ _∣_ ∣-isPreorder = record diff --git a/master/Data.Nat.GCD.html b/master/Data.Nat.GCD.html index 0759272fcb..b50398cb88 100644 --- a/master/Data.Nat.GCD.html +++ b/master/Data.Nat.GCD.html @@ -22,13 +22,13 @@ open import Function.Base using (_$_; _∘_) open import Induction using (build) open import Induction.Lexicographic using (_⊗_; [_⊗_]) -open import Relation.Binary.Definitions using (tri<; tri>; tri≈; Symmetric) +open import Relation.Binary.Definitions using (tri<; tri>; tri≈; Symmetric) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; _≢_; subst; cong) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) -open import Relation.Nullary.Decidable using (Dec) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (Dec) +open import Relation.Nullary.Negation using (contradiction) import Relation.Nullary.Decidable as Dec open import Algebra.Definitions {A = } _≡_ as Algebra @@ -50,9 +50,9 @@ gcd : gcd m n with <-cmp m n -... | tri< m<n _ _ = gcd′ n m (<-wellFounded-fast n) m<n -... | tri≈ _ _ _ = m -... | tri> _ _ n<m = gcd′ m n (<-wellFounded-fast m) n<m +... | tri< m<n _ _ = gcd′ n m (<-wellFounded-fast n) m<n +... | tri≈ _ _ _ = m +... | tri> _ _ n<m = gcd′ m n (<-wellFounded-fast m) n<m ------------------------------------------------------------------------ -- Core properties of gcd′ @@ -73,21 +73,21 @@ gcd[m,n]∣m : m n gcd m n m gcd[m,n]∣m m n with <-cmp m n -... | tri< n<m _ _ = proj₂ (gcd′[m,n]∣m,n {n} {m} _ _) -... | tri≈ _ _ _ = ∣-refl -... | tri> _ _ m<n = proj₁ (gcd′[m,n]∣m,n {m} {n} _ _) +... | tri< n<m _ _ = proj₂ (gcd′[m,n]∣m,n {n} {m} _ _) +... | tri≈ _ _ _ = ∣-refl +... | tri> _ _ m<n = proj₁ (gcd′[m,n]∣m,n {m} {n} _ _) gcd[m,n]∣n : m n gcd m n n gcd[m,n]∣n m n with <-cmp m n -... | tri< n<m _ _ = proj₁ (gcd′[m,n]∣m,n {n} {m} _ _) -... | tri≈ _ ≡.refl _ = ∣-refl -... | tri> _ _ m<n = proj₂ (gcd′[m,n]∣m,n {m} {n} _ _) +... | tri< n<m _ _ = proj₁ (gcd′[m,n]∣m,n {n} {m} _ _) +... | tri≈ _ ≡.refl _ = ∣-refl +... | tri> _ _ m<n = proj₂ (gcd′[m,n]∣m,n {m} {n} _ _) gcd-greatest : {m n c} c m c n c gcd m n gcd-greatest {m} {n} c∣m c∣n with <-cmp m n -... | tri< n<m _ _ = gcd′-greatest _ _ c∣n c∣m -... | tri≈ _ _ _ = c∣m -... | tri> _ _ m<n = gcd′-greatest _ _ c∣m c∣n +... | tri< n<m _ _ = gcd′-greatest _ _ c∣n c∣m +... | tri≈ _ _ _ = c∣m +... | tri> _ _ m<n = gcd′-greatest _ _ c∣m c∣n ------------------------------------------------------------------------ -- Other properties @@ -104,11 +104,11 @@ gcd[m,n]≡0⇒m≡0 : {m n} gcd m n 0 m 0 gcd[m,n]≡0⇒m≡0 {zero} {n} eq = ≡.refl -gcd[m,n]≡0⇒m≡0 {suc m} {n} eq = contradiction eq (gcd[m,n]≢0 (suc m) n (inj₁ λ())) +gcd[m,n]≡0⇒m≡0 {suc m} {n} eq = contradiction eq (gcd[m,n]≢0 (suc m) n (inj₁ λ())) gcd[m,n]≡0⇒n≡0 : m {n} gcd m n 0 n 0 gcd[m,n]≡0⇒n≡0 m {zero} eq = ≡.refl -gcd[m,n]≡0⇒n≡0 m {suc n} eq = contradiction eq (gcd[m,n]≢0 m (suc n) (inj₂ λ())) +gcd[m,n]≡0⇒n≡0 m {suc n} eq = contradiction eq (gcd[m,n]≢0 m (suc n) (inj₂ λ())) gcd-comm : Commutative gcd gcd-comm m n = ∣-antisym @@ -281,9 +281,9 @@ -- gcd as a proposition is decidable -gcd? : (m n d : ) Dec (GCD m n d) +gcd? : (m n d : ) Dec (GCD m n d) gcd? m n d = - Dec.map′ { ≡.refl gcd-GCD m n }) (GCD.unique (gcd-GCD m n)) + Dec.map′ { ≡.refl gcd-GCD m n }) (GCD.unique (gcd-GCD m n)) (gcd m n d) GCD-* : {m n d c} .{{_ : NonZero c}} GCD (m * c) (n * c) (d * c) GCD m n d @@ -323,7 +323,7 @@ -- Various properties about Identity. - sym : {d} Symmetric (Identity d) + sym : {d} Symmetric (Identity d) sym (+- x y eq) = -+ y x eq sym (-+ x y eq) = +- y x eq @@ -361,7 +361,7 @@ -- Various properties about Lemma. - sym : Symmetric Lemma + sym : Symmetric Lemma sym (result d g b) = result d (GCD.sym g) (Identity.sym b) base : d Lemma 0 d diff --git a/master/Data.Nat.InfinitelyOften.html b/master/Data.Nat.InfinitelyOften.html index 29f5f35b5e..299b8f700b 100644 --- a/master/Data.Nat.InfinitelyOften.html +++ b/master/Data.Nat.InfinitelyOften.html @@ -18,11 +18,11 @@ open import Data.Sum.Base using (inj₁; inj₂; _⊎_) open import Function.Base using (_∘_; id) open import Relation.Binary.PropositionalEquality.Core using (_≢_) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Negation using (¬¬-Monad; call/cc) -open import Relation.Unary using (Pred; _∪_; _⊆_) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬¬-Monad; call/cc) +open import Relation.Unary using (Pred; _∪_; _⊆_) -open RawMonad (¬¬-Monad {a = 0ℓ}) +open RawMonad (¬¬-Monad {a = 0ℓ}) private variable @@ -32,22 +32,22 @@ -- Only true finitely often. -Fin : Pred Set -Fin P = λ i j i j ¬ P j +Fin : Pred Set +Fin P = λ i j i j ¬ P j -- A non-constructive definition of "true infinitely often". -Inf : Pred Set -Inf P = ¬ Fin P +Inf : Pred Set +Inf P = ¬ Fin P -- Fin is preserved by binary sums. -_∪-Fin_ : {ℓp ℓq P Q} Fin {ℓp} P Fin {ℓq} Q Fin (P Q) +_∪-Fin_ : {ℓp ℓq P Q} Fin {ℓp} P Fin {ℓq} Q Fin (P Q) _∪-Fin_ {P = P} {Q} (i , ¬p) (j , ¬q) = (i j , helper) where open ≤-Reasoning - helper : k i j k ¬ (P Q) k + helper : k i j k ¬ (P Q) k helper k i⊔j≤k (inj₁ p) = ¬p k (begin i ≤⟨ m≤m⊔n i j i j ≤⟨ i⊔j≤k @@ -60,15 +60,15 @@ -- Inf commutes with binary sums (in the double-negation monad). -commutes-with-∪ : {P Q} Inf (P Q) ¬ ¬ (Inf P Inf Q) +commutes-with-∪ : {P Q} Inf (P Q) ¬ ¬ (Inf P Inf Q) commutes-with-∪ p∪q = - call/cc λ ¬[p⊎q] + call/cc λ ¬[p⊎q] ¬p ¬q ⊥-elim (p∪q (¬p ∪-Fin ¬q))) <$> ¬[p⊎q] inj₁ ¬[p⊎q] inj₂ -- Inf is functorial. -map : {ℓp ℓq P Q} P Q Inf {ℓp} P Inf {ℓq} Q +map : {ℓp ℓq P Q} P Q Inf {ℓp} P Inf {ℓq} Q map P⊆Q ¬fin = ¬fin Prod.map id fin j i≤j fin j i≤j P⊆Q) -- Inf is upwards closed. @@ -80,18 +80,18 @@ up₁ : Inf P Inf (P suc) up₁ ¬fin (i , fin) = ¬fin (suc i , helper) where - helper : j 1 + i j ¬ P j + helper : j 1 + i j ¬ P j helper ._ (s≤s i≤j) = fin _ i≤j -- A witness. -witness : {P} Inf {} P ¬ ¬ P +witness : {P} Inf {} P ¬ ¬ P witness ¬fin ¬p = ¬fin (0 , λ i _ Pi ¬p (i , Pi)) -- Two different witnesses. twoDifferentWitnesses - : {P} Inf P ¬ ¬ ∃₂ λ m n m n × P m × P n + : {P} Inf P ¬ ¬ ∃₂ λ m n m n × P m × P n twoDifferentWitnesses inf = witness inf >>= λ w₁ witness (up (1 + proj₁ w₁) inf) >>= λ w₂ diff --git a/master/Data.Nat.LCM.html b/master/Data.Nat.LCM.html index 7f37d01985..6f19ee0224 100644 --- a/master/Data.Nat.LCM.html +++ b/master/Data.Nat.LCM.html @@ -22,7 +22,7 @@ using (_≡_; refl; sym; trans; cong; cong₂; subst) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) -open import Relation.Nullary.Decidable using (False; fromWitnessFalse) +open import Relation.Nullary.Decidable using (False; fromWitnessFalse) private -- instance diff --git a/master/Data.Nat.Primality.Factorisation.html b/master/Data.Nat.Primality.Factorisation.html index ccdbd1b02e..02c0bf3a64 100644 --- a/master/Data.Nat.Primality.Factorisation.html +++ b/master/Data.Nat.Primality.Factorisation.html @@ -32,8 +32,8 @@ open import Function.Base using (_$_; _∘_; _|>_; flip) open import Induction using (build) open import Induction.Lexicographic using (_⊗_; [_⊗_]) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; trans; cong) open import Relation.Binary.PropositionalEquality.Properties @@ -94,7 +94,7 @@ primeFactorisation[p] (rough∧square>⇒prime rough (m∸n≡0⇒m≤n eq)) facRec (n@(2+ _) , suc k) (recFactor , recQuotient) {m@(2+ _)} rough eq with m ∣? n -- Case 2: m ∤ n, try larger m, reducing k accordingly - ... | no m∤n = recFactor (≤-<-trans (m∸n≤m k (m + m)) (n<1+n k)) {suc m} (∤⇒rough-suc m∤n rough) $ begin + ... | no m∤n = recFactor (≤-<-trans (m∸n≤m k (m + m)) (n<1+n k)) {suc m} (∤⇒rough-suc m∤n rough) $ begin suc n (suc m + m * suc m) ≡⟨ cong # suc n (suc m + #)) (*-suc m m) suc n (suc m + (m + m * m)) ≡⟨ cong (suc n ∸_) (+-assoc (suc m) m (m * m)) suc n (suc (m + m) + m * m) ≡⟨ cong (suc n ∸_) (+-comm (suc (m + m)) (m * m)) @@ -103,7 +103,7 @@ suc k suc (m + m) where open ≡-Reasoning -- Case 3: m ∣ n, record m and recurse on the quotient - ... | yes m∣n = record + ... | yes m∣n = record { factors = m ps ; isFactorisation = sym m*Πps≡n ; factorsPrime = rough∧∣⇒prime rough m∣n primes @@ -138,18 +138,18 @@ -- Properties of a factorisation factorisationHasAllPrimeFactors : {as} {p} Prime p p product as All Prime as p as -factorisationHasAllPrimeFactors {[]} {2+ p} pPrime p∣Πas [] = contradiction (∣1⇒≡1 p∣Πas) λ () +factorisationHasAllPrimeFactors {[]} {2+ p} pPrime p∣Πas [] = contradiction (∣1⇒≡1 p∣Πas) λ () factorisationHasAllPrimeFactors {a as} {p} pPrime p∣aΠas (aPrime asPrime) with euclidsLemma a (product as) pPrime p∣aΠas ... | inj₂ p∣Πas = there (factorisationHasAllPrimeFactors pPrime p∣Πas asPrime) ... | inj₁ p∣a with prime⇒irreducible aPrime p∣a -... | inj₁ refl = contradiction pPrime ¬prime[1] +... | inj₁ refl = contradiction pPrime ¬prime[1] ... | inj₂ refl = here refl private factorisationUnique′ : (as bs : List ) product as product bs All Prime as All Prime bs as bs factorisationUnique′ [] [] Πas≡Πbs asPrime bsPrime = refl factorisationUnique′ [] (b@(2+ _) bs) Πas≡Πbs prime[as] (_ prime[bs]) = - contradiction Πas≡Πbs (<⇒≢ Πas<Πbs) + contradiction Πas≡Πbs (<⇒≢ Πas<Πbs) where Πas<Πbs : product [] < product (b bs) Πas<Πbs = begin-strict diff --git a/master/Data.Nat.Primality.html b/master/Data.Nat.Primality.html index 056ab278e6..e1e2c99909 100644 --- a/master/Data.Nat.Primality.html +++ b/master/Data.Nat.Primality.html @@ -20,9 +20,9 @@ open import Function.Base using (flip; _∘_; _∘′_) open import Function.Bundles using (_⇔_; mk⇔) open import Relation.Nullary.Decidable as Dec - using (yes; no; from-yes; from-no; ¬?; _×-dec_; _⊎-dec_; _→-dec_; decidable-stable) -open import Relation.Nullary.Negation using (¬_; contradiction; contradiction₂) -open import Relation.Unary using (Pred; Decidable) + using (yes; no; from-yes; from-no; ¬?; _×-dec_; _⊎-dec_; _→-dec_; decidable-stable) +open import Relation.Nullary.Negation using (¬_; contradiction; contradiction₂) +open import Relation.Unary using (Pred; Decidable) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; cong) @@ -33,7 +33,7 @@ recompute-nonTrivial : .{{NonTrivial n}} NonTrivial n recompute-nonTrivial {n} {{nontrivial}} = - Dec.recompute (nonTrivial? n) nontrivial + Dec.recompute (nonTrivial? n) nontrivial ------------------------------------------------------------------------ -- Definitions @@ -56,14 +56,14 @@ -- by m. infix 10 _Rough_ -_Rough_ : Pred _ -m Rough n = ¬ (n HasNonTrivialDivisorLessThan m) +_Rough_ : Pred _ +m Rough n = ¬ (n HasNonTrivialDivisorLessThan m) ------------------------------------------------------------------------ -- Compositeness -- A number is composite if it has a proper non-trivial divisor. -Composite : Pred _ +Composite : Pred _ Composite n = n HasNonTrivialDivisorLessThan n -- A shorter pattern synonym for the record constructor producing a @@ -83,12 +83,12 @@ constructor prime field .{{nontrivial}} : NonTrivial p - notComposite : ¬ Composite p + notComposite : ¬ Composite p ------------------------------------------------------------------------ -- Irreducibility -Irreducible : Pred _ +Irreducible : Pred _ Irreducible n = {d} d n d 1 d n ------------------------------------------------------------------------ @@ -101,7 +101,7 @@ -- 1 is always n-rough rough-1 : n n Rough 1 rough-1 _ (hasNonTrivialDivisor _ d∣1) = - contradiction (∣1⇒≡1 d∣1) nonTrivial⇒≢1 + contradiction (∣1⇒≡1 d∣1) nonTrivial⇒≢1 -- Any number is 0-, 1- and 2-rough, -- because no proper divisor d can be strictly less than 0, 1, or 2 @@ -124,7 +124,7 @@ ∤⇒rough-suc m∤n r (hasNonTrivialDivisor d<1+m d∣n) with m<1+n⇒m<n∨m≡n d<1+m ... | inj₁ d<m = r (hasNonTrivialDivisor d<m d∣n) -... | inj₂ d≡m@refl = contradiction d∣n m∤n +... | inj₂ d≡m@refl = contradiction d∣n m∤n -- If a number is m-rough, then so are all of its divisors rough∧∣⇒rough : m Rough o n o m Rough n @@ -148,10 +148,10 @@ -- Basic (counter-)examples of Composite -¬composite[0] : ¬ Composite 0 +¬composite[0] : ¬ Composite 0 ¬composite[0] = 0-rough -¬composite[1] : ¬ Composite 1 +¬composite[1] : ¬ Composite 1 ¬composite[1] = 1-rough composite[4] : Composite 4 @@ -165,11 +165,11 @@ composite⇒nonTrivial : Composite n NonTrivial n composite⇒nonTrivial {1} composite[1] = - contradiction composite[1] ¬composite[1] + contradiction composite[1] ¬composite[1] composite⇒nonTrivial {2+ _} _ = _ -composite? : Decidable Composite -composite? n = Dec.map CompositeUpTo⇔Composite (compositeUpTo? n) +composite? : Decidable Composite +composite? n = Dec.map CompositeUpTo⇔Composite (compositeUpTo? n) where -- For technical reasons, in order to be able to prove decidability -- via the `all?` and `any?` combinators for *bounded* predicates on @@ -177,7 +177,7 @@ -- `P...` as `P...UpTo` and show the equivalence of the two. -- Equivalent bounded predicate definition - CompositeUpTo : Pred _ + CompositeUpTo : Pred _ CompositeUpTo n = ∃[ d ] d < n × NonTrivial d × d n -- Proof of equivalence @@ -192,18 +192,18 @@ CompositeUpTo⇔Composite = mk⇔ comp-upto⇒comp comp⇒comp-upto -- Proof of decidability - compositeUpTo? : Decidable CompositeUpTo - compositeUpTo? n = anyUpTo? d nonTrivial? d ×-dec d ∣? n) n + compositeUpTo? : Decidable CompositeUpTo + compositeUpTo? n = anyUpTo? d nonTrivial? d ×-dec d ∣? n) n ------------------------------------------------------------------------ -- Primality -- Basic (counter-)examples -¬prime[0] : ¬ Prime 0 +¬prime[0] : ¬ Prime 0 ¬prime[0] () -¬prime[1] : ¬ Prime 1 +¬prime[1] : ¬ Prime 1 ¬prime[1] () prime[2] : Prime 2 @@ -215,13 +215,13 @@ prime⇒nonTrivial : Prime p NonTrivial p prime⇒nonTrivial _ = recompute-nonTrivial -prime? : Decidable Prime -prime? 0 = no ¬prime[0] -prime? 1 = no ¬prime[1] -prime? n@(2+ _) = Dec.map PrimeUpTo⇔Prime (primeUpTo? n) +prime? : Decidable Prime +prime? 0 = no ¬prime[0] +prime? 1 = no ¬prime[1] +prime? n@(2+ _) = Dec.map PrimeUpTo⇔Prime (primeUpTo? n) where -- Equivalent bounded predicate definition - PrimeUpTo : Pred _ + PrimeUpTo : Pred _ PrimeUpTo n = {d} d < n NonTrivial d d n -- Proof of equivalence @@ -237,8 +237,8 @@ PrimeUpTo⇔Prime = mk⇔ prime-upto⇒prime prime⇒prime-upto -- Proof of decidability - primeUpTo? : Decidable PrimeUpTo - primeUpTo? n = allUpTo? d nonTrivial? d →-dec ¬? (d ∣? n)) n + primeUpTo? : Decidable PrimeUpTo + primeUpTo? n = allUpTo? d nonTrivial? d →-dec ¬? (d ∣? n)) n -- Euclid's lemma - for p prime, if p ∣ m * n, then either p ∣ m or p ∣ n. -- @@ -264,7 +264,7 @@ -- impossible as p is a prime. -- note: this should be a typechecker-rejectable case!? ... | Bézout.result 0 g _ = - contradiction (0∣⇒≡0 (GCD.gcd∣n g)) (≢-nonZero⁻¹ _) + contradiction (0∣⇒≡0 (GCD.gcd∣n g)) (≢-nonZero⁻¹ _) -- if the GCD of m and p is one then m and p are coprime, and we know -- that for some integers s and r, sm + rp = 1. We can use this fact @@ -286,8 +286,8 @@ -- if the GCD of m and p is greater than one, then it must be p and -- hence p ∣ m. ... | Bézout.result d@(2+ _) g _ with d p - ... | yes d≡p@refl = inj₁ (GCD.gcd∣m g) - ... | no d≢p = contradiction (composite-≢ d d≢p (GCD.gcd∣n g)) pr + ... | yes d≡p@refl = inj₁ (GCD.gcd∣m g) + ... | no d≢p = contradiction (composite-≢ d d≢p (GCD.gcd∣n g)) pr -- Relationship between roughness and primality. prime⇒rough : Prime p p Rough p @@ -301,27 +301,27 @@ rough∧square>⇒prime : .{{NonTrivial n}} m Rough n m * m > n Prime n rough∧square>⇒prime rough m*m>n = prime ¬composite where - ¬composite : ¬ Composite _ - ¬composite (composite d<n d∣n) = contradiction (m∣n⇒n≡quotient*m d∣n) + ¬composite : ¬ Composite _ + ¬composite (composite d<n d∣n) = contradiction (m∣n⇒n≡quotient*m d∣n) (<⇒≢ (<-≤-trans m*m>n (*-mono-≤ (rough⇒≤ (rough∧∣⇒rough rough (quotient-∣ d∣n))) (rough⇒≤ (rough∧∣⇒rough rough d∣n))))) where instance _ = n>1⇒nonTrivial (quotient>1 d∣n d<n) -- Relationship between compositeness and primality. -composite⇒¬prime : Composite n ¬ Prime n +composite⇒¬prime : Composite n ¬ Prime n composite⇒¬prime composite[d] (prime p) = p composite[d] -¬composite⇒prime : .{{NonTrivial n}} ¬ Composite n Prime n +¬composite⇒prime : .{{NonTrivial n}} ¬ Composite n Prime n ¬composite⇒prime = prime -prime⇒¬composite : Prime n ¬ Composite n +prime⇒¬composite : Prime n ¬ Composite n prime⇒¬composite (prime p) = p -- Note that this has to recompute the factor! -¬prime⇒composite : .{{NonTrivial n}} ¬ Prime n Composite n +¬prime⇒composite : .{{NonTrivial n}} ¬ Prime n Composite n ¬prime⇒composite {n} ¬prime[n] = - decidable-stable (composite? n) (¬prime[n] ∘′ ¬composite⇒prime) + decidable-stable (composite? n) (¬prime[n] ∘′ ¬composite⇒prime) productOfPrimes≢0 : {as} All Prime as NonZero (product as) productOfPrimes≢0 pas = product≢0 (All.map prime⇒nonZero pas) @@ -336,8 +336,8 @@ ------------------------------------------------------------------------ -- Basic (counter-)examples of Irreducible -¬irreducible[0] : ¬ Irreducible 0 -¬irreducible[0] irr[0] = contradiction₂ 2≡1⊎2≡0 ()) ()) +¬irreducible[0] : ¬ Irreducible 0 +¬irreducible[0] irr[0] = contradiction₂ 2≡1⊎2≡0 ()) ()) where 2≡1⊎2≡0 = irr[0] {2} (divides-refl 0) irreducible[1] : Irreducible 1 @@ -350,16 +350,16 @@ ... | s<s z<s = inj₂ refl irreducible⇒nonZero : Irreducible n NonZero n -irreducible⇒nonZero {zero} = flip contradiction ¬irreducible[0] +irreducible⇒nonZero {zero} = flip contradiction ¬irreducible[0] irreducible⇒nonZero {suc _} _ = _ -irreducible? : Decidable Irreducible -irreducible? zero = no ¬irreducible[0] +irreducible? : Decidable Irreducible +irreducible? zero = no ¬irreducible[0] irreducible? n@(suc _) = - Dec.map IrreducibleUpTo⇔Irreducible (irreducibleUpTo? n) + Dec.map IrreducibleUpTo⇔Irreducible (irreducibleUpTo? n) where -- Equivalent bounded predicate definition - IrreducibleUpTo : Pred _ + IrreducibleUpTo : Pred _ IrreducibleUpTo n = {d} d < n d n d 1 d n -- Proof of equivalence @@ -375,9 +375,9 @@ IrreducibleUpTo⇔Irreducible = mk⇔ irr-upto⇒irr irr⇒irr-upto -- Decidability - irreducibleUpTo? : Decidable IrreducibleUpTo + irreducibleUpTo? : Decidable IrreducibleUpTo irreducibleUpTo? n = allUpTo? - m (m ∣? n) →-dec (m 1 ⊎-dec m n)) n + m (m ∣? n) →-dec (m 1 ⊎-dec m n)) n -- Relationship between primality and irreducibility. prime⇒irreducible : Prime p Irreducible p @@ -385,7 +385,7 @@ where instance _ = prime⇒nonZero pp irr : .{{NonZero p}} Irreducible p - irr {0} 0∣p = contradiction (0∣⇒≡0 0∣p) (≢-nonZero⁻¹ p) + irr {0} 0∣p = contradiction (0∣⇒≡0 0∣p) (≢-nonZero⁻¹ p) irr {1} 1∣p = inj₁ refl irr {2+ _} d∣p = inj₂ (≤∧≮⇒≡ (∣⇒≤ d∣p) d≮p) where d≮p = λ d<p pr (composite d<p d∣p) @@ -407,21 +407,21 @@ -- Example: 2 is prime, but not-composite. 2-is-prime : Prime 2 - 2-is-prime = from-yes (prime? 2) + 2-is-prime = from-yes (prime? 2) - 2-is-not-composite : ¬ Composite 2 - 2-is-not-composite = from-no (composite? 2) + 2-is-not-composite : ¬ Composite 2 + 2-is-not-composite = from-no (composite? 2) -- Example: 4 and 6 are composite, hence not-prime 4-is-composite : Composite 4 - 4-is-composite = from-yes (composite? 4) + 4-is-composite = from-yes (composite? 4) - 4-is-not-prime : ¬ Prime 4 - 4-is-not-prime = from-no (prime? 4) + 4-is-not-prime : ¬ Prime 4 + 4-is-not-prime = from-no (prime? 4) 6-is-composite : Composite 6 - 6-is-composite = from-yes (composite? 6) + 6-is-composite = from-yes (composite? 6) - 6-is-not-prime : ¬ Prime 6 - 6-is-not-prime = from-no (prime? 6) + 6-is-not-prime : ¬ Prime 6 + 6-is-not-prime = from-no (prime? 6) \ No newline at end of file diff --git a/master/Data.Nat.Properties.html b/master/Data.Nat.Properties.html index 498a308c16..0d29a6f59e 100644 --- a/master/Data.Nat.Properties.html +++ b/master/Data.Nat.Properties.html @@ -12,7 +12,7 @@ module Data.Nat.Properties where -open import Axiom.UniquenessOfIdentityProofs using (module Decidable⇒UIP) +open import Axiom.UniquenessOfIdentityProofs using (module Decidable⇒UIP) open import Algebra.Bundles using (Magma; Semigroup; CommutativeSemigroup; CommutativeMonoid; Monoid; Semiring; CommutativeSemiring; CommutativeSemiringWithoutOne) open import Algebra.Morphism @@ -24,7 +24,7 @@ import Algebra.Lattice.Construct.NaturalChoice.MinMaxOp as LatticeMinMaxOp import Algebra.Properties.CommutativeSemigroup as CommSemigroupProperties open import Data.Bool.Base using (Bool; false; true; T) -open import Data.Bool.Properties using (T?) +open import Data.Bool.Properties using (T?) open import Data.Nat.Base open import Data.Product.Base using (; _×_; _,_) open import Data.Sum.Base as Sum using (inj₁; inj₂; _⊎_; [_,_]′) @@ -35,16 +35,16 @@ IsQuasiSemiMetric; IsSemiMetric; IsMetric; PreMetric; QuasiSemiMetric; SemiMetric; Metric) open import Level using (0ℓ) -open import Relation.Unary as U using (Pred) +open import Relation.Unary as U using (Pred) open import Relation.Binary.Core using (_⇒_; _Preserves_⟶_; _Preserves₂_⟶_⟶_) open import Relation.Binary open import Relation.Binary.Consequences using (flip-Connex) open import Relation.Binary.PropositionalEquality -open import Relation.Nullary hiding (Irrelevant) -open import Relation.Nullary.Decidable using (True; via-injection; map′) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) -open import Relation.Nullary.Reflects using (fromEquivalence) +open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary.Decidable using (True; via-injection; map′) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Reflects using (fromEquivalence) open import Algebra.Definitions {A = } _≡_ hiding (LeftCancellative; RightCancellative; Cancellative) @@ -62,18 +62,18 @@ -- Properties of NonZero ------------------------------------------------------------------------ -nonZero? : U.Decidable NonZero -nonZero? zero = no NonZero.nonZero -nonZero? (suc n) = yes _ +nonZero? : U.Decidable NonZero +nonZero? zero = no NonZero.nonZero +nonZero? (suc n) = yes _ ------------------------------------------------------------------------ -- Properties of NonTrivial ------------------------------------------------------------------------ -nonTrivial? : U.Decidable NonTrivial -nonTrivial? 0 = no λ() -nonTrivial? 1 = no λ() -nonTrivial? (2+ n) = yes _ +nonTrivial? : U.Decidable NonTrivial +nonTrivial? 0 = no λ() +nonTrivial? 1 = no λ() +nonTrivial? (2+ n) = yes _ ------------------------------------------------------------------------ -- Properties of _≡_ @@ -97,13 +97,13 @@ -- backend erases proofs. infix 4 _≟_ -_≟_ : DecidableEquality -m n = map′ (≡ᵇ⇒≡ m n) (≡⇒≡ᵇ m n) (T? (m ≡ᵇ n)) +_≟_ : DecidableEquality +m n = map′ (≡ᵇ⇒≡ m n) (≡⇒≡ᵇ m n) (T? (m ≡ᵇ n)) -≡-irrelevant : Irrelevant {A = } _≡_ -≡-irrelevant = Decidable⇒UIP.≡-irrelevant _≟_ +≡-irrelevant : Irrelevant {A = } _≡_ +≡-irrelevant = Decidable⇒UIP.≡-irrelevant _≟_ -≟-diag : (eq : m n) (m n) yes eq +≟-diag : (eq : m n) (m n) yes eq ≟-diag = ≡-≟-identity _≟_ ≡-isDecEquivalence : IsDecEquivalence (_≡_ {A = }) @@ -140,8 +140,8 @@ <⇒<ᵇ z<s = tt <⇒<ᵇ (s<s m<n@(s≤s _)) = <⇒<ᵇ m<n -<ᵇ-reflects-< : m n Reflects (m < n) (m <ᵇ n) -<ᵇ-reflects-< m n = fromEquivalence (<ᵇ⇒< m n) <⇒<ᵇ +<ᵇ-reflects-< : m n Reflects (m < n) (m <ᵇ n) +<ᵇ-reflects-< m n = fromEquivalence (<ᵇ⇒< m n) <⇒<ᵇ ------------------------------------------------------------------------ -- Properties of _≤ᵇ_ @@ -155,8 +155,8 @@ ≤⇒≤ᵇ z≤n = tt ≤⇒≤ᵇ m≤n@(s≤s _) = <⇒<ᵇ m≤n -≤ᵇ-reflects-≤ : m n Reflects (m n) (m ≤ᵇ n) -≤ᵇ-reflects-≤ m n = fromEquivalence (≤ᵇ⇒≤ m n) ≤⇒≤ᵇ +≤ᵇ-reflects-≤ : m n Reflects (m n) (m ≤ᵇ n) +≤ᵇ-reflects-≤ m n = fromEquivalence (≤ᵇ⇒≤ m n) ≤⇒≤ᵇ ------------------------------------------------------------------------ -- Properties of _≤_ @@ -169,23 +169,23 @@ ≤-reflexive {zero} refl = z≤n ≤-reflexive {suc m} refl = s≤s (≤-reflexive refl) -≤-refl : Reflexive _≤_ +≤-refl : Reflexive _≤_ ≤-refl = ≤-reflexive refl -≤-antisym : Antisymmetric _≡_ _≤_ +≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym z≤n z≤n = refl ≤-antisym (s≤s m≤n) (s≤s n≤m) = cong suc (≤-antisym m≤n n≤m) -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans z≤n _ = z≤n ≤-trans (s≤s m≤n) (s≤s n≤o) = s≤s (≤-trans m≤n n≤o) -≤-total : Total _≤_ +≤-total : Total _≤_ ≤-total zero _ = inj₁ z≤n ≤-total _ zero = inj₂ z≤n ≤-total (suc m) (suc n) = Sum.map s≤s s≤s (≤-total m n) -≤-irrelevant : Irrelevant _≤_ +≤-irrelevant : Irrelevant _≤_ ≤-irrelevant z≤n z≤n = refl ≤-irrelevant (s≤s m≤n₁) (s≤s m≤n₂) = cong s≤s (≤-irrelevant m≤n₁ m≤n₂) @@ -197,10 +197,10 @@ infix 4 _≤?_ _≥?_ -_≤?_ : Decidable _≤_ -m ≤? n = map′ (≤ᵇ⇒≤ m n) ≤⇒≤ᵇ (T? (m ≤ᵇ n)) +_≤?_ : Decidable _≤_ +m ≤? n = map′ (≤ᵇ⇒≤ m n) ≤⇒≤ᵇ (T? (m ≤ᵇ n)) -_≥?_ : Decidable _≥_ +_≥?_ : Decidable _≥_ _≥?_ = flip _≤?_ ------------------------------------------------------------------------ @@ -321,7 +321,7 @@ ≰⇒≮ m≰n 1+m≤n = m≰n (<⇒≤ 1+m≤n) ≰⇒> : _≰_ _>_ -≰⇒> {zero} z≰n = contradiction z≤n z≰n +≰⇒> {zero} z≰n = contradiction z≤n z≰n ≰⇒> {suc m} {zero} _ = z<s ≰⇒> {suc m} {suc n} m≰n = s<s (≰⇒> (m≰n s≤s)) @@ -330,11 +330,11 @@ ≮⇒≥ : _≮_ _≥_ ≮⇒≥ {_} {zero} _ = z≤n -≮⇒≥ {zero} {suc j} 1≮j+1 = contradiction z<s 1≮j+1 +≮⇒≥ {zero} {suc j} 1≮j+1 = contradiction z<s 1≮j+1 ≮⇒≥ {suc i} {suc j} i+1≮j+1 = s≤s (≮⇒≥ (i+1≮j+1 s<s)) ≤∧≢⇒< : {m n} m n m n m < n -≤∧≢⇒< {_} {zero} z≤n m≢n = contradiction refl m≢n +≤∧≢⇒< {_} {zero} z≤n m≢n = contradiction refl m≢n ≤∧≢⇒< {_} {suc n} z≤n m≢n = z<s ≤∧≢⇒< {_} {suc n} (s≤s m≤n) 1+m≢1+n = s<s (≤∧≢⇒< m≤n (1+m≢1+n cong suc)) @@ -342,36 +342,36 @@ ≤∧≮⇒≡ : {m n} m n m n m n ≤∧≮⇒≡ m≤n m≮n = ≤-antisym m≤n (≮⇒≥ m≮n) -≤-<-connex : Connex _≤_ _<_ +≤-<-connex : Connex _≤_ _<_ ≤-<-connex m n with m ≤? n -... | yes m≤n = inj₁ m≤n -... | no ¬m≤n = inj₂ (≰⇒> ¬m≤n) +... | yes m≤n = inj₁ m≤n +... | no ¬m≤n = inj₂ (≰⇒> ¬m≤n) -≥->-connex : Connex _≥_ _>_ +≥->-connex : Connex _≥_ _>_ ≥->-connex = flip ≤-<-connex -<-≤-connex : Connex _<_ _≤_ +<-≤-connex : Connex _<_ _≤_ <-≤-connex = flip-Connex ≤-<-connex ->-≥-connex : Connex _>_ _≥_ +>-≥-connex : Connex _>_ _≥_ >-≥-connex = flip-Connex ≥->-connex ------------------------------------------------------------------------ -- Relational properties of _<_ -<-irrefl : Irreflexive _≡_ _<_ +<-irrefl : Irreflexive _≡_ _<_ <-irrefl refl (s<s n<n) = <-irrefl refl n<n -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym (s<s n<m) (s<s m<n) = <-asym n<m m<n -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans (s≤s i≤j) (s≤s j<k) = s≤s (≤-trans i≤j (≤-trans (n≤1+n _) j<k)) -≤-<-trans : LeftTrans _≤_ _<_ +≤-<-trans : LeftTrans _≤_ _<_ ≤-<-trans m≤n (s<s n≤o) = s≤s (≤-trans m≤n n≤o) -<-≤-trans : RightTrans _<_ _≤_ +<-≤-trans : RightTrans _<_ _≤_ <-≤-trans (s<s m≤n) (s≤s n≤o) = s≤s (≤-trans m≤n n≤o) -- NB: we use the builtin function `_<ᵇ_` here so that the function @@ -380,24 +380,24 @@ -- We expect the main benefit to be visible in compiled code as the -- backend erases proofs. -<-cmp : Trichotomous _≡_ _<_ -<-cmp m n with m n | T? (m <ᵇ n) -... | yes m≡n | _ = tri≈ (<-irrefl m≡n) m≡n (<-irrefl (sym m≡n)) -... | no m≢n | yes m<n = tri< (<ᵇ⇒< m n m<n) m≢n (<⇒≯ (<ᵇ⇒< m n m<n)) -... | no m≢n | no m≮n = tri> (m≮n <⇒<ᵇ) m≢n (≤∧≢⇒< (≮⇒≥ (m≮n <⇒<ᵇ)) (m≢n sym)) +<-cmp : Trichotomous _≡_ _<_ +<-cmp m n with m n | T? (m <ᵇ n) +... | yes m≡n | _ = tri≈ (<-irrefl m≡n) m≡n (<-irrefl (sym m≡n)) +... | no m≢n | yes m<n = tri< (<ᵇ⇒< m n m<n) m≢n (<⇒≯ (<ᵇ⇒< m n m<n)) +... | no m≢n | no m≮n = tri> (m≮n <⇒<ᵇ) m≢n (≤∧≢⇒< (≮⇒≥ (m≮n <⇒<ᵇ)) (m≢n sym)) infix 4 _<?_ _>?_ -_<?_ : Decidable _<_ +_<?_ : Decidable _<_ m <? n = suc m ≤? n -_>?_ : Decidable _>_ +_>?_ : Decidable _>_ _>?_ = flip _<?_ -<-irrelevant : Irrelevant _<_ +<-irrelevant : Irrelevant _<_ <-irrelevant = ≤-irrelevant -<-resp₂-≡ : _<_ Respects₂ _≡_ +<-resp₂-≡ : _<_ Respects₂ _≡_ <-resp₂-≡ = subst (_ <_) , subst (_< _) ------------------------------------------------------------------------ @@ -460,7 +460,7 @@ n>0⇒n≢0 {suc n} _ () n≢0⇒n>0 : n 0 n > 0 -n≢0⇒n>0 {zero} 0≢0 = contradiction refl 0≢0 +n≢0⇒n>0 {zero} 0≢0 = contradiction refl 0≢0 n≢0⇒n>0 {suc n} _ = 0<1+n m<n⇒0<n : m < n 0 < n @@ -484,7 +484,7 @@ m<1+n⇒m≤n (s≤s m≤n) = m≤n ∀[m≤n⇒m≢o]⇒n<o : n o (∀ {m} m n m o) n < o -∀[m≤n⇒m≢o]⇒n<o _ zero m≤n⇒n≢0 = contradiction refl (m≤n⇒n≢0 z≤n) +∀[m≤n⇒m≢o]⇒n<o _ zero m≤n⇒n≢0 = contradiction refl (m≤n⇒n≢0 z≤n) ∀[m≤n⇒m≢o]⇒n<o zero (suc o) _ = 0<1+n ∀[m≤n⇒m≢o]⇒n<o (suc n) (suc o) m≤n⇒n≢o = s≤s (∀[m≤n⇒m≢o]⇒n<o n o rec) where @@ -493,7 +493,7 @@ ∀[m<n⇒m≢o]⇒n≤o : n o (∀ {m} m < n m o) n o ∀[m<n⇒m≢o]⇒n≤o zero n _ = z≤n -∀[m<n⇒m≢o]⇒n≤o (suc n) zero m<n⇒m≢0 = contradiction refl (m<n⇒m≢0 0<1+n) +∀[m<n⇒m≢o]⇒n≤o (suc n) zero m<n⇒m≢0 = contradiction refl (m<n⇒m≢0 0<1+n) ∀[m<n⇒m≢o]⇒n≤o (suc n) (suc o) m<n⇒m≢o = s≤s (∀[m<n⇒m≢o]⇒n≤o n o rec) where rec : {m} m < n m o @@ -930,7 +930,7 @@ m*n≡1⇒m≡1 (suc zero) n _ = refl m*n≡1⇒m≡1 (suc (suc m)) (suc zero) () m*n≡1⇒m≡1 (suc (suc m)) zero eq = - contradiction (trans (sym $ *-zeroʳ m) eq) λ() + contradiction (trans (sym $ *-zeroʳ m) eq) λ() m*n≡1⇒n≡1 : m n m * n 1 n 1 m*n≡1⇒n≡1 m n eq = m*n≡1⇒m≡1 n m (trans (*-comm n m) eq) @@ -1538,18 +1538,18 @@ ∸-cancelʳ-≤ : {m n o} m o o n o m m n ∸-cancelʳ-≤ {_} {_} z≤n _ = z≤n -∸-cancelʳ-≤ {suc m} {zero} (s≤s _) o<o∸m = contradiction o<o∸m (m≮m∸n _ m) +∸-cancelʳ-≤ {suc m} {zero} (s≤s _) o<o∸m = contradiction o<o∸m (m≮m∸n _ m) ∸-cancelʳ-≤ {suc m} {suc n} (s≤s m≤o) o∸n<o∸m = s≤s (∸-cancelʳ-≤ m≤o o∸n<o∸m) ∸-cancelʳ-< : {m n o} o m < o n n < m -∸-cancelʳ-< {zero} {n} {o} o<o∸n = contradiction o<o∸n (m≮m∸n o n) +∸-cancelʳ-< {zero} {n} {o} o<o∸n = contradiction o<o∸n (m≮m∸n o n) ∸-cancelʳ-< {suc m} {zero} {_} o∸n<o∸m = 0<1+n ∸-cancelʳ-< {suc m} {suc n} {suc o} o∸n<o∸m = s≤s (∸-cancelʳ-< o∸n<o∸m) ∸-cancelˡ-≡ : n m o m m n m o n o ∸-cancelˡ-≡ {_} z≤n z≤n _ = refl -∸-cancelˡ-≡ {o = suc o} z≤n (s≤s _) eq = contradiction eq (1+m≢m∸n o) -∸-cancelˡ-≡ {n = suc n} (s≤s _) z≤n eq = contradiction (sym eq) (1+m≢m∸n n) +∸-cancelˡ-≡ {o = suc o} z≤n (s≤s _) eq = contradiction eq (1+m≢m∸n o) +∸-cancelˡ-≡ {n = suc n} (s≤s _) z≤n eq = contradiction (sym eq) (1+m≢m∸n n) ∸-cancelˡ-≡ {_} (s≤s n≤m) (s≤s o≤m) eq = cong suc (∸-cancelˡ-≡ n≤m o≤m eq) ∸-cancelʳ-≡ : o m o n m o n o m n @@ -1570,8 +1570,8 @@ m∸n≢0⇒n<m : m n 0 n < m m∸n≢0⇒n<m {m} {n} m∸n≢0 with n <? m -... | yes n<m = n<m -... | no n≮m = contradiction (m≤n⇒m∸n≡0 (≮⇒≥ n≮m)) m∸n≢0 +... | yes n<m = n<m +... | no n≮m = contradiction (m≤n⇒m∸n≡0 (≮⇒≥ n≮m)) m∸n≢0 m>n⇒m∸n≢0 : m > n m n 0 m>n⇒m∸n≢0 {n = suc n} (s≤s m>n) = m>n⇒m∸n≢0 m>n @@ -1680,7 +1680,7 @@ *-distrib-∸ = *-distribˡ-∸ , *-distribʳ-∸ even≢odd : m n 2 * m suc (2 * n) -even≢odd (suc m) zero eq = contradiction (suc-injective eq) (m+1+n≢0 m) +even≢odd (suc m) zero eq = contradiction (suc-injective eq) (m+1+n≢0 m) even≢odd (suc m) (suc n) eq = even≢odd m n (suc-injective (begin-equality suc (2 * m) ≡⟨ sym (+-suc m _) m + suc (m + 0) ≡⟨ suc-injective eq @@ -2021,7 +2021,7 @@ ------------------------------------------------------------------------ -- Properties of _≤′_ and _<′_ -≤′-trans : Transitive _≤′_ +≤′-trans : Transitive _≤′_ ≤′-trans m≤n ≤′-refl = m≤n ≤′-trans m≤n (≤′-step n≤o) = ≤′-step (≤′-trans m≤n n≤o) @@ -2075,16 +2075,16 @@ infix 4 _≤′?_ _<′?_ _≥′?_ _>′?_ -_≤′?_ : Decidable _≤′_ -m ≤′? n = map′ ≤⇒≤′ ≤′⇒≤ (m ≤? n) +_≤′?_ : Decidable _≤′_ +m ≤′? n = map′ ≤⇒≤′ ≤′⇒≤ (m ≤? n) -_<′?_ : Decidable _<′_ +_<′?_ : Decidable _<′_ m <′? n = suc m ≤′? n -_≥′?_ : Decidable _≥′_ +_≥′?_ : Decidable _≥′_ _≥′?_ = flip _≤′?_ -_>′?_ : Decidable _>′_ +_>′?_ : Decidable _>′_ _>′?_ = flip _<′?_ m≤′m+n : m n m ≤′ m + n @@ -2141,32 +2141,32 @@ infix 4 _<″?_ _≤″?_ _≥″?_ _>″?_ -_<″?_ : Decidable _<″_ -m <″? n = map′ <ᵇ⇒<″ <″⇒<ᵇ (T? (m <ᵇ n)) +_<″?_ : Decidable _<″_ +m <″? n = map′ <ᵇ⇒<″ <″⇒<ᵇ (T? (m <ᵇ n)) -_≤″?_ : Decidable _≤″_ -zero ≤″? n = yes (≤″-offset n) +_≤″?_ : Decidable _≤″_ +zero ≤″? n = yes (≤″-offset n) suc m ≤″? n = m <″? n -_≥″?_ : Decidable _≥″_ +_≥″?_ : Decidable _≥″_ _≥″?_ = flip _≤″?_ -_>″?_ : Decidable _>″_ +_>″?_ : Decidable _>″_ _>″?_ = flip _<″?_ -≤″-irrelevant : Irrelevant _≤″_ +≤″-irrelevant : Irrelevant _≤″_ ≤″-irrelevant {m} (less-than-or-equal eq₁) (less-than-or-equal eq₂) with refl+-cancelˡ-≡ m _ _ (trans eq₁ (sym eq₂)) = cong less-than-or-equal (≡-irrelevant eq₁ eq₂) -<″-irrelevant : Irrelevant _<″_ +<″-irrelevant : Irrelevant _<″_ <″-irrelevant = ≤″-irrelevant ->″-irrelevant : Irrelevant _>″_ +>″-irrelevant : Irrelevant _>″_ >″-irrelevant = ≤″-irrelevant -≥″-irrelevant : Irrelevant _≥″_ +≥″-irrelevant : Irrelevant _≥″_ ≥″-irrelevant = ≤″-irrelevant ------------------------------------------------------------------------ @@ -2195,17 +2195,17 @@ infix 4 _<‴?_ _≤‴?_ _≥‴?_ _>‴?_ -_<‴?_ : Decidable _<‴_ -m <‴? n = map′ <ᵇ⇒<‴ <‴⇒<ᵇ (T? (m <ᵇ n)) +_<‴?_ : Decidable _<‴_ +m <‴? n = map′ <ᵇ⇒<‴ <‴⇒<ᵇ (T? (m <ᵇ n)) -_≤‴?_ : Decidable _≤‴_ -zero ≤‴? n = yes 0≤‴n +_≤‴?_ : Decidable _≤‴_ +zero ≤‴? n = yes 0≤‴n suc m ≤‴? n = m <‴? n -_≥‴?_ : Decidable _≥‴_ +_≥‴?_ : Decidable _≥‴_ _≥‴?_ = flip _≤‴?_ -_>‴?_ : Decidable _>‴_ +_>‴?_ : Decidable _>‴_ _>‴?_ = flip _<‴?_ ≤⇒≤‴ : _≤_ _≤‴_ @@ -2221,37 +2221,37 @@ -- If there is an injection from a type to ℕ, then the type has -- decidable equality. -eq? : {a} {A : Set a} A DecidableEquality A -eq? inj = via-injection inj _≟_ +eq? : {a} {A : Set a} A DecidableEquality A +eq? inj = via-injection inj _≟_ -- It's possible to decide existential and universal predicates up to -- a limit. -module _ {p} {P : Pred p} (P? : U.Decidable P) where +module _ {p} {P : Pred p} (P? : U.Decidable P) where - anyUpTo? : v Dec ( λ n n < v × P n) - anyUpTo? zero = no λ {(_ , () , _)} + anyUpTo? : v Dec ( λ n n < v × P n) + anyUpTo? zero = no λ {(_ , () , _)} anyUpTo? (suc v) with P? v | anyUpTo? v - ... | yes Pv | _ = yes (v , ≤-refl , Pv) - ... | _ | yes (n , n<v , Pn) = yes (n , m≤n⇒m≤1+n n<v , Pn) - ... | no ¬Pv | no ¬Pn<v = no ¬Pn<1+v + ... | yes Pv | _ = yes (v , ≤-refl , Pv) + ... | _ | yes (n , n<v , Pn) = yes (n , m≤n⇒m≤1+n n<v , Pn) + ... | no ¬Pv | no ¬Pn<v = no ¬Pn<1+v where - ¬Pn<1+v : ¬ ( λ n n < suc v × P n) + ¬Pn<1+v : ¬ ( λ n n < suc v × P n) ¬Pn<1+v (n , s≤s n≤v , Pn) with n v - ... | yes refl = ¬Pv Pn - ... | no n≢v = ¬Pn<v (n , ≤∧≢⇒< n≤v n≢v , Pn) + ... | yes refl = ¬Pv Pn + ... | no n≢v = ¬Pn<v (n , ≤∧≢⇒< n≤v n≢v , Pn) - allUpTo? : v Dec (∀ {n} n < v P n) - allUpTo? zero = yes λ() + allUpTo? : v Dec (∀ {n} n < v P n) + allUpTo? zero = yes λ() allUpTo? (suc v) with P? v | allUpTo? v - ... | no ¬Pv | _ = no λ prf ¬Pv (prf ≤-refl) - ... | _ | no ¬Pn<v = no λ prf ¬Pn<v (prf m≤n⇒m≤1+n) - ... | yes Pn | yes Pn<v = yes Pn<1+v + ... | no ¬Pv | _ = no λ prf ¬Pv (prf ≤-refl) + ... | _ | no ¬Pn<v = no λ prf ¬Pn<v (prf m≤n⇒m≤1+n) + ... | yes Pn | yes Pn<v = yes Pn<1+v where Pn<1+v : {n} n < suc v P n Pn<1+v {n} (s≤s n≤v) with n v - ... | yes refl = Pn - ... | no n≢v = Pn<v (≤∧≢⇒< n≤v n≢v) + ... | yes refl = Pn + ... | no n≢v = Pn<v (≤∧≢⇒< n≤v n≢v) @@ -2354,7 +2354,7 @@ -- Version 2.0 suc[pred[n]]≡n : n 0 suc (pred n) n -suc[pred[n]]≡n {zero} 0≢0 = contradiction refl 0≢0 +suc[pred[n]]≡n {zero} 0≢0 = contradiction refl 0≢0 suc[pred[n]]≡n {suc n} _ = refl {-# WARNING_ON_USAGE suc[pred[n]]≡n "Warning: suc[pred[n]]≡n was deprecated in v2.0. Please use suc-pred instead. Note that the proof now uses instance arguments" diff --git a/master/Data.Nat.Show.Properties.html b/master/Data.Nat.Show.Properties.html index b20e3af4e8..ffc5f0cb3c 100644 --- a/master/Data.Nat.Show.Properties.html +++ b/master/Data.Nat.Show.Properties.html @@ -13,12 +13,12 @@ open import Data.Nat.Properties using (_≤?_) open import Data.Nat.Show using (charsInBase) open import Function.Base using (_∘_) -open import Relation.Nullary.Decidable using (True) +open import Relation.Nullary.Decidable using (True) open import Relation.Binary.PropositionalEquality.Core using (_≡_) module Data.Nat.Show.Properties where -module _ (base : ) {base≥2 : True (2 ≤? base)} {base≤16 : True (base ≤? 16)} where +module _ (base : ) {base≥2 : True (2 ≤? base)} {base≤16 : True (base ≤? 16)} where private charsInBase-base = charsInBase base {base≥2} {base≤16} diff --git a/master/Data.Nat.Show.html b/master/Data.Nat.Show.html index ccff6bb965..a1cfee4ad0 100644 --- a/master/Data.Nat.Show.html +++ b/master/Data.Nat.Show.html @@ -20,12 +20,12 @@ open import Data.Product.Base using (proj₁) open import Data.String.Base using (toList; fromList; String) open import Function.Base using (_∘′_; _∘_) -open import Relation.Nullary.Decidable using (True) +open import Relation.Nullary.Decidable using (True) ------------------------------------------------------------------------ -- Read -readMaybe : base {base≤16 : True (base ≤? 16)} String Maybe +readMaybe : base {base≤16 : True (base ≤? 16)} String Maybe readMaybe _ "" = nothing readMaybe base = Maybe.map convert ∘′ TraversableA.mapA Maybe.applicative readDigit @@ -70,8 +70,8 @@ -- O(n) instead of the expected O(log(n)). charsInBase : (base : ) - {base≥2 : True (2 ≤? base)} - {base≤16 : True (base ≤? 16)} + {base≥2 : True (2 ≤? base)} + {base≤16 : True (base ≤? 16)} List Char charsInBase base {base≥2} {base≤16} = List.map (showDigit {base≤16 = base≤16}) List.reverse @@ -79,8 +79,8 @@ toDigits base {base≥2 = base≥2} showInBase : (base : ) - {base≥2 : True (2 ≤? base)} - {base≤16 : True (base ≤? 16)} + {base≥2 : True (2 ≤? base)} + {base≤16 : True (base ≤? 16)} String showInBase base {base≥2} {base≤16} = fromList charsInBase base {base≥2} {base≤16} diff --git a/master/Data.Parity.Properties.html b/master/Data.Parity.Properties.html index 317b88aeb9..cff89a0d43 100644 --- a/master/Data.Parity.Properties.html +++ b/master/Data.Parity.Properties.html @@ -20,13 +20,13 @@ using (inverseʳ⇒injective; inverseˡ⇒surjective) open import Level using (0ℓ) open import Relation.Binary - using (Decidable; DecidableEquality; Setoid; DecSetoid; IsDecEquivalence) + using (Decidable; DecidableEquality; Setoid; DecSetoid; IsDecEquivalence) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; sym; cong; cong₂) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning; setoid; isEquivalence; decSetoid; isDecEquivalence) -open import Relation.Nullary using (yes; no) -open import Relation.Nullary.Negation.Core using (contradiction) +open import Relation.Nullary using (yes; no) +open import Relation.Nullary.Negation.Core using (contradiction) open import Algebra.Structures {A = Parity} _≡_ open import Algebra.Definitions {A = Parity} _≡_ @@ -39,11 +39,11 @@ infix 4 _≟_ -_≟_ : DecidableEquality Parity -1ℙ 1ℙ = yes refl -1ℙ 0ℙ = no λ() -0ℙ 1ℙ = no λ() -0ℙ 0ℙ = yes refl +_≟_ : DecidableEquality Parity +1ℙ 1ℙ = yes refl +1ℙ 0ℙ = no λ() +0ℙ 1ℙ = no λ() +0ℙ 0ℙ = yes refl ≡-setoid : Setoid 0ℓ 0ℓ ≡-setoid = setoid Parity @@ -132,8 +132,8 @@ +-cancelʳ-≡ : RightCancellative ℙ._+_ +-cancelʳ-≡ _ 1ℙ 1ℙ _ = refl -+-cancelʳ-≡ _ 1ℙ 0ℙ eq = contradiction (sym eq) (p≢p⁻¹ _) -+-cancelʳ-≡ _ 0ℙ 1ℙ eq = contradiction eq (p≢p⁻¹ _) ++-cancelʳ-≡ _ 1ℙ 0ℙ eq = contradiction (sym eq) (p≢p⁻¹ _) ++-cancelʳ-≡ _ 0ℙ 1ℙ eq = contradiction eq (p≢p⁻¹ _) +-cancelʳ-≡ _ 0ℙ 0ℙ _ = refl +-cancelˡ-≡ : LeftCancellative ℙ._+_ diff --git a/master/Data.Product.Nary.NonDependent.html b/master/Data.Product.Nary.NonDependent.html index 77bb6f4315..61c69d48c8 100644 --- a/master/Data.Product.Nary.NonDependent.html +++ b/master/Data.Product.Nary.NonDependent.html @@ -23,7 +23,7 @@ open import Data.Nat.Base using (; zero; suc; pred) open import Data.Fin.Base using (Fin; zero; suc) open import Function.Base using (const; _∘′_; _∘_) -open import Relation.Nullary.Decidable.Core using (Dec; yes; no; _×-dec_) +open import Relation.Nullary.Decidable.Core using (Dec; yes; no; _×-dec_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) @@ -118,14 +118,14 @@ ------------------------------------------------------------------------ -- decidability -Product⊤-dec : n {ls} {as : Sets n ls} Product⊤ n (Dec <$> as) Dec (Product⊤ n as) -Product⊤-dec zero _ = yes _ -Product⊤-dec (suc n) (p? , ps?) = p? ×-dec Product⊤-dec n ps? +Product⊤-dec : n {ls} {as : Sets n ls} Product⊤ n (Dec <$> as) Dec (Product⊤ n as) +Product⊤-dec zero _ = yes _ +Product⊤-dec (suc n) (p? , ps?) = p? ×-dec Product⊤-dec n ps? -Product-dec : n {ls} {as : Sets n ls} Product n (Dec <$> as) Dec (Product n as) -Product-dec 0 _ = yes _ +Product-dec : n {ls} {as : Sets n ls} Product n (Dec <$> as) Dec (Product n as) +Product-dec 0 _ = yes _ Product-dec 1 p? = p? -Product-dec (suc n@(suc _)) (p? , ps?) = p? ×-dec Product-dec n ps? +Product-dec (suc n@(suc _)) (p? , ps?) = p? ×-dec Product-dec n ps? ------------------------------------------------------------------------ -- pointwise liftings diff --git a/master/Data.Product.Properties.html b/master/Data.Product.Properties.html index 5cc6c6e814..94589e2283 100644 --- a/master/Data.Product.Properties.html +++ b/master/Data.Product.Properties.html @@ -9,15 +9,15 @@ module Data.Product.Properties where -open import Axiom.UniquenessOfIdentityProofs using (UIP; module Decidable⇒UIP) +open import Axiom.UniquenessOfIdentityProofs using (UIP; module Decidable⇒UIP) open import Data.Product.Base using (_,_; Σ; _×_; map; swap; ; ∃₂) open import Function.Base using (_∋_; _∘_; id) open import Function.Bundles using (_↔_; mk↔ₛ′) open import Level using (Level) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; _≗_; subst; cong; cong₂; cong′) -open import Relation.Nullary.Decidable as Dec using (Dec; yes; no) +open import Relation.Nullary.Decidable as Dec using (Dec; yes; no) private variable @@ -35,17 +35,17 @@ ,-injectiveˡ : {a c} {b : B a} {d : B c} (a , b) (c , d) a c ,-injectiveˡ refl = refl - ,-injectiveʳ-≡ : {a b} {c : B a} {d : B b} UIP A (a , c) (b , d) (q : a b) subst B q c d + ,-injectiveʳ-≡ : {a b} {c : B a} {d : B b} UIP A (a , c) (b , d) (q : a b) subst B q c d ,-injectiveʳ-≡ {c = c} u refl q = cong x subst B x c) (u q refl) - ,-injectiveʳ-UIP : {a} {b c : B a} UIP A (Σ A B (a , b)) (a , c) b c + ,-injectiveʳ-UIP : {a} {b c : B a} UIP A (Σ A B (a , b)) (a , c) b c ,-injectiveʳ-UIP u p = ,-injectiveʳ-≡ u p refl - ≡-dec : DecidableEquality A (∀ {a} DecidableEquality (B a)) - DecidableEquality (Σ A B) + ≡-dec : DecidableEquality A (∀ {a} DecidableEquality (B a)) + DecidableEquality (Σ A B) ≡-dec dec₁ dec₂ (a , x) (b , y) with dec₁ a b - ... | no [a≢b] = no ([a≢b] ,-injectiveˡ) - ... | yes refl = Dec.map′ (cong (a ,_)) (,-injectiveʳ-UIP (Decidable⇒UIP.≡-irrelevant dec₁)) (dec₂ x y) + ... | no [a≢b] = no ([a≢b] ,-injectiveˡ) + ... | yes refl = Dec.map′ (cong (a ,_)) (,-injectiveʳ-UIP (Decidable⇒UIP.≡-irrelevant dec₁)) (dec₂ x y) ------------------------------------------------------------------------ -- Equality (non-dependent) diff --git a/master/Data.Product.Relation.Binary.Lex.NonStrict.html b/master/Data.Product.Relation.Binary.Lex.NonStrict.html index d4baafc9f1..1e2575cb19 100644 --- a/master/Data.Product.Relation.Binary.Lex.NonStrict.html +++ b/master/Data.Product.Relation.Binary.Lex.NonStrict.html @@ -21,7 +21,7 @@ open import Relation.Binary.Structures using (IsPartialOrder; IsEquivalence; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Transitive; Symmetric; Decidable; Antisymmetric; Total; Trichotomous; Irreflexive; Asymmetric; _Respects₂_; tri<; tri>; tri≈) + using (Transitive; Symmetric; Decidable; Antisymmetric; Total; Trichotomous; Irreflexive; Asymmetric; _Respects₂_; tri<; tri>; tri≈) open import Relation.Binary.Consequences import Relation.Binary.Construct.NonStrictToStrict as Conv open import Data.Product.Relation.Binary.Pointwise.NonDependent as Pointwise @@ -56,8 +56,8 @@ private _≤ₗₑₓ_ = ×-Lex _≈₁_ _≤₁_ _≤₂_ - ×-transitive : IsPartialOrder _≈₁_ _≤₁_ Transitive _≤₂_ - Transitive _≤ₗₑₓ_ + ×-transitive : IsPartialOrder _≈₁_ _≤₁_ Transitive _≤₂_ + Transitive _≤ₗₑₓ_ ×-transitive po₁ trans₂ = Strict.×-transitive {_≈₁_ = _≈₁_} {_<₂_ = _≤₂_} isEquivalence (Conv.<-resp-≈ _ _ isEquivalence ≤-resp-≈) @@ -65,24 +65,24 @@ trans₂ where open IsPartialOrder po₁ - ×-total : Symmetric _≈₁_ Decidable _≈₁_ Antisymmetric _≈₁_ _≤₁_ - Total _≤₁_ Total _≤₂_ Total _≤ₗₑₓ_ + ×-total : Symmetric _≈₁_ Decidable _≈₁_ Antisymmetric _≈₁_ _≤₁_ + Total _≤₁_ Total _≤₂_ Total _≤ₗₑₓ_ ×-total sym₁ dec₁ antisym₁ total₁ total₂ = total where - tri₁ : Trichotomous _≈₁_ (Conv._<_ _≈₁_ _≤₁_) + tri₁ : Trichotomous _≈₁_ (Conv._<_ _≈₁_ _≤₁_) tri₁ = Conv.<-trichotomous _ _ sym₁ dec₁ antisym₁ total₁ - total : Total _≤ₗₑₓ_ + total : Total _≤ₗₑₓ_ total x y with tri₁ (proj₁ x) (proj₁ y) - ... | tri< x₁<y₁ x₁≉y₁ x₁≯y₁ = inj₁ (inj₁ x₁<y₁) - ... | tri> x₁≮y₁ x₁≉y₁ x₁>y₁ = inj₂ (inj₁ x₁>y₁) - ... | tri≈ x₁≮y₁ x₁≈y₁ x₁≯y₁ with total₂ (proj₂ x) (proj₂ y) + ... | tri< x₁<y₁ x₁≉y₁ x₁≯y₁ = inj₁ (inj₁ x₁<y₁) + ... | tri> x₁≮y₁ x₁≉y₁ x₁>y₁ = inj₂ (inj₁ x₁>y₁) + ... | tri≈ x₁≮y₁ x₁≈y₁ x₁≯y₁ with total₂ (proj₂ x) (proj₂ y) ... | inj₁ x₂≤y₂ = inj₁ (inj₂ (x₁≈y₁ , x₂≤y₂)) ... | inj₂ x₂≥y₂ = inj₂ (inj₂ (sym₁ x₁≈y₁ , x₂≥y₂)) - ×-decidable : Decidable _≈₁_ Decidable _≤₁_ Decidable _≤₂_ - Decidable _≤ₗₑₓ_ + ×-decidable : Decidable _≈₁_ Decidable _≤₁_ Decidable _≤₂_ + Decidable _≤ₗₑₓ_ ×-decidable dec-≈₁ dec-≤₁ dec-≤₂ = Strict.×-decidable dec-≈₁ (Conv.<-decidable _ _ dec-≈₁ dec-≤₁) dec-≤₂ @@ -95,8 +95,8 @@ _≤ₗₑₓ_ = ×-Lex _≈₁_ _≤₁_ _≤₂_ _≋_ = Pointwise _≈₁_ _≈₂_ - ×-antisymmetric : IsPartialOrder _≈₁_ _≤₁_ Antisymmetric _≈₂_ _≤₂_ - Antisymmetric _≋_ _≤ₗₑₓ_ + ×-antisymmetric : IsPartialOrder _≈₁_ _≤₁_ Antisymmetric _≈₂_ _≤₂_ + Antisymmetric _≋_ _≤ₗₑₓ_ ×-antisymmetric po₁ antisym₂ = Strict.×-antisymmetric {_≈₁_ = _≈₁_} {_<₂_ = _≤₂_} ≈-sym₁ irrefl₁ asym₁ antisym₂ @@ -104,16 +104,16 @@ open IsPartialOrder po₁ open Eq renaming (refl to ≈-refl₁; sym to ≈-sym₁) - irrefl₁ : Irreflexive _≈₁_ (Conv._<_ _≈₁_ _≤₁_) + irrefl₁ : Irreflexive _≈₁_ (Conv._<_ _≈₁_ _≤₁_) irrefl₁ = Conv.<-irrefl _≈₁_ _≤₁_ - asym₁ : Asymmetric (Conv._<_ _≈₁_ _≤₁_) + asym₁ : Asymmetric (Conv._<_ _≈₁_ _≤₁_) asym₁ = trans∧irr⇒asym {_≈_ = _≈₁_} ≈-refl₁ (Conv.<-trans _ _ po₁) irrefl₁ ×-respects₂ : IsEquivalence _≈₁_ - _≤₁_ Respects₂ _≈₁_ _≤₂_ Respects₂ _≈₂_ - _≤ₗₑₓ_ Respects₂ _≋_ + _≤₁_ Respects₂ _≈₁_ _≤₂_ Respects₂ _≈₂_ + _≤ₗₑₓ_ Respects₂ _≋_ ×-respects₂ eq₁ resp₁ resp₂ = Strict.×-respects₂ eq₁ (Conv.<-resp-≈ _ _ eq₁ resp₁) resp₂ @@ -136,7 +136,7 @@ } where open IsPartialOrder - ×-isTotalOrder : Decidable _≈₁_ + ×-isTotalOrder : Decidable _≈₁_ IsTotalOrder _≈₁_ _≤₁_ IsTotalOrder _≈₂_ _≤₂_ IsTotalOrder _≋_ _≤ₗₑₓ_ diff --git a/master/Data.Product.Relation.Binary.Lex.Strict.html b/master/Data.Product.Relation.Binary.Lex.Strict.html index 816fa0b5c0..e069ebb02d 100644 --- a/master/Data.Product.Relation.Binary.Lex.Strict.html +++ b/master/Data.Product.Relation.Binary.Lex.Strict.html @@ -27,7 +27,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsPreorder; IsStrictPartialOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Transitive; Symmetric; Irreflexive; Asymmetric; Total; Decidable; Antisymmetric; Trichotomous; _Respects₂_; _Respectsʳ_; _Respectsˡ_; tri<; tri>; tri≈) + using (Transitive; Symmetric; Irreflexive; Asymmetric; Total; Decidable; Antisymmetric; Trichotomous; _Respects₂_; _Respectsʳ_; _Respectsˡ_; tri<; tri>; tri≈) open import Relation.Binary.Consequences open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -61,13 +61,13 @@ _<ₗₑₓ_ = ×-Lex _≈₁_ _<₁_ _<₂_ - ×-transitive : IsEquivalence _≈₁_ _<₁_ Respects₂ _≈₁_ Transitive _<₁_ - Transitive _<₂_ Transitive _<ₗₑₓ_ + ×-transitive : IsEquivalence _≈₁_ _<₁_ Respects₂ _≈₁_ Transitive _<₁_ + Transitive _<₂_ Transitive _<ₗₑₓ_ ×-transitive eq₁ resp₁ trans₁ trans₂ = trans where module Eq₁ = IsEquivalence eq₁ - trans : Transitive _<ₗₑₓ_ + trans : Transitive _<ₗₑₓ_ trans (inj₁ x₁<y₁) (inj₁ y₁<z₁) = inj₁ (trans₁ x₁<y₁ y₁<z₁) trans (inj₁ x₁<y₁) (inj₂ y≈≤z) = inj₁ (proj₁ resp₁ (proj₁ y≈≤z) x₁<y₁) @@ -77,42 +77,42 @@ inj₂ ( Eq₁.trans (proj₁ x≈≤y) (proj₁ y≈≤z) , trans₂ (proj₂ x≈≤y) (proj₂ y≈≤z)) - ×-asymmetric : Symmetric _≈₁_ _<₁_ Respects₂ _≈₁_ - Asymmetric _<₁_ Asymmetric _<₂_ - Asymmetric _<ₗₑₓ_ + ×-asymmetric : Symmetric _≈₁_ _<₁_ Respects₂ _≈₁_ + Asymmetric _<₁_ Asymmetric _<₂_ + Asymmetric _<ₗₑₓ_ ×-asymmetric sym₁ resp₁ asym₁ asym₂ = asym where - irrefl₁ : Irreflexive _≈₁_ _<₁_ + irrefl₁ : Irreflexive _≈₁_ _<₁_ irrefl₁ = asym⇒irr resp₁ sym₁ asym₁ - asym : Asymmetric _<ₗₑₓ_ + asym : Asymmetric _<ₗₑₓ_ asym (inj₁ x₁<y₁) (inj₁ y₁<x₁) = asym₁ x₁<y₁ y₁<x₁ asym (inj₁ x₁<y₁) (inj₂ y≈<x) = irrefl₁ (sym₁ $ proj₁ y≈<x) x₁<y₁ asym (inj₂ x≈<y) (inj₁ y₁<x₁) = irrefl₁ (sym₁ $ proj₁ x≈<y) y₁<x₁ asym (inj₂ x≈<y) (inj₂ y≈<x) = asym₂ (proj₂ x≈<y) (proj₂ y≈<x) - ×-total₁ : Total _<₁_ Total _<ₗₑₓ_ + ×-total₁ : Total _<₁_ Total _<ₗₑₓ_ ×-total₁ total₁ x y with total₁ (proj₁ x) (proj₁ y) ... | inj₁ x₁<y₁ = inj₁ (inj₁ x₁<y₁) ... | inj₂ x₁>y₁ = inj₂ (inj₁ x₁>y₁) - ×-total₂ : Symmetric _≈₁_ - Trichotomous _≈₁_ _<₁_ Total _<₂_ - Total _<ₗₑₓ_ + ×-total₂ : Symmetric _≈₁_ + Trichotomous _≈₁_ _<₁_ Total _<₂_ + Total _<ₗₑₓ_ ×-total₂ sym tri₁ total₂ x y with tri₁ (proj₁ x) (proj₁ y) - ... | tri< x₁<y₁ _ _ = inj₁ (inj₁ x₁<y₁) - ... | tri> _ _ y₁<x₁ = inj₂ (inj₁ y₁<x₁) - ... | tri≈ _ x₁≈y₁ _ with total₂ (proj₂ x) (proj₂ y) + ... | tri< x₁<y₁ _ _ = inj₁ (inj₁ x₁<y₁) + ... | tri> _ _ y₁<x₁ = inj₂ (inj₁ y₁<x₁) + ... | tri≈ _ x₁≈y₁ _ with total₂ (proj₂ x) (proj₂ y) ... | inj₁ x₂≤y₂ = inj₁ (inj₂ (x₁≈y₁ , x₂≤y₂)) ... | inj₂ y₂≤x₂ = inj₂ (inj₂ (sym x₁≈y₁ , y₂≤x₂)) - ×-decidable : Decidable _≈₁_ Decidable _<₁_ Decidable _<₂_ - Decidable _<ₗₑₓ_ + ×-decidable : Decidable _≈₁_ Decidable _<₁_ Decidable _<₂_ + Decidable _<ₗₑₓ_ ×-decidable dec-≈₁ dec-<₁ dec-≤₂ x y = dec-<₁ (proj₁ x) (proj₁ y) - ⊎-dec + ⊎-dec (dec-≈₁ (proj₁ x) (proj₁ y) - ×-dec + ×-dec dec-≤₂ (proj₂ x) (proj₂ y)) module _ {_≈₁_ : Rel A ℓ₁} {_<₁_ : Rel A ℓ₂} @@ -122,16 +122,16 @@ _≋_ = Pointwise _≈₁_ _≈₂_ _<ₗₑₓ_ = ×-Lex _≈₁_ _<₁_ _<₂_ - ×-irreflexive : Irreflexive _≈₁_ _<₁_ Irreflexive _≈₂_ _<₂_ - Irreflexive (Pointwise _≈₁_ _≈₂_) _<ₗₑₓ_ + ×-irreflexive : Irreflexive _≈₁_ _<₁_ Irreflexive _≈₂_ _<₂_ + Irreflexive (Pointwise _≈₁_ _≈₂_) _<ₗₑₓ_ ×-irreflexive ir₁ ir₂ x≈y (inj₁ x₁<y₁) = ir₁ (proj₁ x≈y) x₁<y₁ ×-irreflexive ir₁ ir₂ x≈y (inj₂ x≈<y) = ir₂ (proj₂ x≈y) (proj₂ x≈<y) - ×-antisymmetric : Symmetric _≈₁_ Irreflexive _≈₁_ _<₁_ Asymmetric _<₁_ - Antisymmetric _≈₂_ _<₂_ Antisymmetric _≋_ _<ₗₑₓ_ + ×-antisymmetric : Symmetric _≈₁_ Irreflexive _≈₁_ _<₁_ Asymmetric _<₁_ + Antisymmetric _≈₂_ _<₂_ Antisymmetric _≋_ _<ₗₑₓ_ ×-antisymmetric sym₁ irrefl₁ asym₁ antisym₂ = antisym where - antisym : Antisymmetric _≋_ _<ₗₑₓ_ + antisym : Antisymmetric _≋_ _<ₗₑₓ_ antisym (inj₁ x₁<y₁) (inj₁ y₁<x₁) = ⊥-elim $ asym₁ x₁<y₁ y₁<x₁ antisym (inj₁ x₁<y₁) (inj₂ y≈≤x) = @@ -141,50 +141,50 @@ antisym (inj₂ x≈≤y) (inj₂ y≈≤x) = proj₁ x≈≤y , antisym₂ (proj₂ x≈≤y) (proj₂ y≈≤x) - ×-respectsʳ : Transitive _≈₁_ - _<₁_ Respectsʳ _≈₁_ _<₂_ Respectsʳ _≈₂_ - _<ₗₑₓ_ Respectsʳ _≋_ + ×-respectsʳ : Transitive _≈₁_ + _<₁_ Respectsʳ _≈₁_ _<₂_ Respectsʳ _≈₂_ + _<ₗₑₓ_ Respectsʳ _≋_ ×-respectsʳ trans resp₁ resp₂ y≈y' (inj₁ x₁<y₁) = inj₁ (resp₁ (proj₁ y≈y') x₁<y₁) ×-respectsʳ trans resp₁ resp₂ y≈y' (inj₂ x≈<y) = inj₂ (trans (proj₁ x≈<y) (proj₁ y≈y') , (resp₂ (proj₂ y≈y') (proj₂ x≈<y))) - ×-respectsˡ : Symmetric _≈₁_ Transitive _≈₁_ - _<₁_ Respectsˡ _≈₁_ _<₂_ Respectsˡ _≈₂_ - _<ₗₑₓ_ Respectsˡ _≋_ + ×-respectsˡ : Symmetric _≈₁_ Transitive _≈₁_ + _<₁_ Respectsˡ _≈₁_ _<₂_ Respectsˡ _≈₂_ + _<ₗₑₓ_ Respectsˡ _≋_ ×-respectsˡ sym trans resp₁ resp₂ x≈x' (inj₁ x₁<y₁) = inj₁ (resp₁ (proj₁ x≈x') x₁<y₁) ×-respectsˡ sym trans resp₁ resp₂ x≈x' (inj₂ x≈<y) = inj₂ (trans (sym $ proj₁ x≈x') (proj₁ x≈<y) , (resp₂ (proj₂ x≈x') (proj₂ x≈<y))) ×-respects₂ : IsEquivalence _≈₁_ - _<₁_ Respects₂ _≈₁_ _<₂_ Respects₂ _≈₂_ - _<ₗₑₓ_ Respects₂ _≋_ + _<₁_ Respects₂ _≈₁_ _<₂_ Respects₂ _≈₂_ + _<ₗₑₓ_ Respects₂ _≋_ ×-respects₂ eq₁ resp₁ resp₂ = ×-respectsʳ trans (proj₁ resp₁) (proj₁ resp₂) , ×-respectsˡ sym trans (proj₂ resp₁) (proj₂ resp₂) where open IsEquivalence eq₁ - ×-compare : Symmetric _≈₁_ - Trichotomous _≈₁_ _<₁_ Trichotomous _≈₂_ _<₂_ - Trichotomous _≋_ _<ₗₑₓ_ + ×-compare : Symmetric _≈₁_ + Trichotomous _≈₁_ _<₁_ Trichotomous _≈₂_ _<₂_ + Trichotomous _≋_ _<ₗₑₓ_ ×-compare sym₁ cmp₁ cmp₂ (x₁ , x₂) (y₁ , y₂) with cmp₁ x₁ y₁ - ... | (tri< x₁<y₁ x₁≉y₁ x₁≯y₁) = - tri< (inj₁ x₁<y₁) + ... | (tri< x₁<y₁ x₁≉y₁ x₁≯y₁) = + tri< (inj₁ x₁<y₁) (x₁≉y₁ proj₁) [ x₁≯y₁ , x₁≉y₁ sym₁ proj₁ ] - ... | (tri> x₁≮y₁ x₁≉y₁ x₁>y₁) = - tri> [ x₁≮y₁ , x₁≉y₁ proj₁ ] + ... | (tri> x₁≮y₁ x₁≉y₁ x₁>y₁) = + tri> [ x₁≮y₁ , x₁≉y₁ proj₁ ] (x₁≉y₁ proj₁) (inj₁ x₁>y₁) - ... | (tri≈ x₁≮y₁ x₁≈y₁ x₁≯y₁) with cmp₂ x₂ y₂ - ... | (tri< x₂<y₂ x₂≉y₂ x₂≯y₂) = - tri< (inj₂ (x₁≈y₁ , x₂<y₂)) + ... | (tri≈ x₁≮y₁ x₁≈y₁ x₁≯y₁) with cmp₂ x₂ y₂ + ... | (tri< x₂<y₂ x₂≉y₂ x₂≯y₂) = + tri< (inj₂ (x₁≈y₁ , x₂<y₂)) (x₂≉y₂ proj₂) [ x₁≯y₁ , x₂≯y₂ proj₂ ] - ... | (tri> x₂≮y₂ x₂≉y₂ x₂>y₂) = - tri> [ x₁≮y₁ , x₂≮y₂ proj₂ ] + ... | (tri> x₂≮y₂ x₂≉y₂ x₂>y₂) = + tri> [ x₁≮y₁ , x₂≮y₂ proj₂ ] (x₂≉y₂ proj₂) (inj₂ (sym₁ x₁≈y₁ , x₂>y₂)) - ... | (tri≈ x₂≮y₂ x₂≈y₂ x₂≯y₂) = - tri≈ [ x₁≮y₁ , x₂≮y₂ proj₂ ] + ... | (tri≈ x₂≮y₂ x₂≈y₂ x₂≯y₂) = + tri≈ [ x₁≮y₁ , x₂≮y₂ proj₂ ] (x₁≈y₁ , x₂≈y₂) [ x₁≯y₁ , x₂≯y₂ proj₂ ] @@ -193,8 +193,8 @@ private _<ₗₑₓ_ = ×-Lex _≈₁_ _<₁_ _<₂_ - ×-wellFounded' : Transitive _≈₁_ - _<₁_ Respectsʳ _≈₁_ + ×-wellFounded' : Transitive _≈₁_ + _<₁_ Respectsʳ _≈₁_ WellFounded _<₁_ WellFounded _<₂_ WellFounded _<ₗₑₓ_ diff --git a/master/Data.Product.Relation.Binary.Pointwise.Dependent.html b/master/Data.Product.Relation.Binary.Pointwise.Dependent.html index 391a5eb256..b97fdbd643 100644 --- a/master/Data.Product.Relation.Binary.Pointwise.Dependent.html +++ b/master/Data.Product.Relation.Binary.Pointwise.Dependent.html @@ -51,13 +51,13 @@ private R×S = Pointwise B R S - refl : B.Reflexive R I.Reflexive B S B.Reflexive R×S + refl : B.Reflexive R I.Reflexive B S B.Reflexive R×S refl refl₁ refl₂ = (refl₁ , refl₂) - symmetric : B.Symmetric R I.Symmetric B S B.Symmetric R×S + symmetric : B.Symmetric R I.Symmetric B S B.Symmetric R×S symmetric sym₁ sym₂ (x₁Rx₂ , y₁Ry₂) = (sym₁ x₁Rx₂ , sym₂ y₁Ry₂) - transitive : B.Transitive R I.Transitive B S B.Transitive R×S + transitive : B.Transitive R I.Transitive B S B.Transitive R×S transitive trans₁ trans₂ (x₁Rx₂ , y₁Ry₂) (x₂Rx₃ , y₂Ry₃) = (trans₁ x₁Rx₂ x₂Rx₃ , trans₂ y₁Ry₂ y₂Ry₃) diff --git a/master/Data.Product.Relation.Binary.Pointwise.NonDependent.html b/master/Data.Product.Relation.Binary.Pointwise.NonDependent.html index d81f59ea24..cc4e13a273 100644 --- a/master/Data.Product.Relation.Binary.Pointwise.NonDependent.html +++ b/master/Data.Product.Relation.Binary.Pointwise.NonDependent.html @@ -14,7 +14,7 @@ open import Level using (Level; _⊔_; 0ℓ) open import Function.Base using (id) open import Function.Bundles using (Inverse) -open import Relation.Nullary.Decidable using (_×-dec_) +open import Relation.Nullary.Decidable using (_×-dec_) open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Preorder; Poset; StrictPartialOrder) @@ -41,46 +41,46 @@ ×-reflexive : ≈₁ R ≈₂ S Pointwise ≈₁ ≈₂ Pointwise R S ×-reflexive refl₁ refl₂ = Product.map refl₁ refl₂ -×-refl : Reflexive R Reflexive S Reflexive (Pointwise R S) +×-refl : Reflexive R Reflexive S Reflexive (Pointwise R S) ×-refl refl₁ refl₂ = refl₁ , refl₂ -×-irreflexive₁ : Irreflexive ≈₁ R - Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) +×-irreflexive₁ : Irreflexive ≈₁ R + Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) ×-irreflexive₁ ir x≈y x<y = ir (proj₁ x≈y) (proj₁ x<y) -×-irreflexive₂ : Irreflexive ≈₂ S - Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) +×-irreflexive₂ : Irreflexive ≈₂ S + Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) ×-irreflexive₂ ir x≈y x<y = ir (proj₂ x≈y) (proj₂ x<y) -×-symmetric : Symmetric R Symmetric S Symmetric (Pointwise R S) +×-symmetric : Symmetric R Symmetric S Symmetric (Pointwise R S) ×-symmetric sym₁ sym₂ = Product.map sym₁ sym₂ -×-transitive : Transitive R Transitive S Transitive (Pointwise R S) +×-transitive : Transitive R Transitive S Transitive (Pointwise R S) ×-transitive trans₁ trans₂ = Product.zip trans₁ trans₂ -×-antisymmetric : Antisymmetric ≈₁ R Antisymmetric ≈₂ S - Antisymmetric (Pointwise ≈₁ ≈₂) (Pointwise R S) +×-antisymmetric : Antisymmetric ≈₁ R Antisymmetric ≈₂ S + Antisymmetric (Pointwise ≈₁ ≈₂) (Pointwise R S) ×-antisymmetric antisym₁ antisym₂ = Product.zip antisym₁ antisym₂ -×-asymmetric₁ : Asymmetric R Asymmetric (Pointwise R S) +×-asymmetric₁ : Asymmetric R Asymmetric (Pointwise R S) ×-asymmetric₁ asym₁ x<y y<x = asym₁ (proj₁ x<y) (proj₁ y<x) -×-asymmetric₂ : Asymmetric S Asymmetric (Pointwise R S) +×-asymmetric₂ : Asymmetric S Asymmetric (Pointwise R S) ×-asymmetric₂ asym₂ x<y y<x = asym₂ (proj₂ x<y) (proj₂ y<x) -×-respectsʳ : R Respectsʳ ≈₁ S Respectsʳ ≈₂ - (Pointwise R S) Respectsʳ (Pointwise ≈₁ ≈₂) +×-respectsʳ : R Respectsʳ ≈₁ S Respectsʳ ≈₂ + (Pointwise R S) Respectsʳ (Pointwise ≈₁ ≈₂) ×-respectsʳ resp₁ resp₂ = Product.zip resp₁ resp₂ -×-respectsˡ : R Respectsˡ ≈₁ S Respectsˡ ≈₂ - (Pointwise R S) Respectsˡ (Pointwise ≈₁ ≈₂) +×-respectsˡ : R Respectsˡ ≈₁ S Respectsˡ ≈₂ + (Pointwise R S) Respectsˡ (Pointwise ≈₁ ≈₂) ×-respectsˡ resp₁ resp₂ = Product.zip resp₁ resp₂ -×-respects₂ : R Respects₂ ≈₁ S Respects₂ ≈₂ - (Pointwise R S) Respects₂ (Pointwise ≈₁ ≈₂) +×-respects₂ : R Respects₂ ≈₁ S Respects₂ ≈₂ + (Pointwise R S) Respects₂ (Pointwise ≈₁ ≈₂) ×-respects₂ = Product.zip ×-respectsʳ ×-respectsˡ -×-total : Symmetric R Total R Total S Total (Pointwise R S) +×-total : Symmetric R Total R Total S Total (Pointwise R S) ×-total sym₁ total₁ total₂ (x₁ , x₂) (y₁ , y₂) with total₁ x₁ y₁ | total₂ x₂ y₂ ... | inj₁ x₁∼y₁ | inj₁ x₂∼y₂ = inj₁ ( x₁∼y₁ , x₂∼y₂) @@ -88,8 +88,8 @@ ... | inj₂ y₁∼x₁ | inj₂ y₂∼x₂ = inj₂ ( y₁∼x₁ , y₂∼x₂) ... | inj₂ y₁∼x₁ | inj₁ x₂∼y₂ = inj₁ (sym₁ y₁∼x₁ , x₂∼y₂) -×-decidable : Decidable R Decidable S Decidable (Pointwise R S) -×-decidable _≟₁_ _≟₂_ (x₁ , x₂) (y₁ , y₂) = (x₁ ≟₁ y₁) ×-dec (x₂ ≟₂ y₂) +×-decidable : Decidable R Decidable S Decidable (Pointwise R S) +×-decidable _≟₁_ _≟₂_ (x₁ , x₂) (y₁ , y₂) = (x₁ ≟₁ y₁) ×-dec (x₂ ≟₂ y₂) ------------------------------------------------------------------------ -- Structures can also be combined. diff --git a/master/Data.Product.html b/master/Data.Product.html index e187e97149..66790f6169 100644 --- a/master/Data.Product.html +++ b/master/Data.Product.html @@ -10,7 +10,7 @@ module Data.Product where open import Level using (Level; _⊔_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) private variable @@ -47,7 +47,7 @@ -- Negation of existential quantifier : {A : Set a} (A Set b) Set (a b) - P = ¬ P + P = ¬ P -- Unique existence (parametrised by an underlying equality). diff --git a/master/Data.Rational.Base.html b/master/Data.Rational.Base.html index 3360b92a70..980f4a0140 100644 --- a/master/Data.Rational.Base.html +++ b/master/Data.Rational.Base.html @@ -22,9 +22,9 @@ open import Data.Sum.Base using (inj₂) open import Function.Base using (id) open import Level using (0ℓ) -open import Relation.Nullary.Decidable.Core using (recompute) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Decidable.Core using (recompute) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Unary using (Pred) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl) @@ -71,7 +71,7 @@ *≡* : {p q} ( p ℤ.* q) ( q ℤ.* p) p q _≄_ : Rel 0ℓ -p q = ¬ (p q) +p q = ¬ (p q) ------------------------------------------------------------------------ -- Ordering of rationals @@ -91,16 +91,16 @@ x > y = y < x _≰_ : Rel 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≱_ : Rel 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≮_ : Rel 0ℓ -x y = ¬ (x < y) +x y = ¬ (x < y) _≯_ : Rel 0ℓ -x y = ¬ (x > y) +x y = ¬ (x > y) ------------------------------------------------------------------------ -- Boolean ordering @@ -167,19 +167,19 @@ ------------------------------------------------------------------------ -- Simple predicates -NonZero : Pred 0ℓ +NonZero : Pred 0ℓ NonZero p = ℚᵘ.NonZero (toℚᵘ p) -Positive : Pred 0ℓ +Positive : Pred 0ℓ Positive p = ℚᵘ.Positive (toℚᵘ p) -Negative : Pred 0ℓ +Negative : Pred 0ℓ Negative p = ℚᵘ.Negative (toℚᵘ p) -NonPositive : Pred 0ℓ +NonPositive : Pred 0ℓ NonPositive p = ℚᵘ.NonPositive (toℚᵘ p) -NonNegative : Pred 0ℓ +NonNegative : Pred 0ℓ NonNegative p = ℚᵘ.NonNegative (toℚᵘ p) -- Instances @@ -192,9 +192,9 @@ ≢-nonZero : {p} p 0ℚ NonZero p ≢-nonZero {mkℚ -[1+ _ ] _ _} _ = _ ≢-nonZero {mkℚ +[1+ _ ] _ _} _ = _ -≢-nonZero {mkℚ +0 zero _} p≢0 = contradiction refl p≢0 +≢-nonZero {mkℚ +0 zero _} p≢0 = contradiction refl p≢0 ≢-nonZero {mkℚ +0 d@(suc m) c} p≢0 = - contradiction {d} ℕ.recompute c {d}) (¬0-coprimeTo-2+ {{ℕ.nonTrivial {m}}}) + contradiction {d} ℕ.recompute c {d}) (¬0-coprimeTo-2+ {{ℕ.nonTrivial {m}}}) >-nonZero : {p} p > 0ℚ NonZero p >-nonZero {p@(mkℚ _ _ _)} (*<* p<q) = ℚᵘ.>-nonZero {toℚᵘ p} (ℚᵘ.*<* p<q) diff --git a/master/Data.Rational.Properties.html b/master/Data.Rational.Properties.html index 1b92451db9..05fda30fe2 100644 --- a/master/Data.Rational.Properties.html +++ b/master/Data.Rational.Properties.html @@ -62,8 +62,8 @@ import Relation.Binary.Reasoning.Setoid as ≈-Reasoning open import Relation.Binary.Reasoning.Syntax using (module ≃-syntax) open import Relation.Nullary.Decidable.Core as Dec - using (yes; no; recompute; map′; _×-dec_) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) + using (yes; no; recompute; map′; _×-dec_) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) open import Algebra.Definitions {A = } _≡_ open import Algebra.Structures {A = } _≡_ @@ -90,11 +90,11 @@ infix 4 _≟_ -_≟_ : DecidableEquality -mkℚ n₁ d₁ _ mkℚ n₂ d₂ _ = map′ +_≟_ : DecidableEquality +mkℚ n₁ d₁ _ mkℚ n₂ d₂ _ = map′ (uncurry mkℚ-cong) mkℚ-injective - (n₁ ℤ.≟ n₂ ×-dec d₁ ℕ.≟ d₂) + (n₁ ℤ.≟ n₂ ×-dec d₁ ℕ.≟ d₂) ≡-setoid : Setoid 0ℓ 0ℓ ≡-setoid = setoid @@ -173,7 +173,7 @@ ... | refl with ℤ.*-cancelʳ-≡ n₁ n₂ (+ suc d₁) eq ... | refl = refl -≃-sym : Symmetric _≃_ +≃-sym : Symmetric _≃_ ≃-sym = ≡⇒≃ ∘′ sym ∘′ ≃⇒≡ ------------------------------------------------------------------------ @@ -400,7 +400,7 @@ /-injective-≃-helper : {m n c d} .{{_ : ℕ.NonZero c}} .{{_ : ℕ.NonZero d}} - normalize (suc m) c normalize n d mkℚᵘ -[1+ m ] (ℕ.pred c) ≃ᵘ mkℚᵘ (+ n) (ℕ.pred d) - /-injective-≃-helper {m} {n} {c} {d} -norm≡norm = contradiction + /-injective-≃-helper {m} {n} {c} {d} -norm≡norm = contradiction (sym -norm≡norm) (nonNeg≢neg (normalize n d) (- normalize (suc m) c)) where instance @@ -503,27 +503,27 @@ ≤-reflexive : _≡_ _≤_ ≤-reflexive refl = *≤* ℤ.≤-refl -≤-refl : Reflexive _≤_ +≤-refl : Reflexive _≤_ ≤-refl = ≤-reflexive refl -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans = ≤-Monomorphism.trans ℚᵘ.≤-trans -≤-antisym : Antisymmetric _≡_ _≤_ +≤-antisym : Antisymmetric _≡_ _≤_ ≤-antisym (*≤* le₁) (*≤* le₂) = ≃⇒≡ (*≡* (ℤ.≤-antisym le₁ le₂)) -≤-total : Total _≤_ +≤-total : Total _≤_ ≤-total p q = [ inj₁ *≤* , inj₂ *≤* ]′ (ℤ.≤-total ( p ℤ.* q) ( q ℤ.* p)) infix 4 _≤?_ _≥?_ -_≤?_ : Decidable _≤_ -p ≤? q = Dec.map′ *≤* drop-*≤* ( p ℤ.* q ℤ.≤? q ℤ.* p) +_≤?_ : Decidable _≤_ +p ≤? q = Dec.map′ *≤* drop-*≤* ( p ℤ.* q ℤ.≤? q ℤ.* p) -_≥?_ : Decidable _≥_ +_≥?_ : Decidable _≥_ _≥?_ = flip _≤?_ -≤-irrelevant : Irrelevant _≤_ +≤-irrelevant : Irrelevant _≤_ ≤-irrelevant (*≤* p≤q₁) (*≤* p≤q₂) = cong *≤* (ℤ.≤-irrelevant p≤q₁ p≤q₂) ------------------------------------------------------------------------ @@ -621,13 +621,13 @@ <⇒≢ : _<_ _≢_ <⇒≢ {p} {q} (*<* p<q) = ℤ.<⇒≢ p<q drop-*≡* ≡⇒≃ -<-irrefl : Irreflexive _≡_ _<_ +<-irrefl : Irreflexive _≡_ _<_ <-irrefl refl (*<* p<p) = ℤ.<-irrefl refl p<p -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym (*<* p<q) (*<* q<p) = ℤ.<-asym p<q q<p -<-dense : Dense _<_ +<-dense : Dense _<_ <-dense {p} {q} p<q = let m , p<ᵘm , m<ᵘq = ℚᵘ.<-dense (toℚᵘ-mono-< p<q) @@ -641,7 +641,7 @@ m<q = toℚᵘ-cancel-< (ℚᵘ.<-respˡ-≃ m≃m m<ᵘq) in fromℚᵘ m , p<m , m<q -<-≤-trans : Trans _<_ _≤_ _<_ +<-≤-trans : Trans _<_ _≤_ _<_ <-≤-trans {p} {q} {r} (*<* p<q) (*≤* q≤r) = *<* (ℤ.*-cancelʳ-<-nonNeg _ (begin-strict let n₁ = p; n₂ = q; n₃ = r; sd₁ = p; sd₂ = q; sd₃ = r in @@ -657,7 +657,7 @@ (n₃ ℤ.* sd₁) ℤ.* sd₂ )) where open ℤ.≤-Reasoning -≤-<-trans : Trans _≤_ _<_ _<_ +≤-<-trans : Trans _≤_ _<_ _<_ ≤-<-trans {p} {q} {r} (*≤* p≤q) (*<* q<r) = *<* (ℤ.*-cancelʳ-<-nonNeg _ (begin-strict let n₁ = p; n₂ = q; n₃ = r; sd₁ = p; sd₂ = q; sd₃ = r in @@ -673,33 +673,33 @@ (n₃ ℤ.* sd₁) ℤ.* sd₂ )) where open ℤ.≤-Reasoning -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans p<q = ≤-<-trans (<⇒≤ p<q) infix 4 _<?_ _>?_ -_<?_ : Decidable _<_ -p <? q = Dec.map′ *<* drop-*<* (( p ℤ.* q) ℤ.<? ( q ℤ.* p)) +_<?_ : Decidable _<_ +p <? q = Dec.map′ *<* drop-*<* (( p ℤ.* q) ℤ.<? ( q ℤ.* p)) -_>?_ : Decidable _>_ +_>?_ : Decidable _>_ _>?_ = flip _<?_ -<-cmp : Trichotomous _≡_ _<_ +<-cmp : Trichotomous _≡_ _<_ <-cmp p q with ℤ.<-cmp ( p ℤ.* q) ( q ℤ.* p) -... | tri< < = tri< (*<* <) ( drop-*≡* ≡⇒≃) ( drop-*<*) -... | tri≈ = tri≈ ( drop-*<*) (≃⇒≡ (*≡* )) ( drop-*<*) -... | tri> > = tri> ( drop-*<*) ( drop-*≡* ≡⇒≃) (*<* >) +... | tri< < = tri< (*<* <) ( drop-*≡* ≡⇒≃) ( drop-*<*) +... | tri≈ = tri≈ ( drop-*<*) (≃⇒≡ (*≡* )) ( drop-*<*) +... | tri> > = tri> ( drop-*<*) ( drop-*≡* ≡⇒≃) (*<* >) -<-irrelevant : Irrelevant _<_ +<-irrelevant : Irrelevant _<_ <-irrelevant (*<* p<q₁) (*<* p<q₂) = cong *<* (ℤ.<-irrelevant p<q₁ p<q₂) -<-respʳ-≡ : _<_ Respectsʳ _≡_ +<-respʳ-≡ : _<_ Respectsʳ _≡_ <-respʳ-≡ = subst (_ <_) -<-respˡ-≡ : _<_ Respectsˡ _≡_ +<-respˡ-≡ : _<_ Respectsˡ _≡_ <-respˡ-≡ = subst (_< _) -<-resp-≡ : _<_ Respects₂ _≡_ +<-resp-≡ : _<_ Respects₂ _≡_ <-resp-≡ = <-respʳ-≡ , <-respˡ-≡ ------------------------------------------------------------------------ @@ -761,7 +761,7 @@ open Triple public hiding (step-≈; step-≈˘; step-≈-⟩; step-≈-⟨) - ≃-go : Trans _≃_ _IsRelatedTo_ _IsRelatedTo_ + ≃-go : Trans _≃_ _IsRelatedTo_ _IsRelatedTo_ ≃-go = Triple.≈-go ∘′ ≃⇒≡ open ≃-syntax _IsRelatedTo_ _IsRelatedTo_ ≃-go {x y} ≃-sym {x} {y}) public @@ -843,7 +843,7 @@ toℚᵘ-homo-+ : Homomorphic₂ toℚᵘ _+_ ℚᵘ._+_ toℚᵘ-homo-+ p@record{} q@record{} with +-nf p q ℤ.≟ 0ℤ -... | yes nf[p,q]≡0 = *≡* $ begin +... | yes nf[p,q]≡0 = *≡* $ begin ↥ᵘ (toℚᵘ (p + q)) ℤ.* ↧+ᵘ p q ≡⟨ cong (ℤ._* ↧+ᵘ p q) (↥ᵘ-toℚᵘ (p + q)) (p + q) ℤ.* ↧+ᵘ p q ≡⟨ cong (ℤ._* ↧+ᵘ p q) eq 0ℤ ℤ.* ↧+ᵘ p q ≡⟨⟩ @@ -858,7 +858,7 @@ eq : (p + q) 0ℤ eq rewrite eq2 = cong ↥_ (0/n≡0 (↧ₙ p ℕ.* ↧ₙ q)) -... | no nf[p,q]≢0 = *≡* (ℤ.*-cancelʳ-≡ _ _ (+-nf p q) {{ℤ.≢-nonZero nf[p,q]≢0}} $ begin +... | no nf[p,q]≢0 = *≡* (ℤ.*-cancelʳ-≡ _ _ (+-nf p q) {{ℤ.≢-nonZero nf[p,q]≢0}} $ begin (↥ᵘ (toℚᵘ (p + q))) ℤ.* ↧+ᵘ p q ℤ.* +-nf p q ≡⟨ cong v v ℤ.* ↧+ᵘ p q ℤ.* +-nf p q) (↥ᵘ-toℚᵘ (p + q)) (p + q) ℤ.* ↧+ᵘ p q ℤ.* +-nf p q ≡⟨ xy∙z≈xz∙y ( (p + q)) _ _ (p + q) ℤ.* +-nf p q ℤ.* ↧+ᵘ p q ≡⟨ cong (ℤ._* ↧+ᵘ p q) (↥-+ p q) @@ -1055,7 +1055,7 @@ toℚᵘ-homo-* : Homomorphic₂ toℚᵘ _*_ ℚᵘ._*_ toℚᵘ-homo-* p@record{} q@record{} with *-nf p q ℤ.≟ 0ℤ -... | yes nf[p,q]≡0 = *≡* $ begin +... | yes nf[p,q]≡0 = *≡* $ begin ↥ᵘ (toℚᵘ (p * q)) ℤ.* ( p ℤ.* q) ≡⟨ cong (ℤ._* ( p ℤ.* q)) (↥ᵘ-toℚᵘ (p * q)) (p * q) ℤ.* ( p ℤ.* q) ≡⟨ cong (ℤ._* ( p ℤ.* q)) eq 0ℤ ℤ.* ( p ℤ.* q) ≡⟨⟩ @@ -1069,7 +1069,7 @@ eq : (p * q) 0ℤ eq rewrite eq2 = cong ↥_ (0/n≡0 (↧ₙ p ℕ.* ↧ₙ q)) -... | no nf[p,q]≢0 = *≡* (ℤ.*-cancelʳ-≡ _ _ (*-nf p q) {{ℤ.≢-nonZero nf[p,q]≢0}} $ begin +... | no nf[p,q]≢0 = *≡* (ℤ.*-cancelʳ-≡ _ _ (*-nf p q) {{ℤ.≢-nonZero nf[p,q]≢0}} $ begin ↥ᵘ (toℚᵘ (p * q)) ℤ.* ( p ℤ.* q) ℤ.* *-nf p q ≡⟨ cong v v ℤ.* ( p ℤ.* q) ℤ.* *-nf p q) (↥ᵘ-toℚᵘ (p * q)) (p * q) ℤ.* ( p ℤ.* q) ℤ.* *-nf p q ≡⟨ xy∙z≈xz∙y ( (p * q)) _ _ (p * q) ℤ.* *-nf p q ℤ.* ( p ℤ.* q) ≡⟨ cong (ℤ._* ( p ℤ.* q)) (↥-* p q) @@ -1263,7 +1263,7 @@ where instance _ = ≢-nonZero (p≢q (x∙y⁻¹≈ε⇒x≈y p q)) invertible⇒# : Invertible 1ℚ _*_ (p - q) p q - invertible⇒# {p} {q} (1/[p-q] , _ , [p-q]/[p-q]≡1) p≡q = contradiction 1≡0 1≢0 + invertible⇒# {p} {q} (1/[p-q] , _ , [p-q]/[p-q]≡1) p≡q = contradiction 1≡0 1≢0 where open ≈-Reasoning ≡-setoid 1≡0 : 1ℚ 0ℚ @@ -1395,7 +1395,7 @@ p≤q⇒p⊔q≡q : p q p q q p≤q⇒p⊔q≡q {p@record{}} {q@record{}} p≤q with p ≤ᵇ q in p≰q ... | true = refl -... | false = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) +... | false = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) p≥q⇒p⊔q≡p : p q p q p p≥q⇒p⊔q≡p {p@record{}} {q@record{}} p≥q with p ≤ᵇ q in p≤q @@ -1405,7 +1405,7 @@ p≤q⇒p⊓q≡p : p q p q p p≤q⇒p⊓q≡p {p@record{}} {q@record{}} p≤q with p ≤ᵇ q in p≰q ... | true = refl -... | false = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) +... | false = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) p≥q⇒p⊓q≡q : p q p q q p≥q⇒p⊓q≡q {p@record{}} {q@record{}} p≥q with p ≤ᵇ q in p≤q @@ -1543,17 +1543,17 @@ mono-<-distrib-⊓ : {f} f Preserves _<_ _<_ p q f (p q) f p f q mono-<-distrib-⊓ {f} f-mono-< p q with <-cmp p q -... | tri< p<q p≢r p≯q = begin +... | tri< p<q p≢r p≯q = begin f (p q) ≡⟨ cong f (p≤q⇒p⊓q≡p (<⇒≤ p<q)) f p ≡⟨ p≤q⇒p⊓q≡p (<⇒≤ (f-mono-< p<q)) f p f q where open ≡-Reasoning -... | tri≈ p≮q refl p≯q = begin +... | tri≈ p≮q refl p≯q = begin f (p q) ≡⟨ cong f (⊓-idem p) f p ≡⟨ ⊓-idem (f p) f p f q where open ≡-Reasoning -... | tri> p≮q p≡r p>q = begin +... | tri> p≮q p≡r p>q = begin f (p q) ≡⟨ cong f (p≥q⇒p⊓q≡q (<⇒≤ p>q)) f q ≡⟨ p≥q⇒p⊓q≡q (<⇒≤ (f-mono-< p>q)) f p f q @@ -1562,17 +1562,17 @@ mono-<-distrib-⊔ : {f} f Preserves _<_ _<_ p q f (p q) f p f q mono-<-distrib-⊔ {f} f-mono-< p q with <-cmp p q -... | tri< p<q p≢r p≯q = begin +... | tri< p<q p≢r p≯q = begin f (p q) ≡⟨ cong f (p≤q⇒p⊔q≡q (<⇒≤ p<q)) f q ≡⟨ p≤q⇒p⊔q≡q (<⇒≤ (f-mono-< p<q)) f p f q where open ≡-Reasoning -... | tri≈ p≮q refl p≯q = begin +... | tri≈ p≮q refl p≯q = begin f (p q) ≡⟨ cong f (⊔-idem p) f q ≡⟨ ⊔-idem (f p) f p f q where open ≡-Reasoning -... | tri> p≮q p≡r p>q = begin +... | tri> p≮q p≡r p>q = begin f (p q) ≡⟨ cong f (p≥q⇒p⊔q≡p (<⇒≤ p>q)) f p ≡⟨ p≥q⇒p⊔q≡p (<⇒≤ (f-mono-< p>q)) f p f q diff --git a/master/Data.Rational.Unnormalised.Base.html b/master/Data.Rational.Unnormalised.Base.html index 803b0e2131..e950df20da 100644 --- a/master/Data.Rational.Unnormalised.Base.html +++ b/master/Data.Rational.Unnormalised.Base.html @@ -17,8 +17,8 @@ hiding (module ) open import Data.Nat.Base as using (; zero; suc) open import Level using (0ℓ) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Unary using (Pred) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl) @@ -69,7 +69,7 @@ *≡* : {p q} ( p ℤ.* q) ( q ℤ.* p) p q _≄_ : Rel ℚᵘ 0ℓ -p q = ¬ (p q) +p q = ¬ (p q) ------------------------------------------------------------------------ -- Ordering of rationals @@ -89,16 +89,16 @@ x > y = y < x _≰_ : Rel ℚᵘ 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≱_ : Rel ℚᵘ 0ℓ -x y = ¬ (x y) +x y = ¬ (x y) _≮_ : Rel ℚᵘ 0ℓ -x y = ¬ (x < y) +x y = ¬ (x < y) _≯_ : Rel ℚᵘ 0ℓ -x y = ¬ (x > y) +x y = ¬ (x > y) ------------------------------------------------------------------------ -- Boolean ordering @@ -137,19 +137,19 @@ ------------------------------------------------------------------------ -- Simple predicates -NonZero : Pred ℚᵘ 0ℓ +NonZero : Pred ℚᵘ 0ℓ NonZero p = ℤ.NonZero ( p) -Positive : Pred ℚᵘ 0ℓ +Positive : Pred ℚᵘ 0ℓ Positive p = ℤ.Positive ( p) -Negative : Pred ℚᵘ 0ℓ +Negative : Pred ℚᵘ 0ℓ Negative p = ℤ.Negative ( p) -NonPositive : Pred ℚᵘ 0ℓ +NonPositive : Pred ℚᵘ 0ℓ NonPositive p = ℤ.NonPositive ( p) -NonNegative : Pred ℚᵘ 0ℓ +NonNegative : Pred ℚᵘ 0ℓ NonNegative p = ℤ.NonNegative ( p) -- Instances @@ -166,8 +166,8 @@ ≢-nonZero : {p} p 0ℚᵘ NonZero p ≢-nonZero {mkℚᵘ -[1+ _ ] _ } _ = _ ≢-nonZero {mkℚᵘ +[1+ _ ] _ } _ = _ -≢-nonZero {mkℚᵘ +0 zero } p≢0 = contradiction (*≡* refl) p≢0 -≢-nonZero {mkℚᵘ +0 (suc d)} p≢0 = contradiction (*≡* refl) p≢0 +≢-nonZero {mkℚᵘ +0 zero } p≢0 = contradiction (*≡* refl) p≢0 +≢-nonZero {mkℚᵘ +0 (suc d)} p≢0 = contradiction (*≡* refl) p≢0 >-nonZero : {p} p > 0ℚᵘ NonZero p >-nonZero {mkℚᵘ +0 _} (*<* (+<+ ())) diff --git a/master/Data.Rational.Unnormalised.Properties.html b/master/Data.Rational.Unnormalised.Properties.html index c3fab916e7..0800bae148 100644 --- a/master/Data.Rational.Unnormalised.Properties.html +++ b/master/Data.Rational.Unnormalised.Properties.html @@ -30,15 +30,15 @@ import Data.Sign as Sign open import Function.Base using (_on_; _$_; _∘_; flip) open import Level using (0ℓ) -open import Relation.Nullary.Decidable.Core as Dec using (yes; no) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Decidable.Core as Dec using (yes; no) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) open import Relation.Binary.Core using (_⇒_; _Preserves_⟶_; _Preserves₂_⟶_⟶_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Preorder; TotalPreorder; Poset; TotalOrder; DecTotalOrder; StrictPartialOrder; StrictTotalOrder; DenseLinearOrder) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsApartnessRelation; IsTotalPreorder; IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictPartialOrder; IsStrictTotalOrder; IsDenseLinearOrder) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Cotransitive; Tight; Decidable; Antisymmetric; Asymmetric; Dense; Total; Trans; Trichotomous; Irreflexive; Irrelevant; _Respectsˡ_; _Respectsʳ_; _Respects₂_; tri≈; tri<; tri>) + using (Reflexive; Symmetric; Transitive; Cotransitive; Tight; Decidable; Antisymmetric; Asymmetric; Dense; Total; Trans; Trichotomous; Irreflexive; Irrelevant; _Respectsˡ_; _Respectsʳ_; _Respects₂_; tri≈; tri<; tri>) import Relation.Binary.Consequences as BC open import Relation.Binary.PropositionalEquality import Relation.Binary.Properties.Poset as PosetProperties @@ -79,16 +79,16 @@ drop-*≡* : {p q} p q p ℤ.* q q ℤ.* p drop-*≡* (*≡* eq) = eq -≃-refl : Reflexive _≃_ +≃-refl : Reflexive _≃_ ≃-refl = *≡* refl ≃-reflexive : _≡_ _≃_ ≃-reflexive refl = *≡* refl -≃-sym : Symmetric _≃_ +≃-sym : Symmetric _≃_ ≃-sym (*≡* eq) = *≡* (sym eq) -≃-trans : Transitive _≃_ +≃-trans : Transitive _≃_ ≃-trans {x} {y} {z} (*≡* ad≡cb) (*≡* cf≡ed) = *≡* (ℤ.*-cancelʳ-≡ ( x ℤ.* z) ( z ℤ.* x) ( y) (begin x ℤ.* z ℤ.* y ≡⟨ xy∙z≈xz∙y ( x) _ _ @@ -101,23 +101,23 @@ infix 4 _≃?_ -_≃?_ : Decidable _≃_ -p ≃? q = Dec.map′ *≡* drop-*≡* ( p ℤ.* q ℤ.≟ q ℤ.* p) +_≃?_ : Decidable _≃_ +p ≃? q = Dec.map′ *≡* drop-*≡* ( p ℤ.* q ℤ.≟ q ℤ.* p) 0≄1 : 0ℚᵘ 1ℚᵘ -0≄1 = Dec.from-no (0ℚᵘ ≃? 1ℚᵘ) +0≄1 = Dec.from-no (0ℚᵘ ≃? 1ℚᵘ) -≃-≄-irreflexive : Irreflexive _≃_ _≄_ +≃-≄-irreflexive : Irreflexive _≃_ _≄_ ≃-≄-irreflexive x≃y x≄y = x≄y x≃y -≄-symmetric : Symmetric _≄_ +≄-symmetric : Symmetric _≄_ ≄-symmetric x≄y y≃x = x≄y (≃-sym y≃x) -≄-cotransitive : Cotransitive _≄_ +≄-cotransitive : Cotransitive _≄_ ≄-cotransitive {x} {y} x≄y z with x ≃? z | z ≃? y -... | no x≄z | _ = inj₁ x≄z -... | yes _ | no z≄y = inj₂ z≄y -... | yes x≃z | yes z≃y = contradiction (≃-trans x≃z z≃y) x≄y +... | no x≄z | _ = inj₁ x≄z +... | yes _ | no z≄y = inj₂ z≄y +... | yes x≃z | yes z≃y = contradiction (≃-trans x≃z z≃y) x≄y ≃-isEquivalence : IsEquivalence _≃_ ≃-isEquivalence = record @@ -139,8 +139,8 @@ ; cotrans = ≄-cotransitive } -≄-tight : Tight _≃_ _≄_ -proj₁ (≄-tight p q) ¬p≄q = Dec.decidable-stable (p ≃? q) ¬p≄q +≄-tight : Tight _≃_ _≄_ +proj₁ (≄-tight p q) ¬p≄q = Dec.decidable-stable (p ≃? q) ¬p≄q proj₂ (≄-tight p q) p≃q p≄q = p≄q p≃q ≃-setoid : Setoid 0ℓ 0ℓ @@ -223,13 +223,13 @@ ≤-reflexive : _≃_ _≤_ ≤-reflexive (*≡* eq) = *≤* (ℤ.≤-reflexive eq) -≤-refl : Reflexive _≤_ +≤-refl : Reflexive _≤_ ≤-refl = ≤-reflexive ≃-refl ≤-reflexive-≡ : _≡_ _≤_ ≤-reflexive-≡ refl = ≤-refl -≤-trans : Transitive _≤_ +≤-trans : Transitive _≤_ ≤-trans {p} {q} {r} (*≤* eq₁) (*≤* eq₂) = let n₁ = p; n₂ = q; n₃ = r; d₁ = p; d₂ = q; d₃ = r in *≤* $ ℤ.*-cancelʳ-≤-pos (n₁ ℤ.* d₃) (n₃ ℤ.* d₁) d₂ $ begin @@ -244,32 +244,32 @@ (d₁ ℤ.* n₃) ℤ.* d₂ ≡⟨ cong (ℤ._* d₂) (ℤ.*-comm d₁ n₃) (n₃ ℤ.* d₁) ℤ.* d₂ where open ℤ.≤-Reasoning -≤-antisym : Antisymmetric _≃_ _≤_ +≤-antisym : Antisymmetric _≃_ _≤_ ≤-antisym (*≤* le₁) (*≤* le₂) = *≡* (ℤ.≤-antisym le₁ le₂) -≤-total : Total _≤_ +≤-total : Total _≤_ ≤-total p q = [ inj₁ *≤* , inj₂ *≤* ]′ (ℤ.≤-total ( p ℤ.* q) ( q ℤ.* p)) -≤-respˡ-≃ : _≤_ Respectsˡ _≃_ +≤-respˡ-≃ : _≤_ Respectsˡ _≃_ ≤-respˡ-≃ x≈y = ≤-trans (≤-reflexive (≃-sym x≈y)) -≤-respʳ-≃ : _≤_ Respectsʳ _≃_ +≤-respʳ-≃ : _≤_ Respectsʳ _≃_ ≤-respʳ-≃ x≈y z≤x = ≤-trans z≤x (≤-reflexive x≈y) -≤-resp₂-≃ : _≤_ Respects₂ _≃_ +≤-resp₂-≃ : _≤_ Respects₂ _≃_ ≤-resp₂-≃ = ≤-respʳ-≃ , ≤-respˡ-≃ infix 4 _≤?_ _≥?_ -_≤?_ : Decidable _≤_ -p ≤? q = Dec.map′ *≤* drop-*≤* ( p ℤ.* q ℤ.≤? q ℤ.* p) +_≤?_ : Decidable _≤_ +p ≤? q = Dec.map′ *≤* drop-*≤* ( p ℤ.* q ℤ.≤? q ℤ.* p) -_≥?_ : Decidable _≥_ +_≥?_ : Decidable _≥_ _≥?_ = flip _≤?_ -≤-irrelevant : Irrelevant _≤_ +≤-irrelevant : Irrelevant _≤_ ≤-irrelevant (*≤* p≤q₁) (*≤* p≤q₂) = cong *≤* (ℤ.≤-irrelevant p≤q₁ p≤q₂) ------------------------------------------------------------------------ @@ -414,16 +414,16 @@ ------------------------------------------------------------------------ -- Relational properties -<-irrefl-≡ : Irreflexive _≡_ _<_ +<-irrefl-≡ : Irreflexive _≡_ _<_ <-irrefl-≡ refl (*<* x<x) = ℤ.<-irrefl refl x<x -<-irrefl : Irreflexive _≃_ _<_ +<-irrefl : Irreflexive _≃_ _<_ <-irrefl (*≡* x≡y) (*<* x<y) = ℤ.<-irrefl x≡y x<y -<-asym : Asymmetric _<_ +<-asym : Asymmetric _<_ <-asym (*<* x<y) = ℤ.<-asym x<y drop-*<* -<-dense : Dense _<_ +<-dense : Dense _<_ <-dense {p} {q} (*<* p<q) = m , p<m , m<q where open ℤ.≤-Reasoning @@ -456,7 +456,7 @@ ≡⟨⟩ q ℤ.* m ) -≤-<-trans : Trans _≤_ _<_ _<_ +≤-<-trans : Trans _≤_ _<_ _<_ ≤-<-trans {p} {q} {r} (*≤* p≤q) (*<* q<r) = *<* $ ℤ.*-cancelʳ-<-nonNeg _ $ begin-strict n₁ ℤ.* d₃ ℤ.* d₂ ≡⟨ ℤ.*-assoc n₁ d₃ d₂ @@ -472,7 +472,7 @@ where open ℤ.≤-Reasoning n₁ = p; n₂ = q; n₃ = r; d₁ = p; d₂ = q; d₃ = r -<-≤-trans : Trans _<_ _≤_ _<_ +<-≤-trans : Trans _<_ _≤_ _<_ <-≤-trans {p} {q} {r} (*<* p<q) (*≤* q≤r) = *<* $ ℤ.*-cancelʳ-<-nonNeg _ $ begin-strict n₁ ℤ.* d₃ ℤ.* d₂ ≡⟨ ℤ.*-assoc n₁ d₃ d₂ @@ -488,27 +488,27 @@ where open ℤ.≤-Reasoning n₁ = p; n₂ = q; n₃ = r; d₁ = p; d₂ = q; d₃ = r -<-trans : Transitive _<_ +<-trans : Transitive _<_ <-trans = ≤-<-trans <⇒≤ -<-cmp : Trichotomous _≃_ _<_ +<-cmp : Trichotomous _≃_ _<_ <-cmp p q with ℤ.<-cmp ( p ℤ.* q) ( q ℤ.* p) -... | tri< x<y x≉y x≯y = tri< (*<* x<y) (x≉y drop-*≡*) (x≯y drop-*<*) -... | tri≈ x≮y x≈y x≯y = tri≈ (x≮y drop-*<*) (*≡* x≈y) (x≯y drop-*<*) -... | tri> x≮y x≉y x>y = tri> (x≮y drop-*<*) (x≉y drop-*≡*) (*<* x>y) +... | tri< x<y x≉y x≯y = tri< (*<* x<y) (x≉y drop-*≡*) (x≯y drop-*<*) +... | tri≈ x≮y x≈y x≯y = tri≈ (x≮y drop-*<*) (*≡* x≈y) (x≯y drop-*<*) +... | tri> x≮y x≉y x>y = tri> (x≮y drop-*<*) (x≉y drop-*≡*) (*<* x>y) infix 4 _<?_ _>?_ -_<?_ : Decidable _<_ -p <? q = Dec.map′ *<* drop-*<* ( p ℤ.* q ℤ.<? q ℤ.* p) +_<?_ : Decidable _<_ +p <? q = Dec.map′ *<* drop-*<* ( p ℤ.* q ℤ.<? q ℤ.* p) -_>?_ : Decidable _>_ +_>?_ : Decidable _>_ _>?_ = flip _<?_ -<-irrelevant : Irrelevant _<_ +<-irrelevant : Irrelevant _<_ <-irrelevant (*<* p<q₁) (*<* p<q₂) = cong *<* (ℤ.<-irrelevant p<q₁ p<q₂) -<-respʳ-≃ : _<_ Respectsʳ _≃_ +<-respʳ-≃ : _<_ Respectsʳ _≃_ <-respʳ-≃ {p} {q} {r} (*≡* q≡r) (*<* p<q) = *<* $ ℤ.*-cancelʳ-<-nonNeg _ $ begin-strict n₁ ℤ.* d₃ ℤ.* d₂ ≡⟨ ℤ.*-assoc n₁ d₃ d₂ @@ -526,13 +526,13 @@ where open ℤ.≤-Reasoning n₁ = p; n₂ = q; n₃ = r; d₁ = p; d₂ = q; d₃ = r -<-respˡ-≃ : _<_ Respectsˡ _≃_ +<-respˡ-≃ : _<_ Respectsˡ _≃_ <-respˡ-≃ q≃r q<p = subst (_< _) (neg-involutive-≡ _) $ subst (_ <_) (neg-involutive-≡ _) $ neg-mono-< (<-respʳ-≃ (-‿cong q≃r) (neg-mono-< q<p)) -<-resp-≃ : _<_ Respects₂ _≃_ +<-resp-≃ : _<_ Respects₂ _≃_ <-resp-≃ = <-respʳ-≃ , <-respˡ-≃ ------------------------------------------------------------------------ @@ -1526,7 +1526,7 @@ p≤q⇒p⊔q≃q : p q p q q p≤q⇒p⊔q≃q {p@record{}} {q@record{}} p≤q with p ≤ᵇ q | inspect (p ≤ᵇ_) q ... | true | _ = ≃-refl -... | false | [ p≰q ] = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) +... | false | [ p≰q ] = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) p≥q⇒p⊔q≃p : p q p q p p≥q⇒p⊔q≃p {p@record{}} {q@record{}} p≥q with p ≤ᵇ q | inspect (p ≤ᵇ_) q @@ -1536,7 +1536,7 @@ p≤q⇒p⊓q≃p : p q p q p p≤q⇒p⊓q≃p {p@record{}} {q@record{}} p≤q with p ≤ᵇ q | inspect (p ≤ᵇ_) q ... | true | _ = ≃-refl -... | false | [ p≰q ] = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) +... | false | [ p≰q ] = contradiction (≤⇒≤ᵇ p≤q) (subst (¬_ T) (sym p≰q) λ()) p≥q⇒p⊓q≃q : p q p q q p≥q⇒p⊓q≃q {p@record{}} {q@record{}} p≥q with p ≤ᵇ q | inspect (p ≤ᵇ_) q @@ -1800,7 +1800,7 @@ 0≤p⇒∣p∣≡p : 0ℚᵘ p p p 0≤p⇒∣p∣≡p {mkℚᵘ (ℤ.+ n) d-1} 0≤p = refl -0≤p⇒∣p∣≡p {mkℚᵘ -[1+ n ] d-1} 0≤p = contradiction 0≤p (<⇒≱ (*<* ℤ.-<+)) +0≤p⇒∣p∣≡p {mkℚᵘ -[1+ n ] d-1} 0≤p = contradiction 0≤p (<⇒≱ (*<* ℤ.-<+)) 0≤p⇒∣p∣≃p : 0ℚᵘ p p p 0≤p⇒∣p∣≃p {p} = ≃-reflexive 0≤p⇒∣p∣≡p {p} diff --git a/master/Data.Record.html b/master/Data.Record.html index 72cb61f383..4dbdd4f8f4 100644 --- a/master/Data.Record.html +++ b/master/Data.Record.html @@ -17,13 +17,13 @@ open import Data.Unit.Polymorphic using () open import Function.Base using (id; _∘_) open import Level using (suc; _⊔_) -open import Relation.Binary.Definitions using (DecidableEquality) -open import Relation.Nullary.Decidable using (does) +open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable using (does) -- The module is parametrised by the type of labels, which should come -- with decidable equality. -module Data.Record {} (Label : Set ) (_≟_ : DecidableEquality Label) where +module Data.Record {} (Label : Set ) (_≟_ : DecidableEquality Label) where ------------------------------------------------------------------------ -- A Σ-type with a manifest field @@ -90,7 +90,7 @@ _∈_ : {s} Label Signature s Set Sig = - foldr ℓ′ if does ( ℓ′) then _ ) else id) (labels Sig) + foldr ℓ′ if does ( ℓ′) then _ ) else id) (labels Sig) ------------------------------------------------------------------------ -- Projections @@ -101,10 +101,10 @@ Restrict : {s} (Sig : Signature s) ( : Label) Sig Signature s Restrict () -Restrict (Sig , ℓ′ A) ℓ∈ with does ( ℓ′) +Restrict (Sig , ℓ′ A) ℓ∈ with does ( ℓ′) ... | true = Sig ... | false = Restrict Sig ℓ∈ -Restrict (Sig , ℓ′ a) ℓ∈ with does ( ℓ′) +Restrict (Sig , ℓ′ a) ℓ∈ with does ( ℓ′) ... | true = Sig ... | false = Restrict Sig ℓ∈ @@ -114,10 +114,10 @@ Proj : {s} (Sig : Signature s) ( : Label) {ℓ∈ : Sig} Restricted Sig ℓ∈ Set s Proj {} -Proj (Sig , ℓ′ A) {ℓ∈} with does ( ℓ′) +Proj (Sig , ℓ′ A) {ℓ∈} with does ( ℓ′) ... | true = A ... | false = Proj Sig {ℓ∈} -Proj (_,_≔_ Sig ℓ′ {A = A} a) {ℓ∈} with does ( ℓ′) +Proj (_,_≔_ Sig ℓ′ {A = A} a) {ℓ∈} with does ( ℓ′) ... | true = A ... | false = Proj Sig {ℓ∈} @@ -128,10 +128,10 @@ _∣_ : {s} {Sig : Signature s} Record Sig ( : Label) {ℓ∈ : Sig} Restricted Sig ℓ∈ _∣_ {Sig = } r {} -_∣_ {Sig = Sig , ℓ′ A} (rec r) {ℓ∈} with does ( ℓ′) +_∣_ {Sig = Sig , ℓ′ A} (rec r) {ℓ∈} with does ( ℓ′) ... | true = Σ.proj₁ r ... | false = _∣_ (Σ.proj₁ r) {ℓ∈} -_∣_ {Sig = Sig , ℓ′ a} (rec r) {ℓ∈} with does ( ℓ′) +_∣_ {Sig = Sig , ℓ′ a} (rec r) {ℓ∈} with does ( ℓ′) ... | true = Manifest-Σ.proj₁ r ... | false = _∣_ (Manifest-Σ.proj₁ r) {ℓ∈} @@ -141,10 +141,10 @@ ( : Label) {ℓ∈ : Sig} Proj Sig {ℓ∈} (r ) _·_ {Sig = } r {} -_·_ {Sig = Sig , ℓ′ A} (rec r) {ℓ∈} with does ( ℓ′) +_·_ {Sig = Sig , ℓ′ A} (rec r) {ℓ∈} with does ( ℓ′) ... | true = Σ.proj₂ r ... | false = _·_ (Σ.proj₁ r) {ℓ∈} -_·_ {Sig = Sig , ℓ′ a} (rec r) {ℓ∈} with does ( ℓ′) +_·_ {Sig = Sig , ℓ′ a} (rec r) {ℓ∈} with does ( ℓ′) ... | true = Manifest-Σ.proj₂ r ... | false = _·_ (Manifest-Σ.proj₁ r) {ℓ∈} @@ -160,10 +160,10 @@ _With_≔_ : {s} (Sig : Signature s) ( : Label) {ℓ∈ : Sig} ((r : Restricted Sig ℓ∈) Proj Sig r) Signature s _With_≔_ {} a - _With_≔_ (Sig , ℓ′ A) {ℓ∈} a with does ( ℓ′) + _With_≔_ (Sig , ℓ′ A) {ℓ∈} a with does ( ℓ′) ... | true = Sig , ℓ′ a ... | false = _With_≔_ Sig {ℓ∈} a , ℓ′ A drop-With - _With_≔_ (Sig , ℓ′ a′) {ℓ∈} a with does ( ℓ′) + _With_≔_ (Sig , ℓ′ a′) {ℓ∈} a with does ( ℓ′) ... | true = Sig , ℓ′ a ... | false = _With_≔_ Sig {ℓ∈} a , ℓ′ a′ drop-With @@ -171,10 +171,10 @@ {a : (r : Restricted Sig ℓ∈) Proj Sig r} Record (_With_≔_ Sig {ℓ∈} a) Record Sig drop-With {Sig = } {ℓ∈ = ()} r - drop-With {Sig = Sig , ℓ′ A} {} (rec r) with does ( ℓ′) + drop-With {Sig = Sig , ℓ′ A} {} (rec r) with does ( ℓ′) ... | true = rec (Manifest-Σ.proj₁ r , Manifest-Σ.proj₂ r) ... | false = rec (drop-With (Σ.proj₁ r) , Σ.proj₂ r) - drop-With {Sig = Sig , ℓ′ a} {} (rec r) with does ( ℓ′) + drop-With {Sig = Sig , ℓ′ a} {} (rec r) with does ( ℓ′) ... | true = rec (Manifest-Σ.proj₁ r ,) ... | false = rec (drop-With (Manifest-Σ.proj₁ r) ,) \ No newline at end of file diff --git a/master/Data.Refinement.html b/master/Data.Refinement.html index f95a6fecc3..3e557f010a 100644 --- a/master/Data.Refinement.html +++ b/master/Data.Refinement.html @@ -12,7 +12,7 @@ open import Level open import Data.Irrelevant as Irrelevant using (Irrelevant) open import Function.Base -open import Relation.Unary using (IUniversal; _⇒_; _⊢_) +open import Relation.Unary using (IUniversal; _⇒_; _⊢_) private variable @@ -37,12 +37,12 @@ module _ {P : A Set p} {Q : B Set q} where - map : (f : A B) ∀[ P f Q ] + map : (f : A B) ∀[ P f Q ] [ a A P a ] [ b B Q b ] map f prf (a , p) = f a , Irrelevant.map prf p module _ {P : A Set p} {Q : A Set q} where - refine : ∀[ P Q ] [ a A P a ] [ a A Q a ] + refine : ∀[ P Q ] [ a A P a ] [ a A Q a ] refine = map id \ No newline at end of file diff --git a/master/Data.Sign.Properties.html b/master/Data.Sign.Properties.html index a7659c076c..9a9c53ab3c 100644 --- a/master/Data.Sign.Properties.html +++ b/master/Data.Sign.Properties.html @@ -17,13 +17,13 @@ open import Function.Definitions using (Injective) open import Level using (0ℓ) open import Relation.Binary - using (Decidable; DecidableEquality; Setoid; DecSetoid; IsDecEquivalence) + using (Decidable; DecidableEquality; Setoid; DecSetoid; IsDecEquivalence) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; _≢_; sym; cong₂) open import Relation.Binary.PropositionalEquality.Properties using (setoid; decSetoid; isDecEquivalence; isEquivalence) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Negation.Core using (contradiction) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Negation.Core using (contradiction) open import Algebra.Structures {A = Sign} _≡_ open import Algebra.Definitions {A = Sign} _≡_ @@ -35,11 +35,11 @@ infix 4 _≟_ -_≟_ : DecidableEquality Sign -- - = yes refl -- + = no λ() -+ - = no λ() -+ + = yes refl +_≟_ : DecidableEquality Sign +- - = yes refl +- + = no λ() ++ - = no λ() ++ + = yes refl ≡-setoid : Setoid 0ℓ 0ℓ ≡-setoid = setoid Sign @@ -107,8 +107,8 @@ *-cancelʳ-≡ : RightCancellative _*_ *-cancelʳ-≡ _ - - _ = refl -*-cancelʳ-≡ _ - + eq = contradiction (sym eq) (s≢opposite[s] _) -*-cancelʳ-≡ _ + - eq = contradiction eq (s≢opposite[s] _) +*-cancelʳ-≡ _ - + eq = contradiction (sym eq) (s≢opposite[s] _) +*-cancelʳ-≡ _ + - eq = contradiction eq (s≢opposite[s] _) *-cancelʳ-≡ _ + + _ = refl *-cancelˡ-≡ : LeftCancellative _*_ diff --git a/master/Data.Star.Decoration.html b/master/Data.Star.Decoration.html index 88495549ef..a09b04c543 100644 --- a/master/Data.Star.Decoration.html +++ b/master/Data.Star.Decoration.html @@ -13,7 +13,7 @@ open import Function.Base using (flip) open import Level using (Level; suc; _⊔_) open import Relation.Binary.Core using (Rel; _=[_]⇒_; _⇒_) -open import Relation.Binary.Definitions using (NonEmpty; nonEmpty) +open import Relation.Binary.Definitions using (NonEmpty; nonEmpty) open import Relation.Binary.Construct.Closure.ReflexiveTransitive -- A predicate on relation "edges" (think of the relation as a graph). @@ -29,17 +29,17 @@ -- Decorating an edge with more information. data DecoratedWith { r p : Level} {I : Set } {T : Rel I r} (P : EdgePred p T) - : Rel (NonEmpty (Star T)) ( r p) where + : Rel (NonEmpty (Star T)) ( r p) where : {i j k} {x : T i j} {xs : Star T j k} - (p : P x) DecoratedWith P (nonEmpty (x xs)) (nonEmpty xs) + (p : P x) DecoratedWith P (nonEmpty (x xs)) (nonEmpty xs) module _ { r p : Level} {I : Set } {T : Rel I r} {P : EdgePred p T} where - edge : {i j} DecoratedWith {T = T} P i j NonEmpty T - edge ( {x = x} p) = nonEmpty x + edge : {i j} DecoratedWith {T = T} P i j NonEmpty T + edge ( {x = x} p) = nonEmpty x decoration : {i j} (d : DecoratedWith {T = T} P i j) - P (NonEmpty.proof (edge d)) + P (NonEmpty.proof (edge d)) decoration ( p) = p -- Star-lists decorated with extra information. All P xs means that @@ -47,7 +47,7 @@ All : { r p} {I : Set } {T : Rel I r} EdgePred p T EdgePred ( (r p)) (Star T) All P {j = j} xs = - Star (DecoratedWith P) (nonEmpty xs) (nonEmpty {y = j} ε) + Star (DecoratedWith P) (nonEmpty xs) (nonEmpty {y = j} ε) -- We can map over decorated vectors. diff --git a/master/Data.Star.Pointer.html b/master/Data.Star.Pointer.html index b436518ea5..d7001383e6 100644 --- a/master/Data.Star.Pointer.html +++ b/master/Data.Star.Pointer.html @@ -15,7 +15,7 @@ open import Function.Base using (const; case_of_) open import Level open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (NonEmpty; nonEmpty) +open import Relation.Binary.Definitions using (NonEmpty; nonEmpty) open import Relation.Binary.Construct.Closure.ReflexiveTransitive private @@ -27,12 +27,12 @@ data Pointer {T : Rel I r} (P : EdgePred p T) (Q : EdgePred q T) - : Rel (Maybe (NonEmpty (Star T))) ( r p q) where + : Rel (Maybe (NonEmpty (Star T))) ( r p q) where step : {i j k} {x : T i j} {xs : Star T j k} - (p : P x) Pointer P Q (just (nonEmpty (x xs))) - (just (nonEmpty xs)) + (p : P x) Pointer P Q (just (nonEmpty (x xs))) + (just (nonEmpty xs)) done : {i j k} {x : T i j} {xs : Star T j k} - (q : Q x) Pointer P Q (just (nonEmpty (x xs))) nothing + (q : Q x) Pointer P Q (just (nonEmpty (x xs))) nothing -- Any P Q xs means that some edge in xs satisfies Q, while all -- preceding edges satisfy P. A star-list of type Any Always Always xs @@ -41,7 +41,7 @@ Any : {T : Rel I r} (P : EdgePred p T) (Q : EdgePred q T) EdgePred ( (r (p q))) (Star T) -Any P Q xs = Star (Pointer P Q) (just (nonEmpty xs)) nothing +Any P Q xs = Star (Pointer P Q) (just (nonEmpty xs)) nothing module _ {T : Rel I r} {P : EdgePred p T} {Q : EdgePred q T} where diff --git a/master/Data.String.Base.html b/master/Data.String.Base.html index ad77d96312..dde84ac2fd 100644 --- a/master/Data.String.Base.html +++ b/master/Data.String.Base.html @@ -22,8 +22,8 @@ open import Level using (Level; 0ℓ) open import Relation.Binary.Core using (Rel) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Decidable.Core using (does; T?) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Decidable.Core using (does; T?) ------------------------------------------------------------------------ -- From Agda.Builtin: type and renamed primitives @@ -164,11 +164,11 @@ ------------------------------------------------------------------------ -- Splitting strings -wordsBy : {p} {P : Pred Char p} Decidable P String List String +wordsBy : {p} {P : Pred Char p} Decidable P String List String wordsBy P? = List.map fromList List.wordsBy P? toList wordsByᵇ : (Char Bool) String List String -wordsByᵇ p = wordsBy (T? p) +wordsByᵇ p = wordsBy (T? p) words : String List String words = wordsByᵇ Char.isSpace @@ -177,11 +177,11 @@ _ : words " abc b " "abc" "b" [] _ = refl -linesBy : {p} {P : Pred Char p} Decidable P String List String +linesBy : {p} {P : Pred Char p} Decidable P String List String linesBy P? = List.map fromList List.linesBy P? toList linesByᵇ : (Char Bool) String List String -linesByᵇ p = linesBy (T? p) +linesByᵇ p = linesBy (T? p) lines : String List String lines = linesByᵇ ('\n' Char.≈ᵇ_) diff --git a/master/Data.String.Properties.html b/master/Data.String.Properties.html index abf23efb44..94cc159281 100644 --- a/master/Data.String.Properties.html +++ b/master/Data.String.Properties.html @@ -16,15 +16,15 @@ import Data.List.Relation.Binary.Lex.Strict as StrictLex open import Data.String.Base open import Function.Base -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Decidable using (map′; isYes) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Decidable using (map′; isYes) open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; StrictPartialOrder; StrictTotalOrder; DecTotalOrder; DecPoset) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsStrictPartialOrder; IsStrictTotalOrder; IsDecPartialOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Substitutive; Decidable; DecidableEquality) + using (Reflexive; Symmetric; Transitive; Substitutive; Decidable; DecidableEquality) open import Relation.Binary.PropositionalEquality.Core import Relation.Binary.Construct.On as On import Relation.Binary.PropositionalEquality.Properties as PropEq @@ -46,20 +46,20 @@ ≈-reflexive = Pointwise.≡⇒Pointwise-≡ cong toList -≈-refl : Reflexive _≈_ +≈-refl : Reflexive _≈_ ≈-refl {x} = ≈-reflexive {x} {x} refl -≈-sym : Symmetric _≈_ +≈-sym : Symmetric _≈_ ≈-sym = Pointwise.symmetric sym -≈-trans : Transitive _≈_ +≈-trans : Transitive _≈_ ≈-trans = Pointwise.transitive trans -≈-subst : {} Substitutive _≈_ +≈-subst : {} Substitutive _≈_ ≈-subst P x≈y p = subst P (≈⇒≡ x≈y) p infix 4 _≈?_ -_≈?_ : Decidable _≈_ +_≈?_ : Decidable _≈_ x ≈? y = Pointwise.decidable Char._≟_ (toList x) (toList y) ≈-isEquivalence : IsEquivalence _≈_ @@ -90,8 +90,8 @@ infix 4 _≟_ -_≟_ : DecidableEquality String -x y = map′ ≈⇒≡ ≈-reflexive $ x ≈? y +_≟_ : DecidableEquality String +x y = map′ ≈⇒≡ ≈-reflexive $ x ≈? y ≡-setoid : Setoid _ _ ≡-setoid = PropEq.setoid String @@ -103,7 +103,7 @@ -- Properties of _<_ infix 4 _<?_ -_<?_ : Decidable _<_ +_<?_ : Decidable _<_ x <? y = StrictLex.<-decidable Char._≟_ Char._<?_ (toList x) (toList y) <-isStrictPartialOrder-≈ : IsStrictPartialOrder _≈_ _<_ @@ -164,7 +164,7 @@ infix 4 _==_ _==_ : String String Bool -s₁ == s₂ = isYes (s₁ s₂) +s₁ == s₂ = isYes (s₁ s₂) private diff --git a/master/Data.String.html b/master/Data.String.html index c7e2d70e8f..b9dca25f43 100644 --- a/master/Data.String.html +++ b/master/Data.String.html @@ -19,7 +19,7 @@ open import Data.Vec.Base as Vec using (Vec) open import Data.Char.Base as Char using (Char) import Data.Char.Properties as Char using (_≟_) -open import Relation.Nullary.Decidable.Core using (does) +open import Relation.Nullary.Decidable.Core using (does) open import Data.List.Membership.DecPropositional Char._≟_ @@ -42,7 +42,7 @@ -- enclose string with parens if it contains a space character parensIfSpace : String String -parensIfSpace s = if does (' ' ∈? toList s) then parens s else s +parensIfSpace s = if does (' ' ∈? toList s) then parens s else s ------------------------------------------------------------------------ diff --git a/master/Data.Sum.Properties.html b/master/Data.Sum.Properties.html index b909538fce..2de3db9eda 100644 --- a/master/Data.Sum.Properties.html +++ b/master/Data.Sum.Properties.html @@ -14,10 +14,10 @@ map₁; map₂; assocˡ; assocʳ) open import Function.Base using (_∋_; _∘_; id) open import Function.Bundles using (mk↔ₛ′; _↔_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≗_; refl; cong) -open import Relation.Nullary.Decidable.Core using (yes; no; map′) +open import Relation.Nullary.Decidable.Core using (yes; no; map′) private variable @@ -35,14 +35,14 @@ inj₂-injective : {x y} (A B inj₂ x) inj₂ y x y inj₂-injective refl = refl -module _ (dec₁ : DecidableEquality A) - (dec₂ : DecidableEquality B) where +module _ (dec₁ : DecidableEquality A) + (dec₂ : DecidableEquality B) where - ≡-dec : DecidableEquality (A B) - ≡-dec (inj₁ x) (inj₁ y) = map′ (cong inj₁) inj₁-injective (dec₁ x y) - ≡-dec (inj₁ x) (inj₂ y) = no λ() - ≡-dec (inj₂ x) (inj₁ y) = no λ() - ≡-dec (inj₂ x) (inj₂ y) = map′ (cong inj₂) inj₂-injective (dec₂ x y) + ≡-dec : DecidableEquality (A B) + ≡-dec (inj₁ x) (inj₁ y) = map′ (cong inj₁) inj₁-injective (dec₁ x y) + ≡-dec (inj₁ x) (inj₂ y) = no λ() + ≡-dec (inj₂ x) (inj₁ y) = no λ() + ≡-dec (inj₂ x) (inj₂ y) = map′ (cong inj₂) inj₂-injective (dec₂ x y) swap-involutive : swap {A = A} {B = B} swap id swap-involutive = [ _ refl) , _ refl) ] diff --git a/master/Data.Sum.Relation.Binary.LeftOrder.html b/master/Data.Sum.Relation.Binary.LeftOrder.html index 56e40dd207..27fdebbafe 100644 --- a/master/Data.Sum.Relation.Binary.LeftOrder.html +++ b/master/Data.Sum.Relation.Binary.LeftOrder.html @@ -24,7 +24,7 @@ open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsStrictPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Reflexive; Transitive; Asymmetric; Total; Decidable; Irreflexive; Antisymmetric; Trichotomous; _Respectsʳ_; _Respectsˡ_; _Respects₂_; tri<; tri>; tri≈) + using (Reflexive; Transitive; Asymmetric; Total; Decidable; Irreflexive; Antisymmetric; Trichotomous; _Respectsʳ_; _Respectsˡ_; _Respects₂_; tri<; tri>; tri≈) open import Relation.Binary.PropositionalEquality.Core using (_≡_) ------------------------------------------------------------------------ @@ -52,38 +52,38 @@ drop-inj₂ : {x y} (∼₁ ⊎-< ∼₂) (inj₂ x) (inj₂ y) ∼₂ x y drop-inj₂ (₂∼₂ x∼₂y) = x∼₂y - ⊎-<-refl : Reflexive ∼₁ Reflexive ∼₂ - Reflexive (∼₁ ⊎-< ∼₂) + ⊎-<-refl : Reflexive ∼₁ Reflexive ∼₂ + Reflexive (∼₁ ⊎-< ∼₂) ⊎-<-refl refl₁ refl₂ {inj₁ x} = ₁∼₁ refl₁ ⊎-<-refl refl₁ refl₂ {inj₂ y} = ₂∼₂ refl₂ - ⊎-<-transitive : Transitive ∼₁ Transitive ∼₂ - Transitive (∼₁ ⊎-< ∼₂) + ⊎-<-transitive : Transitive ∼₁ Transitive ∼₂ + Transitive (∼₁ ⊎-< ∼₂) ⊎-<-transitive trans₁ trans₂ ₁∼₂ (₂∼₂ x∼₂y) = ₁∼₂ ⊎-<-transitive trans₁ trans₂ (₁∼₁ x∼₁y) ₁∼₂ = ₁∼₂ ⊎-<-transitive trans₁ trans₂ (₁∼₁ x∼₁y) (₁∼₁ x∼₁y₁) = ₁∼₁ (trans₁ x∼₁y x∼₁y₁) ⊎-<-transitive trans₁ trans₂ (₂∼₂ x∼₂y) (₂∼₂ x∼₂y₁) = ₂∼₂ (trans₂ x∼₂y x∼₂y₁) - ⊎-<-asymmetric : Asymmetric ∼₁ Asymmetric ∼₂ - Asymmetric (∼₁ ⊎-< ∼₂) + ⊎-<-asymmetric : Asymmetric ∼₁ Asymmetric ∼₂ + Asymmetric (∼₁ ⊎-< ∼₂) ⊎-<-asymmetric asym₁ asym₂ (₁∼₁ x∼₁y) (₁∼₁ x∼₁y₁) = asym₁ x∼₁y x∼₁y₁ ⊎-<-asymmetric asym₁ asym₂ (₂∼₂ x∼₂y) (₂∼₂ x∼₂y₁) = asym₂ x∼₂y x∼₂y₁ - ⊎-<-total : Total ∼₁ Total ∼₂ Total (∼₁ ⊎-< ∼₂) + ⊎-<-total : Total ∼₁ Total ∼₂ Total (∼₁ ⊎-< ∼₂) ⊎-<-total total₁ total₂ = total where - total : Total (_ ⊎-< _) + total : Total (_ ⊎-< _) total (inj₁ x) (inj₁ y) = Sum.map ₁∼₁ ₁∼₁ $ total₁ x y total (inj₁ x) (inj₂ y) = inj₁ ₁∼₂ total (inj₂ x) (inj₁ y) = inj₂ ₁∼₂ total (inj₂ x) (inj₂ y) = Sum.map ₂∼₂ ₂∼₂ $ total₂ x y - ⊎-<-decidable : Decidable ∼₁ Decidable ∼₂ - Decidable (∼₁ ⊎-< ∼₂) - ⊎-<-decidable dec₁ dec₂ (inj₁ x) (inj₁ y) = Dec.map′ ₁∼₁ drop-inj₁ (dec₁ x y) - ⊎-<-decidable dec₁ dec₂ (inj₁ x) (inj₂ y) = yes ₁∼₂ - ⊎-<-decidable dec₁ dec₂ (inj₂ x) (inj₁ y) = no λ() - ⊎-<-decidable dec₁ dec₂ (inj₂ x) (inj₂ y) = Dec.map′ ₂∼₂ drop-inj₂ (dec₂ x y) + ⊎-<-decidable : Decidable ∼₁ Decidable ∼₂ + Decidable (∼₁ ⊎-< ∼₂) + ⊎-<-decidable dec₁ dec₂ (inj₁ x) (inj₁ y) = Dec.map′ ₁∼₁ drop-inj₁ (dec₁ x y) + ⊎-<-decidable dec₁ dec₂ (inj₁ x) (inj₂ y) = yes ₁∼₂ + ⊎-<-decidable dec₁ dec₂ (inj₂ x) (inj₁ y) = no λ() + ⊎-<-decidable dec₁ dec₂ (inj₂ x) (inj₂ y) = Dec.map′ ₂∼₂ drop-inj₂ (dec₂ x y) module _ {a₁ a₂} {A₁ : Set a₁} {A₂ : Set a₂} {ℓ₁ ℓ₂} {∼₁ : Rel A₁ ℓ₁} {≈₁ : Rel A₁ ℓ₂} @@ -95,44 +95,44 @@ ⊎-<-reflexive refl₁ refl₂ (inj₁ x) = ₁∼₁ (refl₁ x) ⊎-<-reflexive refl₁ refl₂ (inj₂ x) = ₂∼₂ (refl₂ x) - ⊎-<-irreflexive : Irreflexive ≈₁ ∼₁ Irreflexive ≈₂ ∼₂ - Irreflexive (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂) + ⊎-<-irreflexive : Irreflexive ≈₁ ∼₁ Irreflexive ≈₂ ∼₂ + Irreflexive (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂) ⊎-<-irreflexive irrefl₁ irrefl₂ (inj₁ x) (₁∼₁ x∼₁y) = irrefl₁ x x∼₁y ⊎-<-irreflexive irrefl₁ irrefl₂ (inj₂ x) (₂∼₂ x∼₂y) = irrefl₂ x x∼₂y - ⊎-<-antisymmetric : Antisymmetric ≈₁ ∼₁ Antisymmetric ≈₂ ∼₂ - Antisymmetric (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂) + ⊎-<-antisymmetric : Antisymmetric ≈₁ ∼₁ Antisymmetric ≈₂ ∼₂ + Antisymmetric (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂) ⊎-<-antisymmetric antisym₁ antisym₂ (₁∼₁ x∼₁y) (₁∼₁ x∼₁y₁) = inj₁ (antisym₁ x∼₁y x∼₁y₁) ⊎-<-antisymmetric antisym₁ antisym₂ (₂∼₂ x∼₂y) (₂∼₂ x∼₂y₁) = inj₂ (antisym₂ x∼₂y x∼₂y₁) - ⊎-<-respectsʳ : ∼₁ Respectsʳ ≈₁ ∼₂ Respectsʳ ≈₂ - (∼₁ ⊎-< ∼₂) Respectsʳ (Pointwise ≈₁ ≈₂) + ⊎-<-respectsʳ : ∼₁ Respectsʳ ≈₁ ∼₂ Respectsʳ ≈₂ + (∼₁ ⊎-< ∼₂) Respectsʳ (Pointwise ≈₁ ≈₂) ⊎-<-respectsʳ resp₁ resp₂ (inj₁ x₁) (₁∼₁ x∼₁y) = ₁∼₁ (resp₁ x₁ x∼₁y) ⊎-<-respectsʳ resp₁ resp₂ (inj₂ x₁) ₁∼₂ = ₁∼₂ ⊎-<-respectsʳ resp₁ resp₂ (inj₂ x₁) (₂∼₂ x∼₂y) = ₂∼₂ (resp₂ x₁ x∼₂y) - ⊎-<-respectsˡ : ∼₁ Respectsˡ ≈₁ ∼₂ Respectsˡ ≈₂ - (∼₁ ⊎-< ∼₂) Respectsˡ (Pointwise ≈₁ ≈₂) + ⊎-<-respectsˡ : ∼₁ Respectsˡ ≈₁ ∼₂ Respectsˡ ≈₂ + (∼₁ ⊎-< ∼₂) Respectsˡ (Pointwise ≈₁ ≈₂) ⊎-<-respectsˡ resp₁ resp₂ (inj₁ x) ₁∼₂ = ₁∼₂ ⊎-<-respectsˡ resp₁ resp₂ (inj₁ x) (₁∼₁ x∼₁y) = ₁∼₁ (resp₁ x x∼₁y) ⊎-<-respectsˡ resp₁ resp₂ (inj₂ x) (₂∼₂ x∼₂y) = ₂∼₂ (resp₂ x x∼₂y) - ⊎-<-respects₂ : ∼₁ Respects₂ ≈₁ ∼₂ Respects₂ ≈₂ - (∼₁ ⊎-< ∼₂) Respects₂ (Pointwise ≈₁ ≈₂) + ⊎-<-respects₂ : ∼₁ Respects₂ ≈₁ ∼₂ Respects₂ ≈₂ + (∼₁ ⊎-< ∼₂) Respects₂ (Pointwise ≈₁ ≈₂) ⊎-<-respects₂ (r₁ , l₁) (r₂ , l₂) = ⊎-<-respectsʳ r₁ r₂ , ⊎-<-respectsˡ l₁ l₂ - ⊎-<-trichotomous : Trichotomous ≈₁ ∼₁ Trichotomous ≈₂ ∼₂ - Trichotomous (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂) - ⊎-<-trichotomous tri₁ tri₂ (inj₁ x) (inj₂ y) = tri< ₁∼₂ (λ()) (λ()) - ⊎-<-trichotomous tri₁ tri₂ (inj₂ x) (inj₁ y) = tri> (λ()) (λ()) ₁∼₂ + ⊎-<-trichotomous : Trichotomous ≈₁ ∼₁ Trichotomous ≈₂ ∼₂ + Trichotomous (Pointwise ≈₁ ≈₂) (∼₁ ⊎-< ∼₂) + ⊎-<-trichotomous tri₁ tri₂ (inj₁ x) (inj₂ y) = tri< ₁∼₂ (λ()) (λ()) + ⊎-<-trichotomous tri₁ tri₂ (inj₂ x) (inj₁ y) = tri> (λ()) (λ()) ₁∼₂ ⊎-<-trichotomous tri₁ tri₂ (inj₁ x) (inj₁ y) with tri₁ x y - ... | tri< x<y x≉y x≯y = tri< (₁∼₁ x<y) (x≉y PW.drop-inj₁) (x≯y drop-inj₁) - ... | tri≈ x≮y x≈y x≯y = tri≈ (x≮y drop-inj₁) (inj₁ x≈y) (x≯y drop-inj₁) - ... | tri> x≮y x≉y x>y = tri> (x≮y drop-inj₁) (x≉y PW.drop-inj₁) (₁∼₁ x>y) + ... | tri< x<y x≉y x≯y = tri< (₁∼₁ x<y) (x≉y PW.drop-inj₁) (x≯y drop-inj₁) + ... | tri≈ x≮y x≈y x≯y = tri≈ (x≮y drop-inj₁) (inj₁ x≈y) (x≯y drop-inj₁) + ... | tri> x≮y x≉y x>y = tri> (x≮y drop-inj₁) (x≉y PW.drop-inj₁) (₁∼₁ x>y) ⊎-<-trichotomous tri₁ tri₂ (inj₂ x) (inj₂ y) with tri₂ x y - ... | tri< x<y x≉y x≯y = tri< (₂∼₂ x<y) (x≉y PW.drop-inj₂) (x≯y drop-inj₂) - ... | tri≈ x≮y x≈y x≯y = tri≈ (x≮y drop-inj₂) (inj₂ x≈y) (x≯y drop-inj₂) - ... | tri> x≮y x≉y x>y = tri> (x≮y drop-inj₂) (x≉y PW.drop-inj₂) (₂∼₂ x>y) + ... | tri< x<y x≉y x≯y = tri< (₂∼₂ x<y) (x≉y PW.drop-inj₂) (x≯y drop-inj₂) + ... | tri≈ x≮y x≈y x≯y = tri≈ (x≮y drop-inj₂) (inj₂ x≈y) (x≯y drop-inj₂) + ... | tri> x≮y x≉y x>y = tri> (x≮y drop-inj₂) (x≉y PW.drop-inj₂) (₂∼₂ x>y) ------------------------------------------------------------------------ -- Some collections of properties which are preserved diff --git a/master/Data.Sum.Relation.Binary.Pointwise.html b/master/Data.Sum.Relation.Binary.Pointwise.html index 69f06686f4..bf6c0df9e4 100644 --- a/master/Data.Sum.Relation.Binary.Pointwise.html +++ b/master/Data.Sum.Relation.Binary.Pointwise.html @@ -55,63 +55,63 @@ drop-inj₂ : {x y} Pointwise R S (inj₂ x) (inj₂ y) S x y drop-inj₂ (inj₂ x) = x -⊎-refl : Reflexive R Reflexive S Reflexive (Pointwise R S) +⊎-refl : Reflexive R Reflexive S Reflexive (Pointwise R S) ⊎-refl refl₁ refl₂ {inj₁ x} = inj₁ refl₁ ⊎-refl refl₁ refl₂ {inj₂ y} = inj₂ refl₂ -⊎-symmetric : Symmetric R Symmetric S - Symmetric (Pointwise R S) +⊎-symmetric : Symmetric R Symmetric S + Symmetric (Pointwise R S) ⊎-symmetric sym₁ sym₂ (inj₁ x) = inj₁ (sym₁ x) ⊎-symmetric sym₁ sym₂ (inj₂ x) = inj₂ (sym₂ x) -⊎-transitive : Transitive R Transitive S - Transitive (Pointwise R S) +⊎-transitive : Transitive R Transitive S + Transitive (Pointwise R S) ⊎-transitive trans₁ trans₂ (inj₁ x) (inj₁ y) = inj₁ (trans₁ x y) ⊎-transitive trans₁ trans₂ (inj₂ x) (inj₂ y) = inj₂ (trans₂ x y) -⊎-asymmetric : Asymmetric R Asymmetric S - Asymmetric (Pointwise R S) +⊎-asymmetric : Asymmetric R Asymmetric S + Asymmetric (Pointwise R S) ⊎-asymmetric asym₁ asym₂ (inj₁ x) = λ { (inj₁ y) asym₁ x y } ⊎-asymmetric asym₁ asym₂ (inj₂ x) = λ { (inj₂ y) asym₂ x y } -⊎-substitutive : Substitutive R ℓ₃ Substitutive S ℓ₃ - Substitutive (Pointwise R S) ℓ₃ +⊎-substitutive : Substitutive R ℓ₃ Substitutive S ℓ₃ + Substitutive (Pointwise R S) ℓ₃ ⊎-substitutive subst₁ subst₂ P (inj₁ x) = subst₁ (P inj₁) x ⊎-substitutive subst₁ subst₂ P (inj₂ x) = subst₂ (P inj₂) x -⊎-decidable : Decidable R Decidable S Decidable (Pointwise R S) -⊎-decidable _≟₁_ _≟₂_ (inj₁ x) (inj₁ y) = Dec.map′ inj₁ drop-inj₁ (x ≟₁ y) -⊎-decidable _≟₁_ _≟₂_ (inj₁ x) (inj₂ y) = no λ() -⊎-decidable _≟₁_ _≟₂_ (inj₂ x) (inj₁ y) = no λ() -⊎-decidable _≟₁_ _≟₂_ (inj₂ x) (inj₂ y) = Dec.map′ inj₂ drop-inj₂ (x ≟₂ y) +⊎-decidable : Decidable R Decidable S Decidable (Pointwise R S) +⊎-decidable _≟₁_ _≟₂_ (inj₁ x) (inj₁ y) = Dec.map′ inj₁ drop-inj₁ (x ≟₁ y) +⊎-decidable _≟₁_ _≟₂_ (inj₁ x) (inj₂ y) = no λ() +⊎-decidable _≟₁_ _≟₂_ (inj₂ x) (inj₁ y) = no λ() +⊎-decidable _≟₁_ _≟₂_ (inj₂ x) (inj₂ y) = Dec.map′ inj₂ drop-inj₂ (x ≟₂ y) ⊎-reflexive : ≈₁ R ≈₂ S (Pointwise ≈₁ ≈₂) (Pointwise R S) ⊎-reflexive refl₁ refl₂ (inj₁ x) = inj₁ (refl₁ x) ⊎-reflexive refl₁ refl₂ (inj₂ x) = inj₂ (refl₂ x) -⊎-irreflexive : Irreflexive ≈₁ R Irreflexive ≈₂ S - Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) +⊎-irreflexive : Irreflexive ≈₁ R Irreflexive ≈₂ S + Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise R S) ⊎-irreflexive irrefl₁ irrefl₂ (inj₁ x) (inj₁ y) = irrefl₁ x y ⊎-irreflexive irrefl₁ irrefl₂ (inj₂ x) (inj₂ y) = irrefl₂ x y -⊎-antisymmetric : Antisymmetric ≈₁ R Antisymmetric ≈₂ S - Antisymmetric (Pointwise ≈₁ ≈₂) (Pointwise R S) +⊎-antisymmetric : Antisymmetric ≈₁ R Antisymmetric ≈₂ S + Antisymmetric (Pointwise ≈₁ ≈₂) (Pointwise R S) ⊎-antisymmetric antisym₁ antisym₂ (inj₁ x) (inj₁ y) = inj₁ (antisym₁ x y) ⊎-antisymmetric antisym₁ antisym₂ (inj₂ x) (inj₂ y) = inj₂ (antisym₂ x y) -⊎-respectsˡ : R Respectsˡ ≈₁ S Respectsˡ ≈₂ - (Pointwise R S) Respectsˡ (Pointwise ≈₁ ≈₂) +⊎-respectsˡ : R Respectsˡ ≈₁ S Respectsˡ ≈₂ + (Pointwise R S) Respectsˡ (Pointwise ≈₁ ≈₂) ⊎-respectsˡ resp₁ resp₂ (inj₁ x) (inj₁ y) = inj₁ (resp₁ x y) ⊎-respectsˡ resp₁ resp₂ (inj₂ x) (inj₂ y) = inj₂ (resp₂ x y) -⊎-respectsʳ : R Respectsʳ ≈₁ S Respectsʳ ≈₂ - (Pointwise R S) Respectsʳ (Pointwise ≈₁ ≈₂) +⊎-respectsʳ : R Respectsʳ ≈₁ S Respectsʳ ≈₂ + (Pointwise R S) Respectsʳ (Pointwise ≈₁ ≈₂) ⊎-respectsʳ resp₁ resp₂ (inj₁ x) (inj₁ y) = inj₁ (resp₁ x y) ⊎-respectsʳ resp₁ resp₂ (inj₂ x) (inj₂ y) = inj₂ (resp₂ x y) -⊎-respects₂ : R Respects₂ ≈₁ S Respects₂ ≈₂ - (Pointwise R S) Respects₂ (Pointwise ≈₁ ≈₂) +⊎-respects₂ : R Respects₂ ≈₁ S Respects₂ ≈₂ + (Pointwise R S) Respects₂ (Pointwise ≈₁ ≈₂) ⊎-respects₂ (r₁ , l₁) (r₂ , l₂) = ⊎-respectsʳ r₁ r₂ , ⊎-respectsˡ l₁ l₂ ------------------------------------------------------------------------ diff --git a/master/Data.Sum.Relation.Unary.All.html b/master/Data.Sum.Relation.Unary.All.html index 92bce489de..b6d8f2a578 100644 --- a/master/Data.Sum.Relation.Unary.All.html +++ b/master/Data.Sum.Relation.Unary.All.html @@ -11,19 +11,19 @@ open import Data.Sum.Base using (_⊎_; inj₁; inj₂) open import Level using (Level; _⊔_) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable a b c p q : Level A B : Set _ - P Q : Pred A p + P Q : Pred A p ------------------------------------------------------------------------ -- Definition -data All {A : Set a} {B : Set b} (P : Pred A p) (Q : Pred B q) - : Pred (A B) (a b p q) where +data All {A : Set a} {B : Set b} (P : Pred A p) (Q : Pred B q) + : Pred (A B) (a b p q) where inj₁ : {a} P a All P Q (inj₁ a) inj₂ : {b} Q b All P Q (inj₂ b) diff --git a/master/Data.Sum.html b/master/Data.Sum.html index cb532837b5..f4a85da040 100644 --- a/master/Data.Sum.html +++ b/master/Data.Sum.html @@ -16,8 +16,8 @@ open import Data.Maybe.Base using (Maybe; just; nothing) open import Function.Base open import Level -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary using (Dec; yes; no; _because_; ¬_) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary using (Dec; yes; no; _because_; ¬_) private variable @@ -60,11 +60,11 @@ -- Conversion back and forth with Dec -fromDec : Dec A A ¬ A -fromDec ( true because [p]) = inj₁ (invert [p]) -fromDec (false because [¬p]) = inj₂ (invert [¬p]) +fromDec : Dec A A ¬ A +fromDec ( true because [p]) = inj₁ (invert [p]) +fromDec (false because [¬p]) = inj₂ (invert [¬p]) -toDec : A ¬ A Dec A -toDec (inj₁ p) = yes p -toDec (inj₂ ¬p) = no ¬p +toDec : A ¬ A Dec A +toDec (inj₁ p) = yes p +toDec (inj₂ ¬p) = no ¬p \ No newline at end of file diff --git a/master/Data.These.Properties.html b/master/Data.These.Properties.html index 2c69159a0c..91f312bde6 100644 --- a/master/Data.These.Properties.html +++ b/master/Data.These.Properties.html @@ -12,10 +12,10 @@ open import Data.Product.Base using (_×_; _,_; <_,_>; uncurry) open import Data.These.Base using (These; this; that; these) open import Function.Base using (_∘_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂) -open import Relation.Nullary.Decidable using (yes; no; map′; _×-dec_) +open import Relation.Nullary.Decidable using (yes; no; map′; _×-dec_) ------------------------------------------------------------------------ -- Equality @@ -37,17 +37,17 @@ these-injective : {x y : A} {a b : B} these x a these y b x y × a b these-injective = < these-injectiveˡ , these-injectiveʳ > - ≡-dec : DecidableEquality A DecidableEquality B DecidableEquality (These A B) + ≡-dec : DecidableEquality A DecidableEquality B DecidableEquality (These A B) ≡-dec dec₁ dec₂ (this x) (this y) = - map′ (cong this) this-injective (dec₁ x y) - ≡-dec dec₁ dec₂ (this x) (that y) = no λ() - ≡-dec dec₁ dec₂ (this x) (these y b) = no λ() - ≡-dec dec₁ dec₂ (that x) (this y) = no λ() + map′ (cong this) this-injective (dec₁ x y) + ≡-dec dec₁ dec₂ (this x) (that y) = no λ() + ≡-dec dec₁ dec₂ (this x) (these y b) = no λ() + ≡-dec dec₁ dec₂ (that x) (this y) = no λ() ≡-dec dec₁ dec₂ (that x) (that y) = - map′ (cong that) that-injective (dec₂ x y) - ≡-dec dec₁ dec₂ (that x) (these y b) = no λ() - ≡-dec dec₁ dec₂ (these x a) (this y) = no λ() - ≡-dec dec₁ dec₂ (these x a) (that y) = no λ() + map′ (cong that) that-injective (dec₂ x y) + ≡-dec dec₁ dec₂ (that x) (these y b) = no λ() + ≡-dec dec₁ dec₂ (these x a) (this y) = no λ() + ≡-dec dec₁ dec₂ (these x a) (that y) = no λ() ≡-dec dec₁ dec₂ (these x a) (these y b) = - map′ (uncurry (cong₂ these)) these-injective (dec₁ x y ×-dec dec₂ a b) + map′ (uncurry (cong₂ these)) these-injective (dec₁ x y ×-dec dec₂ a b) \ No newline at end of file diff --git a/master/Data.Tree.AVL.Indexed.Relation.Unary.All.html b/master/Data.Tree.AVL.Indexed.Relation.Unary.All.html index 9eaf7aa5f9..67bbd6755f 100644 --- a/master/Data.Tree.AVL.Indexed.Relation.Unary.All.html +++ b/master/Data.Tree.AVL.Indexed.Relation.Unary.All.html @@ -22,8 +22,8 @@ open import Level using (Level; _⊔_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) -open import Relation.Nullary.Decidable using (Dec; yes; map′; _×-dec_) -open import Relation.Unary using (Pred; Decidable; Universal; Irrelevant; _⊆_; _∪_) +open import Relation.Nullary.Decidable using (Dec; yes; map′; _×-dec_) +open import Relation.Unary using (Pred; Decidable; Universal; Irrelevant; _⊆_; _∪_) open StrictTotalOrder strictTotalOrder renaming (Carrier to Key) open import Data.Tree.AVL.Indexed strictTotalOrder @@ -35,8 +35,8 @@ variable v p q : Level V : Value v - P : Pred (K& V) p - Q : Pred (K& V) q + P : Pred (K& V) p + Q : Pred (K& V) q l u : Key⁺ n : t : Tree V l u n @@ -48,7 +48,7 @@ -- satisfy P. -- See `Relation.Unary` for an explanation of predicates. -data All {V : Value v} (P : Pred (K& V) p) {l u} +data All {V : Value v} (P : Pred (K& V) p) {l u} : {n} Tree V l u n Set (p a v ℓ₂) where leaf : {p : l <⁺ u} All P (leaf p) node : { h} {kv : K& V} @@ -60,11 +60,11 @@ ------------------------------------------------------------------------ -- Operations on All -map : P Q All P t All Q t +map : P Q All P t All Q t map f leaf = leaf map f (node p l r) = node (f p) (map f l) (map f r) -decide : Π[ P Q ] (t : Tree V l u n) All P t Any Q t +decide : Π[ P Q ] (t : Tree V l u n) All P t Any Q t decide p⊎q (leaf l<u) = inj₁ leaf decide p⊎q (node kv l r bal) with p⊎q kv | decide p⊎q l | decide p⊎q r ... | inj₂ q | _ | _ = inj₂ (here q) @@ -79,16 +79,16 @@ All P (node kv lk ku bal) P kv × All P lk × All P ku unnode (node p l r) = p , l , r -all? : Decidable P (t : Tree V l u n) Dec (All P t) -all? p? (leaf l<u) = yes leaf -all? p? (node kv l r bal) = map′ (uncurryₙ 3 node) unnode - (p? kv ×-dec all? p? l ×-dec all? p? r) +all? : Decidable P (t : Tree V l u n) Dec (All P t) +all? p? (leaf l<u) = yes leaf +all? p? (node kv l r bal) = map′ (uncurryₙ 3 node) unnode + (p? kv ×-dec all? p? l ×-dec all? p? r) -universal : Universal P (t : Tree V l u n) All P t +universal : Universal P (t : Tree V l u n) All P t universal u (leaf l<u) = leaf universal u (node kv l r bal) = node (u kv) (universal u l) (universal u r) -irrelevant : Irrelevant P (p q : All P t) p q +irrelevant : Irrelevant P (p q : All P t) p q irrelevant irr leaf leaf = refl irrelevant irr (node p l₁ r₁) (node q l₂ r₂) = congₙ 3 node (irr p q) (irrelevant irr l₁ l₂) (irrelevant irr r₁ r₂) diff --git a/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.Properties.html b/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.Properties.html index a53e519604..b55c668e80 100644 --- a/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.Properties.html +++ b/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.Properties.html @@ -22,11 +22,11 @@ open import Function.Base as F open import Level using (Level) -open import Relation.Binary.Definitions using (_Respects_; tri<; tri≈; tri>) +open import Relation.Binary.Definitions using (_Respects_; tri<; tri≈; tri>) open import Relation.Binary.PropositionalEquality.Core using (_≡_) renaming (refl to ≡-refl) -open import Relation.Nullary using (¬_; Dec; yes; no) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Unary using (Pred; _∩_) +open import Relation.Nullary using (¬_; Dec; yes; no) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary using (Pred; _∩_) open import Data.Tree.AVL.Indexed sto as AVL open import Data.Tree.AVL.Indexed.Relation.Unary.Any sto as Any @@ -43,7 +43,7 @@ V : Value v l u : Key⁺ n : - P Q : Pred (K& V) p + P Q : Pred (K& V) p ------------------------------------------------------------------------ -- Any.lookup @@ -65,7 +65,7 @@ lookup-rebuild (left p) q = left (lookup-rebuild p q) lookup-rebuild (right p) q = right (lookup-rebuild p q) -lookup-rebuild-accum : {t : Tree V l u n} (p : Any P t) Q (Any.lookup p) Any (Q P) t +lookup-rebuild-accum : {t : Tree V l u n} (p : Any P t) Q (Any.lookup p) Any (Q P) t lookup-rebuild-accum p q = lookup-rebuild p (q , lookup-result p) joinˡ⁺-here⁺ : {l u h} @@ -230,14 +230,14 @@ Val = Value.family V Val≈ = Value.respects V - singleton⁺ : {P : Pred (K& V) p} + singleton⁺ : {P : Pred (K& V) p} (k : Key) (v : Val k) (l<k<u : l < k < u) P (k , v) Any P (singleton k v l<k<u) singleton⁺ k v l<k<u Pkv = here Pkv - singleton⁻ : {P : Pred (K& V) p} + singleton⁻ : {P : Pred (K& V) p} (k : Key) (v : Val k) (l<k<u : l < k < u) @@ -253,15 +253,15 @@ Any-insertWith-nothing : (t : Tree V l u n) (seg : l < k < u) P (k , f nothing) - ¬ (Any ((k ≈_) ∘′ key) t) Any P (proj₂ (insertWith k f t seg)) + ¬ (Any ((k ≈_) ∘′ key) t) Any P (proj₂ (insertWith k f t seg)) Any-insertWith-nothing (leaf l<u) seg pr ¬p = here pr Any-insertWith-nothing (node kv@(k′ , v) lk ku bal) (l<k , k<u) pr ¬p with compare k k′ - ... | tri≈ _ k≈k′ _ = contradiction (here k≈k′) ¬p - ... | tri< k<k′ _ _ = let seg′ = l<k , [ k<k′ ]ᴿ; lk′ = insertWith k f lk seg′ + ... | tri≈ _ k≈k′ _ = contradiction (here k≈k′) ¬p + ... | tri< k<k′ _ _ = let seg′ = l<k , [ k<k′ ]ᴿ; lk′ = insertWith k f lk seg′ ih = Any-insertWith-nothing lk seg′ pr p ¬p (left p)) in joinˡ⁺-left⁺ kv lk′ ku bal ih - ... | tri> _ _ k>k′ = let seg′ = [ k>k′ ]ᴿ , k<u; ku′ = insertWith k f ku seg′ + ... | tri> _ _ k>k′ = let seg′ = [ k>k′ ]ᴿ , k<u; ku′ = insertWith k f ku seg′ ih = Any-insertWith-nothing ku seg′ pr p ¬p (right p)) in joinʳ⁺-right⁺ kv lk ku′ bal ih @@ -271,40 +271,40 @@ Any-insertWith-just (node kv@(k′ , v) lk ku bal) (l<k , k<u) pr p with p | compare k k′ -- happy paths - ... | here _ | tri≈ _ k≈k′ _ = here (pr k′ v k≈k′) - ... | left lp | tri< k<k′ _ _ = let seg′ = l<k , [ k<k′ ]ᴿ; lk′ = insertWith k f lk seg′ in + ... | here _ | tri≈ _ k≈k′ _ = here (pr k′ v k≈k′) + ... | left lp | tri< k<k′ _ _ = let seg′ = l<k , [ k<k′ ]ᴿ; lk′ = insertWith k f lk seg′ in joinˡ⁺-left⁺ kv lk′ ku bal (Any-insertWith-just lk seg′ pr lp) - ... | right rp | tri> _ _ k>k′ = let seg′ = [ k>k′ ]ᴿ , k<u; ku′ = insertWith k f ku seg′ in + ... | right rp | tri> _ _ k>k′ = let seg′ = [ k>k′ ]ᴿ , k<u; ku′ = insertWith k f ku seg′ in joinʳ⁺-right⁺ kv lk ku′ bal (Any-insertWith-just ku seg′ pr rp) -- impossible cases - ... | here eq | tri< k<k′ _ _ = begin-contradiction + ... | here eq | tri< k<k′ _ _ = begin-contradiction [ k ] <⟨ [ k<k′ ]ᴿ [ k′ ] ≈⟨ [ sym eq ]ᴱ [ k ] - ... | here eq | tri> _ _ k>k′ = begin-contradiction + ... | here eq | tri> _ _ k>k′ = begin-contradiction [ k ] ≈⟨ [ eq ]ᴱ [ k′ ] <⟨ [ k>k′ ]ᴿ [ k ] - ... | left lp | tri≈ _ k≈k′ _ = begin-contradiction + ... | left lp | tri≈ _ k≈k′ _ = begin-contradiction let k″ = Any.lookup lp .key; k≈k″ = lookup-result lp; (_ , k″<k′) = lookup-bounded lp in [ k ] ≈⟨ [ k≈k″ ]ᴱ [ k″ ] <⟨ k″<k′ [ k′ ] ≈⟨ [ sym k≈k′ ]ᴱ [ k ] - ... | left lp | tri> _ _ k>k′ = begin-contradiction + ... | left lp | tri> _ _ k>k′ = begin-contradiction let k″ = Any.lookup lp .key; k≈k″ = lookup-result lp; (_ , k″<k′) = lookup-bounded lp in [ k ] ≈⟨ [ k≈k″ ]ᴱ [ k″ ] <⟨ k″<k′ [ k′ ] <⟨ [ k>k′ ]ᴿ [ k ] - ... | right rp | tri< k<k′ _ _ = begin-contradiction + ... | right rp | tri< k<k′ _ _ = begin-contradiction let k″ = Any.lookup rp .key; k≈k″ = lookup-result rp; (k′<k″ , _) = lookup-bounded rp in [ k ] <⟨ [ k<k′ ]ᴿ [ k′ ] <⟨ k′<k″ [ k″ ] ≈⟨ [ sym k≈k″ ]ᴱ [ k ] - ... | right rp | tri≈ _ k≈k′ _ = begin-contradiction + ... | right rp | tri≈ _ k≈k′ _ = begin-contradiction let k″ = Any.lookup rp .key; k≈k″ = lookup-result rp; (k′<k″ , _) = lookup-bounded rp in [ k ] ≈⟨ [ k≈k′ ]ᴱ [ k′ ] <⟨ k′<k″ @@ -313,7 +313,7 @@ module _ (k : Key) (v : Val k) (t : Tree V l u n) (seg : l < k < u) where - Any-insert-nothing : P (k , v) ¬ (Any ((k ≈_) ∘′ key) t) Any P (proj₂ (insert k v t seg)) + Any-insert-nothing : P (k , v) ¬ (Any ((k ≈_) ∘′ key) t) Any P (proj₂ (insert k v t seg)) Any-insert-nothing = Any-insertWith-nothing k (F.const v) t seg Any-insert-just : (pr : k′ (eq : k k′) P (k′ , Val≈ eq v)) @@ -327,25 +327,25 @@ Any P (proj₂ (insertWith k f t seg)) insertWith⁺ (node kv@(k′ , v′) l r bal) (l<k , k<u) (here p) k≉ with compare k k′ - ... | tri< k<k′ _ _ = let l′ = insertWith k f l (l<k , [ k<k′ ]ᴿ) + ... | tri< k<k′ _ _ = let l′ = insertWith k f l (l<k , [ k<k′ ]ᴿ) in joinˡ⁺-here⁺ kv l′ r bal p - ... | tri≈ _ k≈k′ _ = contradiction k≈k′ k≉ - ... | tri> _ _ k′<k = let r′ = insertWith k f r ([ k′<k ]ᴿ , k<u) + ... | tri≈ _ k≈k′ _ = contradiction k≈k′ k≉ + ... | tri> _ _ k′<k = let r′ = insertWith k f r ([ k′<k ]ᴿ , k<u) in joinʳ⁺-here⁺ kv l r′ bal p insertWith⁺ (node kv@(k′ , v′) l r bal) (l<k , k<u) (left p) k≉ with compare k k′ - ... | tri< k<k′ _ _ = let l′ = insertWith k f l (l<k , [ k<k′ ]ᴿ) + ... | tri< k<k′ _ _ = let l′ = insertWith k f l (l<k , [ k<k′ ]ᴿ) ih = insertWith⁺ l (l<k , [ k<k′ ]ᴿ) p k≉ in joinˡ⁺-left⁺ kv l′ r bal ih - ... | tri≈ _ k≈k′ _ = left p - ... | tri> _ _ k′<k = let r′ = insertWith k f r ([ k′<k ]ᴿ , k<u) + ... | tri≈ _ k≈k′ _ = left p + ... | tri> _ _ k′<k = let r′ = insertWith k f r ([ k′<k ]ᴿ , k<u) in joinʳ⁺-left⁺ kv l r′ bal p insertWith⁺ (node kv@(k′ , v′) l r bal) (l<k , k<u) (right p) k≉ with compare k k′ - ... | tri< k<k′ _ _ = let l′ = insertWith k f l (l<k , [ k<k′ ]ᴿ) + ... | tri< k<k′ _ _ = let l′ = insertWith k f l (l<k , [ k<k′ ]ᴿ) in joinˡ⁺-right⁺ kv l′ r bal p - ... | tri≈ _ k≈k′ _ = right p - ... | tri> _ _ k′<k = let r′ = insertWith k f r ([ k′<k ]ᴿ , k<u) + ... | tri≈ _ k≈k′ _ = right p + ... | tri> _ _ k′<k = let r′ = insertWith k f r ([ k′<k ]ᴿ , k<u) ih = insertWith⁺ r ([ k′<k ]ᴿ , k<u) p k≉ in joinʳ⁺-right⁺ kv l r′ bal ih @@ -355,7 +355,7 @@ insert⁺ k v = insertWith⁺ k (F.const v) module _ - {P : Pred (K& V) p} + {P : Pred (K& V) p} (P-Resp : {k k′ v} (k≈k′ : k k′) P (k′ , Val≈ k≈k′ v) P (k , v)) (k : Key) (v : Val k) where @@ -365,7 +365,7 @@ P (k , v) Any (λ{ (k′ , v′) k k′ × P (k′ , v′)}) t insert⁻ (leaf l<u) seg (here p) = inj₁ p insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p with compare k k′ - insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p | tri< k<k′ k≉k′ _ + insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p | tri< k<k′ k≉k′ _ with joinˡ⁺⁻ kv′ (insert k v l (l<k , [ k<k′ ]ᴿ)) r bal p ... | inj₁ p = inj₂ (here (k≉k′ , p)) ... | inj₂ (inj₂ p) = inj₂ (right (lookup-rebuild-accum p k≉p)) @@ -373,7 +373,7 @@ k′<p = [<]-injective (proj₁ (lookup-bounded p)) k≉p = λ k≈p irrefl k≈p (<-trans k<k′ k′<p) ... | inj₂ (inj₁ p) = Sum.map₂ q left q) (insert⁻ l (l<k , [ k<k′ ]ᴿ) p) - insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p | tri> _ k≉k′ k′<k + insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p | tri> _ k≉k′ k′<k with joinʳ⁺⁻ kv′ l (insert k v r ([ k′<k ]ᴿ , k<u)) bal p ... | inj₁ p = inj₂ (here (k≉k′ , p)) ... | inj₂ (inj₁ p) = inj₂ (left (lookup-rebuild-accum p k≉p)) @@ -381,7 +381,7 @@ p<k′ = [<]-injective (proj₂ (lookup-bounded p)) k≉p = λ k≈p irrefl (sym k≈p) (<-trans p<k′ k′<k) ... | inj₂ (inj₂ p) = Sum.map₂ q right q) (insert⁻ r ([ k′<k ]ᴿ , k<u) p) - insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p | tri≈ _ k≈k′ _ + insert⁻ (node kv′@(k′ , v′) l r bal) (l<k , k<u) p | tri≈ _ k≈k′ _ with p ... | left p = inj₂ (left (lookup-rebuild-accum p k≉p)) where @@ -398,25 +398,25 @@ key (Any.lookup p) k ∃[ p≈k ] AVL.lookup t k seg just (Val≈ p≈k (value (Any.lookup p))) lookup⁺ (node (k′ , v′) l r bal) k (l<k , k<u) p with compare k′ k | p - ... | tri< k′<k _ _ | right p = lookup⁺ r k ([ k′<k ]ᴿ , k<u) p - ... | tri≈ _ k′≈k _ | here p = inj₂ (k′≈k , ≡-refl) - ... | tri> _ _ k<k′ | left p = lookup⁺ l k (l<k , [ k<k′ ]ᴿ) p - ... | tri< k′<k _ _ | left p = inj₁ p≈k irrefl p≈k (<-trans p<k′ k′<k)) + ... | tri< k′<k _ _ | right p = lookup⁺ r k ([ k′<k ]ᴿ , k<u) p + ... | tri≈ _ k′≈k _ | here p = inj₂ (k′≈k , ≡-refl) + ... | tri> _ _ k<k′ | left p = lookup⁺ l k (l<k , [ k<k′ ]ᴿ) p + ... | tri< k′<k _ _ | left p = inj₁ p≈k irrefl p≈k (<-trans p<k′ k′<k)) where p<k′ = [<]-injective (proj₂ (lookup-bounded p)) - ... | tri< k′<k _ _ | here p = inj₁ p≈k irrefl p≈k k′<k) - ... | tri≈ _ k′≈k _ | left p = inj₁ p≈k irrefl (trans p≈k (sym k′≈k)) p<k′) + ... | tri< k′<k _ _ | here p = inj₁ p≈k irrefl p≈k k′<k) + ... | tri≈ _ k′≈k _ | left p = inj₁ p≈k irrefl (trans p≈k (sym k′≈k)) p<k′) where p<k′ = [<]-injective (proj₂ (lookup-bounded p)) - ... | tri≈ _ k′≈k _ | right p = inj₁ p≈k irrefl (trans k′≈k (sym p≈k)) k′<p) + ... | tri≈ _ k′≈k _ | right p = inj₁ p≈k irrefl (trans k′≈k (sym p≈k)) k′<p) where k′<p = [<]-injective (proj₁ (lookup-bounded p)) - ... | tri> _ _ k<k′ | here p = inj₁ p≈k irrefl (sym p≈k) k<k′) - ... | tri> _ _ k<k′ | right p = inj₁ p≈k irrefl (sym p≈k) (<-trans k<k′ k′<p)) + ... | tri> _ _ k<k′ | here p = inj₁ p≈k irrefl (sym p≈k) k<k′) + ... | tri> _ _ k<k′ | right p = inj₁ p≈k irrefl (sym p≈k) (<-trans k<k′ k′<p)) where k′<p = [<]-injective (proj₁ (lookup-bounded p)) lookup⁻ : (t : Tree V l u n) (k : Key) (v : Val k) (seg : l < k < u) AVL.lookup t k seg just v Any (λ{ (k′ , v′) λ k′≈k Val≈ k′≈k v′ v}) t lookup⁻ (node (k′ , v′) l r bal) k v (l<k , k<u) eq with compare k′ k - ... | tri< k′<k _ _ = right (lookup⁻ r k v ([ k′<k ]ᴿ , k<u) eq) - ... | tri≈ _ k′≈k _ = here (k′≈k , just-injective eq) - ... | tri> _ _ k<k′ = left (lookup⁻ l k v (l<k , [ k<k′ ]ᴿ) eq) + ... | tri< k′<k _ _ = right (lookup⁻ r k v ([ k′<k ]ᴿ , k<u) eq) + ... | tri≈ _ k′≈k _ = here (k′≈k , just-injective eq) + ... | tri> _ _ k<k′ = left (lookup⁻ l k v (l<k , [ k<k′ ]ᴿ) eq) \ No newline at end of file diff --git a/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.html b/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.html index 184951af2e..a2e3cb696d 100644 --- a/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.html +++ b/master/Data.Tree.AVL.Indexed.Relation.Unary.Any.html @@ -19,7 +19,7 @@ open import Function.Base using (_∘′_; _∘_) open import Level using (Level; _⊔_) -open import Relation.Nullary.Decidable using (Dec; no; map′; _⊎-dec_) +open import Relation.Nullary.Decidable using (Dec; no; map′; _⊎-dec_) open import Relation.Unary open StrictTotalOrder strictTotalOrder renaming (Carrier to Key) @@ -31,8 +31,8 @@ variable v p q : Level V : Value v - P : Pred (K& V) p - Q : Pred (K& V) q + P : Pred (K& V) p + Q : Pred (K& V) q l u : Key⁺ n : t : Tree V l u n @@ -44,7 +44,7 @@ -- satisfies P. There may be others. -- See `Relation.Unary` for an explanation of predicates. -data Any {V : Value v} (P : Pred (K& V) p) {l u} +data Any {V : Value v} (P : Pred (K& V) p) {l u} : {n} Tree V l u n Set (p a v ℓ₂) where here : { h} {kv : K& V} P kv {lk : Tree V l [ kv .key ] } @@ -67,7 +67,7 @@ ------------------------------------------------------------------------ -- Operations on Any -map : P Q Any P t Any Q t +map : P Q Any P t Any Q t map f (here p) = here (f p) map f (left p) = left (map f p) map f (right p) = right (map f p) @@ -106,14 +106,14 @@ ------------------------------------------------------------------------ -- Properties of predicates preserved by Any -any? : Decidable P (t : Tree V l u n) Dec (Any P t) -any? P? (leaf _) = no λ () -any? P? (node kv l r bal) = map′ fromSum toSum - (P? kv ⊎-dec any? P? l ⊎-dec any? P? r) +any? : Decidable P (t : Tree V l u n) Dec (Any P t) +any? P? (leaf _) = no λ () +any? P? (node kv l r bal) = map′ fromSum toSum + (P? kv ⊎-dec any? P? l ⊎-dec any? P? r) satisfiable : {k l u} l <⁺ [ k ] [ k ] <⁺ u - Satisfiable (P (k ,_)) - Satisfiable {A = Tree V l u 1} (Any P) + Satisfiable (P (k ,_)) + Satisfiable {A = Tree V l u 1} (Any P) satisfiable {k = k} lb ub sat = node (k , proj₁ sat) (leaf lb) (leaf ub) ∼0 , here (proj₂ sat) \ No newline at end of file diff --git a/master/Data.Tree.AVL.Indexed.html b/master/Data.Tree.AVL.Indexed.html index 04af2ee03b..64d84288b8 100644 --- a/master/Data.Tree.AVL.Indexed.html +++ b/master/Data.Tree.AVL.Indexed.html @@ -20,7 +20,7 @@ open import Data.DifferenceList using (DiffList; []; _∷_; _++_) open import Function.Base as F hiding (const) open import Relation.Unary -open import Relation.Binary.Definitions using (_Respects_; Tri; tri<; tri≈; tri>) +open import Relation.Binary.Definitions using (_Respects_; Tri; tri<; tri≈; tri>) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) private @@ -214,9 +214,9 @@ λ i Tree V l u (i h) insertWith k f (leaf l<u) l<k<u = (1# , singleton k (f nothing) l<k<u) insertWith k f (node (k′ , v′) lp pu bal) (l<k , k<u) with compare k k′ - ... | tri< k<k′ _ _ = joinˡ⁺ (k′ , v′) (insertWith k f lp (l<k , [ k<k′ ]ᴿ)) pu bal - ... | tri> _ _ k′<k = joinʳ⁺ (k′ , v′) lp (insertWith k f pu ([ k′<k ]ᴿ , k<u)) bal - ... | tri≈ _ k≈k′ _ = (0# , node (k′ , V≈ k≈k′ (f (just (V≈ (Eq.sym k≈k′) v′)))) lp pu bal) + ... | tri< k<k′ _ _ = joinˡ⁺ (k′ , v′) (insertWith k f lp (l<k , [ k<k′ ]ᴿ)) pu bal + ... | tri> _ _ k′<k = joinʳ⁺ (k′ , v′) lp (insertWith k f pu ([ k′<k ]ᴿ , k<u)) bal + ... | tri≈ _ k≈k′ _ = (0# , node (k′ , V≈ k≈k′ (f (just (V≈ (Eq.sym k≈k′) v′)))) lp pu bal) -- Inserts a key into the tree. If the key already exists, then it -- is replaced. Logarithmic in the size of the tree (assuming @@ -234,9 +234,9 @@ λ i Tree V l u pred[ i h ] delete k (leaf l<u) l<k<u = (0# , leaf l<u) delete k (node p@(k′ , v) lp pu bal) (l<k , k<u) with compare k′ k - ... | tri< k′<k _ _ = joinʳ⁻ _ p lp (delete k pu ([ k′<k ]ᴿ , k<u)) bal - ... | tri> _ _ k′>k = joinˡ⁻ _ p (delete k lp (l<k , [ k′>k ]ᴿ)) pu bal - ... | tri≈ _ k′≡k _ = join lp pu bal + ... | tri< k′<k _ _ = joinʳ⁻ _ p lp (delete k pu ([ k′<k ]ᴿ , k<u)) bal + ... | tri> _ _ k′>k = joinˡ⁻ _ p (delete k lp (l<k , [ k′>k ]ᴿ)) pu bal + ... | tri≈ _ k′≡k _ = join lp pu bal -- Looks up a key. Logarithmic in the size of the tree (assuming -- constant-time comparisons). @@ -244,9 +244,9 @@ lookup : {l u h} Tree V l u h (k : Key) l < k < u Maybe (Val k) lookup (leaf _) k l<k<u = nothing lookup (node (k′ , v) lk′ k′u _) k (l<k , k<u) with compare k′ k - ... | tri< k′<k _ _ = lookup k′u k ([ k′<k ]ᴿ , k<u) - ... | tri> _ _ k′>k = lookup lk′ k (l<k , [ k′>k ]ᴿ) - ... | tri≈ _ k′≡k _ = just (V≈ k′≡k v) + ... | tri< k′<k _ _ = lookup k′u k ([ k′<k ]ᴿ , k<u) + ... | tri> _ _ k′>k = lookup lk′ k (l<k , [ k′>k ]ᴿ) + ... | tri≈ _ k′≡k _ = just (V≈ k′≡k v) -- Converts the tree to an ordered list. Linear in the size of the -- tree. @@ -273,7 +273,7 @@ -- Maps a function over all values in the tree. - map : ∀[ Val Wal ] {l u h} Tree V l u h Tree W l u h + map : ∀[ Val Wal ] {l u h} Tree V l u h Tree W l u h map f (leaf l<u) = leaf l<u map f (node (k , v) l r bal) = node (k , f v) (map f l) (map f r) bal \ No newline at end of file diff --git a/master/Data.Tree.AVL.Key.html b/master/Data.Tree.AVL.Key.html index 5663dd6fb4..532ba41a53 100644 --- a/master/Data.Tree.AVL.Key.html +++ b/master/Data.Tree.AVL.Key.html @@ -17,9 +17,9 @@ open import Level using (Level; _⊔_) open import Data.Product.Base using (_×_; _,_) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) open import Relation.Binary.PropositionalEquality.Core using (_≡_ ; refl) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) open import Relation.Nullary.Construct.Add.Extrema as AddExtremaToSet using () import Relation.Binary.Construct.Add.Extrema.Equality @@ -78,7 +78,7 @@ ⊥⁺<[_]<⊤⁺ : k ⊥⁺ < k < ⊤⁺ ⊥⁺<[ k ]<⊤⁺ = ⊥⁺<[ k ] , [ k ]<⊤⁺ -refl⁺ : Reflexive _≈⁺_ +refl⁺ : Reflexive _≈⁺_ refl⁺ = AddExtremaToEquality.≈±-refl _≈_ Eq.refl sym⁺ : {l u} l ≈⁺ u u ≈⁺ l @@ -87,7 +87,7 @@ trans⁺ : l {m u} l <⁺ m m <⁺ u l <⁺ u trans⁺ l = AddExtremaToOrder.<±-trans _<_ trans -irrefl⁺ : k ¬ (k <⁺ k) +irrefl⁺ : k ¬ (k <⁺ k) irrefl⁺ k = AddExtremaToOrder.<±-irrefl _<_ irrefl refl⁺ -- Bundle diff --git a/master/Data.Tree.AVL.Map.Membership.Propositional.Properties.html b/master/Data.Tree.AVL.Map.Membership.Propositional.Properties.html index e5e78440cd..58b071a0fd 100644 --- a/master/Data.Tree.AVL.Map.Membership.Propositional.Properties.html +++ b/master/Data.Tree.AVL.Map.Membership.Propositional.Properties.html @@ -22,13 +22,13 @@ open import Function.Base using (_∘_; _∘′_) open import Level using (Level) -open import Relation.Binary.Definitions using (Transitive; Symmetric; _Respectsˡ_) +open import Relation.Binary.Definitions using (Transitive; Symmetric; _Respectsˡ_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Construct.Intersection using (_∩_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) renaming (refl to ≡-refl; sym to ≡-sym; trans to ≡-trans) -open import Relation.Nullary using (Reflects; ¬_; yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary using (Reflects; ¬_; yes; no) +open import Relation.Nullary.Negation using (contradiction) open StrictTotalOrder strictTotalOrder renaming (Carrier to Key) hiding (trans) open Eq using (_≉_; refl; sym; trans) @@ -51,13 +51,13 @@ x x′ y y′ : V kx : Key × V -≈ₖᵥ-trans : Transitive (_≈ₖᵥ_ {V = V}) +≈ₖᵥ-trans : Transitive (_≈ₖᵥ_ {V = V}) ≈ₖᵥ-trans {i = i} {k = k} = ×-transitive Eq.trans ≡-trans {i = i} {k = k} -≈ₖᵥ-sym : Symmetric (_≈ₖᵥ_ {V = V}) +≈ₖᵥ-sym : Symmetric (_≈ₖᵥ_ {V = V}) ≈ₖᵥ-sym {x = x} {y = y} = ×-symmetric sym ≡-sym {x} {y} -∈ₖᵥ-Respectsˡ : _∈ₖᵥ_ {V = V} Respectsˡ _≈ₖᵥ_ +∈ₖᵥ-Respectsˡ : _∈ₖᵥ_ {V = V} Respectsˡ _≈ₖᵥ_ ∈ₖᵥ-Respectsˡ x~y = Any.map (≈ₖᵥ-trans (≈ₖᵥ-sym x~y)) ∈ₖᵥ-empty : kx ∉ₖᵥ empty @@ -88,8 +88,8 @@ ∈ₖᵥ-insert⁺⁺ : (k , x) ∈ₖᵥ insert k x m ∈ₖᵥ-insert⁺⁺ {k = k} {m = tree t} with IAny.any? ((k ≟_) key) t -... | yes k∈ = tree (IAnyₚ.Any-insert-just _ _ _ _ k′ _, ≡-refl) k∈) -... | no ¬k∈ = tree (IAnyₚ.Any-insert-nothing _ _ _ _ (refl , ≡-refl) ¬k∈) +... | yes k∈ = tree (IAnyₚ.Any-insert-just _ _ _ _ k′ _, ≡-refl) k∈) +... | no ¬k∈ = tree (IAnyₚ.Any-insert-nothing _ _ _ _ (refl , ≡-refl) ¬k∈) private ≈ₖᵥ-Resp : k k′ kx ≈ₖᵥ (k′ , x) kx ≈ₖᵥ (k , x) @@ -109,7 +109,7 @@ ∈ₖᵥ-lookup⁺ : (k , x) ∈ₖᵥ m lookup m k just x ∈ₖᵥ-lookup⁺ {k = k} {m = tree t} (tree kx∈m) with IAnyₚ.lookup⁺ t k (⊥⁺<[ _ ]<⊤⁺) kx∈m | IAnyₚ.lookup-result kx∈m -... | inj₁ p≉k | k≈p , x≡p = contradiction (sym k≈p) p≉k +... | inj₁ p≉k | k≈p , x≡p = contradiction (sym k≈p) p≉k ... | inj₂ (p≈k , eq) | k≈p , x≡p = ≡-trans eq (cong just (≡-sym x≡p)) ∈ₖᵥ-lookup⁻ : lookup m k just x (k , x) ∈ₖᵥ m @@ -119,7 +119,7 @@ ∈ₖᵥ-lookup-nothing⁺ : (∀ x (k , x) ∉ₖᵥ m) lookup m k nothing ∈ₖᵥ-lookup-nothing⁺ {k = k} {m = m@(tree t)} k∉m with lookup m k in eq ... | nothing = ≡-refl -... | just x = contradiction (∈ₖᵥ-lookup⁻ eq) (k∉m x) +... | just x = contradiction (∈ₖᵥ-lookup⁻ eq) (k∉m x) ∈ₖᵥ-lookup-nothing⁻ : lookup m k nothing (k , x) ∉ₖᵥ m ∈ₖᵥ-lookup-nothing⁻ eq kx∈m with ≡-trans (≡-sym eq) (∈ₖᵥ-lookup⁺ kx∈m) @@ -142,8 +142,8 @@ member-∉ₖᵥ {k = k} {m = m} ≡false x with lookup m k in eq ... | nothing = ∈ₖᵥ-lookup-nothing⁻ eq -member-Reflects-∈ₖᵥ : Reflects (∃[ x ] (k , x) ∈ₖᵥ m) (member k m) +member-Reflects-∈ₖᵥ : Reflects (∃[ x ] (k , x) ∈ₖᵥ m) (member k m) member-Reflects-∈ₖᵥ {k = k} {m = m} with lookup m k in eq -... | just x = Reflects.ofʸ (x , ∈ₖᵥ-lookup⁻ eq) -... | nothing = Reflects.ofⁿ (∈ₖᵥ-lookup-nothing⁻ eq proj₂) +... | just x = Reflects.ofʸ (x , ∈ₖᵥ-lookup⁻ eq) +... | nothing = Reflects.ofⁿ (∈ₖᵥ-lookup-nothing⁻ eq proj₂) \ No newline at end of file diff --git a/master/Data.Tree.AVL.Map.Membership.Propositional.html b/master/Data.Tree.AVL.Map.Membership.Propositional.html index 3fd6c86ebe..f32481010d 100644 --- a/master/Data.Tree.AVL.Map.Membership.Propositional.html +++ b/master/Data.Tree.AVL.Map.Membership.Propositional.html @@ -22,13 +22,13 @@ open import Function.Base using (_∘_; _∘′_) open import Level using (Level) -open import Relation.Binary.Definitions using (Transitive; Symmetric; _Respectsˡ_) +open import Relation.Binary.Definitions using (Transitive; Symmetric; _Respectsˡ_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Construct.Intersection using (_∩_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) renaming (refl to ≡-refl; sym to ≡-sym; trans to ≡-trans) -open import Relation.Nullary using (Reflects; ¬_; yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary using (Reflects; ¬_; yes; no) +open import Relation.Nullary.Negation using (contradiction) open StrictTotalOrder strictTotalOrder renaming (Carrier to Key) hiding (trans) open Eq using (_≉_; refl; sym; trans) @@ -64,5 +64,5 @@ kx ∈ₖᵥ m = Any (_≈ₖᵥ_ kx) m _∉ₖᵥ_ : Key × V Map V Set _ -kx ∉ₖᵥ m = ¬ kx ∈ₖᵥ m +kx ∉ₖᵥ m = ¬ kx ∈ₖᵥ m \ No newline at end of file diff --git a/master/Data.Tree.AVL.Map.Relation.Unary.Any.html b/master/Data.Tree.AVL.Map.Relation.Unary.Any.html index 6b46d0b016..85e47acbc8 100644 --- a/master/Data.Tree.AVL.Map.Relation.Unary.Any.html +++ b/master/Data.Tree.AVL.Map.Relation.Unary.Any.html @@ -28,8 +28,8 @@ variable v p q : Level V : Set v - P : Pred V p - Q : Pred V q + P : Pred V p + Q : Pred V q m : Map V ------------------------------------------------------------------------ @@ -39,13 +39,13 @@ -- satisfies P. There may be others. -- See `Relation.Unary` for an explanation of predicates. -Any : {V : Set v} Pred (Key × V) p Pred (Map V) (a ℓ₂ v p) +Any : {V : Set v} Pred (Key × V) p Pred (Map V) (a ℓ₂ v p) Any P = Map.Any (P ∘′ toPair) ------------------------------------------------------------------------ -- Operations on Any -map : P Q Any P Any Q +map : P Q Any P Any Q map f = Map.map f lookup : Any {V = V} P m Key × V @@ -62,9 +62,9 @@ ------------------------------------------------------------------------ -- Properties of predicates preserved by Any -any? : Decidable P Decidable (Any P) +any? : Decidable P Decidable (Any P) any? P? = Map.any? (P? toPair) -satisfiable : Satisfiable P Satisfiable (Any P) +satisfiable : Satisfiable P Satisfiable (Any P) satisfiable ((k , v) , p) = Map.satisfiable k (v , p) \ No newline at end of file diff --git a/master/Data.Tree.AVL.NonEmpty.html b/master/Data.Tree.AVL.NonEmpty.html index 32f527afe0..280bf4b2f0 100644 --- a/master/Data.Tree.AVL.NonEmpty.html +++ b/master/Data.Tree.AVL.NonEmpty.html @@ -24,7 +24,7 @@ open import Data.Product.Base hiding (map) open import Function.Base using (_$_; _∘′_) open import Level using (_⊔_) -open import Relation.Unary using (IUniversal; _⇒_) +open import Relation.Unary using (IUniversal; _⇒_) open StrictTotalOrder strictTotalOrder renaming (Carrier to Key) open import Data.Tree.AVL.Value Eq.setoid @@ -73,7 +73,7 @@ Val = Value.family V Wal = Value.family W - map : ∀[ Val Wal ] Tree⁺ V Tree⁺ W + map : ∀[ Val Wal ] Tree⁺ V Tree⁺ W map f (tree t) = tree $ Indexed.map f t module _ {v} {V : Value v} where diff --git a/master/Data.Tree.AVL.Relation.Unary.Any.html b/master/Data.Tree.AVL.Relation.Unary.Any.html index 827337498e..843f19daab 100644 --- a/master/Data.Tree.AVL.Relation.Unary.Any.html +++ b/master/Data.Tree.AVL.Relation.Unary.Any.html @@ -17,7 +17,7 @@ open import Function.Base using (_∘_; _$_) open import Level using (Level; _⊔_) -open import Relation.Nullary.Decidable using (map′) +open import Relation.Nullary.Decidable using (map′) open import Relation.Unary open StrictTotalOrder strictTotalOrder renaming (Carrier to Key) @@ -31,8 +31,8 @@ v p q : Level V : Value v t : Tree V - P : Pred (K& V) p - Q : Pred (K& V) q + P : Pred (K& V) p + Q : Pred (K& V) q ------------------------------------------------------------------------ -- Definition @@ -41,14 +41,14 @@ -- satisfies P. There may be others. -- See `Relation.Unary` for an explanation of predicates. -data Any {V : Value v} (P : Pred (K& V) p) : +data Any {V : Value v} (P : Pred (K& V) p) : Tree V Set (p a v ℓ₂) where tree : {h t} AVLₚ.Any P t Any P (tree {h = h} t) ------------------------------------------------------------------------ -- Operations on Any -map : P Q Any P t Any Q t +map : P Q Any P t Any Q t map f (tree p) = tree (AVLₚ.map f p) lookup : Any {V = V} P t K& V @@ -65,10 +65,10 @@ ------------------------------------------------------------------------ -- Properties of predicates preserved by Any -any? : Decidable P Decidable (Any {V = V} P) -any? P? (tree p) = map′ tree where (tree p) p) (AVLₚ.any? P? p) +any? : Decidable P Decidable (Any {V = V} P) +any? P? (tree p) = map′ tree where (tree p) p) (AVLₚ.any? P? p) -satisfiable : (k : Key) Satisfiable (P (k ,_)) Satisfiable (Any {V = V} P) +satisfiable : (k : Key) Satisfiable (P (k ,_)) Satisfiable (Any {V = V} P) satisfiable k sat = Product.map tree tree $ AVLₚ.satisfiable Indexed.⊥⁺<[ k ] Indexed.[ k ]<⊤⁺ sat \ No newline at end of file diff --git a/master/Data.Tree.AVL.Sets.Membership.Properties.html b/master/Data.Tree.AVL.Sets.Membership.Properties.html index 11bde13555..85ff5baa2f 100644 --- a/master/Data.Tree.AVL.Sets.Membership.Properties.html +++ b/master/Data.Tree.AVL.Sets.Membership.Properties.html @@ -20,8 +20,8 @@ open import Function.Base using (_∘_; _∘′_; const) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) -open import Relation.Nullary using (¬_; yes; no; Reflects) -open import Relation.Nullary.Reflects using (fromEquivalence) +open import Relation.Nullary using (¬_; yes; no; Reflects) +open import Relation.Nullary.Reflects using (fromEquivalence) open StrictTotalOrder strictTotalOrder renaming (Carrier to A) open import Data.Tree.AVL.Sets strictTotalOrder @@ -61,8 +61,8 @@ ∈-insert⁺ : x s x insert y s ∈-insert⁺ {x = x} {s = s} {y = y} x∈s with x y -... | yes x≈y = ∈fromMap (Map.∈ₖᵥ-Respectsˡ (Eq.sym x≈y , refl) Map.∈ₖᵥ-insert⁺⁺) -... | no x≉y = ∈fromMap (Map.∈ₖᵥ-insert⁺ x≉y (∈toMap x∈s)) +... | yes x≈y = ∈fromMap (Map.∈ₖᵥ-Respectsˡ (Eq.sym x≈y , refl) Map.∈ₖᵥ-insert⁺⁺) +... | no x≉y = ∈fromMap (Map.∈ₖᵥ-insert⁺ x≉y (∈toMap x∈s)) ∈-insert⁺⁺ : x insert x s ∈-insert⁺⁺ = ∈fromMap Map.∈ₖᵥ-insert⁺⁺ @@ -85,8 +85,8 @@ member-∉ : member x s false x s member-∉ p = Map.member-∉ₖᵥ p tt ∈toMap -member-Reflects-∈ : Reflects (x s) (member x s) +member-Reflects-∈ : Reflects (x s) (member x s) member-Reflects-∈ {x = x} {s = s} with member x s in eq -... | true = Reflects.ofʸ (member-∈ eq) -... | false = Reflects.ofⁿ (member-∉ eq) +... | true = Reflects.ofʸ (member-∈ eq) +... | false = Reflects.ofⁿ (member-∉ eq) \ No newline at end of file diff --git a/master/Data.Tree.AVL.Sets.Membership.html b/master/Data.Tree.AVL.Sets.Membership.html index 5729237fbd..d96b7e3bb6 100644 --- a/master/Data.Tree.AVL.Sets.Membership.html +++ b/master/Data.Tree.AVL.Sets.Membership.html @@ -19,8 +19,8 @@ open import Data.Unit.Base using (tt) open import Function.Base using (_∘_; _∘′_; const) -open import Relation.Nullary using (¬_; yes; no; Reflects) -open import Relation.Nullary.Reflects using (fromEquivalence) +open import Relation.Nullary using (¬_; yes; no; Reflects) +open import Relation.Nullary.Reflects using (fromEquivalence) open StrictTotalOrder strictTotalOrder renaming (Carrier to A) open import Data.Tree.AVL.Sets strictTotalOrder @@ -35,5 +35,5 @@ x s = Any ((x ≈_) proj₁) s _∉_ : A ⟨Set⟩ Set _ -x s = ¬ x s +x s = ¬ x s \ No newline at end of file diff --git a/master/Data.Tree.AVL.Value.html b/master/Data.Tree.AVL.Value.html index ade6b3ec5e..b6b6538187 100644 --- a/master/Data.Tree.AVL.Value.html +++ b/master/Data.Tree.AVL.Value.html @@ -9,7 +9,7 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) module Data.Tree.AVL.Value {a } (S : Setoid a ) where @@ -25,7 +25,7 @@ constructor MkValue field family : Key Set v - respects : family Respects _≈_ + respects : family Respects _≈_ ------------------------------------------------------------------------ -- A Key together with its value diff --git a/master/Data.Tree.AVL.html b/master/Data.Tree.AVL.html index fdd5de6ae3..7829c70b2b 100644 --- a/master/Data.Tree.AVL.html +++ b/master/Data.Tree.AVL.html @@ -28,7 +28,7 @@ open import Data.Product.Base hiding (map) open import Function.Base as F open import Level using (Level; _⊔_) -open import Relation.Unary using (IUniversal; _⇒_) +open import Relation.Unary using (IUniversal; _⇒_) private variable @@ -80,7 +80,7 @@ Val = Value.family V Wal = Value.family W - map : ∀[ Val Wal ] Tree V Tree W + map : ∀[ Val Wal ] Tree V Tree W map f (tree t) = tree $ Indexed.map f t module _ {v} {V : Value v} where diff --git a/master/Data.Tree.Binary.Relation.Unary.All.Properties.html b/master/Data.Tree.Binary.Relation.Unary.All.Properties.html index 2a71fbf6e4..f2cfcaf6a4 100644 --- a/master/Data.Tree.Binary.Relation.Unary.All.Properties.html +++ b/master/Data.Tree.Binary.Relation.Unary.All.Properties.html @@ -25,13 +25,13 @@ P : N₁ Set p Q : L₁ Set q -map⁺ : (f : N N₁) (g : L L₁) All (f P) (g Q) Tree.map f g All P Q +map⁺ : (f : N N₁) (g : L L₁) All (f P) (g Q) Tree.map f g All P Q map⁺ f g (leaf x) = leaf x map⁺ f g (node l m r) = node (map⁺ f g l) m (map⁺ f g r) -mapₙ⁺ : (f : N N₁) All (f P) Q Tree.mapₙ f All P Q +mapₙ⁺ : (f : N N₁) All (f P) Q Tree.mapₙ f All P Q mapₙ⁺ f = map⁺ f id -mapₗ⁺ : (g : L L₁) All P (g Q) Tree.mapₗ g All P Q +mapₗ⁺ : (g : L L₁) All P (g Q) Tree.mapₗ g All P Q mapₗ⁺ g = map⁺ id g \ No newline at end of file diff --git a/master/Data.Tree.Binary.Relation.Unary.All.html b/master/Data.Tree.Binary.Relation.Unary.All.html index e327cf907f..6a93f84c3b 100644 --- a/master/Data.Tree.Binary.Relation.Unary.All.html +++ b/master/Data.Tree.Binary.Relation.Unary.All.html @@ -28,13 +28,13 @@ leaf : {x} Q x All P Q (leaf x) node : {l m r} All P Q l P m All P Q r All P Q (node l m r) -map : ∀[ P R ] ∀[ Q S ] ∀[ All P Q All R S ] +map : ∀[ P R ] ∀[ Q S ] ∀[ All P Q All R S ] map f g (leaf x) = leaf (g x) map f g (node l m r) = node (map f g l) (f m) (map f g r) -mapₙ : ∀[ P R ] ∀[ All P Q All R Q ] +mapₙ : ∀[ P R ] ∀[ All P Q All R Q ] mapₙ {Q = Q} f = map f (⊆-refl {x = Q}) -mapₗ : ∀[ Q S ] ∀[ All P Q All P S ] +mapₗ : ∀[ Q S ] ∀[ All P Q All P S ] mapₗ {P = P} f = map (⊆-refl {x = P}) f \ No newline at end of file diff --git a/master/Data.Trie.NonEmpty.html b/master/Data.Trie.NonEmpty.html index 28418ea1bd..d5b58415bf 100644 --- a/master/Data.Trie.NonEmpty.html +++ b/master/Data.Trie.NonEmpty.html @@ -21,7 +21,7 @@ open import Data.These as These using (These; this; that; these) open import Function.Base as F import Function.Identity.Effectful as Identity -open import Relation.Unary using (_⇒_; IUniversal) +open import Relation.Unary using (_⇒_; IUniversal) open StrictTotalOrder S using (module Eq) @@ -52,7 +52,7 @@ Tries⁺ : {v} (V : Value v) (i : Size) Set (v k e r) map : {v w} (V : Value v) (W : Value w) {i} - ∀[ family V family W ] + ∀[ family V family W ] Trie⁺ V i Trie⁺ W i data Trie⁺ V where diff --git a/master/Data.Trie.html b/master/Data.Trie.html index eb3f019563..dfa6617b29 100644 --- a/master/Data.Trie.html +++ b/master/Data.Trie.html @@ -23,7 +23,7 @@ open import Data.Product.Base using () open import Data.These.Base as These using (These) open import Function.Base using (_∘′_; const) -open import Relation.Unary using (IUniversal; _⇒_) +open import Relation.Unary using (IUniversal; _⇒_) open StrictTotalOrder S using (module Eq) @@ -103,7 +103,7 @@ Val = Value.family V Wal = Value.family W - map : {i} ∀[ Val Wal ] Trie V i Trie W i + map : {i} ∀[ Val Wal ] Trie V i Trie W i map = Maybe.map ∘′ Trie⁺.map V W -- Deletion diff --git a/master/Data.Unit.Polymorphic.Properties.html b/master/Data.Unit.Polymorphic.Properties.html index d285291f11..0535e27b7e 100644 --- a/master/Data.Unit.Polymorphic.Properties.html +++ b/master/Data.Unit.Polymorphic.Properties.html @@ -16,13 +16,13 @@ open import Data.Sum.Base using (inj₁) open import Data.Unit.Base renaming ( to ⊤*) open import Data.Unit.Polymorphic.Base using (; tt) -open import Relation.Nullary.Decidable using (yes) +open import Relation.Nullary.Decidable using (yes) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Preorder; Poset; TotalOrder; DecTotalOrder) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (DecidableEquality; Antisymmetric; Total) + using (DecidableEquality; Antisymmetric; Total) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; trans) open import Relation.Binary.PropositionalEquality.Properties @@ -38,8 +38,8 @@ infix 4 _≟_ -_≟_ : DecidableEquality ( {}) -_ _ = yes refl +_≟_ : DecidableEquality ( {}) +_ _ = yes refl ≡-setoid : Setoid ≡-setoid _ = setoid @@ -51,10 +51,10 @@ -- Ordering ------------------------------------------------------------------------ -≡-total : Total {A = {}} _≡_ +≡-total : Total {A = {}} _≡_ ≡-total _ _ = inj₁ refl -≡-antisym : Antisymmetric {A = {}} _≡_ _≡_ +≡-antisym : Antisymmetric {A = {}} _≡_ _≡_ ≡-antisym p _ = p ------------------------------------------------------------------------ diff --git a/master/Data.Unit.Properties.html b/master/Data.Unit.Properties.html index bd994231af..79bf606ada 100644 --- a/master/Data.Unit.Properties.html +++ b/master/Data.Unit.Properties.html @@ -12,12 +12,12 @@ open import Data.Sum.Base using (inj₁) open import Data.Unit.Base using () open import Level using (0ℓ) -open import Relation.Nullary using (Irrelevant; yes) +open import Relation.Nullary using (Irrelevant; yes) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Poset; DecTotalOrder) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder) -open import Relation.Binary.Definitions using (DecidableEquality; Total; Antisymmetric) +open import Relation.Binary.Definitions using (DecidableEquality; Total; Antisymmetric) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; trans) open import Relation.Binary.PropositionalEquality.Properties @@ -26,7 +26,7 @@ ------------------------------------------------------------------------ -- Irrelevancy -⊤-irrelevant : Irrelevant +⊤-irrelevant : Irrelevant ⊤-irrelevant _ _ = refl ------------------------------------------------------------------------ @@ -34,8 +34,8 @@ infix 4 _≟_ -_≟_ : DecidableEquality -_ _ = yes refl +_≟_ : DecidableEquality +_ _ = yes refl ≡-setoid : Setoid 0ℓ 0ℓ ≡-setoid = setoid @@ -46,10 +46,10 @@ ------------------------------------------------------------------------ -- Relational properties -≡-total : Total {A = } _≡_ +≡-total : Total {A = } _≡_ ≡-total _ _ = inj₁ refl -≡-antisym : Antisymmetric {A = } _≡_ _≡_ +≡-antisym : Antisymmetric {A = } _≡_ _≡_ ≡-antisym eq _ = eq ------------------------------------------------------------------------ diff --git a/master/Data.Vec.Base.html b/master/Data.Vec.Base.html index 21666c7f84..e8114e8473 100644 --- a/master/Data.Vec.Base.html +++ b/master/Data.Vec.Base.html @@ -18,8 +18,8 @@ open import Function.Base using (const; _∘′_; id; _∘_; _$_) open import Level using (Level) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; trans; cong) -open import Relation.Nullary.Decidable.Core using (does; T?) -open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Decidable.Core using (does; T?) +open import Relation.Unary using (Pred; Decidable) private variable @@ -231,12 +231,12 @@ sum : Vec n sum = foldr _ _+_ 0 -count : {P : Pred A p} Decidable P Vec A n +count : {P : Pred A p} Decidable P Vec A n count P? [] = zero -count P? (x xs) = if does (P? x) then suc else id $ count P? xs +count P? (x xs) = if does (P? x) then suc else id $ count P? xs countᵇ : (A Bool) Vec A n -countᵇ p = count (T? p) +countᵇ p = count (T? p) ------------------------------------------------------------------------ -- Operations for building vectors diff --git a/master/Data.Vec.Bounded.Base.html b/master/Data.Vec.Bounded.Base.html index 03b7258d54..c84b74ab3e 100644 --- a/master/Data.Vec.Bounded.Base.html +++ b/master/Data.Vec.Bounded.Base.html @@ -21,7 +21,7 @@ open import Data.These.Base as These using (These) open import Function.Base using (_∘_; id; _$_) open import Level using (Level) -open import Relation.Nullary.Decidable.Core using (recompute) +open import Relation.Nullary.Decidable.Core using (recompute) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) @@ -52,12 +52,12 @@ padRight : A Vec≤ A n Vec A n padRight a (vs , m≤n) - with ≤″-offset krecompute (_ ℕ.≤″? _) (ℕ.≤⇒≤″ m≤n) + with ≤″-offset krecompute (_ ℕ.≤″? _) (ℕ.≤⇒≤″ m≤n) = vs Vec.++ Vec.replicate k a padLeft : A Vec≤ A n Vec A n padLeft a record { length = m ; vec = vs ; bound = m≤n } - with ≤″-offset krecompute (_ ℕ.≤″? _) (ℕ.≤⇒≤″ m≤n) + with ≤″-offset krecompute (_ ℕ.≤″? _) (ℕ.≤⇒≤″ m≤n) rewrite ℕ.+-comm m k = Vec.replicate k a Vec.++ vs @@ -73,7 +73,7 @@ padBoth : A A Vec≤ A n Vec A n padBoth aₗ aᵣ record { length = m ; vec = vs ; bound = m≤n } - with ≤″-offset krecompute (_ ℕ.≤″? _) (ℕ.≤⇒≤″ m≤n) + with ≤″-offset krecompute (_ ℕ.≤″? _) (ℕ.≤⇒≤″ m≤n) rewrite split m k = Vec.replicate k /2⌋ aₗ Vec.++ vs diff --git a/master/Data.Vec.Bounded.html b/master/Data.Vec.Bounded.html index adf6646bf3..bb488458cb 100644 --- a/master/Data.Vec.Bounded.html +++ b/master/Data.Vec.Bounded.html @@ -15,7 +15,7 @@ import Data.Vec as Vec using (filter; takeWhile; dropWhile) open import Function.Base using (id) open import Relation.Binary.Core using (_Preserves_⟶_) -open import Relation.Unary using (Pred; Decidable) +open import Relation.Unary using (Pred; Decidable) private variable @@ -42,7 +42,7 @@ ------------------------------------------------------------------------ -- Additional operations -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where filter : {n} Vec≤ A n Vec≤ A n filter = lift′ (Vec.filter P?) diff --git a/master/Data.Vec.Functional.Properties.html b/master/Data.Vec.Functional.Properties.html index f37af33e5c..e85c05c6b6 100644 --- a/master/Data.Vec.Functional.Properties.html +++ b/master/Data.Vec.Functional.Properties.html @@ -24,13 +24,13 @@ map; _++_; insertAt; removeAt; toVec; fromVec; toList; fromList) open import Function.Base using (_∘_; id) open import Level using (Level) -open import Relation.Binary.Definitions using (DecidableEquality; Decidable) +open import Relation.Binary.Definitions using (DecidableEquality; Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≗_; refl; _≢_; cong) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) open import Relation.Nullary.Decidable - using (Dec; does; yes; no; map′; _×-dec_) + using (Dec; does; yes; no; map′; _×-dec_) import Data.Fin.Properties as Finₚ @@ -51,11 +51,11 @@ ∷-injective : xs ys head xs head ys × tail xs tail ys ∷-injective eq = eq zero , eq suc -≗-dec : DecidableEquality A Decidable {A = Vector A n} _≗_ -≗-dec {n = zero} _≟_ xs ys = yes λ () +≗-dec : DecidableEquality A Decidable {A = Vector A n} _≗_ +≗-dec {n = zero} _≟_ xs ys = yes λ () ≗-dec {n = suc n} _≟_ xs ys = - map′ (Product.uncurry ∷-cong) ∷-injective - (head xs head ys ×-dec ≗-dec _≟_ (tail xs) (tail ys)) + map′ (Product.uncurry ∷-cong) ∷-injective + (head xs head ys ×-dec ≗-dec _≟_ (tail xs) (tail ys)) ------------------------------------------------------------------------ -- updateAt @@ -184,13 +184,13 @@ ++-cong : (xs xs′ : Vector A n) xs xs′ ys ys′ xs ++ ys xs′ ++ ys′ ++-cong {n} xs xs′ eq₁ eq₂ i with toℕ i ℕ.<? n - ... | yes i<n = begin + ... | yes i<n = begin (xs ++ ys) i ≡⟨ lookup-++-< xs ys i i<n xs (fromℕ< i<n) ≡⟨ eq₁ (fromℕ< i<n) xs′ (fromℕ< i<n) ≡⟨ lookup-++-< xs′ ys′ i i<n (xs′ ++ ys′) i where open ≡-Reasoning - ... | no i≮n = begin + ... | no i≮n = begin (xs ++ ys) i ≡⟨ lookup-++-≥ xs ys i (ℕ.≮⇒≥ i≮n) ys (reduce≥ i (ℕ.≮⇒≥ i≮n)) ≡⟨ eq₂ (reduce≥ i (ℕ.≮⇒≥ i≮n)) ys′ (reduce≥ i (ℕ.≮⇒≥ i≮n)) ≡⟨ lookup-++-≥ xs′ ys′ i (ℕ.≮⇒≥ i≮n) diff --git a/master/Data.Vec.Functional.Relation.Binary.Equality.Setoid.html b/master/Data.Vec.Functional.Relation.Binary.Equality.Setoid.html index 07a6ddcae9..1a22c7b88a 100644 --- a/master/Data.Vec.Functional.Relation.Binary.Equality.Setoid.html +++ b/master/Data.Vec.Functional.Relation.Binary.Equality.Setoid.html @@ -17,7 +17,7 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) module Data.Vec.Functional.Relation.Binary.Equality.Setoid @@ -38,16 +38,16 @@ -- Relational properties ------------------------------------------------------------------------ -≋-refl : {n} Reflexive (_≋_ {n = n}) +≋-refl : {n} Reflexive (_≋_ {n = n}) ≋-refl {n} = PW.refl {R = _≈_} refl ≋-reflexive : {n} _≡_ (_≋_ {n = n}) ≋-reflexive ≡.refl = ≋-refl -≋-sym : {n} Symmetric (_≋_ {n = n}) +≋-sym : {n} Symmetric (_≋_ {n = n}) ≋-sym = PW.sym {R = _≈_} sym -≋-trans : {n} Transitive (_≋_ {n = n}) +≋-trans : {n} Transitive (_≋_ {n = n}) ≋-trans = PW.trans {R = _≈_} trans ≋-isEquivalence : n IsEquivalence (_≋_ {n = n}) diff --git a/master/Data.Vec.Functional.Relation.Binary.Pointwise.Properties.html b/master/Data.Vec.Functional.Relation.Binary.Pointwise.Properties.html index 63115efd8c..058b8b59fb 100644 --- a/master/Data.Vec.Functional.Relation.Binary.Pointwise.Properties.html +++ b/master/Data.Vec.Functional.Relation.Binary.Pointwise.Properties.html @@ -25,7 +25,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Transitive; Symmetric; Decidable) + using (Reflexive; Transitive; Symmetric; Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_) private @@ -43,16 +43,16 @@ module _ {R : Rel A } where - refl : Reflexive R {n} Reflexive (Pointwise R {n}) + refl : Reflexive R {n} Reflexive (Pointwise R {n}) refl r i = r - sym : Symmetric R {n} Symmetric (Pointwise R {n}) + sym : Symmetric R {n} Symmetric (Pointwise R {n}) sym s xsys i = s (xsys i) - trans : Transitive R {n} Transitive (Pointwise R {n}) + trans : Transitive R {n} Transitive (Pointwise R {n}) trans t xsys yszs i = t (xsys i) (yszs i) - decidable : Decidable R {n} Decidable (Pointwise R {n}) + decidable : Decidable R {n} Decidable (Pointwise R {n}) decidable r? xs ys = all? λ i r? (xs i) (ys i) ------------------------------------------------------------------------ diff --git a/master/Data.Vec.Functional.Relation.Unary.All.Properties.html b/master/Data.Vec.Functional.Relation.Unary.All.Properties.html index 004f645483..0f737f96a3 100644 --- a/master/Data.Vec.Functional.Relation.Unary.All.Properties.html +++ b/master/Data.Vec.Functional.Relation.Unary.All.Properties.html @@ -24,7 +24,7 @@ variable a p : Level A B C : Set a - P Q R : Pred A p + P Q R : Pred A p m n : x y : A xs ys : Vector A n @@ -60,35 +60,35 @@ ------------------------------------------------------------------------ -- zip -zip⁺ : All P xs All Q ys All (P ⟨×⟩ Q) (zip xs ys) +zip⁺ : All P xs All Q ys All (P ⟨×⟩ Q) (zip xs ys) zip⁺ ps qs i = ps i , qs i -zip⁻ : All (P ⟨×⟩ Q) (zip xs ys) All P xs × All Q ys +zip⁻ : All (P ⟨×⟩ Q) (zip xs ys) All P xs × All Q ys zip⁻ pqs = proj₁ pqs , proj₂ pqs ------------------------------------------------------------------------ -- head -head⁺ : (P : Pred A p) All P xs P (head xs) +head⁺ : (P : Pred A p) All P xs P (head xs) head⁺ P ps = ps zero ------------------------------------------------------------------------ -- tail -tail⁺ : (P : Pred A p) All P xs All P (tail xs) +tail⁺ : (P : Pred A p) All P xs All P (tail xs) tail⁺ P xs = xs suc ------------------------------------------------------------------------ -- ++ -module _ (P : Pred A p) {xs : Vector A m} {ys : Vector A n} where +module _ (P : Pred A p) {xs : Vector A m} {ys : Vector A n} where ++⁺ : All P xs All P ys All P (xs ++ ys) ++⁺ pxs pys i with splitAt m i ... | inj₁ i′ = pxs i′ ... | inj₂ j′ = pys j′ -module _ (P : Pred A p) (xs : Vector A m) {ys : Vector A n} where +module _ (P : Pred A p) (xs : Vector A m) {ys : Vector A n} where ++⁻ˡ : All P (xs ++ ys) All P xs ++⁻ˡ ps i with ps (i ↑ˡ n) diff --git a/master/Data.Vec.Functional.Relation.Unary.All.html b/master/Data.Vec.Functional.Relation.Unary.All.html index 2ddd70ba9f..f833ac9dfc 100644 --- a/master/Data.Vec.Functional.Relation.Unary.All.html +++ b/master/Data.Vec.Functional.Relation.Unary.All.html @@ -23,28 +23,28 @@ ------------------------------------------------------------------------ -- Definition -All : Pred A {n} Vector A n Set +All : Pred A {n} Vector A n Set All P xs = i P (xs i) ------------------------------------------------------------------------ -- Operations -module _ {P : Pred A p} {Q : Pred A q} where +module _ {P : Pred A p} {Q : Pred A q} where - map : P Q {n} All P {n = n} All Q + map : P Q {n} All P {n = n} All Q map p⊆q ps i = p⊆q (ps i) ------------------------------------------------------------------------ -- Properties of predicates preserved by All -module _ {P : Pred A p} where +module _ {P : Pred A p} where - all : Decidable P {n} Decidable (All P {n = n}) + all : Decidable P {n} Decidable (All P {n = n}) all p? xs = all? λ i p? (xs i) - universal : Universal P {n} Universal (All P {n = n}) + universal : Universal P {n} Universal (All P {n = n}) universal uni xs i = uni (xs i) - satisfiable : Satisfiable P {n} Satisfiable (All P {n = n}) + satisfiable : Satisfiable P {n} Satisfiable (All P {n = n}) satisfiable (x , px) = _ x) , _ px) \ No newline at end of file diff --git a/master/Data.Vec.Functional.Relation.Unary.Any.html b/master/Data.Vec.Functional.Relation.Unary.Any.html index 283d9bb2e9..edfbbffa24 100644 --- a/master/Data.Vec.Functional.Relation.Unary.Any.html +++ b/master/Data.Vec.Functional.Relation.Unary.Any.html @@ -27,13 +27,13 @@ ------------------------------------------------------------------------ -- Definition -Any : Pred A {n} Vector A n Set +Any : Pred A {n} Vector A n Set Any P xs = λ i P (xs i) ------------------------------------------------------------------------ -- Operations -module _ {P : Pred A p} where +module _ {P : Pred A p} where here : {x n} {v : Vector A n} P x Any P (x v) here px = zero , px @@ -41,16 +41,16 @@ there : {x n} {v : Vector A n} Any P v Any P (x v) there = Σ.map suc id -module _ {P : Pred A p} {Q : Pred A q} where +module _ {P : Pred A p} {Q : Pred A q} where - map : P Q {n} Any P {n = n} Any Q + map : P Q {n} Any P {n = n} Any Q map p⊆q = Σ.map id p⊆q ------------------------------------------------------------------------ -- Properties of predicates preserved by Any -module _ {P : Pred A p} where +module _ {P : Pred A p} where - any : Decidable P {n} Decidable (Any P {n = n}) + any : Decidable P {n} Decidable (Any P {n = n}) any p? xs = any? λ i p? (xs i) \ No newline at end of file diff --git a/master/Data.Vec.Membership.DecPropositional.html b/master/Data.Vec.Membership.DecPropositional.html index 70891fe068..3b45b6259c 100644 --- a/master/Data.Vec.Membership.DecPropositional.html +++ b/master/Data.Vec.Membership.DecPropositional.html @@ -7,10 +7,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.Vec.Membership.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) where + {a} {A : Set a} (_≟_ : DecidableEquality A) where open import Relation.Binary.PropositionalEquality.Properties using (decSetoid) diff --git a/master/Data.Vec.Membership.DecSetoid.html b/master/Data.Vec.Membership.DecSetoid.html index 7cf9815507..585a9533b6 100644 --- a/master/Data.Vec.Membership.DecSetoid.html +++ b/master/Data.Vec.Membership.DecSetoid.html @@ -13,7 +13,7 @@ open import Data.Vec.Base using (Vec) open import Data.Vec.Relation.Unary.Any using (any?) -open import Relation.Nullary.Decidable using (Dec) +open import Relation.Nullary.Decidable using (Dec) open DecSetoid DS renaming (Carrier to A) ------------------------------------------------------------------------ @@ -26,6 +26,6 @@ infix 4 _∈?_ -_∈?_ : x {n} (xs : Vec A n) Dec (x xs) +_∈?_ : x {n} (xs : Vec A n) Dec (x xs) x ∈? xs = any? (x ≟_) xs \ No newline at end of file diff --git a/master/Data.Vec.Membership.Propositional.Properties.html b/master/Data.Vec.Membership.Propositional.Properties.html index c5a7cd3a51..9af0107fa3 100644 --- a/master/Data.Vec.Membership.Propositional.Properties.html +++ b/master/Data.Vec.Membership.Propositional.Properties.html @@ -21,7 +21,7 @@ using () renaming (_∈_ to _∈ₗ_) open import Level using (Level) open import Function.Base using (_∘_; id) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) private @@ -111,7 +111,7 @@ ------------------------------------------------------------------------ -- Relationship to Any -module _ {P : Pred A p} where +module _ {P : Pred A p} where fromAny : {n} {xs : Vec A n} Any P xs λ x x xs × P x fromAny (here px) = -, here refl , px diff --git a/master/Data.Vec.Membership.Setoid.html b/master/Data.Vec.Membership.Setoid.html index 9abb0376fc..e38796d7c9 100644 --- a/master/Data.Vec.Membership.Setoid.html +++ b/master/Data.Vec.Membership.Setoid.html @@ -8,7 +8,7 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) module Data.Vec.Membership.Setoid {c } (S : Setoid c ) where @@ -17,8 +17,8 @@ open import Data.Vec.Relation.Unary.Any as Any using (Any; here; there; index) open import Data.Product.Base using (; _×_; _,_) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Unary using (Pred) open Setoid S renaming (Carrier to A) @@ -31,7 +31,7 @@ x xs = Any (x ≈_) xs _∉_ : A {n} Vec A n Set _ -x xs = ¬ x xs +x xs = ¬ x xs ------------------------------------------------------------------------ -- Operations @@ -49,12 +49,12 @@ ------------------------------------------------------------------------ -- Finding and losing witnesses -module _ {p} {P : Pred A p} where +module _ {p} {P : Pred A p} where find : {n} {xs : Vec A n} Any P xs λ x x xs × P x find (here px) = _ , here refl , px find (there pxs) = let x , x∈xs , px = find pxs in x , there x∈xs , px - lose : P Respects _≈_ {x n} {xs : Vec A n} x xs P x Any P xs + lose : P Respects _≈_ {x n} {xs : Vec A n} x xs P x Any P xs lose resp x∈xs px = Any.map (flip resp px) x∈xs \ No newline at end of file diff --git a/master/Data.Vec.Properties.html b/master/Data.Vec.Properties.html index 75d1a14655..f9b4e75b6f 100644 --- a/master/Data.Vec.Properties.html +++ b/master/Data.Vec.Properties.html @@ -29,14 +29,14 @@ open import Function.Base using (_∘_; id; _$_; const; _ˢ_; flip) open import Function.Bundles using (_↔_; mk↔ₛ′) open import Level using (Level) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; _≗_; refl; sym; trans; cong; cong₂; subst) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Decidable.Core using (Dec; does; yes; _×-dec_; map′) -open import Relation.Nullary.Negation.Core using (contradiction) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Decidable.Core using (Dec; does; yes; _×-dec_; map′) +open import Relation.Nullary.Negation.Core using (contradiction) import Data.Nat.GeneralisedArithmetic as private @@ -59,10 +59,10 @@ ∷-injective : x xs y ys x y × xs ys ∷-injective refl = refl , refl -≡-dec : DecidableEquality A DecidableEquality (Vec A n) -≡-dec _≟_ [] [] = yes refl -≡-dec _≟_ (x xs) (y ys) = map′ (uncurry (cong₂ _∷_)) - ∷-injective (x y ×-dec ≡-dec _≟_ xs ys) +≡-dec : DecidableEquality A DecidableEquality (Vec A n) +≡-dec _≟_ [] [] = yes refl +≡-dec _≟_ (x xs) (y ys) = map′ (uncurry (cong₂ _∷_)) + ∷-injective (x y ×-dec ≡-dec _≟_ xs ys) ------------------------------------------------------------------------ -- _[_]=_ @@ -218,7 +218,7 @@ updateAt-minimal : (i j : Fin n) {f : A A} (xs : Vec A n) i j xs [ i ]= x (updateAt xs j f) [ i ]= x -updateAt-minimal zero zero (x xs) 0≢0 here = contradiction refl 0≢0 +updateAt-minimal zero zero (x xs) 0≢0 here = contradiction refl 0≢0 updateAt-minimal zero (suc j) (x xs) _ here = here updateAt-minimal (suc i) zero (x xs) _ (there loc) = there loc updateAt-minimal (suc i) (suc j) (x xs) i≢j (there loc) = @@ -288,7 +288,7 @@ updateAt-commutes : (i j : Fin n) {f g : A A} i j (xs : Vec A n) updateAt (updateAt xs j g) i f updateAt (updateAt xs i f) j g -updateAt-commutes zero zero 0≢0 (x xs) = contradiction refl 0≢0 +updateAt-commutes zero zero 0≢0 (x xs) = contradiction refl 0≢0 updateAt-commutes zero (suc j) i≢j (x xs) = refl updateAt-commutes (suc i) zero i≢j (x xs) = refl updateAt-commutes (suc i) (suc j) i≢j (x xs) = @@ -1221,11 +1221,11 @@ ------------------------------------------------------------------------ -- count -module _ {P : Pred A p} (P? : Decidable P) where +module _ {P : Pred A p} (P? : Decidable P) where count≤n : (xs : Vec A n) count P? xs n count≤n [] = z≤n - count≤n (x xs) with does (P? x) + count≤n (x xs) with does (P? x) ... | true = s≤s (count≤n xs) ... | false = m≤n⇒m≤1+n (count≤n xs) @@ -1260,7 +1260,7 @@ removeAt-punchOut : (xs : Vec A (suc n)) {i} {j} (i≢j : i j) lookup (removeAt xs i) (Fin.punchOut i≢j) lookup xs j -removeAt-punchOut (x xs) {zero} {zero} i≢j = contradiction refl i≢j +removeAt-punchOut (x xs) {zero} {zero} i≢j = contradiction refl i≢j removeAt-punchOut (x xs) {zero} {suc j} i≢j = refl removeAt-punchOut (x y xs) {suc i} {zero} i≢j = refl removeAt-punchOut (x y xs) {suc i} {suc j} i≢j = diff --git a/master/Data.Vec.Recursive.html b/master/Data.Vec.Recursive.html index ab13a3b61a..c9fc12a038 100644 --- a/master/Data.Vec.Recursive.html +++ b/master/Data.Vec.Recursive.html @@ -34,7 +34,7 @@ open import Function.Bundles using (_↔_; mk↔ₛ′; mk↔) open import Function.Properties.Inverse using (↔-isEquivalence; ↔-refl; ↔-sym; ↔-trans) open import Level using (Level; lift) -open import Relation.Unary using (IUniversal; Universal; _⇒_) +open import Relation.Unary using (IUniversal; Universal; _⇒_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; trans; cong; subst) open import Relation.Binary.Structures using (IsEquivalence) @@ -79,10 +79,10 @@ tail : n A ^ suc n A ^ n tail n as = proj₂ (uncons n as) -fromVec : ∀[ Vec A (A ^_) ] +fromVec : ∀[ Vec A (A ^_) ] fromVec = Vec.foldr (_ ^_) (cons _) _ -toVec : Π[ (A ^_) Vec A ] +toVec : Π[ (A ^_) Vec A ] toVec 0 as = Vec.[] toVec (suc n) as = head n as toVec n (tail n as) diff --git a/master/Data.Vec.Relation.Binary.Equality.Cast.html b/master/Data.Vec.Relation.Binary.Equality.Cast.html index 7f7442af20..674b8e8e66 100644 --- a/master/Data.Vec.Relation.Binary.Equality.Cast.html +++ b/master/Data.Vec.Relation.Binary.Equality.Cast.html @@ -17,7 +17,7 @@ open import Data.Nat.Properties using (suc-injective) open import Data.Vec.Base open import Relation.Binary.Core using (REL; _⇒_) -open import Relation.Binary.Definitions using (Sym; Trans) +open import Relation.Binary.Definitions using (Sym; Trans) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; trans; sym; cong) open import Relation.Binary.PropositionalEquality.Properties @@ -51,7 +51,7 @@ ≈-reflexive : {n} _≡_ xs ys _≈[_]_ {n} xs refl ys) ≈-reflexive {x = x} eq = trans (cast-is-id refl x) eq -≈-sym : .{m≡n : m n} Sym _≈[ m≡n ]_ _≈[ sym m≡n ]_ +≈-sym : .{m≡n : m n} Sym _≈[ m≡n ]_ _≈[ sym m≡n ]_ ≈-sym {m≡n = m≡n} {xs} {ys} xs≈ys = begin cast (sym m≡n) ys ≡⟨ cong (cast (sym m≡n)) xs≈ys cast (sym m≡n) (cast m≡n xs) ≡⟨ cast-trans m≡n (sym m≡n) xs @@ -59,7 +59,7 @@ xs where open ≡-Reasoning -≈-trans : .{m≡n : m n} .{n≡o : n o} Trans _≈[ m≡n ]_ _≈[ n≡o ]_ _≈[ trans m≡n n≡o ]_ +≈-trans : .{m≡n : m n} .{n≡o : n o} Trans _≈[ m≡n ]_ _≈[ n≡o ]_ _≈[ trans m≡n n≡o ]_ ≈-trans {m≡n = m≡n} {n≡o} {xs} {ys} {zs} xs≈ys ys≈zs = begin cast (trans m≡n n≡o) xs ≡⟨ cast-trans m≡n n≡o xs cast n≡o (cast m≡n xs) ≡⟨ cong (cast n≡o) xs≈ys diff --git a/master/Data.Vec.Relation.Binary.Equality.DecPropositional.html b/master/Data.Vec.Relation.Binary.Equality.DecPropositional.html index 574b2d7d8b..981e374c28 100644 --- a/master/Data.Vec.Relation.Binary.Equality.DecPropositional.html +++ b/master/Data.Vec.Relation.Binary.Equality.DecPropositional.html @@ -7,10 +7,10 @@ {-# OPTIONS --cubical-compatible --safe #-} -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) module Data.Vec.Relation.Binary.Equality.DecPropositional - {a} {A : Set a} (_≟_ : DecidableEquality A) where + {a} {A : Set a} (_≟_ : DecidableEquality A) where import Data.Vec.Relation.Binary.Equality.Propositional as PEq import Data.Vec.Relation.Binary.Equality.DecSetoid as DSEq diff --git a/master/Data.Vec.Relation.Binary.Equality.DecSetoid.html b/master/Data.Vec.Relation.Binary.Equality.DecSetoid.html index fb94bdb8c1..a08f262f6b 100644 --- a/master/Data.Vec.Relation.Binary.Equality.DecSetoid.html +++ b/master/Data.Vec.Relation.Binary.Equality.DecSetoid.html @@ -17,7 +17,7 @@ import Data.Vec.Relation.Binary.Equality.Setoid as Equality import Data.Vec.Relation.Binary.Pointwise.Inductive as PW open import Level using (_⊔_) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open DecSetoid DS @@ -31,7 +31,7 @@ infix 4 _≋?_ -_≋?_ : {m n} Decidable (_≋_ {m} {n}) +_≋?_ : {m n} Decidable (_≋_ {m} {n}) _≋?_ = PW.decidable _≟_ ≋-isDecEquivalence : n IsDecEquivalence (_≋_ {n}) diff --git a/master/Data.Vec.Relation.Binary.Equality.Setoid.html b/master/Data.Vec.Relation.Binary.Equality.Setoid.html index e005e4258e..61e8e666cd 100644 --- a/master/Data.Vec.Relation.Binary.Equality.Setoid.html +++ b/master/Data.Vec.Relation.Binary.Equality.Setoid.html @@ -20,7 +20,7 @@ open import Level using (_⊔_) open import Relation.Binary.Core using (REL) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Sym; Trans) +open import Relation.Binary.Definitions using (Reflexive; Sym; Trans) open Setoid S renaming (Carrier to A) @@ -38,13 +38,13 @@ ------------------------------------------------------------------------ -- Relational properties -≋-refl : {n} Reflexive (_≋_ {n}) +≋-refl : {n} Reflexive (_≋_ {n}) ≋-refl = PW.refl refl -≋-sym : {n m} Sym _≋_ (_≋_ {m} {n}) +≋-sym : {n m} Sym _≋_ (_≋_ {m} {n}) ≋-sym = PW.sym sym -≋-trans : {n m o} Trans (_≋_ {m}) (_≋_ {n} {o}) (_≋_) +≋-trans : {n m o} Trans (_≋_ {m}) (_≋_ {n} {o}) (_≋_) ≋-trans = PW.trans trans ≋-isEquivalence : n IsEquivalence (_≋_ {n}) diff --git a/master/Data.Vec.Relation.Binary.Lex.Core.html b/master/Data.Vec.Relation.Binary.Lex.Core.html index dfbd6d82e1..c753e7157e 100644 --- a/master/Data.Vec.Relation.Binary.Lex.Core.html +++ b/master/Data.Vec.Relation.Binary.Lex.Core.html @@ -21,12 +21,12 @@ open import Level using (Level; _⊔_) open import Relation.Binary.Core using (Rel; REL) open import Relation.Binary.Definitions - using (Transitive; Symmetric; Asymmetric; Antisymmetric; Irreflexive; Trans; _Respects₂_; _Respectsˡ_; _Respectsʳ_; Decidable; Irrelevant) + using (Transitive; Symmetric; Asymmetric; Antisymmetric; Irreflexive; Trans; _Respects₂_; _Respectsˡ_; _Respectsʳ_; Decidable; Irrelevant) open import Relation.Binary.Structures using (IsPartialEquivalence) open import Relation.Binary.PropositionalEquality.Core as using (_≡_; refl; cong) import Relation.Nullary as Nullary -open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _×-dec_; _⊎-dec_) +open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _×-dec_; _⊎-dec_) open import Relation.Nullary.Negation private @@ -75,14 +75,14 @@ _<ₗₑₓ_ = Lex P _≈_ _≺_ ≰-this : {x y m n} {xs : Vec A m} {ys : Vec A n} - ¬ (x y) ¬ (x y) ¬ (x xs) <ₗₑₓ (y ys) - ≰-this x≉y x≮y (this x≺y m≡n) = contradiction x≺y x≮y - ≰-this x≉y x≮y (next x≈y xs<ys) = contradiction x≈y x≉y + ¬ (x y) ¬ (x y) ¬ (x xs) <ₗₑₓ (y ys) + ≰-this x≉y x≮y (this x≺y m≡n) = contradiction x≺y x≮y + ≰-this x≉y x≮y (next x≈y xs<ys) = contradiction x≈y x≉y ≰-next : {x y m n} {xs : Vec A m} {ys : Vec A n} - ¬ (x y) ¬ (xs <ₗₑₓ ys) ¬ (x xs) <ₗₑₓ (y ys) - ≰-next x≮y xs≮ys (this x≺y m≡n) = contradiction x≺y x≮y - ≰-next x≮y xs≮ys (next x≈y xs<ys) = contradiction xs<ys xs≮ys + ¬ (x y) ¬ (xs <ₗₑₓ ys) ¬ (x xs) <ₗₑₓ (y ys) + ≰-next x≮y xs≮ys (this x≺y m≡n) = contradiction x≺y x≮y + ≰-next x≮y xs≮ys (next x≈y xs<ys) = contradiction xs<ys xs≮ys P⇔[]<[] : P [] <ₗₑₓ [] P⇔[]<[] = mk⇔ base { (base p) p }) @@ -95,24 +95,24 @@ ∷<∷-⇔ = mk⇔ [ flip this refl , uncurry next ] toSum module _ (≈-equiv : IsPartialEquivalence _≈_) - ((≺-respʳ-≈ , ≺-respˡ-≈) : _≺_ Respects₂ _≈_) - (≺-trans : Transitive _≺_) + ((≺-respʳ-≈ , ≺-respˡ-≈) : _≺_ Respects₂ _≈_) + (≺-trans : Transitive _≺_) (open IsPartialEquivalence ≈-equiv) where - transitive′ : {m n o P₂} Trans (Lex P _≈_ _≺_ {m} {n}) (Lex P₂ _≈_ _≺_ {n} {o}) (Lex (P × P₂) _≈_ _≺_) + transitive′ : {m n o P₂} Trans (Lex P _≈_ _≺_ {m} {n}) (Lex P₂ _≈_ _≺_ {n} {o}) (Lex (P × P₂) _≈_ _≺_) transitive′ (base p₁) (base p₂) = base (p₁ , p₂) transitive′ (this x≺y m≡n) (this y≺z n≡o) = this (≺-trans x≺y y≺z) (≡.trans m≡n n≡o) transitive′ (this x≺y m≡n) (next y≈z ys<zs) = this (≺-respʳ-≈ y≈z x≺y) (≡.trans m≡n (length-equal ys<zs)) transitive′ (next x≈y xs<ys) (this y≺z n≡o) = this (≺-respˡ-≈ (sym x≈y) y≺z) (≡.trans (length-equal xs<ys) n≡o) transitive′ (next x≈y xs<ys) (next y≈z ys<zs) = next (trans x≈y y≈z) (transitive′ xs<ys ys<zs) - transitive : {m n o} Trans (_<ₗₑₓ_ {m} {n}) (_<ₗₑₓ_ {n} {o}) _<ₗₑₓ_ + transitive : {m n o} Trans (_<ₗₑₓ_ {m} {n}) (_<ₗₑₓ_ {n} {o}) _<ₗₑₓ_ transitive xs<ys ys<zs = map-P proj₁ (transitive′ xs<ys ys<zs) - module _ (≈-sym : Symmetric _≈_) (≺-irrefl : Irreflexive _≈_ _≺_) (≺-asym : Asymmetric _≺_) where + module _ (≈-sym : Symmetric _≈_) (≺-irrefl : Irreflexive _≈_ _≺_) (≺-asym : Asymmetric _≺_) where - antisym : {n} Antisymmetric (_≋_ {n}) (_<ₗₑₓ_) + antisym : {n} Antisymmetric (_≋_ {n}) (_<ₗₑₓ_) antisym (base _) (base _) = [] antisym (this x≺y m≡n) (this y≺x n≡m) = ⊥-elim (≺-asym x≺y y≺x) antisym (this x≺y m≡n) (next y≈x ys<xs) = ⊥-elim (≺-irrefl (≈-sym y≈x) x≺y) @@ -121,37 +121,37 @@ module _ (≈-equiv : IsPartialEquivalence _≈_) (open IsPartialEquivalence ≈-equiv) where - respectsˡ : _≺_ Respectsˡ _≈_ {m n} (_<ₗₑₓ_ {m} {n}) Respectsˡ _≋_ + respectsˡ : _≺_ Respectsˡ _≈_ {m n} (_<ₗₑₓ_ {m} {n}) Respectsˡ _≋_ respectsˡ resp [] (base p) = base p respectsˡ resp (x≈y xs≋ys) (this x≺z m≡n) = this (resp x≈y x≺z) m≡n respectsˡ resp (x≈y xs≋ys) (next x≈z xs<zs) = next (trans (sym x≈y) x≈z) (respectsˡ resp xs≋ys xs<zs) - respectsʳ : _≺_ Respectsʳ _≈_ {m n} (_<ₗₑₓ_ {m} {n}) Respectsʳ _≋_ + respectsʳ : _≺_ Respectsʳ _≈_ {m n} (_<ₗₑₓ_ {m} {n}) Respectsʳ _≋_ respectsʳ resp [] (base p) = base p respectsʳ resp (x≈y xs≋ys) (this x≺z m≡n) = this (resp x≈y x≺z) m≡n respectsʳ resp (x≈y xs≋ys) (next x≈z xs<zs) = next (trans x≈z x≈y) (respectsʳ resp xs≋ys xs<zs) - respects₂ : _≺_ Respects₂ _≈_ {n} (_<ₗₑₓ_ {n} {n}) Respects₂ _≋_ + respects₂ : _≺_ Respects₂ _≈_ {n} (_<ₗₑₓ_ {n} {n}) Respects₂ _≋_ respects₂ (≺-resp-≈ʳ , ≺-resp-≈ˡ) = respectsʳ ≺-resp-≈ʳ , respectsˡ ≺-resp-≈ˡ - module _ (P? : Dec P) (_≈?_ : Decidable _≈_) (_≺?_ : Decidable _≺_) where + module _ (P? : Dec P) (_≈?_ : Decidable _≈_) (_≺?_ : Decidable _≺_) where - decidable : {m n} Decidable (_<ₗₑₓ_ {m} {n}) + decidable : {m n} Decidable (_<ₗₑₓ_ {m} {n}) decidable {m} {n} xs ys with m ℕ.≟ n - decidable {_} {_} [] [] | yes refl = Dec.map P⇔[]<[] P? - decidable {_} {_} (x xs) (y ys) | yes refl = Dec.map ∷<∷-⇔ ((x ≺? y) ⊎-dec (x ≈? y) ×-dec (decidable xs ys)) - decidable {_} {_} _ _ | no m≢n = no xs<ys contradiction (length-equal xs<ys) m≢n) - - module _ (P-irrel : Nullary.Irrelevant P) - (≈-irrel : Irrelevant _≈_) - (≺-irrel : Irrelevant _≺_) - (≺-irrefl : Irreflexive _≈_ _≺_) + decidable {_} {_} [] [] | yes refl = Dec.map P⇔[]<[] P? + decidable {_} {_} (x xs) (y ys) | yes refl = Dec.map ∷<∷-⇔ ((x ≺? y) ⊎-dec (x ≈? y) ×-dec (decidable xs ys)) + decidable {_} {_} _ _ | no m≢n = no xs<ys contradiction (length-equal xs<ys) m≢n) + + module _ (P-irrel : Nullary.Irrelevant P) + (≈-irrel : Irrelevant _≈_) + (≺-irrel : Irrelevant _≺_) + (≺-irrefl : Irreflexive _≈_ _≺_) where - irrelevant : {m n} Irrelevant (_<ₗₑₓ_ {m} {n}) + irrelevant : {m n} Irrelevant (_<ₗₑₓ_ {m} {n}) irrelevant (base p₁) (base p₂) rewrite P-irrel p₁ p₂ = refl irrelevant (this x≺y₁ m≡n₁) (this x≺y₂ m≡n₂) rewrite ≺-irrel x≺y₁ x≺y₂ | ℕ.≡-irrelevant m≡n₁ m≡n₂ = refl - irrelevant (this x≺y m≡n) (next x≈y xs<ys₂) = contradiction x≺y (≺-irrefl x≈y) - irrelevant (next x≈y xs<ys₁) (this x≺y m≡n) = contradiction x≺y (≺-irrefl x≈y) + irrelevant (this x≺y m≡n) (next x≈y xs<ys₂) = contradiction x≺y (≺-irrefl x≈y) + irrelevant (next x≈y xs<ys₁) (this x≺y m≡n) = contradiction x≺y (≺-irrefl x≈y) irrelevant (next x≈y₁ xs<ys₁) (next x≈y₂ xs<ys₂) rewrite ≈-irrel x≈y₁ x≈y₂ | irrelevant xs<ys₁ xs<ys₂ = refl \ No newline at end of file diff --git a/master/Data.Vec.Relation.Binary.Lex.NonStrict.html b/master/Data.Vec.Relation.Binary.Lex.NonStrict.html index e1eb2b2c92..04090ac225 100644 --- a/master/Data.Vec.Relation.Binary.Lex.NonStrict.html +++ b/master/Data.Vec.Relation.Binary.Lex.NonStrict.html @@ -28,9 +28,9 @@ open import Relation.Binary.Structures using (IsEquivalence; IsPartialOrder; IsStrictPartialOrder; IsDecPartialOrder; IsDecStrictPartialOrder; IsDecTotalOrder; IsStrictTotalOrder; IsPreorder; IsTotalOrder) open import Relation.Binary.Definitions - using (Irreflexive; _Respects₂_; Antisymmetric; Asymmetric; Symmetric; Trans; Decidable; Total; Trichotomous) + using (Irreflexive; _Respects₂_; Antisymmetric; Asymmetric; Symmetric; Trans; Decidable; Total; Trichotomous) import Relation.Binary.Construct.NonStrictToStrict as Conv -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) private variable @@ -66,42 +66,42 @@ _≋_ = Pointwise _≈_ _<_ = Lex-< _≈_ _≼_ - <-irrefl : {m n} Irreflexive (_≋_ {m} {n}) _<_ + <-irrefl : {m n} Irreflexive (_≋_ {m} {n}) _<_ <-irrefl = Strict.<-irrefl (Conv.<-irrefl _≈_ _≼_) - <-asym : IsEquivalence _≈_ _≼_ Respects₂ _≈_ Antisymmetric _≈_ _≼_ - {n} Asymmetric (_<_ {n} {n}) + <-asym : IsEquivalence _≈_ _≼_ Respects₂ _≈_ Antisymmetric _≈_ _≼_ + {n} Asymmetric (_<_ {n} {n}) <-asym ≈-equiv ≼-resp-≈ ≼-antisym = Strict.<-asym sym (Conv.<-resp-≈ _ _ ≈-equiv ≼-resp-≈) (Conv.<-asym _≈_ _ ≼-antisym) where open IsEquivalence ≈-equiv - <-antisym : Symmetric _≈_ Antisymmetric _≈_ _≼_ - {n} Antisymmetric (_≋_ {n} {n}) _<_ + <-antisym : Symmetric _≈_ Antisymmetric _≈_ _≼_ + {n} Antisymmetric (_≋_ {n} {n}) _<_ <-antisym ≈-sym ≼-antisym = Core.antisym ≈-sym (Conv.<-irrefl _≈_ _≼_) (Conv.<-asym _≈_ _≼_ ≼-antisym) <-trans : IsPartialOrder _≈_ _≼_ - {m n o} Trans (_<_ {m} {n}) (_<_ {n} {o}) _<_ + {m n o} Trans (_<_ {m} {n}) (_<_ {n} {o}) _<_ <-trans ≼-isPartialOrder = Core.transitive Eq.isPartialEquivalence (Conv.<-resp-≈ _ _ isEquivalence ≤-resp-≈) (Conv.<-trans _ _ ≼-isPartialOrder) where open IsPartialOrder ≼-isPartialOrder - <-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ - {n} _Respects₂_ (_<_ {n} {n}) _≋_ + <-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ + {n} _Respects₂_ (_<_ {n} {n}) _≋_ <-resp₂ ≈-equiv ≼-resp-≈ = Core.respects₂ (IsEquivalence.isPartialEquivalence ≈-equiv) (Conv.<-resp-≈ _ _ ≈-equiv ≼-resp-≈) - <-cmp : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ Total _≼_ - {n} Trichotomous (_≋_ {n} {n}) _<_ + <-cmp : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ Total _≼_ + {n} Trichotomous (_≋_ {n} {n}) _<_ <-cmp ≈-sym _≟_ ≼-antisym ≼-total = Strict.<-cmp ≈-sym (Conv.<-trichotomous _ _ ≈-sym _≟_ ≼-antisym ≼-total) - <-dec : Decidable _≈_ Decidable _≼_ {m n} Decidable (_<_ {m} {n}) - <-dec _≟_ _≼?_ = Core.decidable (no id) _≟_ + <-dec : Decidable _≈_ Decidable _≼_ {m n} Decidable (_<_ {m} {n}) + <-dec _≟_ _≼?_ = Core.decidable (no id) _≟_ (Conv.<-decidable _ _ _≟_ _≼?_) ------------------------------------------------------------------------ @@ -157,42 +157,42 @@ ≤-refl : {m n} (_≋_ {m} {n}) _≤_ ≤-refl = Strict.≤-refl - ≤-antisym : Symmetric _≈_ Antisymmetric _≈_ _≼_ - {n} Antisymmetric (_≋_ {n} {n}) _≤_ + ≤-antisym : Symmetric _≈_ Antisymmetric _≈_ _≼_ + {n} Antisymmetric (_≋_ {n} {n}) _≤_ ≤-antisym ≈-sym ≼-antisym = Core.antisym ≈-sym (Conv.<-irrefl _≈_ _≼_) (Conv.<-asym _ _≼_ ≼-antisym) private trans : IsPartialOrder _≈_ _≼_ {P₁ P₂} {m n o} - Trans (Core.Lex P₁ _≈_ (Conv._<_ _≈_ _≼_) {m} {n}) (Core.Lex P₂ _≈_ (Conv._<_ _≈_ _≼_) {n} {o}) _ + Trans (Core.Lex P₁ _≈_ (Conv._<_ _≈_ _≼_) {m} {n}) (Core.Lex P₂ _≈_ (Conv._<_ _≈_ _≼_) {n} {o}) _ trans ≼-po = Core.transitive′ (IsEquivalence.isPartialEquivalence isEquivalence) (Conv.<-resp-≈ _ _ isEquivalence ≤-resp-≈) (Conv.<-trans _ _≼_ ≼-po) where open IsPartialOrder ≼-po - ≤-trans : IsPartialOrder _≈_ _≼_ {m n o} Trans (_≤_ {m} {n}) (_≤_ {n} {o}) _≤_ + ≤-trans : IsPartialOrder _≈_ _≼_ {m n o} Trans (_≤_ {m} {n}) (_≤_ {n} {o}) _≤_ ≤-trans ≼-po xs≤ys ys≤zs = Core.map-P proj₁ (trans ≼-po xs≤ys ys≤zs) - <-transʳ : IsPartialOrder _≈_ _≼_ {m n o} Trans (_≤_ {m} {n}) (_<_ {n} {o}) _<_ + <-transʳ : IsPartialOrder _≈_ _≼_ {m n o} Trans (_≤_ {m} {n}) (_<_ {n} {o}) _<_ <-transʳ ≼-po xs≤ys ys<zs = Core.map-P proj₂ (trans ≼-po xs≤ys ys<zs) - <-transˡ : IsPartialOrder _≈_ _≼_ {m n o} Trans (_<_ {m} {n}) (_≤_ {n} {o}) _<_ + <-transˡ : IsPartialOrder _≈_ _≼_ {m n o} Trans (_<_ {m} {n}) (_≤_ {n} {o}) _<_ <-transˡ ≼-po xs<ys ys≤zs = Core.map-P proj₁ (trans ≼-po xs<ys ys≤zs) - ≤-total : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ Total _≼_ - {n} Total (_≤_ {n}) + ≤-total : Symmetric _≈_ Decidable _≈_ Antisymmetric _≈_ _≼_ Total _≼_ + {n} Total (_≤_ {n}) ≤-total ≈-sym _≟_ ≼-antisym ≼-total = Strict.≤-total ≈-sym (Conv.<-trichotomous _ _ ≈-sym _≟_ ≼-antisym ≼-total) - ≤-dec : Decidable _≈_ Decidable _≼_ - {m n} Decidable (_≤_ {m} {n}) - ≤-dec _≟_ _≼?_ = Core.decidable (yes tt) _≟_ + ≤-dec : Decidable _≈_ Decidable _≼_ + {m n} Decidable (_≤_ {m} {n}) + ≤-dec _≟_ _≼?_ = Core.decidable (yes tt) _≟_ (Conv.<-decidable _ _ _≟_ _≼?_) - ≤-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ - {n} _Respects₂_ (_≤_ {n} {n}) _≋_ + ≤-resp₂ : IsEquivalence _≈_ _≼_ Respects₂ _≈_ + {n} _Respects₂_ (_≤_ {n} {n}) _≋_ ≤-resp₂ ≈-equiv ≼-resp-≈ = Core.respects₂ (IsEquivalence.isPartialEquivalence ≈-equiv) (Conv.<-resp-≈ _ _ ≈-equiv ≼-resp-≈) @@ -213,7 +213,7 @@ {n} IsDecPartialOrder (_≋_ {n} {n}) _≤_ ≤-isDecPartialOrder ≼-dpo = Strict.≤-isDecPartialOrder (Conv.<-isDecStrictPartialOrder _ _ ≼-dpo) - ≤-isTotalOrder : Decidable _≈_ IsTotalOrder _≈_ _≼_ + ≤-isTotalOrder : Decidable _≈_ IsTotalOrder _≈_ _≼_ {n} IsTotalOrder (_≋_ {n} {n}) _≤_ ≤-isTotalOrder _≟_ ≼-isTotalOrder = Strict.≤-isTotalOrder (Conv.<-isStrictTotalOrder₁ _ _ _≟_ ≼-isTotalOrder) @@ -239,7 +239,7 @@ { isDecPartialOrder = ≤-isDecPartialOrder isDecPartialOrder {n = n} } where open DecPoset ≼-dpo -≤-totalOrder : (≼-dto : TotalOrder a ℓ₁ ℓ₂) Decidable (TotalOrder._≈_ ≼-dto) TotalOrder _ _ _ +≤-totalOrder : (≼-dto : TotalOrder a ℓ₁ ℓ₂) Decidable (TotalOrder._≈_ ≼-dto) TotalOrder _ _ _ ≤-totalOrder ≼-dto _≟_ n = record { isTotalOrder = ≤-isTotalOrder _≟_ isTotalOrder {n = n} } where open TotalOrder ≼-dto diff --git a/master/Data.Vec.Relation.Binary.Lex.Strict.html b/master/Data.Vec.Relation.Binary.Lex.Strict.html index d1318ed2d3..eeb3aa5b67 100644 --- a/master/Data.Vec.Relation.Binary.Lex.Strict.html +++ b/master/Data.Vec.Relation.Binary.Lex.Strict.html @@ -24,14 +24,14 @@ using (Pointwise; []; _∷_; head; tail) open import Function.Base using (id; _on_; _∘_) open import Induction.WellFounded -open import Relation.Nullary using (yes; no; ¬_) +open import Relation.Nullary using (yes; no; ¬_) open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Bundles using (Poset; StrictPartialOrder; DecPoset; DecStrictPartialOrder; DecTotalOrder; StrictTotalOrder; Preorder; TotalOrder) open import Relation.Binary.Structures using (IsEquivalence; IsPartialOrder; IsStrictPartialOrder; IsDecPartialOrder; IsDecStrictPartialOrder; IsDecTotalOrder; IsStrictTotalOrder; IsPreorder; IsTotalOrder; IsPartialEquivalence) open import Relation.Binary.Definitions - using (Irreflexive; _Respects₂_; _Respectsˡ_; _Respectsʳ_; Antisymmetric; Asymmetric; Symmetric; Trans; Decidable; Total; Trichotomous; Transitive; Irrelevant; tri≈; tri>; tri<) + using (Irreflexive; _Respects₂_; _Respectsˡ_; _Respectsʳ_; Antisymmetric; Asymmetric; Symmetric; Trans; Decidable; Total; Trichotomous; Transitive; Irrelevant; tri≈; tri>; tri<) open import Relation.Binary.Consequences open import Relation.Binary.Construct.On as On using (wellFounded) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) @@ -70,68 +70,68 @@ _≋_ = Pointwise _≈_ _<_ = Lex-< _≈_ _≺_ - xs≮[] : {n} {xs : Vec A n} ¬ xs < [] + xs≮[] : {n} {xs : Vec A n} ¬ xs < [] xs≮[] (base ()) - ¬[]<[] : ¬ [] < [] + ¬[]<[] : ¬ [] < [] ¬[]<[] = xs≮[] - module _ (≺-irrefl : Irreflexive _≈_ _≺_) where + module _ (≺-irrefl : Irreflexive _≈_ _≺_) where - <-irrefl : {m n} Irreflexive (_≋_ {m} {n}) (_<_ {m} {n}) + <-irrefl : {m n} Irreflexive (_≋_ {m} {n}) (_<_ {m} {n}) <-irrefl [] (base ()) <-irrefl (x≈y xs≋ys) (this x≺y m≡n) = ≺-irrefl x≈y x≺y <-irrefl (x≈y xs≋ys) (next _ xs<ys) = <-irrefl xs≋ys xs<ys - module _ (≈-sym : Symmetric _≈_) (≺-resp-≈ : _≺_ Respects₂ _≈_) (≺-asym : Asymmetric _≺_) where + module _ (≈-sym : Symmetric _≈_) (≺-resp-≈ : _≺_ Respects₂ _≈_) (≺-asym : Asymmetric _≺_) where - <-asym : {n} Asymmetric (_<_ {n} {n}) + <-asym : {n} Asymmetric (_<_ {n} {n}) <-asym (this x≺y m≡n) (this y≺x n≡m) = ≺-asym x≺y y≺x <-asym (this x≺y m≡n) (next y≈x ys<xs) = asym⇒irr ≺-resp-≈ ≈-sym ≺-asym (≈-sym y≈x) x≺y <-asym (next x≈y xs<ys) (this y≺x n≡m) = asym⇒irr ≺-resp-≈ ≈-sym ≺-asym (≈-sym x≈y) y≺x <-asym (next x≈y xs<ys) (next y≈x ys<xs) = <-asym xs<ys ys<xs - <-antisym : Symmetric _≈_ Irreflexive _≈_ _≺_ Asymmetric _≺_ - {n} Antisymmetric (_≋_ {n} {n}) _<_ + <-antisym : Symmetric _≈_ Irreflexive _≈_ _≺_ Asymmetric _≺_ + {n} Antisymmetric (_≋_ {n} {n}) _<_ <-antisym = Core.antisym - <-trans : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ - {m n o} Trans (_<_ {m} {n}) (_<_ {n} {o}) _<_ + <-trans : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ + {m n o} Trans (_<_ {m} {n}) (_<_ {n} {o}) _<_ <-trans = Core.transitive - module _ (≈-sym : Symmetric _≈_) (≺-cmp : Trichotomous _≈_ _≺_) where + module _ (≈-sym : Symmetric _≈_) (≺-cmp : Trichotomous _≈_ _≺_) where - <-cmp : {n} Trichotomous _≋_ (_<_ {n}) - <-cmp [] [] = tri≈ ¬[]<[] [] ¬[]<[] + <-cmp : {n} Trichotomous _≋_ (_<_ {n}) + <-cmp [] [] = tri≈ ¬[]<[] [] ¬[]<[] <-cmp (x xs) (y ys) with ≺-cmp x y - ... | tri< x≺y x≉y x⊁y = tri< (this x≺y refl) (x≉y head) (≰-this (x≉y ≈-sym) x⊁y) - ... | tri> x⊀y x≉y x≻y = tri> (≰-this x≉y x⊀y) (x≉y head) (this x≻y refl) - ... | tri≈ x⊀y x≈y x⊁y with <-cmp xs ys - ... | tri< xs<ys xs≋̸ys xs≯ys = tri< (next x≈y xs<ys) (xs≋̸ys tail) (≰-next x⊁y xs≯ys) - ... | tri≈ xs≮ys xs≋ys xs≯ys = tri≈ (≰-next x⊀y xs≮ys) (x≈y xs≋ys) (≰-next x⊁y xs≯ys) - ... | tri> xs≮ys xs≋̸ys xs>ys = tri> (≰-next x⊀y xs≮ys) (xs≋̸ys tail) (next (≈-sym x≈y) xs>ys) - - <-decidable : Decidable _≈_ Decidable _≺_ - {m n} Decidable (_<_ {m} {n}) - <-decidable = Core.decidable (no id) - - <-respectsˡ : IsPartialEquivalence _≈_ _≺_ Respectsˡ _≈_ - {m n} _Respectsˡ_ (_<_ {m} {n}) _≋_ + ... | tri< x≺y x≉y x⊁y = tri< (this x≺y refl) (x≉y head) (≰-this (x≉y ≈-sym) x⊁y) + ... | tri> x⊀y x≉y x≻y = tri> (≰-this x≉y x⊀y) (x≉y head) (this x≻y refl) + ... | tri≈ x⊀y x≈y x⊁y with <-cmp xs ys + ... | tri< xs<ys xs≋̸ys xs≯ys = tri< (next x≈y xs<ys) (xs≋̸ys tail) (≰-next x⊁y xs≯ys) + ... | tri≈ xs≮ys xs≋ys xs≯ys = tri≈ (≰-next x⊀y xs≮ys) (x≈y xs≋ys) (≰-next x⊁y xs≯ys) + ... | tri> xs≮ys xs≋̸ys xs>ys = tri> (≰-next x⊀y xs≮ys) (xs≋̸ys tail) (next (≈-sym x≈y) xs>ys) + + <-decidable : Decidable _≈_ Decidable _≺_ + {m n} Decidable (_<_ {m} {n}) + <-decidable = Core.decidable (no id) + + <-respectsˡ : IsPartialEquivalence _≈_ _≺_ Respectsˡ _≈_ + {m n} _Respectsˡ_ (_<_ {m} {n}) _≋_ <-respectsˡ = Core.respectsˡ - <-respectsʳ : IsPartialEquivalence _≈_ _≺_ Respectsʳ _≈_ - {m n} _Respectsʳ_ (_<_ {m} {n}) _≋_ + <-respectsʳ : IsPartialEquivalence _≈_ _≺_ Respectsʳ _≈_ + {m n} _Respectsʳ_ (_<_ {m} {n}) _≋_ <-respectsʳ = Core.respectsʳ - <-respects₂ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ - {n} _Respects₂_ (_<_ {n} {n}) _≋_ + <-respects₂ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ + {n} _Respects₂_ (_<_ {n} {n}) _≋_ <-respects₂ = Core.respects₂ - <-irrelevant : Irrelevant _≈_ Irrelevant _≺_ Irreflexive _≈_ _≺_ - {m n} Irrelevant (_<_ {m} {n}) + <-irrelevant : Irrelevant _≈_ Irrelevant _≺_ Irreflexive _≈_ _≺_ + {m n} Irrelevant (_<_ {m} {n}) <-irrelevant = Core.irrelevant ()) - module _ (≈-trans : Transitive _≈_) (≺-respʳ : _≺_ Respectsʳ _≈_ ) (≺-wf : WellFounded _≺_) + module _ (≈-trans : Transitive _≈_) (≺-respʳ : _≺_ Respectsʳ _≈_ ) (≺-wf : WellFounded _≺_) where <-wellFounded : {n} WellFounded (_<_ {n}) @@ -208,54 +208,54 @@ ≤-refl [] = base tt ≤-refl (x≈y xs≋ys) = next x≈y (≤-refl xs≋ys) - ≤-antisym : Symmetric _≈_ Irreflexive _≈_ _≺_ Asymmetric _≺_ - {n} Antisymmetric (_≋_ {n} {n}) _≤_ + ≤-antisym : Symmetric _≈_ Irreflexive _≈_ _≺_ Asymmetric _≺_ + {n} Antisymmetric (_≋_ {n} {n}) _≤_ ≤-antisym = Core.antisym - ≤-resp₂ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ - {n} _Respects₂_ (_≤_ {n} {n}) _≋_ + ≤-resp₂ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ + {n} _Respects₂_ (_≤_ {n} {n}) _≋_ ≤-resp₂ = Core.respects₂ - ≤-trans : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ - {m n o} Trans (_≤_ {m} {n}) (_≤_ {n} {o}) _≤_ + ≤-trans : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ + {m n o} Trans (_≤_ {m} {n}) (_≤_ {n} {o}) _≤_ ≤-trans = Core.transitive - <-transʳ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ - {m n o} Trans (_≤_ {m} {n}) (_<_ {n} {o}) _<_ + <-transʳ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ + {m n o} Trans (_≤_ {m} {n}) (_<_ {n} {o}) _<_ <-transʳ ≈-equiv ≺-resp-≈ ≺-trans xs≤ys ys<zs = Core.map-P proj₂ (Core.transitive′ ≈-equiv ≺-resp-≈ ≺-trans xs≤ys ys<zs) - <-transˡ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ - {m n o} Trans (_<_ {m} {n}) (_≤_ {n} {o}) _<_ + <-transˡ : IsPartialEquivalence _≈_ _≺_ Respects₂ _≈_ Transitive _≺_ + {m n o} Trans (_<_ {m} {n}) (_≤_ {n} {o}) _<_ <-transˡ ≈-equiv ≺-resp-≈ ≺-trans xs<ys ys≤zs = Core.map-P proj₁ (Core.transitive′ ≈-equiv ≺-resp-≈ ≺-trans xs<ys ys≤zs) -- Note that trichotomy is an unnecessarily strong precondition for -- the following lemma. - module _ (≈-sym : Symmetric _≈_) (≺-cmp : Trichotomous _≈_ _≺_) where + module _ (≈-sym : Symmetric _≈_) (≺-cmp : Trichotomous _≈_ _≺_) where - ≤-total : {n} Total (_≤_ {n} {n}) + ≤-total : {n} Total (_≤_ {n} {n}) ≤-total [] [] = inj₁ (base tt) ≤-total (x xs) (y ys) with ≺-cmp x y - ... | tri< x≺y _ _ = inj₁ (this x≺y refl) - ... | tri> _ _ x≻y = inj₂ (this x≻y refl) - ... | tri≈ _ x≈y _ with ≤-total xs ys + ... | tri< x≺y _ _ = inj₁ (this x≺y refl) + ... | tri> _ _ x≻y = inj₂ (this x≻y refl) + ... | tri≈ _ x≈y _ with ≤-total xs ys ... | inj₁ xs<ys = inj₁ (next x≈y xs<ys) ... | inj₂ xs>ys = inj₂ (next (≈-sym x≈y) xs>ys) - ≤-dec : Decidable _≈_ Decidable _≺_ - {m n} Decidable (_≤_ {m} {n}) - ≤-dec = Core.decidable (yes tt) + ≤-dec : Decidable _≈_ Decidable _≺_ + {m n} Decidable (_≤_ {m} {n}) + ≤-dec = Core.decidable (yes tt) - ≤-irrelevant : Irrelevant _≈_ Irrelevant _≺_ Irreflexive _≈_ _≺_ - {m n} Irrelevant (_≤_ {m} {n}) + ≤-irrelevant : Irrelevant _≈_ Irrelevant _≺_ Irreflexive _≈_ _≺_ + {m n} Irrelevant (_≤_ {m} {n}) ≤-irrelevant = Core.irrelevant ⊤-irrelevant ------------------------------------------------------------------------ -- Structures - ≤-isPreorder : IsEquivalence _≈_ Transitive _≺_ _≺_ Respects₂ _≈_ + ≤-isPreorder : IsEquivalence _≈_ Transitive _≺_ _≺_ Respects₂ _≈_ {n} IsPreorder (_≋_ {n} {n}) _≤_ ≤-isPreorder ≈-equiv ≺-trans ≺-resp-≈ {n} = record { isEquivalence = Pointwise.isEquivalence ≈-equiv n diff --git a/master/Data.Vec.Relation.Binary.Pointwise.Extensional.html b/master/Data.Vec.Relation.Binary.Pointwise.Extensional.html index a0b990dfc5..8e18748a84 100644 --- a/master/Data.Vec.Relation.Binary.Pointwise.Extensional.html +++ b/master/Data.Vec.Relation.Binary.Pointwise.Extensional.html @@ -22,7 +22,7 @@ open import Relation.Binary.Core using (Rel; REL; _⇒_; _=[_]⇒_) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Sym; Trans; Decidable) +open import Relation.Binary.Definitions using (Reflexive; Sym; Trans; Decidable) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Construct.Closure.Transitive as Plus hiding (equivalent; map) @@ -96,22 +96,22 @@ -- Relational properties refl : {_∼_ : Rel A } {n} - Reflexive _∼_ Reflexive (Pointwise _∼_ {n = n}) + Reflexive _∼_ Reflexive (Pointwise _∼_ {n = n}) refl ∼-rfl = ext _ ∼-rfl) sym : {P : REL A B } {Q : REL B A } {n} - Sym P Q Sym (Pointwise P) (Pointwise Q {n = n}) + Sym P Q Sym (Pointwise P) (Pointwise Q {n = n}) sym sm xs∼ys = ext λ i sm (Pointwise.app xs∼ys i) trans : {P : REL A B } {Q : REL B C } {R : REL A C } {n} - Trans P Q R - Trans (Pointwise P) (Pointwise Q) (Pointwise R {n = n}) + Trans P Q R + Trans (Pointwise P) (Pointwise Q) (Pointwise R {n = n}) trans trns xs∼ys ys∼zs = ext λ i trns (Pointwise.app xs∼ys i) (Pointwise.app ys∼zs i) decidable : {_∼_ : REL A B } - Decidable _∼_ {n} Decidable (Pointwise _∼_ {n = n}) -decidable dec xs ys = Dec.map + Decidable _∼_ {n} Decidable (Pointwise _∼_ {n = n}) +decidable dec xs ys = Dec.map (Setoid.sym (⇔-setoid _) equivalent) (Inductive.decidable dec xs ys) @@ -158,7 +158,7 @@ _ ∼⁺⟨ Pointwise.app (⁺∙⇒∙⁺ ρ≈ρ′ ) x Pointwise.app (⁺∙⇒∙⁺ ρ′≈ρ″) x) - ∙⁺⇒⁺∙ : {n} {xs ys : Vec A n} Reflexive _∼_ + ∙⁺⇒⁺∙ : {n} {xs ys : Vec A n} Reflexive _∼_ Pointwise (Plus _∼_) xs ys Plus (Pointwise _∼_) xs ys ∙⁺⇒⁺∙ rfl = Plus.map (Equivalence.from equivalent) @@ -202,13 +202,13 @@ ix∙⁺jz : IPointwise (Plus _R_) ix jz ix∙⁺jz = [ iRj ] xR⁺z [] - ¬ix⁺∙jz : ¬ TransClosure (IPointwise _R_) ix jz + ¬ix⁺∙jz : ¬ TransClosure (IPointwise _R_) ix jz ¬ix⁺∙jz [ iRj () [] ] ¬ix⁺∙jz ((iRj xRy []) [ () yRz [] ]) ¬ix⁺∙jz ((iRj xRy []) (() yRz []) _) counterexample : - ¬ (∀ {n} {xs ys : Vec D n} + ¬ (∀ {n} {xs ys : Vec D n} Pointwise (Plus _R_) xs ys Plus (Pointwise _R_) xs ys) counterexample ∙⁺⇒⁺∙ = diff --git a/master/Data.Vec.Relation.Binary.Pointwise.Inductive.html b/master/Data.Vec.Relation.Binary.Pointwise.Inductive.html index 7e91b1bb2c..9a3ab35b9c 100644 --- a/master/Data.Vec.Relation.Binary.Pointwise.Inductive.html +++ b/master/Data.Vec.Relation.Binary.Pointwise.Inductive.html @@ -22,10 +22,10 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.Definitions - using (Trans; Decidable; Reflexive; Sym) + using (Trans; Decidable; Reflexive; Sym) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) -open import Relation.Nullary.Decidable using (yes; no; _×-dec_; map′) -open import Relation.Unary using (Pred) +open import Relation.Nullary.Decidable using (yes; no; _×-dec_; map′) +open import Relation.Unary using (Pred) private variable @@ -87,29 +87,29 @@ -- Relational properties refl : {_∼_ : Rel A } {n} - Reflexive _∼_ Reflexive (Pointwise _∼_ {n}) + Reflexive _∼_ Reflexive (Pointwise _∼_ {n}) refl ∼-refl {[]} = [] refl ∼-refl {x xs} = ∼-refl refl ∼-refl sym : {P : REL A B } {Q : REL B A } {m n} - Sym P Q Sym (Pointwise P) (Pointwise Q {m} {n}) + Sym P Q Sym (Pointwise P) (Pointwise Q {m} {n}) sym sm [] = [] sym sm (x∼y xs∼ys) = sm x∼y sym sm xs∼ys trans : {P : REL A B } {Q : REL B C } {R : REL A C } {m n o} - Trans P Q R - Trans (Pointwise P {m}) (Pointwise Q {n} {o}) (Pointwise R) + Trans P Q R + Trans (Pointwise P {m}) (Pointwise Q {n} {o}) (Pointwise R) trans trns [] [] = [] trans trns (x∼y xs∼ys) (y∼z ys∼zs) = trns x∼y y∼z trans trns xs∼ys ys∼zs decidable : {_∼_ : REL A B } - Decidable _∼_ {m n} Decidable (Pointwise _∼_ {m} {n}) -decidable dec [] [] = yes [] -decidable dec [] (y ys) = no λ() -decidable dec (x xs) [] = no λ() + Decidable _∼_ {m n} Decidable (Pointwise _∼_ {m} {n}) +decidable dec [] [] = yes [] +decidable dec [] (y ys) = no λ() +decidable dec (x xs) [] = no λ() decidable dec (x xs) (y ys) = - map′ (uncurry _∷_) uncons (dec x y ×-dec decidable dec xs ys) + map′ (uncurry _∷_) uncons (dec x y ×-dec decidable dec xs ys) ------------------------------------------------------------------------ -- Structures @@ -226,7 +226,7 @@ ------------------------------------------------------------------------ -- cong -module _ {_∼_ : Rel A } (refl : Reflexive _∼_) where +module _ {_∼_ : Rel A } (refl : Reflexive _∼_) where cong-[_]≔ : {n} i p {xs} {ys} Pointwise _∼_ {n} xs ys Pointwise _∼_ (xs [ i ]≔ p) (ys [ i ]≔ p) @@ -236,7 +236,7 @@ ------------------------------------------------------------------------ -- Degenerate pointwise relations -module _ {P : Pred A } where +module _ {P : Pred A } where Pointwiseˡ⇒All : {m n} {xs : Vec A m} {ys : Vec B n} Pointwise x y P x) xs ys All P xs diff --git a/master/Data.Vec.Relation.Unary.All.Properties.html b/master/Data.Vec.Relation.Unary.All.Properties.html index e74e4b7323..4424a11fe9 100644 --- a/master/Data.Vec.Relation.Unary.All.Properties.html +++ b/master/Data.Vec.Relation.Unary.All.Properties.html @@ -20,7 +20,7 @@ open import Level using (Level) open import Function.Base using (_∘_; id) open import Function.Bundles using (_↔_; mk↔ₛ′) -open import Relation.Unary using (Pred) renaming (_⊆_ to _⋐_) +open import Relation.Unary using (Pred) renaming (_⊆_ to _⋐_) open import Relation.Binary.Core using (REL) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂) @@ -30,8 +30,8 @@ a b p q : Level A : Set a B : Set b - P : Pred A p - Q : Pred B q + P : Pred A p + Q : Pred B q m n : xs : Vec A n @@ -158,7 +158,7 @@ ------------------------------------------------------------------------ -- toList -module _ {P : Pred A p} where +module _ {P : Pred A p} where toList⁺ : {n} {xs : Vec A n} All P xs List.All P (toList xs) toList⁺ [] = [] @@ -171,7 +171,7 @@ ------------------------------------------------------------------------ -- fromList -module _ {P : Pred A p} where +module _ {P : Pred A p} where fromList⁺ : {xs} List.All P xs All P (fromList xs) fromList⁺ [] = [] diff --git a/master/Data.Vec.Relation.Unary.All.html b/master/Data.Vec.Relation.Unary.All.html index 7d0f60a773..476ca9bd78 100644 --- a/master/Data.Vec.Relation.Unary.All.html +++ b/master/Data.Vec.Relation.Unary.All.html @@ -18,10 +18,10 @@ import Data.Vec.Membership.Setoid as SetoidMembership open import Function.Base using (_∘_) open import Level using (Level; _⊔_) -open import Relation.Nullary.Decidable as Dec using (_×-dec_; yes; no) -open import Relation.Unary hiding (_∈_) +open import Relation.Nullary.Decidable as Dec using (_×-dec_; yes; no) +open import Relation.Unary hiding (_∈_) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) private @@ -30,9 +30,9 @@ A : Set a B : Set b C : Set c - P : Pred A p - Q : Pred A q - R : Pred A r + P : Pred A p + Q : Pred A q + R : Pred A r n : x : A xs : Vec A n @@ -42,7 +42,7 @@ infixr 5 _∷_ -data All {A : Set a} (P : Pred A p) : Vec A n Set (p a) where +data All {A : Set a} (P : Pred A p) : Vec A n Set (p a) where [] : All P [] _∷_ : (px : P x) (pxs : All P xs) All P (x xs) @@ -62,19 +62,19 @@ uncons : All P (x xs) P x × All P xs uncons = < head , tail > -map : P Q All P All Q {n} +map : P Q All P All Q {n} map g [] = [] map g (px pxs) = g px map g pxs -zip : All P All Q All (P Q) {n} +zip : All P All Q All (P Q) {n} zip ([] , []) = [] zip (px pxs , qx qxs) = (px , qx) zip (pxs , qxs) -unzip : All (P Q) {n} All P All Q +unzip : All (P Q) {n} All P All Q unzip [] = [] , [] unzip (pqx pqxs) = Product.zip _∷_ _∷_ pqx (unzip pqxs) -module _ {P : Pred A p} {Q : Pred B q} {R : Pred C r} where +module _ {P : Pred A p} {Q : Pred B q} {R : Pred C r} where zipWith : {_⊕_ : A B C} (∀ {x y} P x Q y R (x y)) @@ -87,47 +87,47 @@ ------------------------------------------------------------------------ -- Generalised lookup based on a proof of Any -lookupAny : All P xs (i : Any Q xs) (P Q) (Any.lookup i) +lookupAny : All P xs (i : Any Q xs) (P Q) (Any.lookup i) lookupAny (px pxs) (here qx) = px , qx lookupAny (px pxs) (there i) = lookupAny pxs i -lookupWith : ∀[ P Q R ] All P xs (i : Any Q xs) R (Any.lookup i) +lookupWith : ∀[ P Q R ] All P xs (i : Any Q xs) R (Any.lookup i) lookupWith f pxs i = Product.uncurry f (lookupAny pxs i) lookup : All P xs (∀ {x} x ∈ₚ xs P x) lookup pxs = lookupWith { px refl px }) pxs -module _(S : Setoid a ) {P : Pred (Setoid.Carrier S) p} where +module _(S : Setoid a ) {P : Pred (Setoid.Carrier S) p} where open Setoid S renaming (sym to sym₁) open SetoidMembership S - lookupₛ : P Respects _≈_ All P xs (∀ {x} x xs P x) + lookupₛ : P Respects _≈_ All P xs (∀ {x} x xs P x) lookupₛ resp pxs = lookupWith py x=y resp (sym₁ x=y) py) pxs ------------------------------------------------------------------------ -- Properties of predicates preserved by All -all? : {n} Decidable P Decidable (All P {n}) -all? P? [] = yes [] -all? P? (x xs) = Dec.map′ (uncurry _∷_) uncons (P? x ×-dec all? P? xs) +all? : {n} Decidable P Decidable (All P {n}) +all? P? [] = yes [] +all? P? (x xs) = Dec.map′ (uncurry _∷_) uncons (P? x ×-dec all? P? xs) -universal : Universal P {n} Universal (All P {n}) +universal : Universal P {n} Universal (All P {n}) universal u [] = [] universal u (x xs) = u x universal u xs -irrelevant : Irrelevant P {n} Irrelevant (All P {n}) +irrelevant : Irrelevant P {n} Irrelevant (All P {n}) irrelevant irr [] [] = refl irrelevant irr (px₁ pxs₁) (px₂ pxs₂) = cong₂ _∷_ (irr px₁ px₂) (irrelevant irr pxs₁ pxs₂) -satisfiable : Satisfiable P {n} Satisfiable (All P {n}) +satisfiable : Satisfiable P {n} Satisfiable (All P {n}) satisfiable (x , p) {zero} = [] , [] satisfiable (x , p) {suc n} = Product.map (x ∷_) (p ∷_) (satisfiable (x , p)) ------------------------------------------------------------------------ -- Generalised decidability procedure -decide : Π[ P Q ] Π[ All P {n} Any Q ] +decide : Π[ P Q ] Π[ All P {n} Any Q ] decide p∪q [] = inj₁ [] decide p∪q (x xs) with p∪q x ... | inj₂ qx = inj₂ (here qx) diff --git a/master/Data.Vec.Relation.Unary.AllPairs.html b/master/Data.Vec.Relation.Unary.AllPairs.html index 1ca053640e..745b4133c8 100644 --- a/master/Data.Vec.Relation.Unary.AllPairs.html +++ b/master/Data.Vec.Relation.Unary.AllPairs.html @@ -21,8 +21,8 @@ open import Relation.Binary.Definitions as B open import Relation.Binary.Construct.Intersection renaming (_∩_ to _∩ᵇ_) open import Relation.Binary.PropositionalEquality.Core using (refl; cong₂) -open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) -open import Relation.Nullary.Decidable as Dec using (yes; no; _×-dec_) +open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) +open import Relation.Nullary.Decidable as Dec using (yes; no; _×-dec_) ------------------------------------------------------------------------ -- Definition @@ -44,41 +44,41 @@ module _ {s} {S : Rel A s} where - map : {n} R S AllPairs R {n} AllPairs S {n} + map : {n} R S AllPairs R {n} AllPairs S {n} map ~₁⇒~₂ [] = [] map ~₁⇒~₂ (x~xs pxs) = All.map ~₁⇒~₂ x~xs (map ~₁⇒~₂ pxs) module _ {s t} {S : Rel A s} {T : Rel A t} where - zipWith : {n} R ∩ᵇ S T AllPairs R {n} ∩ᵘ AllPairs S {n} AllPairs T {n} + zipWith : {n} R ∩ᵇ S T AllPairs R {n} ∩ᵘ AllPairs S {n} AllPairs T {n} zipWith f ([] , []) = [] zipWith f (px pxs , qx qxs) = All.map f (All.zip (px , qx)) zipWith f (pxs , qxs) - unzipWith : {n} T R ∩ᵇ S AllPairs T {n} AllPairs R {n} ∩ᵘ AllPairs S {n} + unzipWith : {n} T R ∩ᵇ S AllPairs T {n} AllPairs R {n} ∩ᵘ AllPairs S {n} unzipWith f [] = [] , [] unzipWith f (rx rxs) = Prod.zip _∷_ _∷_ (All.unzip (All.map f rx)) (unzipWith f rxs) module _ {s} {S : Rel A s} where - zip : {n} AllPairs R {n} ∩ᵘ AllPairs S {n} AllPairs (R ∩ᵇ S) {n} + zip : {n} AllPairs R {n} ∩ᵘ AllPairs S {n} AllPairs (R ∩ᵇ S) {n} zip = zipWith id - unzip : {n} AllPairs (R ∩ᵇ S) {n} AllPairs R {n} ∩ᵘ AllPairs S {n} + unzip : {n} AllPairs (R ∩ᵇ S) {n} AllPairs R {n} ∩ᵘ AllPairs S {n} unzip = unzipWith id ------------------------------------------------------------------------ -- Properties of predicates preserved by AllPairs -allPairs? : {n} B.Decidable R U.Decidable (AllPairs R {n}) -allPairs? R? [] = yes [] +allPairs? : {n} B.Decidable R U.Decidable (AllPairs R {n}) +allPairs? R? [] = yes [] allPairs? R? (x xs) = - Dec.map′ (uncurry _∷_) uncons (All.all? (R? x) xs ×-dec allPairs? R? xs) + Dec.map′ (uncurry _∷_) uncons (All.all? (R? x) xs ×-dec allPairs? R? xs) -irrelevant : {n} B.Irrelevant R U.Irrelevant (AllPairs R {n}) +irrelevant : {n} B.Irrelevant R U.Irrelevant (AllPairs R {n}) irrelevant irr [] [] = refl irrelevant irr (px₁ pxs₁) (px₂ pxs₂) = cong₂ _∷_ (All.irrelevant irr px₁ px₂) (irrelevant irr pxs₁ pxs₂) -satisfiable : U.Satisfiable (AllPairs R) +satisfiable : U.Satisfiable (AllPairs R) satisfiable = [] , [] \ No newline at end of file diff --git a/master/Data.Vec.Relation.Unary.Any.Properties.html b/master/Data.Vec.Relation.Unary.Any.Properties.html index c0f094d80d..2ba31f2beb 100644 --- a/master/Data.Vec.Relation.Unary.Any.Properties.html +++ b/master/Data.Vec.Relation.Unary.Any.Properties.html @@ -27,10 +27,10 @@ open import Function.Bundles using (_↔_; mk↔ₛ′) open import Function.Properties.Inverse using (↔-refl; ↔-trans) open import Level using (Level) -open import Relation.Nullary.Negation using (¬_) -open import Relation.Unary hiding (_∈_) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Unary hiding (_∈_) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; trans; cong) @@ -43,13 +43,13 @@ ------------------------------------------------------------------------ -- Equality properties -module _ {P : Pred A p} {_≈_ : Rel A } where +module _ {P : Pred A p} {_≈_ : Rel A } where - lift-resp : {n} P Respects _≈_ (Any P {n}) Respects (Pointwise _≈_) + lift-resp : {n} P Respects _≈_ (Any P {n}) Respects (Pointwise _≈_) lift-resp resp (x∼y xs∼ys) (here px) = here (resp x∼y px) lift-resp resp (x∼y xs∼ys) (there pxs) = there (lift-resp resp xs∼ys pxs) -module _ {P : Pred A p} where +module _ {P : Pred A p} where here-injective : {n x xs} {p q : P x} here {P = P} {n = n} {xs = xs} p here q p q @@ -62,7 +62,7 @@ ------------------------------------------------------------------------ -- Misc - ¬Any[] : ¬ Any P [] + ¬Any[] : ¬ Any P [] ¬Any[] () lookup-index : {m} {xs : Vec A m} (p : Any P xs) @@ -92,14 +92,14 @@ ------------------------------------------------------------------------ -- map -map-id : {P : Pred A p} (f : P P) {n xs} +map-id : {P : Pred A p} (f : P P) {n xs} (∀ {x} (p : P x) f p p) (p : Any P {n} xs) Any.map f p p map-id f hyp (here p) = cong here (hyp p) map-id f hyp (there p) = cong there $ map-id f hyp p -map-∘ : {P : Pred A p} {Q : A Set q} {R : A Set r} - (f : Q R) (g : P Q) +map-∘ : {P : Pred A p} {Q : A Set q} {R : A Set r} + (f : Q R) (g : P Q) {n xs} (p : Any P {n} xs) Any.map (f g) p Any.map f (Any.map g p) map-∘ f g (here p) = refl @@ -146,13 +146,13 @@ from : {n xs} Any (const ) {n} xs {b} {B : Set b} B from (there p) = from p -⊥↔Any[] : {P : Pred A p} Any P [] +⊥↔Any[] : {P : Pred A p} Any P [] ⊥↔Any[] = mk↔ₛ′ (λ()) (λ()) (λ()) (λ()) ------------------------------------------------------------------------ -- Sums commute with Any -module _ {P : Pred A p} {Q : A Set q} where +module _ {P : Pred A p} {Q : A Set q} where Any-⊎⁺ : {n} {xs : Vec A n} Any P xs Any Q xs Any x P x Q x) xs Any-⊎⁺ = [ Any.map inj₁ , Any.map inj₂ ]′ @@ -182,7 +182,7 @@ ------------------------------------------------------------------------ -- Products "commute" with Any. -module _ {P : Pred A p} {Q : Pred B q} where +module _ {P : Pred A p} {Q : Pred B q} where Any-×⁺ : {n m} {xs : Vec A n} {ys : Vec B m} Any P xs × Any Q ys Any x Any y P x × Q y) ys) xs @@ -202,7 +202,7 @@ ------------------------------------------------------------------------ -- Singleton ([_]) -module _ {P : Pred A p} where +module _ {P : Pred A p} where singleton⁺ : {x} P x Any P [ x ] singleton⁺ Px = here Px @@ -226,34 +226,34 @@ module _ {f : A B} where - map⁺ : {P : Pred B p} {n} {xs : Vec A n} + map⁺ : {P : Pred B p} {n} {xs : Vec A n} Any (P f) xs Any P (map f xs) map⁺ (here p) = here p map⁺ (there p) = there $ map⁺ p - map⁻ : {P : Pred B p} {n} {xs : Vec A n} + map⁻ : {P : Pred B p} {n} {xs : Vec A n} Any P (map f xs) Any (P f) xs map⁻ {xs = x xs} (here p) = here p map⁻ {xs = x xs} (there p) = there $ map⁻ p - map⁺∘map⁻ : {P : Pred B p} {n} {xs : Vec A n} + map⁺∘map⁻ : {P : Pred B p} {n} {xs : Vec A n} (p : Any P (map f xs)) map⁺ (map⁻ p) p map⁺∘map⁻ {xs = x xs} (here p) = refl map⁺∘map⁻ {xs = x xs} (there p) = cong there (map⁺∘map⁻ p) - map⁻∘map⁺ : (P : Pred B p) {n} {xs : Vec A n} + map⁻∘map⁺ : (P : Pred B p) {n} {xs : Vec A n} (p : Any (P f) xs) map⁻ {P = P} (map⁺ p) p map⁻∘map⁺ P (here p) = refl map⁻∘map⁺ P (there p) = cong there (map⁻∘map⁺ P p) - map↔ : {P : Pred B p} {n} {xs : Vec A n} + map↔ : {P : Pred B p} {n} {xs : Vec A n} Any (P f) xs Any P (map f xs) map↔ = mk↔ₛ′ map⁺ map⁻ map⁺∘map⁻ (map⁻∘map⁺ _) ------------------------------------------------------------------------ -- _++_ -module _ {P : Pred A p} where +module _ {P : Pred A p} where ++⁺ˡ : {n m} {xs : Vec A n} {ys : Vec A m} Any P xs Any P (xs ++ ys) ++⁺ˡ (here p) = here p @@ -317,7 +317,7 @@ ------------------------------------------------------------------------ -- concat -module _ {P : Pred A p} where +module _ {P : Pred A p} where concat⁺ : {n m} {xss : Vec (Vec A n) m} Any (Any P) xss Any P (concat xss) concat⁺ (here p) = ++⁺ˡ p @@ -358,7 +358,7 @@ ------------------------------------------------------------------------ -- tabulate -module _ {P : Pred A p} where +module _ {P : Pred A p} where tabulate⁺ : {n} {f : Fin n A} i P (f i) Any P (tabulate f) tabulate⁺ zero p = here p @@ -372,7 +372,7 @@ ------------------------------------------------------------------------ -- mapWith∈ -module _ {P : Pred B p} where +module _ {P : Pred B p} where mapWith∈⁺ : {n} {xs : Vec A n} (f : {x} x xs B) (∃₂ λ x (x∈xs : x xs) P (f x∈xs)) @@ -409,14 +409,14 @@ ------------------------------------------------------------------------ -- _∷_ -∷↔ : {n} (P : Pred A p) {x} {xs : Vec A n} +∷↔ : {n} (P : Pred A p) {x} {xs : Vec A n} (P x Any P xs) Any P (x xs) ∷↔ P {x} {xs} = ↔-trans (singleton↔ ⊎-cong ↔-refl) ++↔ ------------------------------------------------------------------------ -- _>>=_ -module _ {A B : Set a} {P : Pred B p} {m} {f : A Vec B m} where +module _ {A B : Set a} {P : Pred B p} {m} {f : A Vec B m} where open CartesianBind diff --git a/master/Data.Vec.Relation.Unary.Any.html b/master/Data.Vec.Relation.Unary.Any.html index 81191c194b..faf2914434 100644 --- a/master/Data.Vec.Relation.Unary.Any.html +++ b/master/Data.Vec.Relation.Unary.Any.html @@ -16,22 +16,22 @@ open import Data.Vec.Base as Vec using (Vec; []; [_]; _∷_) open import Data.Product.Base as Product using (; _,_) open import Level using (Level; _⊔_) -open import Relation.Nullary.Negation using (¬_; contradiction) -open import Relation.Nullary.Decidable as Dec using (yes; no; _⊎-dec_) +open import Relation.Nullary.Negation using (¬_; contradiction) +open import Relation.Nullary.Decidable as Dec using (yes; no; _⊎-dec_) open import Relation.Unary private variable p q : Level - P : Pred A p - Q : Pred A q + P : Pred A p + Q : Pred A q n : xs : Vec A n ------------------------------------------------------------------------ -- Any P xs means that at least one element in xs satisfies P. -data Any (P : Pred A p) : {n} Vec A n Set (a p) where +data Any (P : Pred A p) : {n} Vec A n Set (a p) where here : {n x} {xs : Vec A n} (px : P x) Any P (x xs) there : {n x} {xs : Vec A n} (pxs : Any P xs) Any P (x xs) @@ -39,12 +39,12 @@ -- Operations on Any -- If the tail does not satisfy the predicate, then the head will. -head : {x} ¬ Any P xs Any P (x xs) P x +head : {x} ¬ Any P xs Any P (x xs) P x head ¬pxs (here px) = px -head ¬pxs (there pxs) = contradiction pxs ¬pxs +head ¬pxs (there pxs) = contradiction pxs ¬pxs -- If the head does not satisfy the predicate, then the tail will. -tail : {x} ¬ P x Any P (x xs) Any P xs +tail : {x} ¬ P x Any P (x xs) Any P xs tail ¬px (here px) = ⊥-elim (¬px px) tail ¬px (there pxs) = pxs @@ -56,7 +56,7 @@ fromSum : {x} P x Any P xs Any P (x xs) fromSum = [ here , there ]′ -map : P Q {n} Any P {n} Any Q {n} +map : P Q {n} Any P {n} Any Q {n} map g (here px) = here (g px) map g (there pxs) = there (map g pxs) @@ -75,11 +75,11 @@ ------------------------------------------------------------------------ -- Properties of predicates preserved by Any -any? : Decidable P {n} Decidable (Any P {n}) -any? P? [] = no λ() -any? P? (x xs) = Dec.map′ fromSum toSum (P? x ⊎-dec any? P? xs) +any? : Decidable P {n} Decidable (Any P {n}) +any? P? [] = no λ() +any? P? (x xs) = Dec.map′ fromSum toSum (P? x ⊎-dec any? P? xs) -satisfiable : Satisfiable P {n} Satisfiable (Any P {suc n}) +satisfiable : Satisfiable P {n} Satisfiable (Any P {suc n}) satisfiable (x , p) {zero} = x [] , here p satisfiable (x , p) {suc n} = Product.map (x ∷_) there (satisfiable (x , p)) diff --git a/master/Data.Vec.Relation.Unary.Linked.Properties.html b/master/Data.Vec.Relation.Unary.Linked.Properties.html index bea1970d43..ee3bcc8575 100644 --- a/master/Data.Vec.Relation.Unary.Linked.Properties.html +++ b/master/Data.Vec.Relation.Unary.Linked.Properties.html @@ -19,8 +19,8 @@ open import Level using (Level) open import Function.Base using (_on_) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Transitive) -open import Relation.Unary using (Pred; Decidable) +open import Relation.Binary.Definitions using (Transitive) +open import Relation.Unary using (Pred; Decidable) private variable @@ -34,7 +34,7 @@ -- Relationship to other predicates ------------------------------------------------------------------------ -module _ (trans : Transitive R) where +module _ (trans : Transitive R) where Linked⇒All : {v} {xs : Vec _ (suc n)} R v (head xs) Linked R xs All (R v) xs diff --git a/master/Data.Vec.Relation.Unary.Linked.html b/master/Data.Vec.Relation.Unary.Linked.html index 48fcf38087..f0a04e291c 100644 --- a/master/Data.Vec.Relation.Unary.Linked.html +++ b/master/Data.Vec.Relation.Unary.Linked.html @@ -19,8 +19,8 @@ import Relation.Binary.Definitions as B open import Relation.Binary.Construct.Intersection renaming (_∩_ to _∩ᵇ_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) -open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) -open import Relation.Nullary.Decidable as Dec using (yes; no; _×-dec_; map′) +open import Relation.Unary as U renaming (_∩_ to _∩ᵘ_) hiding (_⇒_) +open import Relation.Nullary.Decidable as Dec using (yes; no; _×-dec_; map′) private variable @@ -54,42 +54,42 @@ tail [-] = [] tail (_ Rxs) = Rxs -map : R S Linked R {n} Linked S +map : R S Linked R {n} Linked S map R⇒S [] = [] map R⇒S [-] = [-] map R⇒S (x~xs pxs) = R⇒S x~xs map R⇒S pxs -zipWith : P ∩ᵇ Q R Linked P {n} ∩ᵘ Linked Q Linked R +zipWith : P ∩ᵇ Q R Linked P {n} ∩ᵘ Linked Q Linked R zipWith f ([] , []) = [] zipWith f ([-] , [-]) = [-] zipWith f (px pxs , qx qxs) = f (px , qx) zipWith f (pxs , qxs) -unzipWith : R P ∩ᵇ Q Linked R {n} Linked P ∩ᵘ Linked Q +unzipWith : R P ∩ᵇ Q Linked R {n} Linked P ∩ᵘ Linked Q unzipWith f [] = [] , [] unzipWith f [-] = [-] , [-] unzipWith f (rx rxs) = Product.zip _∷_ _∷_ (f rx) (unzipWith f rxs) -zip : Linked P {n} ∩ᵘ Linked Q Linked (P ∩ᵇ Q) +zip : Linked P {n} ∩ᵘ Linked Q Linked (P ∩ᵇ Q) zip = zipWith id -unzip : Linked (P ∩ᵇ Q) {n} Linked P ∩ᵘ Linked Q +unzip : Linked (P ∩ᵇ Q) {n} Linked P ∩ᵘ Linked Q unzip = unzipWith id ------------------------------------------------------------------------ -- Properties of predicates preserved by Linked -linked? : B.Decidable R U.Decidable (Linked R {n}) -linked? R? [] = yes [] -linked? R? (x []) = yes [-] +linked? : B.Decidable R U.Decidable (Linked R {n}) +linked? R? [] = yes [] +linked? R? (x []) = yes [-] linked? R? (x y xs) = - map′ (uncurry _∷_) < head , tail > (R? x y ×-dec linked? R? (y xs)) + map′ (uncurry _∷_) < head , tail > (R? x y ×-dec linked? R? (y xs)) -irrelevant : B.Irrelevant R U.Irrelevant (Linked R {n}) +irrelevant : B.Irrelevant R U.Irrelevant (Linked R {n}) irrelevant irr [] [] = refl irrelevant irr [-] [-] = refl irrelevant irr (px₁ pxs₁) (px₂ pxs₂) = cong₂ _∷_ (irr px₁ px₂) (irrelevant irr pxs₁ pxs₂) -satisfiable : U.Satisfiable (Linked R) +satisfiable : U.Satisfiable (Linked R) satisfiable = [] , [] \ No newline at end of file diff --git a/master/Data.Vec.Relation.Unary.Unique.Propositional.Properties.html b/master/Data.Vec.Relation.Unary.Unique.Propositional.Properties.html index 6daa11ecad..68691046ec 100644 --- a/master/Data.Vec.Relation.Unary.Unique.Propositional.Properties.html +++ b/master/Data.Vec.Relation.Unary.Unique.Propositional.Properties.html @@ -26,8 +26,8 @@ open import Relation.Binary.PropositionalEquality.Core using (refl; _≡_; _≢_; sym) open import Relation.Binary.PropositionalEquality.Properties using (setoid) -open import Relation.Unary using (Pred; Decidable) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Unary using (Pred; Decidable) +open import Relation.Nullary.Negation.Core using (¬_) private variable diff --git a/master/Data.Vec.Relation.Unary.Unique.Setoid.Properties.html b/master/Data.Vec.Relation.Unary.Unique.Setoid.Properties.html index 6b671e3292..90795fa924 100644 --- a/master/Data.Vec.Relation.Unary.Unique.Setoid.Properties.html +++ b/master/Data.Vec.Relation.Unary.Unique.Setoid.Properties.html @@ -22,7 +22,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) -open import Relation.Nullary.Negation using (contradiction; contraposition) +open import Relation.Nullary.Negation using (contradiction; contraposition) private variable @@ -40,7 +40,7 @@ map⁺ : {f} (∀ {x y} f x ≈₂ f y x ≈₁ y) {n xs} Unique S {n} xs Unique R {n} (map f xs) - map⁺ inj xs! = AllPairs.map⁺ (AllPairs.map (contraposition inj) xs!) + map⁺ inj xs! = AllPairs.map⁺ (AllPairs.map (contraposition inj) xs!) ------------------------------------------------------------------------ -- take & drop @@ -73,7 +73,7 @@ lookup-injective : {n xs} Unique S {n} xs i j lookup xs i lookup xs j i j lookup-injective (px pxs) zero zero eq = ≡.refl - lookup-injective (px pxs) zero (suc j) eq = contradiction eq (All.lookup⁺ px j) - lookup-injective (px pxs) (suc i) zero eq = contradiction (sym eq) (All.lookup⁺ px i) + lookup-injective (px pxs) zero (suc j) eq = contradiction eq (All.lookup⁺ px j) + lookup-injective (px pxs) (suc i) zero eq = contradiction (sym eq) (All.lookup⁺ px i) lookup-injective (px pxs) (suc i) (suc j) eq = ≡.cong suc (lookup-injective pxs i j eq) \ No newline at end of file diff --git a/master/Data.Vec.Relation.Unary.Unique.Setoid.html b/master/Data.Vec.Relation.Unary.Unique.Setoid.html index 74fe29bdde..bf8b9bceba 100644 --- a/master/Data.Vec.Relation.Unary.Unique.Setoid.html +++ b/master/Data.Vec.Relation.Unary.Unique.Setoid.html @@ -17,8 +17,8 @@ open import Data.Vec.Base import Data.Vec.Relation.Unary.AllPairs as AllPairsM open import Level using (_⊔_) -open import Relation.Unary using (Pred) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Unary using (Pred) +open import Relation.Nullary.Negation using (¬_) ------------------------------------------------------------------------ @@ -26,7 +26,7 @@ private Distinct : Rel A - Distinct x y = ¬ (x y) + Distinct x y = ¬ (x y) open import Data.Vec.Relation.Unary.AllPairs.Core Distinct public renaming (AllPairs to Unique) diff --git a/master/Data.Vec.html b/master/Data.Vec.html index e0130906b5..3f7c097177 100644 --- a/master/Data.Vec.html +++ b/master/Data.Vec.html @@ -39,19 +39,19 @@ ------------------------------------------------------------------------ -- Additional operations -module _ {P : A Set p} (P? : Decidable P) where +module _ {P : A Set p} (P? : Decidable P) where filter : {n} Vec A n Vec≤ A n filter [] = Vec≤.[] - filter (a as) = if does (P? a) then a Vec≤.∷_ else ≤-cast (ℕ.n≤1+n _) $ filter as + filter (a as) = if does (P? a) then a Vec≤.∷_ else ≤-cast (ℕ.n≤1+n _) $ filter as takeWhile : {n} Vec A n Vec≤ A n takeWhile [] = Vec≤.[] - takeWhile (a as) = if does (P? a) then a Vec≤.∷ takeWhile as else Vec≤.[] + takeWhile (a as) = if does (P? a) then a Vec≤.∷ takeWhile as else Vec≤.[] dropWhile : {n} Vec A n Vec≤ A n dropWhile Vec.[] = Vec≤.[] dropWhile (a Vec.∷ as) = - if does (P? a) then ≤-cast (ℕ.n≤1+n _) (dropWhile as) + if does (P? a) then ≤-cast (ℕ.n≤1+n _) (dropWhile as) else fromVec (a Vec.∷ as) \ No newline at end of file diff --git a/master/Data.W.Indexed.html b/master/Data.W.Indexed.html index 8abf51d145..c06bd09645 100644 --- a/master/Data.W.Indexed.html +++ b/master/Data.W.Indexed.html @@ -25,7 +25,7 @@ -- Projections. - head : W Command + head : W Command head (sup (c , _)) = c tail : {o} (w : W o) (r : Response (head w)) W (next (head w) r) @@ -33,14 +33,14 @@ -- Induction, (primitive) recursion and iteration. - ind : {} (P : Pred (Σ O W) ) + ind : {} (P : Pred (Σ O W) ) (∀ {o} (cs : C W o) C P (o , cs) P (o , sup cs)) {o} (w : W o) P (o , w) ind P φ (sup (c , k)) = φ (c , k) r ind P φ (k r)) - rec : {} {X : Pred O } ( C (W X) X) W X + rec : {} {X : Pred O } ( C (W X) X) W X rec φ (sup (c , k))= φ (c , λ r (k r , rec φ (k r))) - iter : {} {X : Pred O } ( C X X) W X + iter : {} {X : Pred O } ( C X X) W X iter φ (sup (c , k))= φ (c , λ r iter φ (k r)) \ No newline at end of file diff --git a/master/Data.W.Sized.html b/master/Data.W.Sized.html index a3460aa44c..28a6b5a2ce 100644 --- a/master/Data.W.Sized.html +++ b/master/Data.W.Sized.html @@ -15,7 +15,7 @@ open import Data.Product.Base using (_,_; -,_; proj₂) open import Data.Container.Core as Container using (Container; ⟦_⟧; Shape; Position; _⇒_; ⟪_⟫) open import Data.Container.Relation.Unary.All using (; all) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) private @@ -65,6 +65,6 @@ -- If Position is always inhabited, then W_C is empty. -inhabited⇒empty : (∀ s Position C s) ¬ W C i +inhabited⇒empty : (∀ s Position C s) ¬ W C i inhabited⇒empty b = foldr ((_$ b _) proj₂) \ No newline at end of file diff --git a/master/Data.W.html b/master/Data.W.html index c35cb672c9..af86dd515b 100644 --- a/master/Data.W.html +++ b/master/Data.W.html @@ -14,7 +14,7 @@ open import Data.Product.Base using (_,_; -,_; proj₂) open import Data.Container.Core using (Container; ⟦_⟧; Shape; Position; _⇒_; ⟪_⟫) open import Data.Container.Relation.Unary.All using (; all) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Agda.Builtin.Equality using (_≡_; refl) private @@ -63,6 +63,6 @@ -- If Position is always inhabited, then W_C is empty. -inhabited⇒empty : (∀ s Position C s) ¬ W C +inhabited⇒empty : (∀ s Position C s) ¬ W C inhabited⇒empty b = foldr ((_$ b _) proj₂) \ No newline at end of file diff --git a/master/Data.Word.Properties.html b/master/Data.Word.Properties.html index 8eb15c4318..09fa97f21a 100644 --- a/master/Data.Word.Properties.html +++ b/master/Data.Word.Properties.html @@ -13,10 +13,10 @@ open import Data.Bool.Base using (Bool) open import Data.Word.Base using (_≈_; toℕ; Word64; _<_) import Data.Nat.Properties as -open import Relation.Nullary.Decidable.Core using (map′; ⌊_⌋) +open import Relation.Nullary.Decidable.Core using (map′; ⌊_⌋) open import Relation.Binary - using ( _⇒_; Reflexive; Symmetric; Transitive; Substitutive - ; Decidable; DecidableEquality; IsEquivalence; IsDecEquivalence + using ( _⇒_; Reflexive; Symmetric; Transitive; Substitutive + ; Decidable; DecidableEquality; IsEquivalence; IsDecEquivalence ; Setoid; DecSetoid; StrictTotalOrder) import Relation.Binary.Construct.On as On open import Relation.Binary.PropositionalEquality.Core @@ -40,20 +40,20 @@ ≈-reflexive : _≡_ _≈_ ≈-reflexive = cong toℕ -≈-refl : Reflexive _≈_ +≈-refl : Reflexive _≈_ ≈-refl = refl -≈-sym : Symmetric _≈_ +≈-sym : Symmetric _≈_ ≈-sym = sym -≈-trans : Transitive _≈_ +≈-trans : Transitive _≈_ ≈-trans = trans -≈-subst : {} Substitutive _≈_ +≈-subst : {} Substitutive _≈_ ≈-subst P x≈y p = subst P (≈⇒≡ x≈y) p infix 4 _≈?_ -_≈?_ : Decidable _≈_ +_≈?_ : Decidable _≈_ x ≈? y = toℕ x ℕ.≟ toℕ y ≈-isEquivalence : IsEquivalence _≈_ @@ -82,8 +82,8 @@ -- Properties of _≡_ infix 4 _≟_ -_≟_ : DecidableEquality Word64 -x y = map′ ≈⇒≡ ≈-reflexive (x ≈? y) +_≟_ : DecidableEquality Word64 +x y = map′ ≈⇒≡ ≈-reflexive (x ≈? y) ≡-setoid : Setoid _ _ ≡-setoid = setoid Word64 @@ -96,13 +96,13 @@ infix 4 _==_ _==_ : Word64 Word64 Bool -w₁ == w₂ = w₁ w₂ +w₁ == w₂ = w₁ w₂ ------------------------------------------------------------------------ -- Properties of _<_ infix 4 _<?_ -_<?_ : Decidable _<_ +_<?_ : Decidable _<_ _<?_ = On.decidable toℕ ℕ._<_ ℕ._<?_ <-strictTotalOrder-≈ : StrictTotalOrder _ _ _ diff --git a/master/Effect.Applicative.Predicate.html b/master/Effect.Applicative.Predicate.html index 6fdc8d8b44..ec0d69a739 100644 --- a/master/Effect.Applicative.Predicate.html +++ b/master/Effect.Applicative.Predicate.html @@ -31,8 +31,8 @@ infix 4 _⊗_ field - pure : {P} P F P - _⊛_ : {P Q} F (P Q) F P F Q + pure : {P} P F P + _⊛_ : {P Q} F (P Q) F P F Q rawPFunctor : RawPFunctor F rawPFunctor = record @@ -42,15 +42,15 @@ private open module RF = RawPFunctor rawPFunctor public - _<⊛_ : {P Q} F P const (∀ {j} F Q j) F P + _<⊛_ : {P Q} F P const (∀ {j} F Q j) F P x <⊛ y = const <$> x y - _⊛>_ : {P Q} const (∀ {i} F P i) F Q F Q + _⊛>_ : {P Q} const (∀ {i} F P i) F Q F Q x ⊛> y = constᵣ <$> x y - _⊗_ : {P Q} F P F Q F (P Q) + _⊗_ : {P Q} F P F Q F (P Q) x y = (_,_) <$> x y - zipWith : {P Q R} (P Q R) F P F Q F R + zipWith : {P Q R} (P Q R) F P F Q F R zipWith f x y = f <$> x y \ No newline at end of file diff --git a/master/Effect.Functor.Predicate.html b/master/Effect.Functor.Predicate.html index 79de38d452..344e51fff1 100644 --- a/master/Effect.Functor.Predicate.html +++ b/master/Effect.Functor.Predicate.html @@ -26,8 +26,8 @@ infixl 4 _<$>_ _<$_ field - _<$>_ : {P Q} P Q F P F Q + _<$>_ : {P Q} P Q F P F Q - _<$_ : {P Q} (∀ {i} P i) F Q F P + _<$_ : {P Q} (∀ {i} P i) F Q F P x <$ y = const x <$> y \ No newline at end of file diff --git a/master/Effect.Monad.Partiality.All.html b/master/Effect.Monad.Partiality.All.html index 6a0a436013..fc2742471b 100644 --- a/master/Effect.Monad.Partiality.All.html +++ b/master/Effect.Monad.Partiality.All.html @@ -14,7 +14,7 @@ open import Codata.Musical.Notation open import Function.Base using (flip; _∘_) open import Level -open import Relation.Binary.Definitions using (_Respects_) +open import Relation.Binary.Definitions using (_Respects_) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -59,7 +59,7 @@ respects : {k} {P : A Set p} {_∼_ : A A Set } - P Respects _∼_ All P Respects Rel _∼_ k + P Respects _∼_ All P Respects Rel _∼_ k respects resp (now x∼y) (now p) = now (resp x∼y p) respects resp (later x∼y) (later p) = later ( respects resp ( x∼y) ( p)) respects resp (laterˡ x∼y) (later p) = respects resp x∼y ( p) @@ -67,7 +67,7 @@ respects-flip : {k} {P : A Set p} {_∼_ : A A Set } - P Respects flip _∼_ All P Respects flip (Rel _∼_ k) + P Respects flip _∼_ All P Respects flip (Rel _∼_ k) respects-flip resp (now x∼y) (now p) = now (resp x∼y p) respects-flip resp (later x∼y) (later p) = later ( respects-flip resp ( x∼y) ( p)) respects-flip resp (laterˡ x∼y) p = later ( respects-flip resp x∼y p) @@ -77,7 +77,7 @@ module Reasoning {P : A Set p} {_∼_ : A A Set } - (resp : P Respects flip _∼_) where + (resp : P Respects flip _∼_) where infix 3 finally infixr 2 _≡⟨_⟩_ _∼⟨_⟩_ diff --git a/master/Effect.Monad.Partiality.html b/master/Effect.Monad.Partiality.html index b46ff6a366..d5cefb3390 100644 --- a/master/Effect.Monad.Partiality.html +++ b/master/Effect.Monad.Partiality.html @@ -22,7 +22,7 @@ open import Level using (Level; _⊔_) open import Relation.Binary.Core as B hiding (Rel; _⇔_) open import Relation.Binary.Definitions - using (DecidableEquality; Reflexive; Symmetric; Transitive) + using (DecidableEquality; Reflexive; Symmetric; Transitive) open import Relation.Binary.Structures using (IsPreorder; IsEquivalence) open import Relation.Binary.Bundles @@ -30,8 +30,8 @@ import Relation.Binary.Properties.Setoid as SetoidProperties open import Relation.Binary.PropositionalEquality.Core as using (_≡_) import Relation.Binary.PropositionalEquality.Properties as -open import Relation.Nullary.Decidable using (yes; no; False; Dec; ¬¬-excluded-middle) -open import Relation.Nullary.Negation using (¬_; ¬¬-Monad) +open import Relation.Nullary.Decidable using (yes; no; False; Dec; ¬¬-excluded-middle) +open import Relation.Nullary.Negation using (¬_; ¬¬-Monad) private variable @@ -116,20 +116,20 @@ infix 4 _≟-Kind_ -_≟-Kind_ : DecidableEquality Kind -_≟-Kind_ strong strong = yes ≡.refl -_≟-Kind_ strong (other k) = no λ() -_≟-Kind_ (other k) strong = no λ() -_≟-Kind_ (other geq) (other geq) = yes ≡.refl -_≟-Kind_ (other geq) (other weak) = no λ() -_≟-Kind_ (other weak) (other geq) = no λ() -_≟-Kind_ (other weak) (other weak) = yes ≡.refl +_≟-Kind_ : DecidableEquality Kind +_≟-Kind_ strong strong = yes ≡.refl +_≟-Kind_ strong (other k) = no λ() +_≟-Kind_ (other k) strong = no λ() +_≟-Kind_ (other geq) (other geq) = yes ≡.refl +_≟-Kind_ (other geq) (other weak) = no λ() +_≟-Kind_ (other weak) (other geq) = no λ() +_≟-Kind_ (other weak) (other weak) = yes ≡.refl -- A predicate which is satisfied only for equalities. Note that, for -- concrete inputs, this predicate evaluates to ⊤ or ⊥. Equality : Kind Set -Equality k = False (k ≟-Kind other geq) +Equality k = False (k ≟-Kind other geq) ------------------------------------------------------------------------ -- Equality/ordering @@ -257,13 +257,13 @@ -- Reflexivity. - refl : Reflexive _∼_ {k} Reflexive (Rel k) + refl : Reflexive _∼_ {k} Reflexive (Rel k) refl refl-∼ {x = now v} = now refl-∼ refl refl-∼ {x = later x} = later ( refl refl-∼) -- Symmetry. - sym : Symmetric _∼_ {k} Equality k Symmetric (Rel k) + sym : Symmetric _∼_ {k} Equality k Symmetric (Rel k) sym sym-∼ eq (now x∼y) = now (sym-∼ x∼y) sym sym-∼ eq (later x∼y) = later ( sym sym-∼ eq ( x∼y)) sym sym-∼ eq (laterʳ x≈y) = laterˡ (sym sym-∼ eq x≈y ) @@ -272,7 +272,7 @@ -- Transitivity. private - module Trans (trans-∼ : Transitive _∼_) where + module Trans (trans-∼ : Transitive _∼_) where now-trans : {k x y} {v : A} Rel k x y Rel k y (now v) Rel k x (now v) @@ -395,18 +395,18 @@ -- Now is not never. - now≉never : {k} {x : A} ¬ Rel k (now x) never + now≉never : {k} {x : A} ¬ Rel k (now x) never now≉never (laterʳ hyp) = now≉never hyp -- A partial value is either now or never (classically, when the -- underlying relation is reflexive). - now-or-never : Reflexive _∼_ + now-or-never : Reflexive _∼_ {k} (x : A ) - ¬ ¬ (( λ y x ⇓[ other k ] y) x ⇑[ other k ]) - now-or-never refl x = helper <$> ¬¬-excluded-middle + ¬ ¬ (( λ y x ⇓[ other k ] y) x ⇑[ other k ]) + now-or-never refl x = helper <$> ¬¬-excluded-middle where - open RawMonad ¬¬-Monad + open RawMonad ¬¬-Monad not-now-is-never : (x : A ) ( λ y x now y) x never not-now-is-never (now x) hyp with hyp (-, now refl) @@ -414,9 +414,9 @@ not-now-is-never (later x) hyp = later ( not-now-is-never ( x) (hyp Prod.map id laterˡ)) - helper : Dec ( λ y x now y) _ - helper (yes ≳now) = inj₁ $ Prod.map id ≳⇒ ≳now - helper (no ≵now) = inj₂ $ ≳⇒ $ not-now-is-never x ≵now + helper : Dec ( λ y x now y) _ + helper (yes ≳now) = inj₁ $ Prod.map id ≳⇒ ≳now + helper (no ≵now) = inj₂ $ ≳⇒ $ not-now-is-never x ≵now ------------------------------------------------------------------------ -- Map-like results @@ -434,7 +434,7 @@ -- underlying relation, then it can also be proved for any other -- reflexive underlying relation. - ≡⇒ : Reflexive _∼_ + ≡⇒ : Reflexive _∼_ {k x y} Equality.Rel _≡_ k x y Rel k x y ≡⇒ refl-∼ = map (flip (≡.subst (_∼_ _)) refl-∼) @@ -448,7 +448,7 @@ steps (now _) = zero steps .{x = later x} (laterˡ {x = x} x⇓) = suc (steps {x = x} x⇓) - module Steps {trans-∼ : Transitive _∼_} where + module Steps {trans-∼ : Transitive _∼_} where left-identity : {k x y} {z : A} @@ -485,12 +485,12 @@ -- Now is a left and right identity of bind (for a reflexive -- underlying relation). - left-identity : Reflexive _∼_ + left-identity : Reflexive _∼_ (x : B) (f : B A ) let open M in (now x >>= f) f x left-identity refl-∼ x f = Equivalence.refl refl-∼ - right-identity : Reflexive _∼_ + right-identity : Reflexive _∼_ (x : A ) let open M in (x >>= now) x right-identity refl (now x) = now refl @@ -498,7 +498,7 @@ -- Bind is associative (for a reflexive underlying relation). - associative : Reflexive _∼_ + associative : Reflexive _∼_ (x : C ) (f : C B ) (g : B A ) let open M in (x >>= f >>= g) (x >>= λ y f y >>= g) @@ -532,7 +532,7 @@ -- Inversion lemmas for bind. >>=-inversion-⇓ : - Reflexive _∼A_ + Reflexive _∼A_ {k} x {f : A B } {y} let open M in (x>>=f⇓ : (x >>= f) ⇓[ k ]B y) λ z ∃₂ λ (x⇓ : x ⇓[ k ]A z) (fz⇓ : f z ⇓[ k ]B y) @@ -546,12 +546,12 @@ >>=-inversion-⇑ : IsEquivalence _∼A_ {k} x {f : A B } let open M in Rel _∼B_ (other k) (x >>= f) never - ¬ ¬ (x ⇑[ other k ]A + ¬ ¬ (x ⇑[ other k ]A λ y x ⇓[ other k ]A y × f y ⇑[ other k ]B) >>=-inversion-⇑ eqA {k} x {f} ∼never = helper <$> now-or-never IsEqA.refl x where - open RawMonad ¬¬-Monad using (_<$>_) + open RawMonad ¬¬-Monad using (_<$>_) open M using (_>>=_) open Reasoning eqA module IsEqA = IsEquivalence eqA diff --git a/master/Effect.Monad.Predicate.html b/master/Effect.Monad.Predicate.html index 2e8d0ac5d9..ad9ccd4c7f 100644 --- a/master/Effect.Monad.Predicate.html +++ b/master/Effect.Monad.Predicate.html @@ -16,7 +16,7 @@ open import Function.Base using (const; id; _∘_) open import Level using (Level; _⊔_; suc) open import Relation.Binary.PropositionalEquality.Core using (refl) -open import Relation.Unary using (_⊆_; _⇒_; _∈_; _∩_; {_}) +open import Relation.Unary using (_⊆_; _⇒_; _∈_; _∩_; {_}) open import Relation.Unary.PredicateTransformer using (Pt) private @@ -33,30 +33,30 @@ -- ``Demonic'' operations (the opponent chooses the state). field - return? : {P} P M P - _=<?_ : {P Q} P M Q M P M Q + return? : {P} P M P + _=<?_ : {P Q} P M Q M P M Q - _?>=_ : {P Q} M P const (P M Q) M Q + _?>=_ : {P Q} M P const (P M Q) M Q m ?>= f = f =<? m - _?>=′_ : {P Q} M P const (∀ j {_ : P j} j M Q) M Q + _?>=′_ : {P Q} M P const (∀ j {_ : P j} j M Q) M Q m ?>=′ f = m ?>= λ {j} p f j {p} - _?>_ : {P Q} M P const (∀ {j} j M Q) M Q + _?>_ : {P Q} M P const (∀ {j} j M Q) M Q m₁ ?> m₂ = m₁ ?>= λ _ m₂ - join? : {P} M (M P) M P + join? : {P} M (M P) M P join? m = m ?>= id - _>?>_ : {P Q R : _} P M Q Q M R P M R + _>?>_ : {P Q R : _} P M Q Q M R P M R f >?> g = _=<?_ g f - _<?<_ : {P Q R} Q M R P M Q P M R + _<?<_ : {P Q R} Q M R P M Q P M R g <?< f = f >?> g -- ``Angelic'' operations (the player knows the state). - rawIMonad : RawIMonad i j A i M (const A j )) + rawIMonad : RawIMonad i j A i M (const A j )) rawIMonad = record { return = λ x return? (x , refl) ; _>>=_ = λ m k m ?>= λ { {._} (x , refl) k x } diff --git a/master/Everything.html b/master/Everything.html index 8d7a9115cc..6ff2367579 100644 --- a/master/Everything.html +++ b/master/Everything.html @@ -2891,218 +2891,221 @@ -- Properties related to negation import Relation.Nullary.Negation --- Properties of the `Reflects` construct -import Relation.Nullary.Reflects +-- Recomputable types and their algebra as Harrop formulas +import Relation.Nullary.Recomputable --- A universe of proposition functors, along with some properties -import Relation.Nullary.Universe +-- Properties of the `Reflects` construct +import Relation.Nullary.Reflects --- Unary relations -import Relation.Unary +-- A universe of proposition functors, along with some properties +import Relation.Nullary.Universe --- Algebraic properties of constructions over unary relations -import Relation.Unary.Algebra +-- Unary relations +import Relation.Unary --- Closures of a unary relation with respect to a binary one. -import Relation.Unary.Closure.Base +-- Algebraic properties of constructions over unary relations +import Relation.Unary.Algebra --- Closure of a unary relation with respect to a preorder -import Relation.Unary.Closure.Preorder +-- Closures of a unary relation with respect to a binary one. +import Relation.Unary.Closure.Base --- Closures of a unary relation with respect to a strict partial order -import Relation.Unary.Closure.StrictPartialOrder +-- Closure of a unary relation with respect to a preorder +import Relation.Unary.Closure.Preorder --- Some properties imply others -import Relation.Unary.Consequences +-- Closures of a unary relation with respect to a strict partial order +import Relation.Unary.Closure.StrictPartialOrder --- Indexed unary relations -import Relation.Unary.Indexed +-- Some properties imply others +import Relation.Unary.Consequences --- Polymorphic versions of standard definitions in Relation.Unary -import Relation.Unary.Polymorphic +-- Indexed unary relations +import Relation.Unary.Indexed --- Properties of polymorphic versions of standard definitions in --- Relation.Unary -import Relation.Unary.Polymorphic.Properties +-- Polymorphic versions of standard definitions in Relation.Unary +import Relation.Unary.Polymorphic --- Predicate transformers -import Relation.Unary.PredicateTransformer +-- Properties of polymorphic versions of standard definitions in +-- Relation.Unary +import Relation.Unary.Polymorphic.Properties --- Properties of constructions over unary relations -import Relation.Unary.Properties +-- Predicate transformers +import Relation.Unary.PredicateTransformer --- Equality of unary relations -import Relation.Unary.Relation.Binary.Equality +-- Properties of constructions over unary relations +import Relation.Unary.Properties --- Order properties of the subset relations _⊆_ and _⊂_ -import Relation.Unary.Relation.Binary.Subset +-- Equality of unary relations +import Relation.Unary.Relation.Binary.Equality --- Indexed unary relations over sized types -import Relation.Unary.Sized +-- Order properties of the subset relations _⊆_ and _⊂_ +import Relation.Unary.Relation.Binary.Subset --- Sizes for Agda's sized types -import Size +-- Indexed unary relations over sized types +import Relation.Unary.Sized --- Measuring time -import System.Clock +-- Sizes for Agda's sized types +import Size --- Primitive System.Clock simple bindings to Haskell functions -import System.Clock.Primitive +-- Measuring time +import System.Clock --- ANSI escape codes -import System.Console.ANSI +-- Primitive System.Clock simple bindings to Haskell functions +import System.Clock.Primitive --- Directory manipulation -import System.Directory +-- ANSI escape codes +import System.Console.ANSI --- Primitive System.Direcotry simple bindings to Haskell functions -import System.Directory.Primitive +-- Directory manipulation +import System.Directory --- Miscellanous information about the system environment -import System.Environment +-- Primitive System.Direcotry simple bindings to Haskell functions +import System.Directory.Primitive --- Primitive System.Environment: simple bindings to Haskell functions -import System.Environment.Primitive +-- Miscellanous information about the system environment +import System.Environment --- Exiting the program. -import System.Exit +-- Primitive System.Environment: simple bindings to Haskell functions +import System.Environment.Primitive --- Primitive System.Exit simple bindings to Haskell functions -import System.Exit.Primitive +-- Exiting the program. +import System.Exit --- Posix filepaths -import System.FilePath.Posix +-- Primitive System.Exit simple bindings to Haskell functions +import System.Exit.Primitive --- Primitive System.FilePath.Posix simple bindings to Haskell functions -import System.FilePath.Posix.Primitive +-- Posix filepaths +import System.FilePath.Posix --- Calling external processes -import System.Process +-- Primitive System.FilePath.Posix simple bindings to Haskell functions +import System.FilePath.Posix.Primitive --- Primitive System.Process simple bindings to Haskell functions -import System.Process.Primitive +-- Calling external processes +import System.Process --- *Pseudo-random* number generation -import System.Random +-- Primitive System.Process simple bindings to Haskell functions +import System.Process.Primitive --- Primitive System.Random simple bindings to Haskell functions -import System.Random.Primitive +-- *Pseudo-random* number generation +import System.Random --- A simple tactic for used to automatically compute the function --- argument to cong. -import Tactic.Cong +-- Primitive System.Random simple bindings to Haskell functions +import System.Random.Primitive --- Reflection-based solver for monoid equalities -import Tactic.MonoidSolver +-- A simple tactic for used to automatically compute the function +-- argument to cong. +import Tactic.Cong --- A solver that uses reflection to automatically obtain and solve --- equations over rings. -import Tactic.RingSolver +-- Reflection-based solver for monoid equalities +import Tactic.MonoidSolver --- Almost commutative rings -import Tactic.RingSolver.Core.AlmostCommutativeRing +-- A solver that uses reflection to automatically obtain and solve +-- equations over rings. +import Tactic.RingSolver --- A type for expressions over a raw ring. -import Tactic.RingSolver.Core.Expression +-- Almost commutative rings +import Tactic.RingSolver.Core.AlmostCommutativeRing --- Simple implementation of sets of ℕ. -import Tactic.RingSolver.Core.NatSet +-- A type for expressions over a raw ring. +import Tactic.RingSolver.Core.Expression --- Sparse polynomials in a commutative ring, encoded in Horner normal --- form. -import Tactic.RingSolver.Core.Polynomial.Base +-- Simple implementation of sets of ℕ. +import Tactic.RingSolver.Core.NatSet --- Some specialised instances of the ring solver -import Tactic.RingSolver.Core.Polynomial.Homomorphism +-- Sparse polynomials in a commutative ring, encoded in Horner normal +-- form. +import Tactic.RingSolver.Core.Polynomial.Base --- Homomorphism proofs for addition over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Addition +-- Some specialised instances of the ring solver +import Tactic.RingSolver.Core.Polynomial.Homomorphism --- Homomorphism proofs for constants over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Constants +-- Homomorphism proofs for addition over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Addition --- Homomorphism proofs for exponentiation over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Exponentiation +-- Homomorphism proofs for constants over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Constants --- Lemmas for use in proving the polynomial homomorphism. -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas +-- Homomorphism proofs for exponentiation over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Exponentiation --- Homomorphism proofs for multiplication over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Multiplication +-- Lemmas for use in proving the polynomial homomorphism. +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas --- Homomorphism proofs for negation over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Negation +-- Homomorphism proofs for multiplication over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Multiplication --- Homomorphism proofs for variables and constants over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables +-- Homomorphism proofs for negation over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Negation --- Bundles of parameters for passing to the Ring Solver -import Tactic.RingSolver.Core.Polynomial.Parameters +-- Homomorphism proofs for variables and constants over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables --- Polynomial reasoning -import Tactic.RingSolver.Core.Polynomial.Reasoning +-- Bundles of parameters for passing to the Ring Solver +import Tactic.RingSolver.Core.Polynomial.Parameters --- "Evaluating" a polynomial, using Horner's method. -import Tactic.RingSolver.Core.Polynomial.Semantics +-- Polynomial reasoning +import Tactic.RingSolver.Core.Polynomial.Reasoning --- An implementation of the ring solver that requires you to manually --- pass the equation you wish to solve. -import Tactic.RingSolver.NonReflective +-- "Evaluating" a polynomial, using Horner's method. +import Tactic.RingSolver.Core.Polynomial.Semantics --- Golden testing framework -import Test.Golden +-- An implementation of the ring solver that requires you to manually +-- pass the equation you wish to solve. +import Tactic.RingSolver.NonReflective --- Format strings for Printf and Scanf -import Text.Format +-- Golden testing framework +import Test.Golden --- Format strings for Printf and Scanf -import Text.Format.Generic +-- Format strings for Printf and Scanf +import Text.Format --- Pretty Printing --- This module is based on Jean-Philippe Bernardy's functional pearl --- "A Pretty But Not Greedy Printer" -import Text.Pretty +-- Format strings for Printf and Scanf +import Text.Format.Generic --- Printf -import Text.Printf +-- Pretty Printing +-- This module is based on Jean-Philippe Bernardy's functional pearl +-- "A Pretty But Not Greedy Printer" +import Text.Pretty --- Generic printf function. -import Text.Printf.Generic +-- Printf +import Text.Printf --- Regular expressions -import Text.Regex +-- Generic printf function. +import Text.Printf.Generic --- Regular expressions: basic types and semantics -import Text.Regex.Base +-- Regular expressions +import Text.Regex --- Regular expressions: Brzozowski derivative -import Text.Regex.Derivative.Brzozowski +-- Regular expressions: basic types and semantics +import Text.Regex.Base --- Properties of regular expressions and their semantics -import Text.Regex.Properties +-- Regular expressions: Brzozowski derivative +import Text.Regex.Derivative.Brzozowski --- Regular expressions: search algorithms -import Text.Regex.Search +-- Properties of regular expressions and their semantics +import Text.Regex.Properties --- Regular expressions: smart constructors --- Computing the Brzozowski derivative of a regular expression may lead --- to a blow-up in the size of the expression. To keep it tractable it --- is crucial to use smart constructors. -import Text.Regex.SmartConstructors +-- Regular expressions: search algorithms +import Text.Regex.Search --- Regular expressions acting on strings -import Text.Regex.String +-- Regular expressions: smart constructors +-- Computing the Brzozowski derivative of a regular expression may lead +-- to a blow-up in the size of the expression. To keep it tractable it +-- is crucial to use smart constructors. +import Text.Regex.SmartConstructors --- Regular expressions acting on strings, using unsafe features -import Text.Regex.String.Unsafe +-- Regular expressions acting on strings +import Text.Regex.String --- Fancy display functions for List-based tables -import Text.Tabular.Base +-- Regular expressions acting on strings, using unsafe features +import Text.Regex.String.Unsafe --- Fancy display functions for List-based tables -import Text.Tabular.List +-- Fancy display functions for List-based tables +import Text.Tabular.Base --- Fancy display functions for Vec-based tables -import Text.Tabular.Vec +-- Fancy display functions for List-based tables +import Text.Tabular.List + +-- Fancy display functions for Vec-based tables +import Text.Tabular.Vec \ No newline at end of file diff --git a/master/EverythingSafe.html b/master/EverythingSafe.html index bd85fbbea3..4d55b805ba 100644 --- a/master/EverythingSafe.html +++ b/master/EverythingSafe.html @@ -2670,159 +2670,162 @@ -- Properties related to negation import Relation.Nullary.Negation --- Properties of the `Reflects` construct -import Relation.Nullary.Reflects +-- Recomputable types and their algebra as Harrop formulas +import Relation.Nullary.Recomputable --- A universe of proposition functors, along with some properties -import Relation.Nullary.Universe +-- Properties of the `Reflects` construct +import Relation.Nullary.Reflects --- Unary relations -import Relation.Unary +-- A universe of proposition functors, along with some properties +import Relation.Nullary.Universe --- Algebraic properties of constructions over unary relations -import Relation.Unary.Algebra +-- Unary relations +import Relation.Unary --- Closures of a unary relation with respect to a binary one. -import Relation.Unary.Closure.Base +-- Algebraic properties of constructions over unary relations +import Relation.Unary.Algebra --- Closure of a unary relation with respect to a preorder -import Relation.Unary.Closure.Preorder +-- Closures of a unary relation with respect to a binary one. +import Relation.Unary.Closure.Base --- Closures of a unary relation with respect to a strict partial order -import Relation.Unary.Closure.StrictPartialOrder +-- Closure of a unary relation with respect to a preorder +import Relation.Unary.Closure.Preorder --- Some properties imply others -import Relation.Unary.Consequences +-- Closures of a unary relation with respect to a strict partial order +import Relation.Unary.Closure.StrictPartialOrder --- Indexed unary relations -import Relation.Unary.Indexed +-- Some properties imply others +import Relation.Unary.Consequences --- Polymorphic versions of standard definitions in Relation.Unary -import Relation.Unary.Polymorphic +-- Indexed unary relations +import Relation.Unary.Indexed --- Properties of polymorphic versions of standard definitions in --- Relation.Unary -import Relation.Unary.Polymorphic.Properties +-- Polymorphic versions of standard definitions in Relation.Unary +import Relation.Unary.Polymorphic --- Predicate transformers -import Relation.Unary.PredicateTransformer +-- Properties of polymorphic versions of standard definitions in +-- Relation.Unary +import Relation.Unary.Polymorphic.Properties --- Properties of constructions over unary relations -import Relation.Unary.Properties +-- Predicate transformers +import Relation.Unary.PredicateTransformer --- Equality of unary relations -import Relation.Unary.Relation.Binary.Equality +-- Properties of constructions over unary relations +import Relation.Unary.Properties --- Order properties of the subset relations _⊆_ and _⊂_ -import Relation.Unary.Relation.Binary.Subset +-- Equality of unary relations +import Relation.Unary.Relation.Binary.Equality --- ANSI escape codes -import System.Console.ANSI +-- Order properties of the subset relations _⊆_ and _⊂_ +import Relation.Unary.Relation.Binary.Subset --- A simple tactic for used to automatically compute the function --- argument to cong. -import Tactic.Cong +-- ANSI escape codes +import System.Console.ANSI --- Reflection-based solver for monoid equalities -import Tactic.MonoidSolver +-- A simple tactic for used to automatically compute the function +-- argument to cong. +import Tactic.Cong --- A solver that uses reflection to automatically obtain and solve --- equations over rings. -import Tactic.RingSolver +-- Reflection-based solver for monoid equalities +import Tactic.MonoidSolver --- Almost commutative rings -import Tactic.RingSolver.Core.AlmostCommutativeRing +-- A solver that uses reflection to automatically obtain and solve +-- equations over rings. +import Tactic.RingSolver --- A type for expressions over a raw ring. -import Tactic.RingSolver.Core.Expression +-- Almost commutative rings +import Tactic.RingSolver.Core.AlmostCommutativeRing --- Simple implementation of sets of ℕ. -import Tactic.RingSolver.Core.NatSet +-- A type for expressions over a raw ring. +import Tactic.RingSolver.Core.Expression --- Sparse polynomials in a commutative ring, encoded in Horner normal --- form. -import Tactic.RingSolver.Core.Polynomial.Base +-- Simple implementation of sets of ℕ. +import Tactic.RingSolver.Core.NatSet --- Some specialised instances of the ring solver -import Tactic.RingSolver.Core.Polynomial.Homomorphism +-- Sparse polynomials in a commutative ring, encoded in Horner normal +-- form. +import Tactic.RingSolver.Core.Polynomial.Base --- Homomorphism proofs for addition over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Addition +-- Some specialised instances of the ring solver +import Tactic.RingSolver.Core.Polynomial.Homomorphism --- Homomorphism proofs for constants over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Constants +-- Homomorphism proofs for addition over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Addition --- Homomorphism proofs for exponentiation over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Exponentiation +-- Homomorphism proofs for constants over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Constants --- Lemmas for use in proving the polynomial homomorphism. -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas +-- Homomorphism proofs for exponentiation over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Exponentiation --- Homomorphism proofs for multiplication over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Multiplication +-- Lemmas for use in proving the polynomial homomorphism. +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas --- Homomorphism proofs for negation over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Negation +-- Homomorphism proofs for multiplication over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Multiplication --- Homomorphism proofs for variables and constants over polynomials -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables +-- Homomorphism proofs for negation over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Negation --- Bundles of parameters for passing to the Ring Solver -import Tactic.RingSolver.Core.Polynomial.Parameters +-- Homomorphism proofs for variables and constants over polynomials +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables --- Polynomial reasoning -import Tactic.RingSolver.Core.Polynomial.Reasoning +-- Bundles of parameters for passing to the Ring Solver +import Tactic.RingSolver.Core.Polynomial.Parameters --- "Evaluating" a polynomial, using Horner's method. -import Tactic.RingSolver.Core.Polynomial.Semantics +-- Polynomial reasoning +import Tactic.RingSolver.Core.Polynomial.Reasoning --- An implementation of the ring solver that requires you to manually --- pass the equation you wish to solve. -import Tactic.RingSolver.NonReflective +-- "Evaluating" a polynomial, using Horner's method. +import Tactic.RingSolver.Core.Polynomial.Semantics --- Format strings for Printf and Scanf -import Text.Format +-- An implementation of the ring solver that requires you to manually +-- pass the equation you wish to solve. +import Tactic.RingSolver.NonReflective --- Format strings for Printf and Scanf -import Text.Format.Generic +-- Format strings for Printf and Scanf +import Text.Format --- Printf -import Text.Printf +-- Format strings for Printf and Scanf +import Text.Format.Generic --- Generic printf function. -import Text.Printf.Generic +-- Printf +import Text.Printf --- Regular expressions -import Text.Regex +-- Generic printf function. +import Text.Printf.Generic --- Regular expressions: basic types and semantics -import Text.Regex.Base +-- Regular expressions +import Text.Regex --- Regular expressions: Brzozowski derivative -import Text.Regex.Derivative.Brzozowski +-- Regular expressions: basic types and semantics +import Text.Regex.Base --- Properties of regular expressions and their semantics -import Text.Regex.Properties +-- Regular expressions: Brzozowski derivative +import Text.Regex.Derivative.Brzozowski --- Regular expressions: search algorithms -import Text.Regex.Search +-- Properties of regular expressions and their semantics +import Text.Regex.Properties --- Regular expressions: smart constructors --- Computing the Brzozowski derivative of a regular expression may lead --- to a blow-up in the size of the expression. To keep it tractable it --- is crucial to use smart constructors. -import Text.Regex.SmartConstructors +-- Regular expressions: search algorithms +import Text.Regex.Search --- Regular expressions acting on strings -import Text.Regex.String +-- Regular expressions: smart constructors +-- Computing the Brzozowski derivative of a regular expression may lead +-- to a blow-up in the size of the expression. To keep it tractable it +-- is crucial to use smart constructors. +import Text.Regex.SmartConstructors --- Fancy display functions for List-based tables -import Text.Tabular.Base +-- Regular expressions acting on strings +import Text.Regex.String --- Fancy display functions for List-based tables -import Text.Tabular.List +-- Fancy display functions for List-based tables +import Text.Tabular.Base --- Fancy display functions for Vec-based tables -import Text.Tabular.Vec +-- Fancy display functions for List-based tables +import Text.Tabular.List + +-- Fancy display functions for Vec-based tables +import Text.Tabular.Vec \ No newline at end of file diff --git a/master/Function.Consequences.Propositional.html b/master/Function.Consequences.Propositional.html index ea021abc30..9afb1fabb0 100644 --- a/master/Function.Consequences.Propositional.html +++ b/master/Function.Consequences.Propositional.html @@ -16,7 +16,7 @@ open import Relation.Binary.PropositionalEquality.Properties using (setoid) open import Function.Definitions -open import Relation.Nullary.Negation.Core using (contraposition) +open import Relation.Nullary.Negation.Core using (contraposition) import Function.Consequences.Setoid (setoid A) (setoid B) as Setoid diff --git a/master/Function.Consequences.Setoid.html b/master/Function.Consequences.Setoid.html index 2d6d15c837..92f8aabc6b 100644 --- a/master/Function.Consequences.Setoid.html +++ b/master/Function.Consequences.Setoid.html @@ -33,7 +33,7 @@ -- Injective contraInjective : Injective ≈₁ ≈₂ f - {x y} ¬ (≈₁ x y) ¬ (≈₂ (f x) (f y)) + {x y} ¬ (≈₁ x y) ¬ (≈₂ (f x) (f y)) contraInjective = C.contraInjective ≈₂ ------------------------------------------------------------------------ diff --git a/master/Function.Consequences.html b/master/Function.Consequences.html index c7126ee049..6a72933816 100644 --- a/master/Function.Consequences.html +++ b/master/Function.Consequences.html @@ -16,8 +16,8 @@ open import Level using (Level) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) -open import Relation.Nullary.Negation.Core using (¬_; contraposition) +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) +open import Relation.Nullary.Negation.Core using (¬_; contraposition) private variable @@ -30,8 +30,8 @@ -- Injective contraInjective : (≈₂ : Rel B ℓ₂) Injective ≈₁ ≈₂ f - {x y} ¬ (≈₁ x y) ¬ (≈₂ (f x) (f y)) -contraInjective _ inj p = contraposition inj p + {x y} ¬ (≈₁ x y) ¬ (≈₂ (f x) (f y)) +contraInjective _ inj p = contraposition inj p ------------------------------------------------------------------------ -- Inverseˡ @@ -45,9 +45,9 @@ -- Inverseʳ inverseʳ⇒injective : (≈₂ : Rel B ℓ₂) f - Reflexive ≈₂ - Symmetric ≈₁ - Transitive ≈₁ + Reflexive ≈₂ + Symmetric ≈₁ + Transitive ≈₁ Inverseʳ ≈₁ ≈₂ f f⁻¹ Injective ≈₁ ≈₂ f inverseʳ⇒injective ≈₂ f refl sym trans invʳ {x} {y} fx≈fy = @@ -57,9 +57,9 @@ -- Inverseᵇ inverseᵇ⇒bijective : (≈₂ : Rel B ℓ₂) - Reflexive ≈₂ - Symmetric ≈₁ - Transitive ≈₁ + Reflexive ≈₂ + Symmetric ≈₁ + Transitive ≈₁ Inverseᵇ ≈₁ ≈₂ f f⁻¹ Bijective ≈₁ ≈₂ f inverseᵇ⇒bijective {f = f} ≈₂ refl sym trans (invˡ , invʳ) = @@ -69,13 +69,13 @@ -- StrictlySurjective surjective⇒strictlySurjective : (≈₂ : Rel B ℓ₂) - Reflexive ≈₁ + Reflexive ≈₁ Surjective ≈₁ ≈₂ f StrictlySurjective ≈₂ f surjective⇒strictlySurjective _ refl surj x = Product.map₂ v v refl) (surj x) -strictlySurjective⇒surjective : Transitive ≈₂ +strictlySurjective⇒surjective : Transitive ≈₂ Congruent ≈₁ ≈₂ f StrictlySurjective ≈₂ f Surjective ≈₁ ≈₂ f @@ -86,12 +86,12 @@ -- StrictlyInverseˡ inverseˡ⇒strictlyInverseˡ : (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) - Reflexive ≈₁ + Reflexive ≈₁ Inverseˡ ≈₁ ≈₂ f f⁻¹ StrictlyInverseˡ ≈₂ f f⁻¹ inverseˡ⇒strictlyInverseˡ _ _ refl sinv x = sinv refl -strictlyInverseˡ⇒inverseˡ : Transitive ≈₂ +strictlyInverseˡ⇒inverseˡ : Transitive ≈₂ Congruent ≈₁ ≈₂ f StrictlyInverseˡ ≈₂ f f⁻¹ Inverseˡ ≈₁ ≈₂ f f⁻¹ @@ -102,12 +102,12 @@ -- StrictlyInverseʳ inverseʳ⇒strictlyInverseʳ : (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) - Reflexive ≈₂ + Reflexive ≈₂ Inverseʳ ≈₁ ≈₂ f f⁻¹ StrictlyInverseʳ ≈₁ f f⁻¹ inverseʳ⇒strictlyInverseʳ _ _ refl sinv x = sinv refl -strictlyInverseʳ⇒inverseʳ : Transitive ≈₁ +strictlyInverseʳ⇒inverseʳ : Transitive ≈₁ Congruent ≈₂ ≈₁ f⁻¹ StrictlyInverseʳ ≈₁ f f⁻¹ Inverseʳ ≈₁ ≈₂ f f⁻¹ diff --git a/master/Function.Construct.Composition.html b/master/Function.Construct.Composition.html index 16746e85d0..4cafa4aea5 100644 --- a/master/Function.Construct.Composition.html +++ b/master/Function.Construct.Composition.html @@ -17,7 +17,7 @@ open import Level using (Level) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) private variable diff --git a/master/Function.Construct.Identity.html b/master/Function.Construct.Identity.html index 949a9b32e3..86e79c7325 100644 --- a/master/Function.Construct.Identity.html +++ b/master/Function.Construct.Identity.html @@ -18,7 +18,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures as B hiding (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) open import Relation.Binary.PropositionalEquality.Core using (_≡_) open import Relation.Binary.PropositionalEquality.Properties using (setoid) diff --git a/master/Function.Construct.Symmetry.html b/master/Function.Construct.Symmetry.html index 6740c65d7f..c0c7f843d4 100644 --- a/master/Function.Construct.Symmetry.html +++ b/master/Function.Construct.Symmetry.html @@ -19,7 +19,7 @@ using (Bijection; Equivalence; LeftInverse; RightInverse; Inverse; _⤖_; _⇔_; _↩_; _↪_; _↔_) open import Level using (Level) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) open import Relation.Binary.PropositionalEquality.Properties using (setoid) @@ -40,15 +40,15 @@ f⁻¹ = proj₁ surj f∘f⁻¹≡id = proj₂ surj - injective : Reflexive ≈₁ Symmetric ≈₂ Transitive ≈₂ + injective : Reflexive ≈₁ Symmetric ≈₂ Transitive ≈₂ Congruent ≈₁ ≈₂ f Injective ≈₂ ≈₁ f⁻¹ injective refl sym trans cong gx≈gy = trans (trans (sym (f∘f⁻¹≡id _ refl)) (cong gx≈gy)) (f∘f⁻¹≡id _ refl) - surjective : Reflexive ≈₁ Transitive ≈₂ Surjective ≈₂ ≈₁ f⁻¹ + surjective : Reflexive ≈₁ Transitive ≈₂ Surjective ≈₂ ≈₁ f⁻¹ surjective refl trans x = f x , inj trans (f∘f⁻¹≡id _ refl) - bijective : Reflexive ≈₁ Symmetric ≈₂ Transitive ≈₂ + bijective : Reflexive ≈₁ Symmetric ≈₂ Transitive ≈₂ Congruent ≈₁ ≈₂ f Bijective ≈₂ ≈₁ f⁻¹ bijective refl sym trans cong = injective refl sym trans cong , surjective refl trans diff --git a/master/Function.Indexed.Bundles.html b/master/Function.Indexed.Bundles.html index 6298259933..08f05f4ccb 100644 --- a/master/Function.Indexed.Bundles.html +++ b/master/Function.Indexed.Bundles.html @@ -9,7 +9,7 @@ module Function.Indexed.Bundles where -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) open import Function.Bundles using (_⟶_; _↣_; _↠_; _⤖_; _⇔_; _↩_; _↪_; _↩↪_; _↔_) open import Relation.Binary.Core hiding (_⇔_) open import Level using (Level) @@ -25,30 +25,30 @@ infix 3 _⟶ᵢ_ _↣ᵢ_ _↠ᵢ_ _⤖ᵢ_ _⇔ᵢ_ _↩ᵢ_ _↪ᵢ_ _↩↪ᵢ_ _↔ᵢ_ -_⟶ᵢ_ : Pred I a Pred I b Set _ +_⟶ᵢ_ : Pred I a Pred I b Set _ A ⟶ᵢ B = {i} A i B i -_↣ᵢ_ : Pred I a Pred I b Set _ +_↣ᵢ_ : Pred I a Pred I b Set _ A ↣ᵢ B = {i} A i B i -_↠ᵢ_ : Pred I a Pred I b Set _ +_↠ᵢ_ : Pred I a Pred I b Set _ A ↠ᵢ B = {i} A i B i -_⤖ᵢ_ : Pred I a Pred I b Set _ +_⤖ᵢ_ : Pred I a Pred I b Set _ A ⤖ᵢ B = {i} A i B i -_⇔ᵢ_ : Pred I a Pred I b Set _ +_⇔ᵢ_ : Pred I a Pred I b Set _ A ⇔ᵢ B = {i} A i B i -_↩ᵢ_ : Pred I a Pred I b Set _ +_↩ᵢ_ : Pred I a Pred I b Set _ A ↩ᵢ B = {i} A i B i -_↪ᵢ_ : Pred I a Pred I b Set _ +_↪ᵢ_ : Pred I a Pred I b Set _ A ↪ᵢ B = {i} A i B i -_↩↪ᵢ_ : Pred I a Pred I b Set _ +_↩↪ᵢ_ : Pred I a Pred I b Set _ A ↩↪ᵢ B = {i} A i ↩↪ B i -_↔ᵢ_ : Pred I a Pred I b Set _ +_↔ᵢ_ : Pred I a Pred I b Set _ A ↔ᵢ B = {i} A i B i \ No newline at end of file diff --git a/master/Function.Metric.Definitions.html b/master/Function.Metric.Definitions.html index 12024db789..bd801bfa9f 100644 --- a/master/Function.Metric.Definitions.html +++ b/master/Function.Metric.Definitions.html @@ -16,7 +16,7 @@ open import Function.Metric.Core using (DistanceFunction) open import Level using (Level) open import Relation.Binary.Core using (Rel; _Preserves₂_⟶_⟶_) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) private variable @@ -58,8 +58,8 @@ ContractingOnOrbits _≤_ f d = x d (f x) (f (f x)) d x (f x) StrictlyContracting : Rel A ℓ₁ Rel I ℓ₂ (A A) DistanceFunction A I Set _ -StrictlyContracting _≈_ _<_ f d = {x y} ¬ (y x) d (f x) (f y) < d x y +StrictlyContracting _≈_ _<_ f d = {x y} ¬ (y x) d (f x) (f y) < d x y StrictlyContractingOnOrbits : Rel A ℓ₁ Rel I ℓ₂ (A A) DistanceFunction A I Set _ -StrictlyContractingOnOrbits _≈_ _<_ f d = {x} ¬ (f x x) d (f x) (f (f x)) < d x (f x) +StrictlyContractingOnOrbits _≈_ _<_ f d = {x} ¬ (f x x) d (f x) (f (f x)) < d x (f x) \ No newline at end of file diff --git a/master/Function.Nary.NonDependent.html b/master/Function.Nary.NonDependent.html index 39f2002485..962a864002 100644 --- a/master/Function.Nary.NonDependent.html +++ b/master/Function.Nary.NonDependent.html @@ -22,7 +22,7 @@ open import Data.Product.Nary.NonDependent using (Product; uncurryₙ; Equalₙ; curryₙ; fromEqualₙ; toEqualₙ) open import Function.Base using (_∘′_; _$′_; const; flip) -open import Relation.Unary using (IUniversal) +open import Relation.Unary using (IUniversal) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) @@ -47,7 +47,7 @@ lreplicate : n Level Levels n lreplicate n = ltabulate n (const ) -0ℓs : ∀[ Levels ] +0ℓs : ∀[ Levels ] 0ℓs = lreplicate _ 0ℓ ------------------------------------------------------------------------ diff --git a/master/Function.Properties.Bijection.html b/master/Function.Properties.Bijection.html index 7e34c8f113..bf5311222d 100644 --- a/master/Function.Properties.Bijection.html +++ b/master/Function.Properties.Bijection.html @@ -14,7 +14,7 @@ open import Level using (Level) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Trans) +open import Relation.Binary.Definitions using (Reflexive; Trans) open import Relation.Binary.PropositionalEquality.Properties using (setoid) open import Data.Product.Base using (_,_; proj₁; proj₂) open import Function.Base using (_∘_) @@ -34,7 +34,7 @@ ------------------------------------------------------------------------ -- Setoid properties -refl : Reflexive (Bijection {a} {}) +refl : Reflexive (Bijection {a} {}) refl = Identity.bijection _ -- Can't prove full symmetry as we have no proof that the witness @@ -42,7 +42,7 @@ sym-≡ : Bijection S (setoid B) Bijection (setoid B) S sym-≡ = Symmetry.bijection-≡ -trans : Trans (Bijection {a} {ℓ₁} {b} {ℓ₂}) (Bijection {b} {ℓ₂} {c} {ℓ₃}) Bijection +trans : Trans (Bijection {a} {ℓ₁} {b} {ℓ₂}) (Bijection {b} {ℓ₂} {c} {ℓ₃}) Bijection trans = Composition.bijection ------------------------------------------------------------------------ diff --git a/master/Function.Properties.Equivalence.html b/master/Function.Properties.Equivalence.html index f716406b1e..ac8257a16e 100644 --- a/master/Function.Properties.Equivalence.html +++ b/master/Function.Properties.Equivalence.html @@ -53,14 +53,14 @@ ------------------------------------------------------------------------ -- Setoid bundles -refl : Reflexive (Equivalence {a} {}) +refl : Reflexive (Equivalence {a} {}) refl {x = x} = Identity.equivalence x -sym : Sym (Equivalence {a} {ℓ₁} {b} {ℓ₂}) +sym : Sym (Equivalence {a} {ℓ₁} {b} {ℓ₂}) (Equivalence {b} {ℓ₂} {a} {ℓ₁}) sym = Symmetry.equivalence -trans : Trans (Equivalence {a} {ℓ₁} {b} {ℓ₂}) +trans : Trans (Equivalence {a} {ℓ₁} {b} {ℓ₂}) (Equivalence {b} {ℓ₂} {c} {ℓ₃}) (Equivalence {a} {ℓ₁} {c} {ℓ₃}) trans = Composition.equivalence diff --git a/master/Function.Properties.Injection.html b/master/Function.Properties.Injection.html index 3627707e88..6a297c41bb 100644 --- a/master/Function.Properties.Injection.html +++ b/master/Function.Properties.Injection.html @@ -45,10 +45,10 @@ ------------------------------------------------------------------------ -- Setoid properties -refl : Reflexive (Injection {a} {}) +refl : Reflexive (Injection {a} {}) refl {x = x} = Identity.injection x -trans : Trans (Injection {a} {ℓ₁} {b} {ℓ₂}) +trans : Trans (Injection {a} {ℓ₁} {b} {ℓ₂}) (Injection {b} {ℓ₂} {c} {ℓ₃}) (Injection {a} {ℓ₁} {c} {ℓ₃}) trans = Compose.injection diff --git a/master/Function.Properties.Surjection.html b/master/Function.Properties.Surjection.html index d882d85aa5..fe9f309ae9 100644 --- a/master/Function.Properties.Surjection.html +++ b/master/Function.Properties.Surjection.html @@ -18,7 +18,7 @@ open import Level using (Level) open import Data.Product.Base using (proj₁; proj₂) import Relation.Binary.PropositionalEquality.Core as -open import Relation.Binary.Definitions using (Reflexive; Trans) +open import Relation.Binary.Definitions using (Reflexive; Trans) open import Relation.Binary.Bundles using (Setoid) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning @@ -56,10 +56,10 @@ ------------------------------------------------------------------------ -- Setoid properties -refl : Reflexive (Surjection {a} {}) +refl : Reflexive (Surjection {a} {}) refl {x = x} = Identity.surjection x -trans : Trans (Surjection {a} {ℓ₁} {b} {ℓ₂}) +trans : Trans (Surjection {a} {ℓ₁} {b} {ℓ₂}) (Surjection {b} {ℓ₂} {c} {ℓ₃}) (Surjection {a} {ℓ₁} {c} {ℓ₃}) trans = Compose.surjection diff --git a/master/Function.Related.Propositional.html b/master/Function.Related.Propositional.html index 1ed54c1185..6df76722ac 100644 --- a/master/Function.Related.Propositional.html +++ b/master/Function.Related.Propositional.html @@ -11,7 +11,7 @@ open import Level open import Relation.Binary - using (Rel; REL; Sym; Reflexive; Trans; IsEquivalence; Setoid; IsPreorder; Preorder) + using (Rel; REL; Sym; Reflexive; Trans; IsEquivalence; Setoid; IsPreorder; Preorder) open import Function.Bundles open import Function.Base open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -242,7 +242,7 @@ -- For a fixed universe level every kind is a preorder and each -- symmetric kind is an equivalence -K-refl : Reflexive (Related {a} k) +K-refl : Reflexive (Related {a} k) K-refl {k = implication} = Identity.⟶-id _ K-refl {k = reverseImplication} = Identity.⟶-id _ K-refl {k = equivalence} = Identity.⇔-id _ @@ -255,7 +255,7 @@ K-reflexive : _≡_ Relation.Binary.⇒ Related {a} k K-reflexive ≡.refl = K-refl -K-trans : Trans (Related {a} {b} k) +K-trans : Trans (Related {a} {b} k) (Related {b} {c} k) (Related {a} {c} k) K-trans {k = implication} = flip Composition._⟶-∘_ @@ -267,7 +267,7 @@ K-trans {k = surjection} = flip Composition._↠-∘_ K-trans {k = bijection} = flip Composition._↔-∘_ -SK-sym : {k} Sym (Related {a} {b} k ) +SK-sym : {k} Sym (Related {a} {b} k ) (Related {b} {a} k ) SK-sym {k = equivalence} = reverse SK-sym {k = bijection} = reverse diff --git a/master/Function.Related.TypeIsomorphisms.html b/master/Function.Related.TypeIsomorphisms.html index 396997dc0e..d02d1137d9 100644 --- a/master/Function.Related.TypeIsomorphisms.html +++ b/master/Function.Related.TypeIsomorphisms.html @@ -31,10 +31,10 @@ open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) open import Relation.Binary.PropositionalEquality.Properties using (module ≡-Reasoning) -open import Relation.Nullary.Reflects using (invert) -open import Relation.Nullary using (Dec; ¬_; _because_; ofⁿ; contradiction) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Nullary using (Dec; ¬_; _because_; ofⁿ; contradiction) import Relation.Nullary.Indexed as I -open import Relation.Nullary.Decidable using (True) +open import Relation.Nullary.Decidable using (True) private variable @@ -297,12 +297,12 @@ ------------------------------------------------------------------------ -- ¬_ (at Level 0) preserves the symmetric relations -¬-cong-⇔ : A B (¬ A) (¬ B) +¬-cong-⇔ : A B (¬ A) (¬ B) ¬-cong-⇔ A⇔B = →-cong-⇔ A⇔B (Identity.⇔-id _) ¬-cong : Extensionality a 0ℓ Extensionality b 0ℓ {k} {A : Set a} {B : Set b} - A ∼[ k ] B (¬ A) ∼[ k ] (¬ B) + A ∼[ k ] B (¬ A) ∼[ k ] (¬ B) ¬-cong extA extB A≈B = →-cong extA extB A≈B (K-reflexive refl) ------------------------------------------------------------------------ @@ -328,9 +328,9 @@ -- A lemma relating True dec and P, where dec : Dec P True↔ : {p} {P : Set p} - (dec : Dec P) ((p₁ p₂ : P) p₁ p₂) True dec P -True↔ ( true because [p]) irr = - mk↔ₛ′ _ invert [p]) _ _) (irr _) _ refl) -True↔ (false because ofⁿ ¬p) _ = - mk↔ₛ′ (λ()) (invert (ofⁿ ¬p)) x flip contradiction ¬p x) ()) + (dec : Dec P) ((p₁ p₂ : P) p₁ p₂) True dec P +True↔ ( true because [p]) irr = + mk↔ₛ′ _ invert [p]) _ _) (irr _) _ refl) +True↔ (false because ofⁿ ¬p) _ = + mk↔ₛ′ (λ()) (invert (ofⁿ ¬p)) x flip contradiction ¬p x) ()) \ No newline at end of file diff --git a/master/Function.Relation.Binary.Setoid.Equality.html b/master/Function.Relation.Binary.Setoid.Equality.html index 5870cd3548..f06af60879 100644 --- a/master/Function.Relation.Binary.Setoid.Equality.html +++ b/master/Function.Relation.Binary.Setoid.Equality.html @@ -15,7 +15,7 @@ open import Function.Bundles using (Func; _⟨$⟩_) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.Structures using (IsEquivalence) @@ -27,13 +27,13 @@ _≈_ : (f g : Func From To) Set (a₁ b₂) f g = {x : From.Carrier} f ⟨$⟩ x To.≈ g ⟨$⟩ x -refl : Reflexive _≈_ +refl : Reflexive _≈_ refl = To.refl -sym : Symmetric _≈_ +sym : Symmetric _≈_ sym = λ f≈g To.sym f≈g -trans : Transitive _≈_ +trans : Transitive _≈_ trans = λ f≈g g≈h To.trans f≈g g≈h isEquivalence : IsEquivalence _≈_ diff --git a/master/Induction.InfiniteDescent.html b/master/Induction.InfiniteDescent.html index 7aa0e28620..7e060c7aed 100644 --- a/master/Induction.InfiniteDescent.html +++ b/master/Induction.InfiniteDescent.html @@ -21,9 +21,9 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Construct.Closure.Transitive open import Relation.Binary.PropositionalEquality.Core -open import Relation.Nullary.Negation.Core as Negation using (¬_) +open import Relation.Nullary.Negation.Core as Negation using (¬_) open import Relation.Unary - using (Pred; ; _∩_; _⊆_; _⇒_; Universal; IUniversal; Stable; Empty) + using (Pred; ; _∩_; _⊆_; _⇒_; Universal; IUniversal; Stable; Empty) private variable @@ -31,7 +31,7 @@ A : Set a f : A _<_ : Rel A r - P : Pred A + P : Pred A ------------------------------------------------------------------------ -- Definitions @@ -39,35 +39,35 @@ InfiniteDescendingSequence : Rel A r ( A) Set _ InfiniteDescendingSequence _<_ f = n f (suc n) < f n -InfiniteDescendingSequenceFrom : Rel A r ( A) Pred A _ +InfiniteDescendingSequenceFrom : Rel A r ( A) Pred A _ InfiniteDescendingSequenceFrom _<_ f x = f zero x × InfiniteDescendingSequence _<_ f InfiniteDescendingSequence⁺ : Rel A r ( A) Set _ InfiniteDescendingSequence⁺ _<_ f = {m n} m ℕ.< n TransClosure _<_ (f n) (f m) -InfiniteDescendingSequenceFrom⁺ : Rel A r ( A) Pred A _ +InfiniteDescendingSequenceFrom⁺ : Rel A r ( A) Pred A _ InfiniteDescendingSequenceFrom⁺ _<_ f x = f zero x × InfiniteDescendingSequence⁺ _<_ f -DescentFrom : Rel A r Pred A Pred A _ +DescentFrom : Rel A r Pred A Pred A _ DescentFrom _<_ P x = P x ∃[ y ] y < x × P y -Descent : Rel A r Pred A Set _ +Descent : Rel A r Pred A Set _ Descent _<_ P = {x} DescentFrom _<_ P x -InfiniteDescentFrom : Rel A r Pred A Pred A _ +InfiniteDescentFrom : Rel A r Pred A Pred A _ InfiniteDescentFrom _<_ P x = P x ∃[ f ] InfiniteDescendingSequenceFrom _<_ f x × n P (f n) -InfiniteDescent : Rel A r Pred A Set _ +InfiniteDescent : Rel A r Pred A Set _ InfiniteDescent _<_ P = {x} InfiniteDescentFrom _<_ P x -InfiniteDescentFrom⁺ : Rel A r Pred A Pred A _ +InfiniteDescentFrom⁺ : Rel A r Pred A Pred A _ InfiniteDescentFrom⁺ _<_ P x = P x ∃[ f ] InfiniteDescendingSequenceFrom⁺ _<_ f x × n P (f n) -InfiniteDescent⁺ : Rel A r Pred A Set _ +InfiniteDescent⁺ : Rel A r Pred A Set _ InfiniteDescent⁺ _<_ P = {x} InfiniteDescentFrom⁺ _<_ P x -NoSmallestCounterExample : Rel A r Pred A Set _ -NoSmallestCounterExample _<_ P = {x} Acc _<_ x DescentFrom (TransClosure _<_) ( P) x +NoSmallestCounterExample : Rel A r Pred A Set _ +NoSmallestCounterExample _<_ P = {x} Acc _<_ x DescentFrom (TransClosure _<_) ( P) x ------------------------------------------------------------------------ -- We can swap between transitively closed and non-transitively closed @@ -90,7 +90,7 @@ module _ (descent : Descent _<_ P) where - descent∧acc⇒infiniteDescentFrom : (Acc _<_) (InfiniteDescentFrom _<_ P) + descent∧acc⇒infiniteDescentFrom : (Acc _<_) (InfiniteDescentFrom _<_ P) descent∧acc⇒infiniteDescentFrom {x} = Some.wfRec (InfiniteDescentFrom _<_ P) rec x where @@ -118,27 +118,27 @@ descent∧wf⇒infiniteDescent : WellFounded _<_ InfiniteDescent _<_ P descent∧wf⇒infiniteDescent wf = descent∧acc⇒infiniteDescentFrom (wf _) - descent∧acc⇒unsatisfiable : Acc _<_ P - descent∧acc⇒unsatisfiable {x} = Some.wfRec ( P) rec x + descent∧acc⇒unsatisfiable : Acc _<_ P + descent∧acc⇒unsatisfiable {x} = Some.wfRec ( P) rec x where rec : _ rec y rec[y] py = let z , z<y , pz = descent py in rec[y] z<y pz - descent∧wf⇒empty : WellFounded _<_ Empty P + descent∧wf⇒empty : WellFounded _<_ Empty P descent∧wf⇒empty wf x = descent∧acc⇒unsatisfiable (wf x) ------------------------------------------------------------------------ -- Results about descent only from accessible elements -module _ (accDescent : Acc _<_ DescentFrom _<_ P) where +module _ (accDescent : Acc _<_ DescentFrom _<_ P) where private - descent∩ : Descent _<_ (P Acc _<_) + descent∩ : Descent _<_ (P Acc _<_) descent∩ (px , acc[x]) = let y , y<x , py = accDescent acc[x] px in y , y<x , py , acc-inverse acc[x] y<x - accDescent∧acc⇒infiniteDescentFrom : Acc _<_ InfiniteDescentFrom _<_ P + accDescent∧acc⇒infiniteDescentFrom : Acc _<_ InfiniteDescentFrom _<_ P accDescent∧acc⇒infiniteDescentFrom acc[x] px = let f , sequence[f] , Π[[P∩Acc]∘f] = descent∧acc⇒infiniteDescentFrom descent∩ acc[x] (px , acc[x]) in f , sequence[f] , proj₁ Π[[P∩Acc]∘f] @@ -146,22 +146,22 @@ accDescent∧wf⇒infiniteDescent : WellFounded _<_ InfiniteDescent _<_ P accDescent∧wf⇒infiniteDescent wf = accDescent∧acc⇒infiniteDescentFrom (wf _) - accDescent∧acc⇒unsatisfiable : Acc _<_ P + accDescent∧acc⇒unsatisfiable : Acc _<_ P accDescent∧acc⇒unsatisfiable acc[x] px = descent∧acc⇒unsatisfiable descent∩ acc[x] (px , acc[x]) - wf⇒empty : WellFounded _<_ Empty P + wf⇒empty : WellFounded _<_ Empty P wf⇒empty wf x = accDescent∧acc⇒unsatisfiable (wf x) ------------------------------------------------------------------------ -- Results about transitively-closed descent only from accessible elements -module _ (accDescent⁺ : Acc _<_ DescentFrom (TransClosure _<_) P) where +module _ (accDescent⁺ : Acc _<_ DescentFrom (TransClosure _<_) P) where private - descent : Acc (TransClosure _<_) DescentFrom (TransClosure _<_) P + descent : Acc (TransClosure _<_) DescentFrom (TransClosure _<_) P descent = accDescent⁺ accessible⁻ _ - accDescent⁺∧acc⇒infiniteDescentFrom⁺ : Acc _<_ InfiniteDescentFrom⁺ _<_ P + accDescent⁺∧acc⇒infiniteDescentFrom⁺ : Acc _<_ InfiniteDescentFrom⁺ _<_ P accDescent⁺∧acc⇒infiniteDescentFrom⁺ acc[x] px with f , (f0≡x , sequence[f]) , Π[P∘f]accDescent∧acc⇒infiniteDescentFrom descent (accessible _ acc[x]) px @@ -170,22 +170,22 @@ accDescent⁺∧wf⇒infiniteDescent⁺ : WellFounded _<_ InfiniteDescent⁺ _<_ P accDescent⁺∧wf⇒infiniteDescent⁺ wf = accDescent⁺∧acc⇒infiniteDescentFrom⁺ (wf _) - accDescent⁺∧acc⇒unsatisfiable : Acc _<_ P + accDescent⁺∧acc⇒unsatisfiable : Acc _<_ P accDescent⁺∧acc⇒unsatisfiable = accDescent∧acc⇒unsatisfiable descent accessible _ - accDescent⁺∧wf⇒empty : WellFounded _<_ Empty P + accDescent⁺∧wf⇒empty : WellFounded _<_ Empty P accDescent⁺∧wf⇒empty = wf⇒empty descent (wellFounded _) ------------------------------------------------------------------------ -- Finally: the (classical) no smallest counterexample principle itself -module _ (stable : Stable P) (noSmallest : NoSmallestCounterExample _<_ P) where +module _ (stable : Stable P) (noSmallest : NoSmallestCounterExample _<_ P) where - noSmallestCounterExample∧acc⇒satisfiable : Acc _<_ P + noSmallestCounterExample∧acc⇒satisfiable : Acc _<_ P noSmallestCounterExample∧acc⇒satisfiable = stable _ accDescent⁺∧acc⇒unsatisfiable noSmallest - noSmallestCounterExample∧wf⇒universal : WellFounded _<_ Universal P + noSmallestCounterExample∧wf⇒universal : WellFounded _<_ Universal P noSmallestCounterExample∧wf⇒universal wf = stable _ accDescent⁺∧wf⇒empty noSmallest wf \ No newline at end of file diff --git a/master/Induction.WellFounded.html b/master/Induction.WellFounded.html index c5b89b9700..15dae34349 100644 --- a/master/Induction.WellFounded.html +++ b/master/Induction.WellFounded.html @@ -15,12 +15,12 @@ open import Level using (Level; _⊔_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Definitions - using (Symmetric; Asymmetric; Irreflexive; _Respects₂_; - _Respectsʳ_; _Respects_) + using (Symmetric; Asymmetric; Irreflexive; _Respects₂_; + _Respectsʳ_; _Respects_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) open import Relation.Binary.Consequences using (asym⇒irr) open import Relation.Unary -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) private variable @@ -60,10 +60,10 @@ module _ {_≈_ : Rel A ℓ₁} {_<_ : Rel A ℓ₂} where - Acc-resp-flip-≈ : _<_ Respectsʳ (flip _≈_) (Acc _<_) Respects _≈_ + Acc-resp-flip-≈ : _<_ Respectsʳ (flip _≈_) (Acc _<_) Respects _≈_ Acc-resp-flip-≈ respʳ x≈y (acc rec) = acc λ z<y rec (respʳ x≈y z<y) - Acc-resp-≈ : Symmetric _≈_ _<_ Respectsʳ _≈_ (Acc _<_) Respects _≈_ + Acc-resp-≈ : Symmetric _≈_ _<_ Respectsʳ _≈_ (Acc _<_) Respects _≈_ Acc-resp-≈ sym respʳ x≈y wf = Acc-resp-flip-≈ (respʳ sym) x≈y wf ------------------------------------------------------------------------ @@ -77,7 +77,7 @@ wfRec : SubsetRecursor (Acc _<_) (WfRec _<_) wfRec = subsetBuild wfRecBuilder - unfold-wfRec : (P : Pred A ) (f : WfRec _<_ P ⊆′ P) {x : A} (q : Acc _<_ x) + unfold-wfRec : (P : Pred A ) (f : WfRec _<_ P ⊆′ P) {x : A} (q : Acc _<_ x) wfRec P f x q f x λ y<x wfRec P f _ (acc-inverse q y<x) unfold-wfRec P f (acc rs) = refl @@ -98,13 +98,13 @@ module FixPoint {_<_ : Rel A r} (wf : WellFounded _<_) - (P : Pred A ) (f : WfRec _<_ P ⊆′ P) + (P : Pred A ) (f : WfRec _<_ P ⊆′ P) (f-ext : (x : A) {IH IH′ : WfRec _<_ P x} (∀ {y} y<x IH {y} y<x IH′ y<x) f x IH f x IH′) where - some-wfrec-Irrelevant : Pred A _ + some-wfrec-Irrelevant : Pred A _ some-wfrec-Irrelevant x = q q′ Some.wfRec P f x q Some.wfRec P f x q′ some-wfRec-irrelevant : x some-wfrec-Irrelevant x @@ -124,15 +124,15 @@ -- Well-founded relations are asymmetric and irreflexive. module _ {_<_ : Rel A r} where - acc⇒asym : {x y} Acc _<_ x x < y ¬ (y < x) + acc⇒asym : {x y} Acc _<_ x x < y ¬ (y < x) acc⇒asym {x} hx = - Some.wfRec x {y} x < y ¬ (y < x)) _ hx x<y y<x hx y<x y<x x<y) _ hx + Some.wfRec x {y} x < y ¬ (y < x)) _ hx x<y y<x hx y<x y<x x<y) _ hx - wf⇒asym : WellFounded _<_ Asymmetric _<_ + wf⇒asym : WellFounded _<_ Asymmetric _<_ wf⇒asym wf = acc⇒asym (wf _) - wf⇒irrefl : {_≈_ : Rel A } _<_ Respects₂ _≈_ - Symmetric _≈_ WellFounded _<_ Irreflexive _≈_ _<_ + wf⇒irrefl : {_≈_ : Rel A } _<_ Respects₂ _≈_ + Symmetric _≈_ WellFounded _<_ Irreflexive _≈_ _<_ wf⇒irrefl r s wf = asym⇒irr r s (wf⇒asym wf) ------------------------------------------------------------------------ @@ -144,7 +144,7 @@ module Subrelation {_<₁_ : Rel A ℓ₁} {_<₂_ : Rel A ℓ₂} (<₁⇒<₂ : {x y} x <₁ y x <₂ y) where - accessible : Acc _<₂_ Acc _<₁_ + accessible : Acc _<₂_ Acc _<₁_ accessible (acc rs) = acc λ y<x accessible (rs (<₁⇒<₂ y<x)) wellFounded : WellFounded _<₂_ WellFounded _<₁_ diff --git a/master/Induction.html b/master/Induction.html index 7049182630..5df85b356d 100644 --- a/master/Induction.html +++ b/master/Induction.html @@ -24,7 +24,7 @@ variable a ℓ₁ ℓ₂ : Level A : Set a - Q : Pred A + Q : Pred A Rec : PT A A ℓ₁ ℓ₂ @@ -40,12 +40,12 @@ -- for a given input. RecursorBuilder : RecStruct A ℓ₁ ℓ₂ Set _ -RecursorBuilder Rec = P Rec P ⊆′ P Universal (Rec P) +RecursorBuilder Rec = P Rec P ⊆′ P Universal (Rec P) -- A recursor can be used to actually compute/prove something useful. Recursor : RecStruct A ℓ₁ ℓ₂ Set _ -Recursor Rec = P Rec P ⊆′ P Universal P +Recursor Rec = P Rec P ⊆′ P Universal P -- And recursors can be constructed from recursor builders. @@ -55,11 +55,11 @@ -- We can repeat the exercise above for subsets of the type we are -- recursing over. -SubsetRecursorBuilder : Pred A RecStruct A ℓ₁ ℓ₂ Set _ -SubsetRecursorBuilder Q Rec = P Rec P ⊆′ P Q ⊆′ Rec P +SubsetRecursorBuilder : Pred A RecStruct A ℓ₁ ℓ₂ Set _ +SubsetRecursorBuilder Q Rec = P Rec P ⊆′ P Q ⊆′ Rec P -SubsetRecursor : Pred A RecStruct A ℓ₁ ℓ₂ Set _ -SubsetRecursor Q Rec = P Rec P ⊆′ P Q ⊆′ P +SubsetRecursor : Pred A RecStruct A ℓ₁ ℓ₂ Set _ +SubsetRecursor Q Rec = P Rec P ⊆′ P Q ⊆′ P subsetBuild : SubsetRecursorBuilder Q Rec SubsetRecursor Q Rec subsetBuild builder P f x q = f x (builder P f x q) diff --git a/master/README.Axiom.html b/master/README.Axiom.html index 8714d8d966..d91e247797 100644 --- a/master/README.Axiom.html +++ b/master/README.Axiom.html @@ -32,7 +32,7 @@ -- The types for which `P` or `¬P` holds is called `Dec P` in the -- standard library (short for `Decidable`). -open import Relation.Nullary.Decidable using (Dec) +open import Relation.Nullary.Decidable using (Dec) -- The type of the proof of saying that excluded middle holds for -- all types at universe level ℓ is therefore: diff --git a/master/README.Data.List.Relation.Binary.Pointwise.html b/master/README.Data.List.Relation.Binary.Pointwise.html index 5aed9d1f92..96f85e2945 100644 --- a/master/README.Data.List.Relation.Binary.Pointwise.html +++ b/master/README.Data.List.Relation.Binary.Pointwise.html @@ -11,7 +11,7 @@ open import Data.List.Base using (List; []; _∷_; length) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; cong; setoid) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) ------------------------------------------------------------------------ -- Pointwise @@ -43,7 +43,7 @@ -- Lists that are related by `Pointwise` must be of the same length. -- For example: -lem₂ : ¬ Pointwise _<_ (0 2 []) (1 []) +lem₂ : ¬ Pointwise _<_ (0 2 []) (1 []) lem₂ (0<1 ()) -- Proofs about pointwise, including that of the above fact are diff --git a/master/README.Data.List.Relation.Ternary.Interleaving.html b/master/README.Data.List.Relation.Ternary.Interleaving.html index e33d4750a3..d9fdf0db81 100644 --- a/master/README.Data.List.Relation.Ternary.Interleaving.html +++ b/master/README.Data.List.Relation.Ternary.Interleaving.html @@ -48,7 +48,7 @@ -- We can make this formal by defining the following record type: infix 3 _≡_⊎_ -record Filter {a p} {A : Set a} (P : Pred A p) (xs : List A) : Set (a p) where +record Filter {a p} {A : Set a} (P : Pred A p) (xs : List A) : Set (a p) where constructor _≡_⊎_ field -- The result of running filter is two lists: @@ -62,12 +62,12 @@ cover : Interleaving kept thrown xs -- Finally, the partition was made according to the predicate allP : All P kept - all¬P : All ( P) thrown + all¬P : All ( P) thrown -- Once we have this type written down, we can write the function. -- We use an anonymous module to clean up the function's type. -module _ {a p} {A : Set a} {P : Pred A p} (P? : Decidable P) where +module _ {a p} {A : Set a} {P : Pred A p} (P? : Decidable P) where filter : xs Filter P xs -- If the list is empty, we are done. @@ -78,8 +78,8 @@ -- And depending on whether `P` holds of the head, -- we cons it to the `kept` or `thrown` list. case P? x of λ where -- [1] - (yes p) consˡ xs′ p ps ¬ps - (no ¬p) consʳ xs′ ps ¬p ¬ps + (yes p) consˡ xs′ p ps ¬ps + (no ¬p) consʳ xs′ ps ¬p ¬ps diff --git a/master/README.Data.Record.html b/master/README.Data.Record.html index 7ebfbc721a..d2e23c7155 100644 --- a/master/README.Data.Record.html +++ b/master/README.Data.Record.html @@ -16,7 +16,7 @@ open import Data.String open import Function.Base using (flip) open import Level -open import Relation.Binary.Definitions using (Symmetric; Transitive) +open import Relation.Binary.Definitions using (Symmetric; Transitive) import Data.Record as Record @@ -29,8 +29,8 @@ PER : Signature _ PER = , "S" _ Set) , "R" r r · "S" r · "S" Set) - , "sym" r Lift _ (Symmetric (r · "R"))) - , "trans" r Lift _ (Transitive (r · "R"))) + , "sym" r Lift _ (Symmetric (r · "R"))) + , "trans" r Lift _ (Transitive (r · "R"))) -- Given a PER the converse relation is also a PER. diff --git a/master/README.Data.Trie.NonDependent.html b/master/README.Data.Trie.NonDependent.html index 904b961aa5..1ac0dd2c65 100644 --- a/master/README.Data.Trie.NonDependent.html +++ b/master/README.Data.Trie.NonDependent.html @@ -65,7 +65,7 @@ open import Function.Base using (case_of_; _$_; _∘′_; id; _on_) open import Relation.Nary open import Relation.Binary.Core using (Rel) -open import Relation.Nullary.Decidable using (¬?) +open import Relation.Nullary.Decidable using (¬?) open import Data.Trie Char.<-strictTotalOrder open import Data.Tree.AVL.Value @@ -84,7 +84,7 @@ -- Two keywords are considered distinct if the strings are not equal Distinct : Rel Keyword 0ℓ - Distinct a b = ¬? ((proj₁ a) String.≟ (proj₁ b)) + Distinct a b = ¬? ((proj₁ a) String.≟ (proj₁ b)) field @@ -176,7 +176,7 @@ LPAR RPAR : TOK ID : String TOK - keywords : List# (String × TOK) a b ¬? ((proj₁ a) String.≟ (proj₁ b)) ) + keywords : List# (String × TOK) a b ¬? ((proj₁ a) String.≟ (proj₁ b)) ) keywords = ("let" , LET) ∷# ("=" , EQ) ∷# ("in" , IN) diff --git a/master/README.Design.Decidability.html b/master/README.Design.Decidability.html index 59a22cbd20..8514e96f1d 100644 --- a/master/README.Design.Decidability.html +++ b/master/README.Design.Decidability.html @@ -31,15 +31,15 @@ -- the boolean `b`. A proof of `Reflects P true` amounts to a proof of `P`, and -- a proof of `Reflects P false` amounts to a refutation of `P`. -ex₀ : (n : ) Reflects (n n) true -ex₀ n = ofʸ refl +ex₀ : (n : ) Reflects (n n) true +ex₀ n = ofʸ refl -ex₁ : (n : ) Reflects (zero suc n) false -ex₁ n = ofⁿ λ () +ex₁ : (n : ) Reflects (zero suc n) false +ex₁ n = ofⁿ λ () -ex₂ : (b : Bool) Reflects (T b) b -ex₂ false = ofⁿ id -ex₂ true = ofʸ tt +ex₂ : (b : Bool) Reflects (T b) b +ex₂ false = ofⁿ id +ex₂ true = ofʸ tt ------------------------------------------------------------------------ -- Dec @@ -51,27 +51,27 @@ -- does : Bool -- proof : Reflects P does -ex₃ : (b : Bool) Dec (T b) -does (ex₃ b) = b -proof (ex₃ b) = ex₂ b +ex₃ : (b : Bool) Dec (T b) +does (ex₃ b) = b +proof (ex₃ b) = ex₂ b -- We also have pattern synonyms `yes` and `no`, allowing both fields to be -- given at once. -ex₄ : (n : ) Dec (zero suc n) -ex₄ n = no λ () +ex₄ : (n : ) Dec (zero suc n) +ex₄ n = no λ () -- It is possible, but not ideal, to define recursive decision procedures using -- only the `yes` and `no` patterns. The following procedure decides whether two -- given natural numbers are equal. -_≟₀_ : (m n : ) Dec (m n) -zero ≟₀ zero = yes refl -zero ≟₀ suc n = no λ () -suc m ≟₀ zero = no λ () +_≟₀_ : (m n : ) Dec (m n) +zero ≟₀ zero = yes refl +zero ≟₀ suc n = no λ () +suc m ≟₀ zero = no λ () suc m ≟₀ suc n with m ≟₀ n -... | yes p = yes (cong suc p) -... | no ¬p = no (¬p suc-injective) +... | yes p = yes (cong suc p) +... | no ¬p = no (¬p suc-injective) -- In this case, we can see that `does (suc m ≟ suc n)` should be equal to -- `does (m ≟ n)`, because a `yes` from `m ≟ n` gives rise to a `yes` from the @@ -80,44 +80,44 @@ -- before returning a result. To avoid this, we can return the `does` part -- separately, before any pattern matching. -_≟₁_ : (m n : ) Dec (m n) -zero ≟₁ zero = yes refl -zero ≟₁ suc n = no λ () -suc m ≟₁ zero = no λ () -does (suc m ≟₁ suc n) = does (m ≟₁ n) -proof (suc m ≟₁ suc n) with m ≟₁ n -... | yes p = ofʸ (cong suc p) -... | no ¬p = ofⁿ (¬p suc-injective) +_≟₁_ : (m n : ) Dec (m n) +zero ≟₁ zero = yes refl +zero ≟₁ suc n = no λ () +suc m ≟₁ zero = no λ () +does (suc m ≟₁ suc n) = does (m ≟₁ n) +proof (suc m ≟₁ suc n) with m ≟₁ n +... | yes p = ofʸ (cong suc p) +... | no ¬p = ofⁿ (¬p suc-injective) -- We now get definitional equalities such as the following. -_ : (m n : ) does (5 + m ≟₁ 3 + n) does (2 + m ≟₁ n) +_ : (m n : ) does (5 + m ≟₁ 3 + n) does (2 + m ≟₁ n) _ = λ m n refl -- Even better, from a maintainability point of view, is to use `map` or `map′`, -- both of which capture the pattern of the `does` field remaining the same, but -- the `proof` field being updated. -_≟₂_ : (m n : ) Dec (m n) -zero ≟₂ zero = yes refl -zero ≟₂ suc n = no λ () -suc m ≟₂ zero = no λ () -suc m ≟₂ suc n = map′ (cong suc) suc-injective (m ≟₂ n) +_≟₂_ : (m n : ) Dec (m n) +zero ≟₂ zero = yes refl +zero ≟₂ suc n = no λ () +suc m ≟₂ zero = no λ () +suc m ≟₂ suc n = map′ (cong suc) suc-injective (m ≟₂ n) -_ : (m n : ) does (5 + m ≟₂ 3 + n) does (2 + m ≟₂ n) +_ : (m n : ) does (5 + m ≟₂ 3 + n) does (2 + m ≟₂ n) _ = λ m n refl -- `map′` can be used in conjunction with combinators such as `_⊎-dec_` and -- `_×-dec_` to build complex (simply typed) decision procedures. -module ListDecEq₀ {a} {A : Set a} (_≟ᴬ_ : (x y : A) Dec (x y)) where +module ListDecEq₀ {a} {A : Set a} (_≟ᴬ_ : (x y : A) Dec (x y)) where - _≟ᴸᴬ_ : (xs ys : List A) Dec (xs ys) - [] ≟ᴸᴬ [] = yes refl - [] ≟ᴸᴬ (y ys) = no λ () - (x xs) ≟ᴸᴬ [] = no λ () + _≟ᴸᴬ_ : (xs ys : List A) Dec (xs ys) + [] ≟ᴸᴬ [] = yes refl + [] ≟ᴸᴬ (y ys) = no λ () + (x xs) ≟ᴸᴬ [] = no λ () (x xs) ≟ᴸᴬ (y ys) = - map′ (uncurry (cong₂ _∷_)) ∷-injective (x ≟ᴬ y ×-dec xs ≟ᴸᴬ ys) + map′ (uncurry (cong₂ _∷_)) ∷-injective (x ≟ᴬ y ×-dec xs ≟ᴸᴬ ys) -- The final case says that `x ∷ xs ≡ y ∷ ys` exactly when `x ≡ y` *and* -- `xs ≡ ys`. The proofs are updated by the first two arguments to `map′`. @@ -126,11 +126,11 @@ -- `map′ (congₙ c) c-injective (x₀ ≟ y₀ ×-dec ... ×-dec xₙ₋₁ ≟ yₙ₋₁)` -- is captured by `≟-mapₙ n c c-injective (x₀ ≟ y₀) ... (xₙ₋₁ ≟ yₙ₋₁)`. -module ListDecEq₁ {a} {A : Set a} (_≟ᴬ_ : (x y : A) Dec (x y)) where +module ListDecEq₁ {a} {A : Set a} (_≟ᴬ_ : (x y : A) Dec (x y)) where - _≟ᴸᴬ_ : (xs ys : List A) Dec (xs ys) - [] ≟ᴸᴬ [] = yes refl - [] ≟ᴸᴬ (y ys) = no λ () - (x xs) ≟ᴸᴬ [] = no λ () + _≟ᴸᴬ_ : (xs ys : List A) Dec (xs ys) + [] ≟ᴸᴬ [] = yes refl + [] ≟ᴸᴬ (y ys) = no λ () + (x xs) ≟ᴸᴬ [] = no λ () (x xs) ≟ᴸᴬ (y ys) = ≟-mapₙ 2 _∷_ ∷-injective (x ≟ᴬ y) (xs ≟ᴸᴬ ys) \ No newline at end of file diff --git a/master/README.Foreign.Haskell.html b/master/README.Foreign.Haskell.html index c6a4ea45e1..47da313b1d 100644 --- a/master/README.Foreign.Haskell.html +++ b/master/README.Foreign.Haskell.html @@ -98,7 +98,7 @@ nothing putStrLn "I cannot believe this file is filed with dashes only!" (just (c , cs)) putStrLn $ unlines $ ("First (non dash) character: " ++ Char.show c) - ("Rest (dash free) of the line: " ++ fromList (takeWhile (¬? ('\n' ≟_)) cs)) + ("Rest (dash free) of the line: " ++ fromList (takeWhile (¬? ('\n' ≟_)) cs)) [] -- You can compile and run this test by writing: diff --git a/master/README.Nary.html b/master/README.Nary.html index 34e8ab808d..2f4eb58beb 100644 --- a/master/README.Nary.html +++ b/master/README.Nary.html @@ -20,7 +20,7 @@ open import Data.Sum.Base using (inj₁; inj₂) open import Function.Base using (id; flip; _∘′_) open import Relation.Nullary -open import Relation.Binary.Definitions using (module Tri); open Tri +open import Relation.Binary.Definitions using (module Tri); open Tri open import Relation.Binary.PropositionalEquality private @@ -338,14 +338,14 @@ -- ∀[_] : (A₁ → ⋯ → Aₙ → Set r) → Set _ -- ∀[_] P = ∀ {a₁} → ⋯ → ∀ {aₙ} → P a₁ ⋯ aₙ -all₁ : ∀[ (a₁ a₂ : ) Dec (a₁ a₂)) ] +all₁ : ∀[ (a₁ a₂ : ) Dec (a₁ a₂)) ] all₁ {a₁} {a₂} = a₁ a₂ ------------------------------------------------------------------------ -- Π : (A₁ → ⋯ → Aₙ → Set r) → Set _ -- Π P = ∀ a₁ → ⋯ → ∀ aₙ → P a₁ ⋯ aₙ -all₂ : Π[ (a₁ a₂ : ) Dec (a₁ a₂)) ] +all₂ : Π[ (a₁ a₂ : ) Dec (a₁ a₂)) ] all₂ = _≟_ ------------------------------------------------------------------------ @@ -361,9 +361,9 @@ ≤->-connex : Π[ _≤_ _>_ ] ≤->-connex m n with <-cmp m n -... | tri< a ¬b ¬c = inj₁ (<⇒≤ a) -... | tri≈ ¬a b ¬c = inj₁ (≤-reflexive b) -... | tri> ¬a ¬b c = inj₂ c +... | tri< a ¬b ¬c = inj₁ (<⇒≤ a) +... | tri≈ ¬a b ¬c = inj₁ (≤-reflexive b) +... | tri> ¬a ¬b c = inj₂ c ------------------------------------------------------------------------ -- _∩_ : (A₁ → ⋯ → Aₙ → Set r) → (A₁ → ⋯ → Aₙ → Set s) → (A₁ → ⋯ → Aₙ → Set _) diff --git a/master/README.Text.Regex.html b/master/README.Text.Regex.html index 345c57ea98..83c00b6c4c 100644 --- a/master/README.Text.Regex.html +++ b/master/README.Text.Regex.html @@ -13,8 +13,8 @@ open import Data.List.Base using (_∷_; []) open import Data.String open import Function.Base using () renaming (_$′_ to _$_) -open import Relation.Nullary.Decidable using (yes) -open import Relation.Nullary.Decidable using (True; False; from-yes) +open import Relation.Nullary.Decidable using (yes) +open import Relation.Nullary.Decidable using (True; False; from-yes) -- Our library available via the Text.Regex module is safe but it works on -- lists of characters. @@ -61,27 +61,27 @@ -- We can run it on a few examples to check that it matches our intuition: -- Valid: starts with a non-zero digit, followed by 3 digits -_ : True ("1848" ∈? ℕ*) +_ : True ("1848" ∈? ℕ*) _ = _ -- Valid: exactly 0 -_ : True ("0" ∈? ) +_ : True ("0" ∈? ) _ = _ -- Invalid: starts with a leading 0 -_ : False ("007" ∈? ) +_ : False ("007" ∈? ) _ = _ -- Invalid: no negative ℕ number -_ : False ("-666" ∈? ) +_ : False ("-666" ∈? ) _ = _ -- Valid: a negative integer -_ : True ("-666" ∈? ) +_ : True ("-666" ∈? ) _ = _ -- Invalid: no negative 0 -_ : False ("-0" ∈? ) +_ : False ("-0" ∈? ) _ = _ ------------------------------------------------------------------------ @@ -114,7 +114,7 @@ -- The search function gives us the ability to look for matches -- Valid: agda in the middle -_ : True (search "Maria Magdalena" infixAgda) +_ : True (search "Maria Magdalena" infixAgda) _ = _ -- By changing the value of fromStart and tillEnd we can control where the @@ -129,15 +129,15 @@ } -- Invalid: agda is in the middle -_ : False (search "Maria Magdalena" suffixAgda) +_ : False (search "Maria Magdalena" suffixAgda) _ = _ -- Valid: agda as a suffix -_ : True (search "README.agda" suffixAgda) +_ : True (search "README.agda" suffixAgda) _ = _ -- Valid: agdai as a suffix -_ : True (search "README.agdai" suffixAgda) +_ : True (search "README.agdai" suffixAgda) _ = _ @@ -159,7 +159,7 @@ mariamAGDAlena : Match "Maria Magdalena" infixAgda mariamAGDAlena = record { string = "agda" -- we have found "agda" - ; match = from-yes ("agda" ∈? agda) -- a proof of the match + ; match = from-yes ("agda" ∈? agda) -- a proof of the match ; related = proof -- and its location } @@ -172,6 +172,6 @@ -- And here is the proof that search returns such an object -_ : search "Maria Magdalena" infixAgda yes mariamAGDAlena +_ : search "Maria Magdalena" infixAgda yes mariamAGDAlena _ = refl \ No newline at end of file diff --git a/master/Reflection.AST.Abstraction.html b/master/Reflection.AST.Abstraction.html index e3fad2cb4f..13f81785bd 100644 --- a/master/Reflection.AST.Abstraction.html +++ b/master/Reflection.AST.Abstraction.html @@ -13,8 +13,8 @@ open import Data.String.Properties as String using (_≟_) open import Data.Product.Base using (_×_; <_,_>; uncurry) open import Level using (Level) -open import Relation.Nullary.Decidable.Core using (Dec; map′; _×-dec_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (Dec; map′; _×-dec_) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) private @@ -58,10 +58,10 @@ unAbs : Abs A A unAbs (abs s a) = a -unAbs-dec : {abs1 abs2 : Abs A} Dec (unAbs abs1 unAbs abs2) Dec (abs1 abs2) +unAbs-dec : {abs1 abs2 : Abs A} Dec (unAbs abs1 unAbs abs2) Dec (abs1 abs2) unAbs-dec {abs1 = abs s a} {abs t a′} a≟a′ = - map′ (uncurry (cong₂ abs)) abs-injective (s String.≟ t ×-dec a≟a′) + map′ (uncurry (cong₂ abs)) abs-injective (s String.≟ t ×-dec a≟a′) -≡-dec : DecidableEquality A DecidableEquality (Abs A) +≡-dec : DecidableEquality A DecidableEquality (Abs A) ≡-dec _≟_ x y = unAbs-dec (unAbs x unAbs y) \ No newline at end of file diff --git a/master/Reflection.AST.AlphaEquality.html b/master/Reflection.AST.AlphaEquality.html index b37c81b61f..47f0035af8 100644 --- a/master/Reflection.AST.AlphaEquality.html +++ b/master/Reflection.AST.AlphaEquality.html @@ -13,8 +13,8 @@ open import Data.List.Base using ([]; _∷_) open import Data.Nat.Base as using (; zero; suc; _≡ᵇ_) open import Data.Product.Base using (_,_) -open import Relation.Nullary.Decidable.Core using (⌊_⌋) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (⌊_⌋) +open import Relation.Binary.Definitions using (DecidableEquality) open import Reflection.AST.Abstraction open import Reflection.AST.Argument @@ -46,8 +46,8 @@ ------------------------------------------------------------------------ -- Utilities -≟⇒α : DecidableEquality A AlphaEquality A -≟⇒α _≟_ = mkAlphaEquality x y x y ) +≟⇒α : DecidableEquality A AlphaEquality A +≟⇒α _≟_ = mkAlphaEquality x y x y ) ------------------------------------------------------------------------ -- Propositional cases diff --git a/master/Reflection.AST.Argument.Information.html b/master/Reflection.AST.Argument.Information.html index 02db21a27c..3b45ed2064 100644 --- a/master/Reflection.AST.Argument.Information.html +++ b/master/Reflection.AST.Argument.Information.html @@ -10,8 +10,8 @@ module Reflection.AST.Argument.Information where open import Data.Product.Base using (_×_; <_,_>; uncurry) -open import Relation.Nullary.Decidable.Core using (map′; _×-dec_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (map′; _×-dec_) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) open import Reflection.AST.Argument.Modality as Modality using (Modality) @@ -51,10 +51,10 @@ infix 4 _≟_ -_≟_ : DecidableEquality ArgInfo +_≟_ : DecidableEquality ArgInfo arg-info v m arg-info v′ m′ = - map′ + map′ (uncurry (cong₂ arg-info)) arg-info-injective - (v Visibility.≟ v′ ×-dec m Modality.≟ m′) + (v Visibility.≟ v′ ×-dec m Modality.≟ m′) \ No newline at end of file diff --git a/master/Reflection.AST.Argument.Modality.html b/master/Reflection.AST.Argument.Modality.html index 1bc6739d2d..2574bfe60e 100644 --- a/master/Reflection.AST.Argument.Modality.html +++ b/master/Reflection.AST.Argument.Modality.html @@ -10,8 +10,8 @@ module Reflection.AST.Argument.Modality where open import Data.Product.Base using (_×_; <_,_>; uncurry) -open import Relation.Nullary.Decidable.Core using (map′; _×-dec_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (map′; _×-dec_) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) open import Reflection.AST.Argument.Relevance as Relevance using (Relevance) @@ -51,10 +51,10 @@ infix 4 _≟_ -_≟_ : DecidableEquality Modality +_≟_ : DecidableEquality Modality modality r q modality r′ q′ = - map′ + map′ (uncurry (cong₂ modality)) modality-injective - (r Relevance.≟ r′ ×-dec q Quantity.≟ q′) + (r Relevance.≟ r′ ×-dec q Quantity.≟ q′) \ No newline at end of file diff --git a/master/Reflection.AST.Argument.Quantity.html b/master/Reflection.AST.Argument.Quantity.html index 060e7a3cc9..391529407f 100644 --- a/master/Reflection.AST.Argument.Quantity.html +++ b/master/Reflection.AST.Argument.Quantity.html @@ -9,8 +9,8 @@ module Reflection.AST.Argument.Quantity where -open import Relation.Nullary.Decidable.Core using (yes; no) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (yes; no) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (refl) ------------------------------------------------------------------------ @@ -24,9 +24,9 @@ infix 4 _≟_ -_≟_ : DecidableEquality Quantity -quantity-ω quantity-ω = yes refl -quantity-0 quantity-0 = yes refl -quantity-ω quantity-0 = no λ() -quantity-0 quantity-ω = no λ() +_≟_ : DecidableEquality Quantity +quantity-ω quantity-ω = yes refl +quantity-0 quantity-0 = yes refl +quantity-ω quantity-0 = no λ() +quantity-0 quantity-ω = no λ() \ No newline at end of file diff --git a/master/Reflection.AST.Argument.Relevance.html b/master/Reflection.AST.Argument.Relevance.html index a388b45095..62aac93569 100644 --- a/master/Reflection.AST.Argument.Relevance.html +++ b/master/Reflection.AST.Argument.Relevance.html @@ -9,8 +9,8 @@ module Reflection.AST.Argument.Relevance where -open import Relation.Nullary.Decidable.Core using (yes; no) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (yes; no) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (refl) ------------------------------------------------------------------------ @@ -24,9 +24,9 @@ infix 4 _≟_ -_≟_ : DecidableEquality Relevance -relevant relevant = yes refl -irrelevant irrelevant = yes refl -relevant irrelevant = no λ() -irrelevant relevant = no λ() +_≟_ : DecidableEquality Relevance +relevant relevant = yes refl +irrelevant irrelevant = yes refl +relevant irrelevant = no λ() +irrelevant relevant = no λ() \ No newline at end of file diff --git a/master/Reflection.AST.Argument.Visibility.html b/master/Reflection.AST.Argument.Visibility.html index c252f63a6e..c4a78c83ee 100644 --- a/master/Reflection.AST.Argument.Visibility.html +++ b/master/Reflection.AST.Argument.Visibility.html @@ -9,8 +9,8 @@ module Reflection.AST.Argument.Visibility where -open import Relation.Nullary.Decidable.Core using (yes; no) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (yes; no) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (refl) ------------------------------------------------------------------------ @@ -24,14 +24,14 @@ infix 4 _≟_ -_≟_ : DecidableEquality Visibility -visible visible = yes refl -hidden hidden = yes refl -instance′ instance′ = yes refl -visible hidden = no λ() -visible instance′ = no λ() -hidden visible = no λ() -hidden instance′ = no λ() -instance′ visible = no λ() -instance′ hidden = no λ() +_≟_ : DecidableEquality Visibility +visible visible = yes refl +hidden hidden = yes refl +instance′ instance′ = yes refl +visible hidden = no λ() +visible instance′ = no λ() +hidden visible = no λ() +hidden instance′ = no λ() +instance′ visible = no λ() +instance′ hidden = no λ() \ No newline at end of file diff --git a/master/Reflection.AST.Argument.html b/master/Reflection.AST.Argument.html index bd07f11fcf..1a4857e9f1 100644 --- a/master/Reflection.AST.Argument.html +++ b/master/Reflection.AST.Argument.html @@ -11,8 +11,8 @@ open import Data.List.Base as List using (List; []; _∷_) open import Data.Product.Base using (_×_; <_,_>; uncurry) -open import Relation.Nullary.Decidable.Core using (Dec; map′; _×-dec_) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (Dec; map′; _×-dec_) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong₂) open import Level @@ -86,10 +86,10 @@ unArg : Arg A A unArg (arg i a) = a -unArg-dec : {arg1 arg2 : Arg A} Dec (unArg arg1 unArg arg2) Dec (arg1 arg2) +unArg-dec : {arg1 arg2 : Arg A} Dec (unArg arg1 unArg arg2) Dec (arg1 arg2) unArg-dec {arg1 = arg i x} {arg j y} arg1≟arg2 = - map′ (uncurry (cong₂ arg)) arg-injective (i Information.≟ j ×-dec arg1≟arg2) + map′ (uncurry (cong₂ arg)) arg-injective (i Information.≟ j ×-dec arg1≟arg2) -≡-dec : DecidableEquality A DecidableEquality (Arg A) +≡-dec : DecidableEquality A DecidableEquality (Arg A) ≡-dec _≟_ x y = unArg-dec (unArg x unArg y) \ No newline at end of file diff --git a/master/Reflection.AST.Definition.html b/master/Reflection.AST.Definition.html index a328c39a09..7135a82ef7 100644 --- a/master/Reflection.AST.Definition.html +++ b/master/Reflection.AST.Definition.html @@ -12,8 +12,8 @@ import Data.List.Properties as List using (≡-dec) import Data.Nat.Properties as using (_≟_) open import Data.Product.Base using (_×_; <_,_>; uncurry) -open import Relation.Nullary.Decidable.Core using (map′; _×-dec_; yes; no) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (map′; _×-dec_; yes; no) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂) import Reflection.AST.Argument as Arg @@ -62,49 +62,49 @@ infix 4 _≟_ -_≟_ : DecidableEquality Definition +_≟_ : DecidableEquality Definition function cs function cs′ = - map′ (cong function) function-injective (cs Term.≟-Clauses cs′) + map′ (cong function) function-injective (cs Term.≟-Clauses cs′) data-type pars cs data-type pars′ cs′ = - map′ (uncurry (cong₂ data-type)) data-type-injective - (pars ℕ.≟ pars′ ×-dec List.≡-dec Name._≟_ cs cs′) + map′ (uncurry (cong₂ data-type)) data-type-injective + (pars ℕ.≟ pars′ ×-dec List.≡-dec Name._≟_ cs cs′) record′ c fs record′ c′ fs′ = - map′ (uncurry (cong₂ record′)) record′-injective - (c Name.≟ c′ ×-dec List.≡-dec (Arg.≡-dec Name._≟_) fs fs′) + map′ (uncurry (cong₂ record′)) record′-injective + (c Name.≟ c′ ×-dec List.≡-dec (Arg.≡-dec Name._≟_) fs fs′) constructor′ d constructor′ d′ = - map′ (cong constructor′) constructor′-injective (d Name.≟ d′) -axiom axiom = yes refl -primitive′ primitive′ = yes refl + map′ (cong constructor′) constructor′-injective (d Name.≟ d′) +axiom axiom = yes refl +primitive′ primitive′ = yes refl -- antidiagonal -function cs data-type pars cs₁ = no ()) -function cs record′ c fs = no ()) -function cs constructor′ d = no ()) -function cs axiom = no ()) -function cs primitive′ = no ()) -data-type pars cs function cs₁ = no ()) -data-type pars cs record′ c fs = no ()) -data-type pars cs constructor′ d = no ()) -data-type pars cs axiom = no ()) -data-type pars cs primitive′ = no ()) -record′ c fs function cs = no ()) -record′ c fs data-type pars cs = no ()) -record′ c fs constructor′ d = no ()) -record′ c fs axiom = no ()) -record′ c fs primitive′ = no ()) -constructor′ d function cs = no ()) -constructor′ d data-type pars cs = no ()) -constructor′ d record′ c fs = no ()) -constructor′ d axiom = no ()) -constructor′ d primitive′ = no ()) -axiom function cs = no ()) -axiom data-type pars cs = no ()) -axiom record′ c fs = no ()) -axiom constructor′ d = no ()) -axiom primitive′ = no ()) -primitive′ function cs = no ()) -primitive′ data-type pars cs = no ()) -primitive′ record′ c fs = no ()) -primitive′ constructor′ d = no ()) -primitive′ axiom = no ()) +function cs data-type pars cs₁ = no ()) +function cs record′ c fs = no ()) +function cs constructor′ d = no ()) +function cs axiom = no ()) +function cs primitive′ = no ()) +data-type pars cs function cs₁ = no ()) +data-type pars cs record′ c fs = no ()) +data-type pars cs constructor′ d = no ()) +data-type pars cs axiom = no ()) +data-type pars cs primitive′ = no ()) +record′ c fs function cs = no ()) +record′ c fs data-type pars cs = no ()) +record′ c fs constructor′ d = no ()) +record′ c fs axiom = no ()) +record′ c fs primitive′ = no ()) +constructor′ d function cs = no ()) +constructor′ d data-type pars cs = no ()) +constructor′ d record′ c fs = no ()) +constructor′ d axiom = no ()) +constructor′ d primitive′ = no ()) +axiom function cs = no ()) +axiom data-type pars cs = no ()) +axiom record′ c fs = no ()) +axiom constructor′ d = no ()) +axiom primitive′ = no ()) +primitive′ function cs = no ()) +primitive′ data-type pars cs = no ()) +primitive′ record′ c fs = no ()) +primitive′ constructor′ d = no ()) +primitive′ axiom = no ()) \ No newline at end of file diff --git a/master/Reflection.AST.Literal.html b/master/Reflection.AST.Literal.html index b28f77b9e1..3cb46efacd 100644 --- a/master/Reflection.AST.Literal.html +++ b/master/Reflection.AST.Literal.html @@ -17,8 +17,8 @@ import Data.Word.Properties as Word import Reflection.AST.Meta as Meta import Reflection.AST.Name as Name -open import Relation.Nullary.Decidable.Core using (yes; no; map′; isYes) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Nullary.Decidable.Core using (yes; no; map′; isYes) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) ------------------------------------------------------------------------ @@ -53,59 +53,59 @@ name-injective refl = refl infix 4 _≟_ -_≟_ : DecidableEquality Literal -nat x nat x₁ = map′ (cong nat) nat-injective (x ℕ.≟ x₁) -nat x word64 x₁ = no ()) -nat x float x₁ = no ()) -nat x char x₁ = no ()) -nat x string x₁ = no ()) -nat x name x₁ = no ()) -nat x meta x₁ = no ()) -word64 x word64 x₁ = map′ (cong word64) word64-injective (x Word.≟ x₁) -word64 x nat x₁ = no ()) -word64 x float x₁ = no ()) -word64 x char x₁ = no ()) -word64 x string x₁ = no ()) -word64 x name x₁ = no ()) -word64 x meta x₁ = no ()) -float x nat x₁ = no ()) -float x word64 x₁ = no ()) -float x float x₁ = map′ (cong float) float-injective (x Float.≟ x₁) -float x char x₁ = no ()) -float x string x₁ = no ()) -float x name x₁ = no ()) -float x meta x₁ = no ()) -char x nat x₁ = no ()) -char x word64 x₁ = no ()) -char x float x₁ = no ()) -char x char x₁ = map′ (cong char) char-injective (x Char.≟ x₁) -char x string x₁ = no ()) -char x name x₁ = no ()) -char x meta x₁ = no ()) -string x nat x₁ = no ()) -string x word64 x₁ = no ()) -string x float x₁ = no ()) -string x char x₁ = no ()) -string x string x₁ = map′ (cong string) string-injective (x String.≟ x₁) -string x name x₁ = no ()) -string x meta x₁ = no ()) -name x nat x₁ = no ()) -name x word64 x₁ = no ()) -name x float x₁ = no ()) -name x char x₁ = no ()) -name x string x₁ = no ()) -name x name x₁ = map′ (cong name) name-injective (x Name.≟ x₁) -name x meta x₁ = no ()) -meta x nat x₁ = no ()) -meta x word64 x₁ = no ()) -meta x float x₁ = no ()) -meta x char x₁ = no ()) -meta x string x₁ = no ()) -meta x name x₁ = no ()) -meta x meta x₁ = map′ (cong meta) meta-injective (x Meta.≟ x₁) +_≟_ : DecidableEquality Literal +nat x nat x₁ = map′ (cong nat) nat-injective (x ℕ.≟ x₁) +nat x word64 x₁ = no ()) +nat x float x₁ = no ()) +nat x char x₁ = no ()) +nat x string x₁ = no ()) +nat x name x₁ = no ()) +nat x meta x₁ = no ()) +word64 x word64 x₁ = map′ (cong word64) word64-injective (x Word.≟ x₁) +word64 x nat x₁ = no ()) +word64 x float x₁ = no ()) +word64 x char x₁ = no ()) +word64 x string x₁ = no ()) +word64 x name x₁ = no ()) +word64 x meta x₁ = no ()) +float x nat x₁ = no ()) +float x word64 x₁ = no ()) +float x float x₁ = map′ (cong float) float-injective (x Float.≟ x₁) +float x char x₁ = no ()) +float x string x₁ = no ()) +float x name x₁ = no ()) +float x meta x₁ = no ()) +char x nat x₁ = no ()) +char x word64 x₁ = no ()) +char x float x₁ = no ()) +char x char x₁ = map′ (cong char) char-injective (x Char.≟ x₁) +char x string x₁ = no ()) +char x name x₁ = no ()) +char x meta x₁ = no ()) +string x nat x₁ = no ()) +string x word64 x₁ = no ()) +string x float x₁ = no ()) +string x char x₁ = no ()) +string x string x₁ = map′ (cong string) string-injective (x String.≟ x₁) +string x name x₁ = no ()) +string x meta x₁ = no ()) +name x nat x₁ = no ()) +name x word64 x₁ = no ()) +name x float x₁ = no ()) +name x char x₁ = no ()) +name x string x₁ = no ()) +name x name x₁ = map′ (cong name) name-injective (x Name.≟ x₁) +name x meta x₁ = no ()) +meta x nat x₁ = no ()) +meta x word64 x₁ = no ()) +meta x float x₁ = no ()) +meta x char x₁ = no ()) +meta x string x₁ = no ()) +meta x name x₁ = no ()) +meta x meta x₁ = map′ (cong meta) meta-injective (x Meta.≟ x₁) infix 4 _≡ᵇ_ _≡ᵇ_ : Literal Literal Bool -l ≡ᵇ l′ = isYes (l l′) +l ≡ᵇ l′ = isYes (l l′) \ No newline at end of file diff --git a/master/Reflection.AST.Meta.html b/master/Reflection.AST.Meta.html index 2b3fe6db08..408de45813 100644 --- a/master/Reflection.AST.Meta.html +++ b/master/Reflection.AST.Meta.html @@ -11,9 +11,9 @@ import Data.Nat.Properties as open import Function.Base using (_on_) -open import Relation.Nullary.Decidable.Core using (map′) +open import Relation.Nullary.Decidable.Core using (map′) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Decidable; DecidableEquality) +open import Relation.Binary.Definitions using (Decidable; DecidableEquality) import Relation.Binary.Construct.On as On open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) @@ -30,9 +30,9 @@ _≈_ : Rel Meta _ _≈_ = _≡_ on toℕ -_≈?_ : Decidable _≈_ +_≈?_ : Decidable _≈_ _≈?_ = On.decidable toℕ _≡_ ℕ._≟_ -_≟_ : DecidableEquality Meta -m n = map′ (toℕ-injective _ _) (cong toℕ) (m ≈? n) +_≟_ : DecidableEquality Meta +m n = map′ (toℕ-injective _ _) (cong toℕ) (m ≈? n) \ No newline at end of file diff --git a/master/Reflection.AST.Name.html b/master/Reflection.AST.Name.html index b509f0e85b..a9143a6b55 100644 --- a/master/Reflection.AST.Name.html +++ b/master/Reflection.AST.Name.html @@ -13,9 +13,9 @@ import Data.Product.Properties as Prodₚ using (≡-dec) import Data.Word.Properties as Wₚ using (_≟_) open import Function.Base using (_on_) -open import Relation.Nullary.Decidable.Core using (map′) +open import Relation.Nullary.Decidable.Core using (map′) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Decidable; DecidableEquality) +open import Relation.Binary.Definitions using (Decidable; DecidableEquality) open import Relation.Binary.Construct.On using (decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) @@ -44,9 +44,9 @@ _≈_ : Rel Name _ _≈_ = _≡_ on toWords -_≈?_ : Decidable _≈_ +_≈?_ : Decidable _≈_ _≈?_ = decidable toWords _≡_ (Prodₚ.≡-dec Wₚ._≟_ Wₚ._≟_) -_≟_ : DecidableEquality Name -m n = map′ (toWords-injective _ _) (cong toWords) (m ≈? n) +_≟_ : DecidableEquality Name +m n = map′ (toWords-injective _ _) (cong toWords) (m ≈? n) \ No newline at end of file diff --git a/master/Reflection.AST.Show.html b/master/Reflection.AST.Show.html index 38af46098d..7e4576734f 100644 --- a/master/Reflection.AST.Show.html +++ b/master/Reflection.AST.Show.html @@ -21,7 +21,7 @@ open import Data.Product.Base using (_×_; _,_) import Data.Word.Base as Word open import Function.Base using (id; _∘′_; case_of_) -open import Relation.Nullary.Decidable.Core using (yes; no) +open import Relation.Nullary.Decidable.Core using (yes; no) open import Reflection.AST.Abstraction hiding (map) open import Reflection.AST.Argument hiding (map) diff --git a/master/Reflection.AST.Term.html b/master/Reflection.AST.Term.html index 01b01c79fd..695ddcb8e4 100644 --- a/master/Reflection.AST.Term.html +++ b/master/Reflection.AST.Term.html @@ -18,8 +18,8 @@ open import Data.Maybe.Base using (Maybe; just; nothing) open import Data.String.Base using (String) open import Data.String.Properties as String hiding (_≟_) -open import Relation.Nullary.Decidable using (map′; _×-dec_; yes; no) -open import Relation.Binary.Definitions using (Decidable; DecidableEquality) +open import Relation.Nullary.Decidable using (map′; _×-dec_; yes; no) +open import Relation.Binary.Definitions using (Decidable; DecidableEquality) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; cong₂) open import Reflection.AST.Abstraction @@ -133,17 +133,17 @@ _≟-Clause_ _≟-Clauses_ _≟_ _≟-Sort_ _≟-Pattern_ _≟-Patterns_ _≟-Telescope_ -_≟-AbsTerm_ : DecidableEquality (Abs Term) -_≟-AbsType_ : DecidableEquality (Abs Type) -_≟-ArgTerm_ : DecidableEquality (Arg Term) -_≟-ArgType_ : DecidableEquality (Arg Type) -_≟-Args_ : DecidableEquality (Args Term) -_≟-Clause_ : DecidableEquality Clause -_≟-Clauses_ : DecidableEquality Clauses -_≟_ : DecidableEquality Term -_≟-Sort_ : DecidableEquality Sort -_≟-Patterns_ : DecidableEquality (Args Pattern) -_≟-Pattern_ : DecidableEquality Pattern +_≟-AbsTerm_ : DecidableEquality (Abs Term) +_≟-AbsType_ : DecidableEquality (Abs Type) +_≟-ArgTerm_ : DecidableEquality (Arg Term) +_≟-ArgType_ : DecidableEquality (Arg Type) +_≟-Args_ : DecidableEquality (Args Term) +_≟-Clause_ : DecidableEquality Clause +_≟-Clauses_ : DecidableEquality Clauses +_≟_ : DecidableEquality Term +_≟-Sort_ : DecidableEquality Sort +_≟-Patterns_ : DecidableEquality (Args Pattern) +_≟-Pattern_ : DecidableEquality Pattern -- Decidable equality 'transformers' -- We need to inline these because the terms are not sized so @@ -155,34 +155,34 @@ arg i a ≟-ArgTerm arg i′ a′ = unArg-dec (a a′) arg i a ≟-ArgType arg i′ a′ = unArg-dec (a a′) -[] ≟-Args [] = yes refl +[] ≟-Args [] = yes refl (x xs) ≟-Args (y ys) = ∷-dec (x ≟-ArgTerm y) (xs ≟-Args ys) -[] ≟-Args (_ _) = no λ() -(_ _) ≟-Args [] = no λ() +[] ≟-Args (_ _) = no λ() +(_ _) ≟-Args [] = no λ() -[] ≟-Clauses [] = yes refl +[] ≟-Clauses [] = yes refl (x xs) ≟-Clauses (y ys) = ∷-dec (x ≟-Clause y) (xs ≟-Clauses ys) -[] ≟-Clauses (_ _) = no λ() -(_ _) ≟-Clauses [] = no λ() +[] ≟-Clauses (_ _) = no λ() +(_ _) ≟-Clauses [] = no λ() -_≟-Telescope_ : DecidableEquality Telescope -[] ≟-Telescope [] = yes refl +_≟-Telescope_ : DecidableEquality Telescope +[] ≟-Telescope [] = yes refl ((x , t) tel) ≟-Telescope ((x′ , t′) tel′) = ∷-dec - (map′ (uncurry (cong₂ _,_)) ,-injective ((x String.≟ x′) ×-dec (t ≟-ArgTerm t′))) + (map′ (uncurry (cong₂ _,_)) ,-injective ((x String.≟ x′) ×-dec (t ≟-ArgTerm t′))) (tel ≟-Telescope tel′) -[] ≟-Telescope (_ _) = no λ () -(_ _) ≟-Telescope [] = no λ () +[] ≟-Telescope (_ _) = no λ () +(_ _) ≟-Telescope [] = no λ () clause tel ps b ≟-Clause clause tel′ ps′ b′ = - map′ (tel≡tel′ , ps≡ps′ , b≡b′) cong₂ (uncurry clause) (cong₂ _,_ tel≡tel′ ps≡ps′) b≡b′) + map′ (tel≡tel′ , ps≡ps′ , b≡b′) cong₂ (uncurry clause) (cong₂ _,_ tel≡tel′ ps≡ps′) b≡b′) clause-injective - (tel ≟-Telescope tel′ ×-dec ps ≟-Patterns ps′ ×-dec b b′) + (tel ≟-Telescope tel′ ×-dec ps ≟-Patterns ps′ ×-dec b b′) absurd-clause tel ps ≟-Clause absurd-clause tel′ ps′ = - map′ (uncurry (cong₂ absurd-clause)) + map′ (uncurry (cong₂ absurd-clause)) absurd-clause-injective - (tel ≟-Telescope tel′ ×-dec ps ≟-Patterns ps′) -clause _ _ _ ≟-Clause absurd-clause _ _ = no λ() -absurd-clause _ _ ≟-Clause clause _ _ _ = no λ() + (tel ≟-Telescope tel′ ×-dec ps ≟-Patterns ps′) +clause _ _ _ ≟-Clause absurd-clause _ _ = no λ() +absurd-clause _ _ ≟-Clause clause _ _ _ = no λ() var-injective₁ : {x x′ args args′} Term.var x args var x′ args′ x x′ var-injective₁ refl = refl @@ -269,150 +269,150 @@ inf-injective refl = refl var x args var x′ args′ = - map′ (uncurry (cong₂ var)) var-injective (x ℕ.≟ x′ ×-dec args ≟-Args args′) + map′ (uncurry (cong₂ var)) var-injective (x ℕ.≟ x′ ×-dec args ≟-Args args′) con c args con c′ args′ = - map′ (uncurry (cong₂ con)) con-injective (c Name.≟ c′ ×-dec args ≟-Args args′) + map′ (uncurry (cong₂ con)) con-injective (c Name.≟ c′ ×-dec args ≟-Args args′) def f args def f′ args′ = - map′ (uncurry (cong₂ def)) def-injective (f Name.≟ f′ ×-dec args ≟-Args args′) + map′ (uncurry (cong₂ def)) def-injective (f Name.≟ f′ ×-dec args ≟-Args args′) meta x args meta x′ args′ = - map′ (uncurry (cong₂ meta)) meta-injective (x Meta.≟ x′ ×-dec args ≟-Args args′) + map′ (uncurry (cong₂ meta)) meta-injective (x Meta.≟ x′ ×-dec args ≟-Args args′) lam v t lam v′ t′ = - map′ (uncurry (cong₂ lam)) lam-injective (v Visibility.≟ v′ ×-dec t ≟-AbsTerm t′) + map′ (uncurry (cong₂ lam)) lam-injective (v Visibility.≟ v′ ×-dec t ≟-AbsTerm t′) pat-lam cs args pat-lam cs′ args′ = - map′ (uncurry (cong₂ pat-lam)) pat-lam-injective (cs ≟-Clauses cs′ ×-dec args ≟-Args args′) + map′ (uncurry (cong₂ pat-lam)) pat-lam-injective (cs ≟-Clauses cs′ ×-dec args ≟-Args args′) pi t₁ t₂ pi t₁′ t₂′ = - map′ (uncurry (cong₂ pi)) pi-injective (t₁ ≟-ArgType t₁′ ×-dec t₂ ≟-AbsType t₂′) -sort s sort s′ = map′ (cong sort) sort-injective (s ≟-Sort s′) -lit l lit l′ = map′ (cong lit) lit-injective (l Literal.≟ l′) -unknown unknown = yes refl - -var x args con c args′ = no λ() -var x args def f args′ = no λ() -var x args lam v t = no λ() -var x args pi t₁ t₂ = no λ() -var x args sort _ = no λ() -var x args lit _ = no λ() -var x args meta _ _ = no λ() -var x args unknown = no λ() -con c args var x args′ = no λ() -con c args def f args′ = no λ() -con c args lam v t = no λ() -con c args pi t₁ t₂ = no λ() -con c args sort _ = no λ() -con c args lit _ = no λ() -con c args meta _ _ = no λ() -con c args unknown = no λ() -def f args var x args′ = no λ() -def f args con c args′ = no λ() -def f args lam v t = no λ() -def f args pi t₁ t₂ = no λ() -def f args sort _ = no λ() -def f args lit _ = no λ() -def f args meta _ _ = no λ() -def f args unknown = no λ() -lam v t var x args = no λ() -lam v t con c args = no λ() -lam v t def f args = no λ() -lam v t pi t₁ t₂ = no λ() -lam v t sort _ = no λ() -lam v t lit _ = no λ() -lam v t meta _ _ = no λ() -lam v t unknown = no λ() -pi t₁ t₂ var x args = no λ() -pi t₁ t₂ con c args = no λ() -pi t₁ t₂ def f args = no λ() -pi t₁ t₂ lam v t = no λ() -pi t₁ t₂ sort _ = no λ() -pi t₁ t₂ lit _ = no λ() -pi t₁ t₂ meta _ _ = no λ() -pi t₁ t₂ unknown = no λ() -sort _ var x args = no λ() -sort _ con c args = no λ() -sort _ def f args = no λ() -sort _ lam v t = no λ() -sort _ pi t₁ t₂ = no λ() -sort _ lit _ = no λ() -sort _ meta _ _ = no λ() -sort _ unknown = no λ() -lit _ var x args = no λ() -lit _ con c args = no λ() -lit _ def f args = no λ() -lit _ lam v t = no λ() -lit _ pi t₁ t₂ = no λ() -lit _ sort _ = no λ() -lit _ meta _ _ = no λ() -lit _ unknown = no λ() -meta _ _ var x args = no λ() -meta _ _ con c args = no λ() -meta _ _ def f args = no λ() -meta _ _ lam v t = no λ() -meta _ _ pi t₁ t₂ = no λ() -meta _ _ sort _ = no λ() -meta _ _ lit _ = no λ() -meta _ _ unknown = no λ() -unknown var x args = no λ() -unknown con c args = no λ() -unknown def f args = no λ() -unknown lam v t = no λ() -unknown pi t₁ t₂ = no λ() -unknown sort _ = no λ() -unknown lit _ = no λ() -unknown meta _ _ = no λ() -pat-lam _ _ var x args = no λ() -pat-lam _ _ con c args = no λ() -pat-lam _ _ def f args = no λ() -pat-lam _ _ lam v t = no λ() -pat-lam _ _ pi t₁ t₂ = no λ() -pat-lam _ _ sort _ = no λ() -pat-lam _ _ lit _ = no λ() -pat-lam _ _ meta _ _ = no λ() -pat-lam _ _ unknown = no λ() -var x args pat-lam _ _ = no λ() -con c args pat-lam _ _ = no λ() -def f args pat-lam _ _ = no λ() -lam v t pat-lam _ _ = no λ() -pi t₁ t₂ pat-lam _ _ = no λ() -sort _ pat-lam _ _ = no λ() -lit _ pat-lam _ _ = no λ() -meta _ _ pat-lam _ _ = no λ() -unknown pat-lam _ _ = no λ() - -set t ≟-Sort set t′ = map′ (cong set) set-injective (t t′) -lit n ≟-Sort lit n′ = map′ (cong lit) slit-injective (n ℕ.≟ n′) -prop t ≟-Sort prop t′ = map′ (cong prop) prop-injective (t t′) -propLit n ≟-Sort propLit n′ = map′ (cong propLit) propLit-injective (n ℕ.≟ n′) -inf n ≟-Sort inf n′ = map′ (cong inf) inf-injective (n ℕ.≟ n′) -unknown ≟-Sort unknown = yes refl -set _ ≟-Sort lit _ = no λ() -set _ ≟-Sort prop _ = no λ() -set _ ≟-Sort propLit _ = no λ() -set _ ≟-Sort inf _ = no λ() -set _ ≟-Sort unknown = no λ() -lit _ ≟-Sort set _ = no λ() -lit _ ≟-Sort prop _ = no λ() -lit _ ≟-Sort propLit _ = no λ() -lit _ ≟-Sort inf _ = no λ() -lit _ ≟-Sort unknown = no λ() -prop _ ≟-Sort set _ = no λ() -prop _ ≟-Sort lit _ = no λ() -prop _ ≟-Sort propLit _ = no λ() -prop _ ≟-Sort inf _ = no λ() -prop _ ≟-Sort unknown = no λ() -propLit _ ≟-Sort set _ = no λ() -propLit _ ≟-Sort lit _ = no λ() -propLit _ ≟-Sort prop _ = no λ() -propLit _ ≟-Sort inf _ = no λ() -propLit _ ≟-Sort unknown = no λ() -inf _ ≟-Sort set _ = no λ() -inf _ ≟-Sort lit _ = no λ() -inf _ ≟-Sort prop _ = no λ() -inf _ ≟-Sort propLit _ = no λ() -inf _ ≟-Sort unknown = no λ() -unknown ≟-Sort set _ = no λ() -unknown ≟-Sort lit _ = no λ() -unknown ≟-Sort prop _ = no λ() -unknown ≟-Sort propLit _ = no λ() -unknown ≟-Sort inf _ = no λ() + map′ (uncurry (cong₂ pi)) pi-injective (t₁ ≟-ArgType t₁′ ×-dec t₂ ≟-AbsType t₂′) +sort s sort s′ = map′ (cong sort) sort-injective (s ≟-Sort s′) +lit l lit l′ = map′ (cong lit) lit-injective (l Literal.≟ l′) +unknown unknown = yes refl + +var x args con c args′ = no λ() +var x args def f args′ = no λ() +var x args lam v t = no λ() +var x args pi t₁ t₂ = no λ() +var x args sort _ = no λ() +var x args lit _ = no λ() +var x args meta _ _ = no λ() +var x args unknown = no λ() +con c args var x args′ = no λ() +con c args def f args′ = no λ() +con c args lam v t = no λ() +con c args pi t₁ t₂ = no λ() +con c args sort _ = no λ() +con c args lit _ = no λ() +con c args meta _ _ = no λ() +con c args unknown = no λ() +def f args var x args′ = no λ() +def f args con c args′ = no λ() +def f args lam v t = no λ() +def f args pi t₁ t₂ = no λ() +def f args sort _ = no λ() +def f args lit _ = no λ() +def f args meta _ _ = no λ() +def f args unknown = no λ() +lam v t var x args = no λ() +lam v t con c args = no λ() +lam v t def f args = no λ() +lam v t pi t₁ t₂ = no λ() +lam v t sort _ = no λ() +lam v t lit _ = no λ() +lam v t meta _ _ = no λ() +lam v t unknown = no λ() +pi t₁ t₂ var x args = no λ() +pi t₁ t₂ con c args = no λ() +pi t₁ t₂ def f args = no λ() +pi t₁ t₂ lam v t = no λ() +pi t₁ t₂ sort _ = no λ() +pi t₁ t₂ lit _ = no λ() +pi t₁ t₂ meta _ _ = no λ() +pi t₁ t₂ unknown = no λ() +sort _ var x args = no λ() +sort _ con c args = no λ() +sort _ def f args = no λ() +sort _ lam v t = no λ() +sort _ pi t₁ t₂ = no λ() +sort _ lit _ = no λ() +sort _ meta _ _ = no λ() +sort _ unknown = no λ() +lit _ var x args = no λ() +lit _ con c args = no λ() +lit _ def f args = no λ() +lit _ lam v t = no λ() +lit _ pi t₁ t₂ = no λ() +lit _ sort _ = no λ() +lit _ meta _ _ = no λ() +lit _ unknown = no λ() +meta _ _ var x args = no λ() +meta _ _ con c args = no λ() +meta _ _ def f args = no λ() +meta _ _ lam v t = no λ() +meta _ _ pi t₁ t₂ = no λ() +meta _ _ sort _ = no λ() +meta _ _ lit _ = no λ() +meta _ _ unknown = no λ() +unknown var x args = no λ() +unknown con c args = no λ() +unknown def f args = no λ() +unknown lam v t = no λ() +unknown pi t₁ t₂ = no λ() +unknown sort _ = no λ() +unknown lit _ = no λ() +unknown meta _ _ = no λ() +pat-lam _ _ var x args = no λ() +pat-lam _ _ con c args = no λ() +pat-lam _ _ def f args = no λ() +pat-lam _ _ lam v t = no λ() +pat-lam _ _ pi t₁ t₂ = no λ() +pat-lam _ _ sort _ = no λ() +pat-lam _ _ lit _ = no λ() +pat-lam _ _ meta _ _ = no λ() +pat-lam _ _ unknown = no λ() +var x args pat-lam _ _ = no λ() +con c args pat-lam _ _ = no λ() +def f args pat-lam _ _ = no λ() +lam v t pat-lam _ _ = no λ() +pi t₁ t₂ pat-lam _ _ = no λ() +sort _ pat-lam _ _ = no λ() +lit _ pat-lam _ _ = no λ() +meta _ _ pat-lam _ _ = no λ() +unknown pat-lam _ _ = no λ() + +set t ≟-Sort set t′ = map′ (cong set) set-injective (t t′) +lit n ≟-Sort lit n′ = map′ (cong lit) slit-injective (n ℕ.≟ n′) +prop t ≟-Sort prop t′ = map′ (cong prop) prop-injective (t t′) +propLit n ≟-Sort propLit n′ = map′ (cong propLit) propLit-injective (n ℕ.≟ n′) +inf n ≟-Sort inf n′ = map′ (cong inf) inf-injective (n ℕ.≟ n′) +unknown ≟-Sort unknown = yes refl +set _ ≟-Sort lit _ = no λ() +set _ ≟-Sort prop _ = no λ() +set _ ≟-Sort propLit _ = no λ() +set _ ≟-Sort inf _ = no λ() +set _ ≟-Sort unknown = no λ() +lit _ ≟-Sort set _ = no λ() +lit _ ≟-Sort prop _ = no λ() +lit _ ≟-Sort propLit _ = no λ() +lit _ ≟-Sort inf _ = no λ() +lit _ ≟-Sort unknown = no λ() +prop _ ≟-Sort set _ = no λ() +prop _ ≟-Sort lit _ = no λ() +prop _ ≟-Sort propLit _ = no λ() +prop _ ≟-Sort inf _ = no λ() +prop _ ≟-Sort unknown = no λ() +propLit _ ≟-Sort set _ = no λ() +propLit _ ≟-Sort lit _ = no λ() +propLit _ ≟-Sort prop _ = no λ() +propLit _ ≟-Sort inf _ = no λ() +propLit _ ≟-Sort unknown = no λ() +inf _ ≟-Sort set _ = no λ() +inf _ ≟-Sort lit _ = no λ() +inf _ ≟-Sort prop _ = no λ() +inf _ ≟-Sort propLit _ = no λ() +inf _ ≟-Sort unknown = no λ() +unknown ≟-Sort set _ = no λ() +unknown ≟-Sort lit _ = no λ() +unknown ≟-Sort prop _ = no λ() +unknown ≟-Sort propLit _ = no λ() +unknown ≟-Sort inf _ = no λ() pat-con-injective₁ : {c c′ args args′} Pattern.con c args con c′ args′ c c′ @@ -439,47 +439,47 @@ absurd-injective : {x y} absurd x absurd y x y absurd-injective refl = refl -con c ps ≟-Pattern con c′ ps′ = map′ (uncurry (cong₂ con)) pat-con-injective (c Name.≟ c′ ×-dec ps ≟-Patterns ps′) -var x ≟-Pattern var x′ = map′ (cong var) pat-var-injective (x ℕ.≟ x′) -lit l ≟-Pattern lit l′ = map′ (cong lit) pat-lit-injective (l Literal.≟ l′) -proj a ≟-Pattern proj a′ = map′ (cong proj) proj-injective (a Name.≟ a′) -dot t ≟-Pattern dot t′ = map′ (cong dot) dot-injective (t t′) -absurd x ≟-Pattern absurd x′ = map′ (cong absurd) absurd-injective (x ℕ.≟ x′) - -con x x₁ ≟-Pattern dot x₂ = no ()) -con x x₁ ≟-Pattern var x₂ = no ()) -con x x₁ ≟-Pattern lit x₂ = no ()) -con x x₁ ≟-Pattern proj x₂ = no ()) -con x x₁ ≟-Pattern absurd x₂ = no ()) -dot x ≟-Pattern con x₁ x₂ = no ()) -dot x ≟-Pattern var x₁ = no ()) -dot x ≟-Pattern lit x₁ = no ()) -dot x ≟-Pattern proj x₁ = no ()) -dot x ≟-Pattern absurd x₁ = no ()) -var s ≟-Pattern con x x₁ = no ()) -var s ≟-Pattern dot x = no ()) -var s ≟-Pattern lit x = no ()) -var s ≟-Pattern proj x = no ()) -var s ≟-Pattern absurd x = no ()) -lit x ≟-Pattern con x₁ x₂ = no ()) -lit x ≟-Pattern dot x₁ = no ()) -lit x ≟-Pattern var _ = no ()) -lit x ≟-Pattern proj x₁ = no ()) -lit x ≟-Pattern absurd x₁ = no ()) -proj x ≟-Pattern con x₁ x₂ = no ()) -proj x ≟-Pattern dot x₁ = no ()) -proj x ≟-Pattern var _ = no ()) -proj x ≟-Pattern lit x₁ = no ()) -proj x ≟-Pattern absurd x₁ = no ()) -absurd x ≟-Pattern con x₁ x₂ = no ()) -absurd x ≟-Pattern dot x₁ = no ()) -absurd x ≟-Pattern var _ = no ()) -absurd x ≟-Pattern lit x₁ = no ()) -absurd x ≟-Pattern proj x₁ = no ()) - -[] ≟-Patterns [] = yes refl +con c ps ≟-Pattern con c′ ps′ = map′ (uncurry (cong₂ con)) pat-con-injective (c Name.≟ c′ ×-dec ps ≟-Patterns ps′) +var x ≟-Pattern var x′ = map′ (cong var) pat-var-injective (x ℕ.≟ x′) +lit l ≟-Pattern lit l′ = map′ (cong lit) pat-lit-injective (l Literal.≟ l′) +proj a ≟-Pattern proj a′ = map′ (cong proj) proj-injective (a Name.≟ a′) +dot t ≟-Pattern dot t′ = map′ (cong dot) dot-injective (t t′) +absurd x ≟-Pattern absurd x′ = map′ (cong absurd) absurd-injective (x ℕ.≟ x′) + +con x x₁ ≟-Pattern dot x₂ = no ()) +con x x₁ ≟-Pattern var x₂ = no ()) +con x x₁ ≟-Pattern lit x₂ = no ()) +con x x₁ ≟-Pattern proj x₂ = no ()) +con x x₁ ≟-Pattern absurd x₂ = no ()) +dot x ≟-Pattern con x₁ x₂ = no ()) +dot x ≟-Pattern var x₁ = no ()) +dot x ≟-Pattern lit x₁ = no ()) +dot x ≟-Pattern proj x₁ = no ()) +dot x ≟-Pattern absurd x₁ = no ()) +var s ≟-Pattern con x x₁ = no ()) +var s ≟-Pattern dot x = no ()) +var s ≟-Pattern lit x = no ()) +var s ≟-Pattern proj x = no ()) +var s ≟-Pattern absurd x = no ()) +lit x ≟-Pattern con x₁ x₂ = no ()) +lit x ≟-Pattern dot x₁ = no ()) +lit x ≟-Pattern var _ = no ()) +lit x ≟-Pattern proj x₁ = no ()) +lit x ≟-Pattern absurd x₁ = no ()) +proj x ≟-Pattern con x₁ x₂ = no ()) +proj x ≟-Pattern dot x₁ = no ()) +proj x ≟-Pattern var _ = no ()) +proj x ≟-Pattern lit x₁ = no ()) +proj x ≟-Pattern absurd x₁ = no ()) +absurd x ≟-Pattern con x₁ x₂ = no ()) +absurd x ≟-Pattern dot x₁ = no ()) +absurd x ≟-Pattern var _ = no ()) +absurd x ≟-Pattern lit x₁ = no ()) +absurd x ≟-Pattern proj x₁ = no ()) + +[] ≟-Patterns [] = yes refl (arg i p xs) ≟-Patterns (arg j q ys) = ∷-dec (unArg-dec (p ≟-Pattern q)) (xs ≟-Patterns ys) -[] ≟-Patterns (_ _) = no λ() -(_ _) ≟-Patterns [] = no λ() +[] ≟-Patterns (_ _) = no λ() +(_ _) ≟-Patterns [] = no λ() \ No newline at end of file diff --git a/master/Relation.Binary.Bundles.html b/master/Relation.Binary.Bundles.html index 2dfb2c3c01..4a6c7b8918 100644 --- a/master/Relation.Binary.Bundles.html +++ b/master/Relation.Binary.Bundles.html @@ -13,7 +13,7 @@ open import Function.Base using (flip) open import Level using (Level; suc; _⊔_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures -- most of it @@ -32,7 +32,7 @@ infix 4 _≉_ _≉_ : Rel Carrier _ - x y = ¬ (x y) + x y = ¬ (x y) record Setoid c : Set (suc (c )) where @@ -97,7 +97,7 @@ infix 4 _⋦_ _⋦_ : Rel Carrier _ - x y = ¬ (x y) + x y = ¬ (x y) infix 4 _≳_ _≳_ = flip _≲_ @@ -214,7 +214,7 @@ infix 4 _≮_ _≮_ : Rel Carrier _ - x y = ¬ (x < y) + x y = ¬ (x < y) infix 4 _>_ _>_ = flip _<_ diff --git a/master/Relation.Binary.Consequences.html b/master/Relation.Binary.Consequences.html index 09409800be..013a4e2a00 100644 --- a/master/Relation.Binary.Consequences.html +++ b/master/Relation.Binary.Consequences.html @@ -17,9 +17,9 @@ open import Level using (Level) open import Relation.Binary.Core open import Relation.Binary.Definitions -open import Relation.Nullary using (yes; no; recompute; ¬_) -open import Relation.Nullary.Decidable.Core using (map′) -open import Relation.Unary using (; Pred) +open import Relation.Nullary using (yes; no; recompute; ¬_) +open import Relation.Nullary.Decidable.Core using (map′) +open import Relation.Unary using (; Pred) private variable @@ -31,18 +31,18 @@ module _ {_∼_ : Rel A } (R : Rel A p) where - subst⇒respˡ : Substitutive _∼_ p R Respectsˡ _∼_ + subst⇒respˡ : Substitutive _∼_ p R Respectsˡ _∼_ subst⇒respˡ subst {y} x′∼x Px′y = subst (flip R y) x′∼x Px′y - subst⇒respʳ : Substitutive _∼_ p R Respectsʳ _∼_ + subst⇒respʳ : Substitutive _∼_ p R Respectsʳ _∼_ subst⇒respʳ subst {x} y′∼y Pxy′ = subst (R x) y′∼y Pxy′ - subst⇒resp₂ : Substitutive _∼_ p R Respects₂ _∼_ + subst⇒resp₂ : Substitutive _∼_ p R Respects₂ _∼_ subst⇒resp₂ subst = subst⇒respʳ subst , subst⇒respˡ subst -module _ {_∼_ : Rel A } {P : Pred A p} where +module _ {_∼_ : Rel A } {P : Pred A p} where - resp⇒¬-resp : Symmetric _∼_ P Respects _∼_ ( P) Respects _∼_ + resp⇒¬-resp : Symmetric _∼_ P Respects _∼_ ( P) Respects _∼_ resp⇒¬-resp sym resp x∼y ¬Px Py = ¬Px (resp (sym x∼y) Py) ------------------------------------------------------------------------ @@ -50,12 +50,12 @@ module _ {_∼_ : Rel A } where - sym⇒¬-sym : Symmetric _∼_ Symmetric (¬_ ∘₂ _∼_) + sym⇒¬-sym : Symmetric _∼_ Symmetric (¬_ ∘₂ _∼_) sym⇒¬-sym sym≁ x≁y y∼x = x≁y (sym≁ y∼x) -- N.B. the implicit arguments to Cotransitive are permuted w.r.t. -- those of Transitive - cotrans⇒¬-trans : Cotransitive _∼_ Transitive (¬_ ∘₂ _∼_) + cotrans⇒¬-trans : Cotransitive _∼_ Transitive (¬_ ∘₂ _∼_) cotrans⇒¬-trans cotrans {j = z} x≁z z≁y x∼y = [ x≁z , z≁y ]′ (cotrans x∼y z) @@ -64,8 +64,8 @@ module _ {_≈_ : Rel A ℓ₁} {_∼_ : Rel A ℓ₂} where - irrefl⇒¬-refl : Reflexive _≈_ Irreflexive _≈_ _∼_ - Reflexive (¬_ ∘₂ _∼_) + irrefl⇒¬-refl : Reflexive _≈_ Irreflexive _≈_ _∼_ + Reflexive (¬_ ∘₂ _∼_) irrefl⇒¬-refl re irr = irr re ------------------------------------------------------------------------ @@ -73,33 +73,33 @@ module _ {_≈_ : Rel A ℓ₁} {_≤_ : Rel A ℓ₂} where - total⇒refl : _≤_ Respects₂ _≈_ Symmetric _≈_ - Total _≤_ _≈_ _≤_ + total⇒refl : _≤_ Respects₂ _≈_ Symmetric _≈_ + Total _≤_ _≈_ _≤_ total⇒refl (respʳ , respˡ) sym total {x} {y} x≈y with total x y ... | inj₁ x∼y = x∼y ... | inj₂ y∼x = respʳ x≈y (respˡ (sym x≈y) y∼x) - total∧dec⇒dec : _≈_ _≤_ Antisymmetric _≈_ _≤_ - Total _≤_ Decidable _≈_ Decidable _≤_ + total∧dec⇒dec : _≈_ _≤_ Antisymmetric _≈_ _≤_ + Total _≤_ Decidable _≈_ Decidable _≤_ total∧dec⇒dec refl antisym total _≟_ x y with total x y - ... | inj₁ x≤y = yes x≤y - ... | inj₂ y≤x = map′ refl (flip antisym y≤x) (x y) + ... | inj₁ x≤y = yes x≤y + ... | inj₂ y≤x = map′ refl (flip antisym y≤x) (x y) module _ (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) {≤₁ : Rel A ℓ₃} {≤₂ : Rel B ℓ₄} where - mono⇒cong : Symmetric ≈₁ ≈₁ ≤₁ Antisymmetric ≈₂ ≤₂ + mono⇒cong : Symmetric ≈₁ ≈₁ ≤₁ Antisymmetric ≈₂ ≤₂ {f} f Preserves ≤₁ ≤₂ f Preserves ≈₁ ≈₂ mono⇒cong sym reflexive antisym mono x≈y = antisym (mono (reflexive x≈y)) (mono (reflexive (sym x≈y))) - antimono⇒cong : Symmetric ≈₁ ≈₁ ≤₁ Antisymmetric ≈₂ ≤₂ + antimono⇒cong : Symmetric ≈₁ ≈₁ ≤₁ Antisymmetric ≈₂ ≤₂ {f} f Preserves ≤₁ (flip ≤₂) f Preserves ≈₁ ≈₂ antimono⇒cong sym reflexive antisym antimono p≈q = antisym (antimono (reflexive (sym p≈q))) (antimono (reflexive p≈q)) - mono₂⇒cong₂ : Symmetric ≈₁ ≈₁ ≤₁ Antisymmetric ≈₂ ≤₂ {f} + mono₂⇒cong₂ : Symmetric ≈₁ ≈₁ ≤₁ Antisymmetric ≈₂ ≤₂ {f} f Preserves₂ ≤₁ ≤₁ ≤₂ f Preserves₂ ≈₁ ≈₁ ≈₂ mono₂⇒cong₂ sym reflexive antisym mono x≈y u≈v = antisym @@ -111,67 +111,67 @@ module _ {_≈_ : Rel A ℓ₁} {_<_ : Rel A ℓ₂} where - trans∧irr⇒asym : Reflexive _≈_ Transitive _<_ - Irreflexive _≈_ _<_ Asymmetric _<_ + trans∧irr⇒asym : Reflexive _≈_ Transitive _<_ + Irreflexive _≈_ _<_ Asymmetric _<_ trans∧irr⇒asym refl trans irrefl x<y y<x = irrefl refl (trans x<y y<x) - irr∧antisym⇒asym : Irreflexive _≈_ _<_ Antisymmetric _≈_ _<_ - Asymmetric _<_ + irr∧antisym⇒asym : Irreflexive _≈_ _<_ Antisymmetric _≈_ _<_ + Asymmetric _<_ irr∧antisym⇒asym irrefl antisym x<y y<x = irrefl (antisym x<y y<x) x<y - asym⇒antisym : Asymmetric _<_ Antisymmetric _≈_ _<_ + asym⇒antisym : Asymmetric _<_ Antisymmetric _≈_ _<_ asym⇒antisym asym x<y y<x = ⊥-elim (asym x<y y<x) - asym⇒irr : _<_ Respects₂ _≈_ Symmetric _≈_ - Asymmetric _<_ Irreflexive _≈_ _<_ + asym⇒irr : _<_ Respects₂ _≈_ Symmetric _≈_ + Asymmetric _<_ Irreflexive _≈_ _<_ asym⇒irr (respʳ , respˡ) sym asym {x} {y} x≈y x<y = asym x<y (respʳ (sym x≈y) (respˡ x≈y x<y)) - tri⇒asym : Trichotomous _≈_ _<_ Asymmetric _<_ + tri⇒asym : Trichotomous _≈_ _<_ Asymmetric _<_ tri⇒asym tri {x} {y} x<y x>y with tri x y - ... | tri< _ _ x≯y = x≯y x>y - ... | tri≈ _ _ x≯y = x≯y x>y - ... | tri> x≮y _ _ = x≮y x<y + ... | tri< _ _ x≯y = x≯y x>y + ... | tri≈ _ _ x≯y = x≯y x>y + ... | tri> x≮y _ _ = x≮y x<y - tri⇒irr : Trichotomous _≈_ _<_ Irreflexive _≈_ _<_ + tri⇒irr : Trichotomous _≈_ _<_ Irreflexive _≈_ _<_ tri⇒irr compare {x} {y} x≈y x<y with compare x y - ... | tri< _ x≉y y≮x = x≉y x≈y - ... | tri> x≮y x≉y y<x = x≉y x≈y - ... | tri≈ x≮y _ y≮x = x≮y x<y + ... | tri< _ x≉y y≮x = x≉y x≈y + ... | tri> x≮y x≉y y<x = x≉y x≈y + ... | tri≈ x≮y _ y≮x = x≮y x<y - tri⇒dec≈ : Trichotomous _≈_ _<_ Decidable _≈_ + tri⇒dec≈ : Trichotomous _≈_ _<_ Decidable _≈_ tri⇒dec≈ compare x y with compare x y - ... | tri< _ x≉y _ = no x≉y - ... | tri≈ _ x≈y _ = yes x≈y - ... | tri> _ x≉y _ = no x≉y + ... | tri< _ x≉y _ = no x≉y + ... | tri≈ _ x≈y _ = yes x≈y + ... | tri> _ x≉y _ = no x≉y - tri⇒dec< : Trichotomous _≈_ _<_ Decidable _<_ + tri⇒dec< : Trichotomous _≈_ _<_ Decidable _<_ tri⇒dec< compare x y with compare x y - ... | tri< x<y _ _ = yes x<y - ... | tri≈ x≮y _ _ = no x≮y - ... | tri> x≮y _ _ = no x≮y + ... | tri< x<y _ _ = yes x<y + ... | tri≈ x≮y _ _ = no x≮y + ... | tri> x≮y _ _ = no x≮y - trans∧tri⇒respʳ : Symmetric _≈_ Transitive _≈_ - Transitive _<_ Trichotomous _≈_ _<_ - _<_ Respectsʳ _≈_ + trans∧tri⇒respʳ : Symmetric _≈_ Transitive _≈_ + Transitive _<_ Trichotomous _≈_ _<_ + _<_ Respectsʳ _≈_ trans∧tri⇒respʳ sym ≈-tr <-tr tri {x} {y} {z} y≈z x<y with tri x z - ... | tri< x<z _ _ = x<z - ... | tri≈ _ x≈z _ = ⊥-elim (tri⇒irr tri (≈-tr x≈z (sym y≈z)) x<y) - ... | tri> _ _ z<x = ⊥-elim (tri⇒irr tri (sym y≈z) (<-tr z<x x<y)) + ... | tri< x<z _ _ = x<z + ... | tri≈ _ x≈z _ = ⊥-elim (tri⇒irr tri (≈-tr x≈z (sym y≈z)) x<y) + ... | tri> _ _ z<x = ⊥-elim (tri⇒irr tri (sym y≈z) (<-tr z<x x<y)) - trans∧tri⇒respˡ : Transitive _≈_ - Transitive _<_ Trichotomous _≈_ _<_ - _<_ Respectsˡ _≈_ + trans∧tri⇒respˡ : Transitive _≈_ + Transitive _<_ Trichotomous _≈_ _<_ + _<_ Respectsˡ _≈_ trans∧tri⇒respˡ ≈-tr <-tr tri {z} {_} {y} x≈y x<z with tri y z - ... | tri< y<z _ _ = y<z - ... | tri≈ _ y≈z _ = ⊥-elim (tri⇒irr tri (≈-tr x≈y y≈z) x<z) - ... | tri> _ _ z<y = ⊥-elim (tri⇒irr tri x≈y (<-tr x<z z<y)) + ... | tri< y<z _ _ = y<z + ... | tri≈ _ y≈z _ = ⊥-elim (tri⇒irr tri (≈-tr x≈y y≈z) x<z) + ... | tri> _ _ z<y = ⊥-elim (tri⇒irr tri x≈y (<-tr x<z z<y)) - trans∧tri⇒resp : Symmetric _≈_ Transitive _≈_ - Transitive _<_ Trichotomous _≈_ _<_ - _<_ Respects₂ _≈_ + trans∧tri⇒resp : Symmetric _≈_ Transitive _≈_ + Transitive _<_ Trichotomous _≈_ _<_ + _<_ Respects₂ _≈_ trans∧tri⇒resp sym ≈-tr <-tr tri = trans∧tri⇒respʳ sym ≈-tr <-tr tri , trans∧tri⇒respˡ ≈-tr <-tr tri @@ -181,7 +181,7 @@ module _ {_R_ : Rel A ℓ₁} {Q : Rel A ℓ₂} where - wlog : Total _R_ Symmetric Q + wlog : Total _R_ Symmetric Q (∀ a b a R b Q a b) a b Q a b wlog r-total q-sym prf a b with r-total a b @@ -193,20 +193,20 @@ module _ {R : REL A B p} where - dec⇒weaklyDec : Decidable R WeaklyDecidable R + dec⇒weaklyDec : Decidable R WeaklyDecidable R dec⇒weaklyDec dec x y = decToMaybe (dec x y) - dec⇒recomputable : Decidable R Recomputable R - dec⇒recomputable dec {a} {b} = recompute $ dec a b + dec⇒recomputable : Decidable R Recomputable R + dec⇒recomputable dec {a} {b} = recompute $ dec a b module _ {R : REL A B ℓ₁} {S : REL A B ℓ₂} where - map-NonEmpty : R S NonEmpty R NonEmpty S - map-NonEmpty f x = nonEmpty (f (NonEmpty.proof x)) + map-NonEmpty : R S NonEmpty R NonEmpty S + map-NonEmpty f x = nonEmpty (f (NonEmpty.proof x)) module _ {R : REL A B ℓ₁} {S : REL B A ℓ₂} where - flip-Connex : Connex R S Connex S R + flip-Connex : Connex R S Connex S R flip-Connex f x y = Sum.swap (f y x) diff --git a/master/Relation.Binary.Construct.Add.Extrema.Equality.html b/master/Relation.Binary.Construct.Add.Extrema.Equality.html index 059c619dfd..6a752fa273 100644 --- a/master/Relation.Binary.Construct.Add.Extrema.Equality.html +++ b/master/Relation.Binary.Construct.Add.Extrema.Equality.html @@ -14,7 +14,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Decidable; Irrelevant; Substitutive) + using (Reflexive; Symmetric; Transitive; Decidable; Irrelevant; Substitutive) module Relation.Binary.Construct.Add.Extrema.Equality {a } {A : Set a} (_≈_ : Rel A ) where @@ -46,22 +46,22 @@ [≈]-injective : {k l} [ k ] ≈± [ l ] k l [≈]-injective = Inf.[≈]-injective ∘′ Sup.[≈]-injective -≈±-refl : Reflexive _≈_ Reflexive _≈±_ +≈±-refl : Reflexive _≈_ Reflexive _≈±_ ≈±-refl = Sup.≈⁺-refl ∘′ Inf.≈₋-refl -≈±-sym : Symmetric _≈_ Symmetric _≈±_ +≈±-sym : Symmetric _≈_ Symmetric _≈±_ ≈±-sym = Sup.≈⁺-sym ∘′ Inf.≈₋-sym -≈±-trans : Transitive _≈_ Transitive _≈±_ +≈±-trans : Transitive _≈_ Transitive _≈±_ ≈±-trans = Sup.≈⁺-trans ∘′ Inf.≈₋-trans -≈±-dec : Decidable _≈_ Decidable _≈±_ +≈±-dec : Decidable _≈_ Decidable _≈±_ ≈±-dec = Sup.≈⁺-dec ∘′ Inf.≈₋-dec -≈±-irrelevant : Irrelevant _≈_ Irrelevant _≈±_ +≈±-irrelevant : Irrelevant _≈_ Irrelevant _≈±_ ≈±-irrelevant = Sup.≈⁺-irrelevant ∘′ Inf.≈₋-irrelevant -≈±-substitutive : {} Substitutive _≈_ Substitutive _≈±_ +≈±-substitutive : {} Substitutive _≈_ Substitutive _≈±_ ≈±-substitutive = Sup.≈⁺-substitutive ∘′ Inf.≈₋-substitutive ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Add.Extrema.NonStrict.html b/master/Relation.Binary.Construct.Add.Extrema.NonStrict.html index 597cdef29d..080673adb3 100644 --- a/master/Relation.Binary.Construct.Add.Extrema.NonStrict.html +++ b/master/Relation.Binary.Construct.Add.Extrema.NonStrict.html @@ -14,7 +14,7 @@ open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsDecPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Decidable; Transitive; Minimum; Maximum; Total; Irrelevant; Antisymmetric) + using (Decidable; Transitive; Minimum; Maximum; Total; Irrelevant; Antisymmetric) module Relation.Binary.Construct.Add.Extrema.NonStrict {a } {A : Set a} (_≤_ : Rel A ) where @@ -62,22 +62,22 @@ [≤]-injective : {k l} [ k ] ≤± [ l ] k l [≤]-injective = Inf.[≤]-injective ∘′ Sup.[≤]-injective -≤±-trans : Transitive _≤_ Transitive _≤±_ +≤±-trans : Transitive _≤_ Transitive _≤±_ ≤±-trans = Sup.≤⁺-trans ∘′ Inf.≤₋-trans -≤±-minimum : Minimum _≤±_ ⊥± +≤±-minimum : Minimum _≤±_ ⊥± ≤±-minimum = ⊥±≤_ -≤±-maximum : Maximum _≤±_ ⊤± +≤±-maximum : Maximum _≤±_ ⊤± ≤±-maximum = _≤⊤± -≤±-dec : Decidable _≤_ Decidable _≤±_ +≤±-dec : Decidable _≤_ Decidable _≤±_ ≤±-dec = Sup.≤⁺-dec ∘′ Inf.≤₋-dec -≤±-total : Total _≤_ Total _≤±_ +≤±-total : Total _≤_ Total _≤±_ ≤±-total = Sup.≤⁺-total ∘′ Inf.≤₋-total -≤±-irrelevant : Irrelevant _≤_ Irrelevant _≤±_ +≤±-irrelevant : Irrelevant _≤_ Irrelevant _≤±_ ≤±-irrelevant = Sup.≤⁺-irrelevant ∘′ Inf.≤₋-irrelevant ------------------------------------------------------------------------ @@ -86,7 +86,7 @@ ≤±-reflexive-≡ : (_≡_ _≤_) (_≡_ _≤±_) ≤±-reflexive-≡ = Sup.≤⁺-reflexive-≡ ∘′ Inf.≤₋-reflexive-≡ -≤±-antisym-≡ : Antisymmetric _≡_ _≤_ Antisymmetric _≡_ _≤±_ +≤±-antisym-≡ : Antisymmetric _≡_ _≤_ Antisymmetric _≡_ _≤±_ ≤±-antisym-≡ = Sup.≤⁺-antisym-≡ ∘′ Inf.≤₋-antisym-≡ ------------------------------------------------------------------------ @@ -99,7 +99,7 @@ ≤±-reflexive : (_≈_ _≤_) (_≈±_ _≤±_) ≤±-reflexive = Sup.≤⁺-reflexive ∘′ Inf.≤₋-reflexive - ≤±-antisym : Antisymmetric _≈_ _≤_ Antisymmetric _≈±_ _≤±_ + ≤±-antisym : Antisymmetric _≈_ _≤_ Antisymmetric _≈±_ _≤±_ ≤±-antisym = Sup.≤⁺-antisym ∘′ Inf.≤₋-antisym ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Add.Extrema.Strict.html b/master/Relation.Binary.Construct.Add.Extrema.Strict.html index 61720094bc..ed9d859a16 100644 --- a/master/Relation.Binary.Construct.Add.Extrema.Strict.html +++ b/master/Relation.Binary.Construct.Add.Extrema.Strict.html @@ -27,7 +27,7 @@ import Relation.Binary.Construct.Add.Extrema.Equality as Equality import Relation.Binary.Construct.Add.Extrema.NonStrict as NonStrict open import Relation.Binary.Definitions - using (Asymmetric; Transitive; Decidable; Irrelevant; Trichotomous; Irreflexive; Trans; _Respectsˡ_; _Respectsʳ_; _Respects₂_) + using (Asymmetric; Transitive; Decidable; Irrelevant; Trichotomous; Irreflexive; Trans; _Respectsˡ_; _Respectsʳ_; _Respects₂_) open import Relation.Binary.Structures using (IsStrictPartialOrder; IsDecStrictPartialOrder; IsStrictTotalOrder) @@ -54,44 +54,44 @@ [<]-injective : {k l} [ k ] [ l ] k < l [<]-injective = Inf.[<]-injective ∘′ Sup.[<]-injective -<±-asym : Asymmetric _<_ Asymmetric _<±_ +<±-asym : Asymmetric _<_ Asymmetric _<±_ <±-asym = Sup.<⁺-asym ∘′ Inf.<₋-asym -<±-trans : Transitive _<_ Transitive _<±_ +<±-trans : Transitive _<_ Transitive _<±_ <±-trans = Sup.<⁺-trans ∘′ Inf.<₋-trans -<±-dec : Decidable _<_ Decidable _<±_ +<±-dec : Decidable _<_ Decidable _<±_ <±-dec = Sup.<⁺-dec ∘′ Inf.<₋-dec -<±-irrelevant : Irrelevant _<_ Irrelevant _<±_ +<±-irrelevant : Irrelevant _<_ Irrelevant _<±_ <±-irrelevant = Sup.<⁺-irrelevant ∘′ Inf.<₋-irrelevant module _ {r} {_≤_ : Rel A r} where open NonStrict _≤_ - <±-transʳ : Trans _≤_ _<_ _<_ Trans _≤±_ _<±_ _<±_ + <±-transʳ : Trans _≤_ _<_ _<_ Trans _≤±_ _<±_ _<±_ <±-transʳ = Sup.<⁺-transʳ ∘′ Inf.<₋-transʳ - <±-transˡ : Trans _<_ _≤_ _<_ Trans _<±_ _≤±_ _<±_ + <±-transˡ : Trans _<_ _≤_ _<_ Trans _<±_ _≤±_ _<±_ <±-transˡ = Sup.<⁺-transˡ ∘′ Inf.<₋-transˡ ------------------------------------------------------------------------ -- Relational properties + propositional equality -<±-cmp-≡ : Trichotomous _≡_ _<_ Trichotomous _≡_ _<±_ +<±-cmp-≡ : Trichotomous _≡_ _<_ Trichotomous _≡_ _<±_ <±-cmp-≡ = Sup.<⁺-cmp-≡ ∘′ Inf.<₋-cmp-≡ -<±-irrefl-≡ : Irreflexive _≡_ _<_ Irreflexive _≡_ _<±_ +<±-irrefl-≡ : Irreflexive _≡_ _<_ Irreflexive _≡_ _<±_ <±-irrefl-≡ = Sup.<⁺-irrefl-≡ ∘′ Inf.<₋-irrefl-≡ -<±-respˡ-≡ : _<±_ Respectsˡ _≡_ +<±-respˡ-≡ : _<±_ Respectsˡ _≡_ <±-respˡ-≡ = Sup.<⁺-respˡ-≡ -<±-respʳ-≡ : _<±_ Respectsʳ _≡_ +<±-respʳ-≡ : _<±_ Respectsʳ _≡_ <±-respʳ-≡ = Sup.<⁺-respʳ-≡ -<±-resp-≡ : _<±_ Respects₂ _≡_ +<±-resp-≡ : _<±_ Respects₂ _≡_ <±-resp-≡ = Sup.<⁺-resp-≡ ------------------------------------------------------------------------ @@ -101,19 +101,19 @@ open Equality _≈_ - <±-cmp : Trichotomous _≈_ _<_ Trichotomous _≈±_ _<±_ + <±-cmp : Trichotomous _≈_ _<_ Trichotomous _≈±_ _<±_ <±-cmp = Sup.<⁺-cmp ∘′ Inf.<₋-cmp - <±-irrefl : Irreflexive _≈_ _<_ Irreflexive _≈±_ _<±_ + <±-irrefl : Irreflexive _≈_ _<_ Irreflexive _≈±_ _<±_ <±-irrefl = Sup.<⁺-irrefl ∘′ Inf.<₋-irrefl - <±-respˡ-≈± : _<_ Respectsˡ _≈_ _<±_ Respectsˡ _≈±_ + <±-respˡ-≈± : _<_ Respectsˡ _≈_ _<±_ Respectsˡ _≈±_ <±-respˡ-≈± = Sup.<⁺-respˡ-≈⁺ ∘′ Inf.<₋-respˡ-≈₋ - <±-respʳ-≈± : _<_ Respectsʳ _≈_ _<±_ Respectsʳ _≈±_ + <±-respʳ-≈± : _<_ Respectsʳ _≈_ _<±_ Respectsʳ _≈±_ <±-respʳ-≈± = Sup.<⁺-respʳ-≈⁺ ∘′ Inf.<₋-respʳ-≈₋ - <±-resp-≈± : _<_ Respects₂ _≈_ _<±_ Respects₂ _≈±_ + <±-resp-≈± : _<_ Respects₂ _≈_ _<±_ Respects₂ _≈±_ <±-resp-≈± = Sup.<⁺-resp-≈⁺ ∘′ Inf.<₋-resp-≈₋ ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Add.Infimum.NonStrict.html b/master/Relation.Binary.Construct.Add.Infimum.NonStrict.html index e491162297..f3af453186 100644 --- a/master/Relation.Binary.Construct.Add.Infimum.NonStrict.html +++ b/master/Relation.Binary.Construct.Add.Infimum.NonStrict.html @@ -14,7 +14,7 @@ open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsDecPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Minimum; Transitive; Total; Decidable; Irrelevant; Antisymmetric) + using (Minimum; Transitive; Total; Decidable; Irrelevant; Antisymmetric) module Relation.Binary.Construct.Add.Infimum.NonStrict {a } {A : Set a} (_≤_ : Rel A ) where @@ -24,7 +24,7 @@ open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) import Relation.Binary.PropositionalEquality.Properties as import Relation.Binary.Construct.Add.Infimum.Equality as Equality -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) open import Relation.Nullary.Construct.Add.Infimum import Relation.Nullary.Decidable as Dec @@ -42,24 +42,24 @@ [≤]-injective : {k l} [ k ] ≤₋ [ l ] k l [≤]-injective [ p ] = p -≤₋-trans : Transitive _≤_ Transitive _≤₋_ +≤₋-trans : Transitive _≤_ Transitive _≤₋_ ≤₋-trans ≤-trans (⊥₋≤ l) q = ⊥₋≤ _ ≤₋-trans ≤-trans [ p ] [ q ] = [ ≤-trans p q ] -≤₋-minimum : Minimum _≤₋_ ⊥₋ +≤₋-minimum : Minimum _≤₋_ ⊥₋ ≤₋-minimum = ⊥₋≤_ -≤₋-dec : Decidable _≤_ Decidable _≤₋_ -≤₋-dec _≤?_ ⊥₋ l = yes (⊥₋≤ l) -≤₋-dec _≤?_ [ k ] ⊥₋ = no ()) -≤₋-dec _≤?_ [ k ] [ l ] = Dec.map′ [_] [≤]-injective (k ≤? l) +≤₋-dec : Decidable _≤_ Decidable _≤₋_ +≤₋-dec _≤?_ ⊥₋ l = yes (⊥₋≤ l) +≤₋-dec _≤?_ [ k ] ⊥₋ = no ()) +≤₋-dec _≤?_ [ k ] [ l ] = Dec.map′ [_] [≤]-injective (k ≤? l) -≤₋-total : Total _≤_ Total _≤₋_ +≤₋-total : Total _≤_ Total _≤₋_ ≤₋-total ≤-total ⊥₋ l = inj₁ (⊥₋≤ l) ≤₋-total ≤-total k ⊥₋ = inj₂ (⊥₋≤ k) ≤₋-total ≤-total [ k ] [ l ] = Sum.map [_] [_] (≤-total k l) -≤₋-irrelevant : Irrelevant _≤_ Irrelevant _≤₋_ +≤₋-irrelevant : Irrelevant _≤_ Irrelevant _≤₋_ ≤₋-irrelevant ≤-irr (⊥₋≤ k) (⊥₋≤ k) = refl ≤₋-irrelevant ≤-irr [ p ] [ q ] = cong _ (≤-irr p q) @@ -70,7 +70,7 @@ ≤₋-reflexive-≡ ≤-reflexive {[ x ]} refl = [ ≤-reflexive refl ] ≤₋-reflexive-≡ ≤-reflexive {⊥₋} refl = ⊥₋≤ ⊥₋ -≤₋-antisym-≡ : Antisymmetric _≡_ _≤_ Antisymmetric _≡_ _≤₋_ +≤₋-antisym-≡ : Antisymmetric _≡_ _≤_ Antisymmetric _≡_ _≤₋_ ≤₋-antisym-≡ antisym (⊥₋≤ _) (⊥₋≤ _) = refl ≤₋-antisym-≡ antisym [ p ] [ q ] = cong [_] (antisym p q) @@ -85,7 +85,7 @@ ≤₋-reflexive ≤-reflexive ⊥₋≈⊥₋ = ⊥₋≤ ⊥₋ ≤₋-reflexive ≤-reflexive [ p ] = [ ≤-reflexive p ] - ≤₋-antisym : Antisymmetric _≈_ _≤_ Antisymmetric _≈₋_ _≤₋_ + ≤₋-antisym : Antisymmetric _≈_ _≤_ Antisymmetric _≈₋_ _≤₋_ ≤₋-antisym ≤≥⇒≈ (⊥₋≤ _) (⊥₋≤ _) = ⊥₋≈⊥₋ ≤₋-antisym ≤≥⇒≈ [ p ] [ q ] = [ ≤≥⇒≈ p q ] diff --git a/master/Relation.Binary.Construct.Add.Infimum.Strict.html b/master/Relation.Binary.Construct.Add.Infimum.Strict.html index 4072f30c70..e759f489fb 100644 --- a/master/Relation.Binary.Construct.Add.Infimum.Strict.html +++ b/master/Relation.Binary.Construct.Add.Infimum.Strict.html @@ -14,7 +14,7 @@ open import Relation.Binary.Structures using (IsStrictPartialOrder; IsDecStrictPartialOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Asymmetric; Transitive; Decidable; Irrelevant; Irreflexive; Trans; Trichotomous; tri≈; tri<; tri>; _Respectsˡ_; _Respectsʳ_; _Respects₂_) + using (Asymmetric; Transitive; Decidable; Irrelevant; Irreflexive; Trans; Trichotomous; tri≈; tri<; tri>; _Respectsˡ_; _Respectsʳ_; _Respects₂_) module Relation.Binary.Construct.Add.Infimum.Strict {a } {A : Set a} (_<_ : Rel A ) where @@ -26,7 +26,7 @@ import Relation.Binary.PropositionalEquality.Properties as import Relation.Binary.Construct.Add.Infimum.Equality as Equality import Relation.Binary.Construct.Add.Infimum.NonStrict as NonStrict -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) open import Relation.Nullary.Construct.Add.Infimum import Relation.Nullary.Decidable as Dec @@ -45,20 +45,20 @@ [<]-injective : {k l} [ k ] <₋ [ l ] k < l [<]-injective [ p ] = p -<₋-asym : Asymmetric _<_ Asymmetric _<₋_ +<₋-asym : Asymmetric _<_ Asymmetric _<₋_ <₋-asym <-asym [ p ] [ q ] = <-asym p q -<₋-trans : Transitive _<_ Transitive _<₋_ +<₋-trans : Transitive _<_ Transitive _<₋_ <₋-trans <-trans ⊥₋<[ l ] [ q ] = ⊥₋<[ _ ] <₋-trans <-trans [ p ] [ q ] = [ <-trans p q ] -<₋-dec : Decidable _<_ Decidable _<₋_ -<₋-dec _<?_ ⊥₋ ⊥₋ = no ()) -<₋-dec _<?_ ⊥₋ [ l ] = yes ⊥₋<[ l ] -<₋-dec _<?_ [ k ] ⊥₋ = no ()) -<₋-dec _<?_ [ k ] [ l ] = Dec.map′ [_] [<]-injective (k <? l) +<₋-dec : Decidable _<_ Decidable _<₋_ +<₋-dec _<?_ ⊥₋ ⊥₋ = no ()) +<₋-dec _<?_ ⊥₋ [ l ] = yes ⊥₋<[ l ] +<₋-dec _<?_ [ k ] ⊥₋ = no ()) +<₋-dec _<?_ [ k ] [ l ] = Dec.map′ [_] [<]-injective (k <? l) -<₋-irrelevant : Irrelevant _<_ Irrelevant _<₋_ +<₋-irrelevant : Irrelevant _<_ Irrelevant _<₋_ <₋-irrelevant <-irr ⊥₋<[ l ] ⊥₋<[ l ] = refl <₋-irrelevant <-irr [ p ] [ q ] = cong _ (<-irr p q) @@ -66,37 +66,37 @@ open NonStrict _≤_ - <₋-transʳ : Trans _≤_ _<_ _<_ Trans _≤₋_ _<₋_ _<₋_ + <₋-transʳ : Trans _≤_ _<_ _<_ Trans _≤₋_ _<₋_ _<₋_ <₋-transʳ <-transʳ (⊥₋≤ .⊥₋) (⊥₋<[ l ]) = ⊥₋<[ l ] <₋-transʳ <-transʳ (⊥₋≤ l) [ q ] = ⊥₋<[ _ ] <₋-transʳ <-transʳ [ p ] [ q ] = [ <-transʳ p q ] - <₋-transˡ : Trans _<_ _≤_ _<_ Trans _<₋_ _≤₋_ _<₋_ + <₋-transˡ : Trans _<_ _≤_ _<_ Trans _<₋_ _≤₋_ _<₋_ <₋-transˡ <-transˡ ⊥₋<[ l ] [ q ] = ⊥₋<[ _ ] <₋-transˡ <-transˡ [ p ] [ q ] = [ <-transˡ p q ] ------------------------------------------------------------------------ -- Relational properties + propositional equality -<₋-cmp-≡ : Trichotomous _≡_ _<_ Trichotomous _≡_ _<₋_ -<₋-cmp-≡ <-cmp ⊥₋ ⊥₋ = tri≈ ()) refl ()) -<₋-cmp-≡ <-cmp ⊥₋ [ l ] = tri< ⊥₋<[ l ] ()) ()) -<₋-cmp-≡ <-cmp [ k ] ⊥₋ = tri> ()) ()) ⊥₋<[ k ] +<₋-cmp-≡ : Trichotomous _≡_ _<_ Trichotomous _≡_ _<₋_ +<₋-cmp-≡ <-cmp ⊥₋ ⊥₋ = tri≈ ()) refl ()) +<₋-cmp-≡ <-cmp ⊥₋ [ l ] = tri< ⊥₋<[ l ] ()) ()) +<₋-cmp-≡ <-cmp [ k ] ⊥₋ = tri> ()) ()) ⊥₋<[ k ] <₋-cmp-≡ <-cmp [ k ] [ l ] with <-cmp k l -... | tri< a ¬b ¬c = tri< [ a ] (¬b []-injective) (¬c [<]-injective) -... | tri≈ ¬a refl ¬c = tri≈ (¬a [<]-injective) refl (¬c [<]-injective) -... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b []-injective) [ c ] +... | tri< a ¬b ¬c = tri< [ a ] (¬b []-injective) (¬c [<]-injective) +... | tri≈ ¬a refl ¬c = tri≈ (¬a [<]-injective) refl (¬c [<]-injective) +... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b []-injective) [ c ] -<₋-irrefl-≡ : Irreflexive _≡_ _<_ Irreflexive _≡_ _<₋_ +<₋-irrefl-≡ : Irreflexive _≡_ _<_ Irreflexive _≡_ _<₋_ <₋-irrefl-≡ <-irrefl refl [ x ] = <-irrefl refl x -<₋-respˡ-≡ : _<₋_ Respectsˡ _≡_ +<₋-respˡ-≡ : _<₋_ Respectsˡ _≡_ <₋-respˡ-≡ = subst (_<₋ _) -<₋-respʳ-≡ : _<₋_ Respectsʳ _≡_ +<₋-respʳ-≡ : _<₋_ Respectsʳ _≡_ <₋-respʳ-≡ = subst (_ <₋_) -<₋-resp-≡ : _<₋_ Respects₂ _≡_ +<₋-resp-≡ : _<₋_ Respects₂ _≡_ <₋-resp-≡ = <₋-respʳ-≡ , <₋-respˡ-≡ ------------------------------------------------------------------------ @@ -106,28 +106,28 @@ open Equality _≈_ - <₋-cmp : Trichotomous _≈_ _<_ Trichotomous _≈₋_ _<₋_ - <₋-cmp <-cmp ⊥₋ ⊥₋ = tri≈ ()) ⊥₋≈⊥₋ ()) - <₋-cmp <-cmp ⊥₋ [ l ] = tri< ⊥₋<[ l ] ()) ()) - <₋-cmp <-cmp [ k ] ⊥₋ = tri> ()) ()) ⊥₋<[ k ] + <₋-cmp : Trichotomous _≈_ _<_ Trichotomous _≈₋_ _<₋_ + <₋-cmp <-cmp ⊥₋ ⊥₋ = tri≈ ()) ⊥₋≈⊥₋ ()) + <₋-cmp <-cmp ⊥₋ [ l ] = tri< ⊥₋<[ l ] ()) ()) + <₋-cmp <-cmp [ k ] ⊥₋ = tri> ()) ()) ⊥₋<[ k ] <₋-cmp <-cmp [ k ] [ l ] with <-cmp k l - ... | tri< a ¬b ¬c = tri< [ a ] (¬b [≈]-injective) (¬c [<]-injective) - ... | tri≈ ¬a b ¬c = tri≈ (¬a [<]-injective) [ b ] (¬c [<]-injective) - ... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b [≈]-injective) [ c ] + ... | tri< a ¬b ¬c = tri< [ a ] (¬b [≈]-injective) (¬c [<]-injective) + ... | tri≈ ¬a b ¬c = tri≈ (¬a [<]-injective) [ b ] (¬c [<]-injective) + ... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b [≈]-injective) [ c ] - <₋-irrefl : Irreflexive _≈_ _<_ Irreflexive _≈₋_ _<₋_ + <₋-irrefl : Irreflexive _≈_ _<_ Irreflexive _≈₋_ _<₋_ <₋-irrefl <-irrefl [ p ] [ q ] = <-irrefl p q - <₋-respˡ-≈₋ : _<_ Respectsˡ _≈_ _<₋_ Respectsˡ _≈₋_ + <₋-respˡ-≈₋ : _<_ Respectsˡ _≈_ _<₋_ Respectsˡ _≈₋_ <₋-respˡ-≈₋ <-respˡ-≈ ⊥₋≈⊥₋ q = q <₋-respˡ-≈₋ <-respˡ-≈ [ p ] [ q ] = [ <-respˡ-≈ p q ] - <₋-respʳ-≈₋ : _<_ Respectsʳ _≈_ _<₋_ Respectsʳ _≈₋_ + <₋-respʳ-≈₋ : _<_ Respectsʳ _≈_ _<₋_ Respectsʳ _≈₋_ <₋-respʳ-≈₋ <-respʳ-≈ ⊥₋≈⊥₋ q = q <₋-respʳ-≈₋ <-respʳ-≈ [ p ] ⊥₋<[ l ] = ⊥₋<[ _ ] <₋-respʳ-≈₋ <-respʳ-≈ [ p ] [ q ] = [ <-respʳ-≈ p q ] - <₋-resp-≈₋ : _<_ Respects₂ _≈_ _<₋_ Respects₂ _≈₋_ + <₋-resp-≈₋ : _<_ Respects₂ _≈_ _<₋_ Respects₂ _≈₋_ <₋-resp-≈₋ = map <₋-respʳ-≈₋ <₋-respˡ-≈₋ ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Add.Point.Equality.html b/master/Relation.Binary.Construct.Add.Point.Equality.html index e97d12a39b..2d2db327ca 100644 --- a/master/Relation.Binary.Construct.Add.Point.Equality.html +++ b/master/Relation.Binary.Construct.Add.Point.Equality.html @@ -14,7 +14,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Decidable; Irrelevant; Substitutive) + using (Reflexive; Symmetric; Transitive; Decidable; Irrelevant; Substitutive) module Relation.Binary.Construct.Add.Point.Equality {a } {A : Set a} (_≈_ : Rel A ) where @@ -22,7 +22,7 @@ open import Level using (_⊔_) open import Function.Base import Relation.Binary.PropositionalEquality.Core as -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) open import Relation.Nullary.Construct.Add.Point import Relation.Nullary.Decidable as Dec @@ -41,29 +41,29 @@ [≈]-injective : {k l} [ k ] ≈∙ [ l ] k l [≈]-injective [ k≈l ] = k≈l -≈∙-refl : Reflexive _≈_ Reflexive _≈∙_ +≈∙-refl : Reflexive _≈_ Reflexive _≈∙_ ≈∙-refl ≈-refl {} = ∙≈∙ ≈∙-refl ≈-refl {[ k ]} = [ ≈-refl ] -≈∙-sym : Symmetric _≈_ Symmetric _≈∙_ +≈∙-sym : Symmetric _≈_ Symmetric _≈∙_ ≈∙-sym ≈-sym ∙≈∙ = ∙≈∙ ≈∙-sym ≈-sym [ x≈y ] = [ ≈-sym x≈y ] -≈∙-trans : Transitive _≈_ Transitive _≈∙_ +≈∙-trans : Transitive _≈_ Transitive _≈∙_ ≈∙-trans ≈-trans ∙≈∙ ∙≈z = ∙≈z ≈∙-trans ≈-trans [ x≈y ] [ y≈z ] = [ ≈-trans x≈y y≈z ] -≈∙-dec : Decidable _≈_ Decidable _≈∙_ -≈∙-dec _≟_ = yes ∙≈∙ -≈∙-dec _≟_ [ l ] = no ()) -≈∙-dec _≟_ [ k ] = no ()) -≈∙-dec _≟_ [ k ] [ l ] = Dec.map′ [_] [≈]-injective (k l) +≈∙-dec : Decidable _≈_ Decidable _≈∙_ +≈∙-dec _≟_ = yes ∙≈∙ +≈∙-dec _≟_ [ l ] = no ()) +≈∙-dec _≟_ [ k ] = no ()) +≈∙-dec _≟_ [ k ] [ l ] = Dec.map′ [_] [≈]-injective (k l) -≈∙-irrelevant : Irrelevant _≈_ Irrelevant _≈∙_ +≈∙-irrelevant : Irrelevant _≈_ Irrelevant _≈∙_ ≈∙-irrelevant ≈-irr ∙≈∙ ∙≈∙ = ≡.refl ≈∙-irrelevant ≈-irr [ p ] [ q ] = ≡.cong _ (≈-irr p q) -≈∙-substitutive : {} Substitutive _≈_ Substitutive _≈∙_ +≈∙-substitutive : {} Substitutive _≈_ Substitutive _≈∙_ ≈∙-substitutive ≈-subst P ∙≈∙ = id ≈∙-substitutive ≈-subst P [ p ] = ≈-subst (P ∘′ [_]) p diff --git a/master/Relation.Binary.Construct.Add.Supremum.NonStrict.html b/master/Relation.Binary.Construct.Add.Supremum.NonStrict.html index 26b45633d1..ec51104ecc 100644 --- a/master/Relation.Binary.Construct.Add.Supremum.NonStrict.html +++ b/master/Relation.Binary.Construct.Add.Supremum.NonStrict.html @@ -14,14 +14,14 @@ open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsDecPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Maximum; Transitive; Total; Decidable; Irrelevant; Antisymmetric) + using (Maximum; Transitive; Total; Decidable; Irrelevant; Antisymmetric) module Relation.Binary.Construct.Add.Supremum.NonStrict {a } {A : Set a} (_≤_ : Rel A ) where open import Level using (_⊔_) open import Data.Sum.Base as Sum -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) import Relation.Nullary.Decidable as Dec open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) @@ -44,24 +44,24 @@ [≤]-injective : {k l} [ k ] ≤⁺ [ l ] k l [≤]-injective [ p ] = p -≤⁺-trans : Transitive _≤_ Transitive _≤⁺_ +≤⁺-trans : Transitive _≤_ Transitive _≤⁺_ ≤⁺-trans ≤-trans [ p ] [ q ] = [ ≤-trans p q ] ≤⁺-trans ≤-trans p (l ≤⊤⁺) = _ ≤⊤⁺ -≤⁺-maximum : Maximum _≤⁺_ ⊤⁺ +≤⁺-maximum : Maximum _≤⁺_ ⊤⁺ ≤⁺-maximum = _≤⊤⁺ -≤⁺-dec : Decidable _≤_ Decidable _≤⁺_ -≤⁺-dec _≤?_ k ⊤⁺ = yes (k ≤⊤⁺) -≤⁺-dec _≤?_ ⊤⁺ [ l ] = no ()) -≤⁺-dec _≤?_ [ k ] [ l ] = Dec.map′ [_] [≤]-injective (k ≤? l) +≤⁺-dec : Decidable _≤_ Decidable _≤⁺_ +≤⁺-dec _≤?_ k ⊤⁺ = yes (k ≤⊤⁺) +≤⁺-dec _≤?_ ⊤⁺ [ l ] = no ()) +≤⁺-dec _≤?_ [ k ] [ l ] = Dec.map′ [_] [≤]-injective (k ≤? l) -≤⁺-total : Total _≤_ Total _≤⁺_ +≤⁺-total : Total _≤_ Total _≤⁺_ ≤⁺-total ≤-total k ⊤⁺ = inj₁ (k ≤⊤⁺) ≤⁺-total ≤-total ⊤⁺ l = inj₂ (l ≤⊤⁺) ≤⁺-total ≤-total [ k ] [ l ] = Sum.map [_] [_] (≤-total k l) -≤⁺-irrelevant : Irrelevant _≤_ Irrelevant _≤⁺_ +≤⁺-irrelevant : Irrelevant _≤_ Irrelevant _≤⁺_ ≤⁺-irrelevant ≤-irr [ p ] [ q ] = cong _ (≤-irr p q) ≤⁺-irrelevant ≤-irr (k ≤⊤⁺) (k ≤⊤⁺) = refl @@ -72,7 +72,7 @@ ≤⁺-reflexive-≡ ≤-reflexive {[ x ]} refl = [ ≤-reflexive refl ] ≤⁺-reflexive-≡ ≤-reflexive {⊤⁺} refl = ⊤⁺ ≤⊤⁺ -≤⁺-antisym-≡ : Antisymmetric _≡_ _≤_ Antisymmetric _≡_ _≤⁺_ +≤⁺-antisym-≡ : Antisymmetric _≡_ _≤_ Antisymmetric _≡_ _≤⁺_ ≤⁺-antisym-≡ antisym (_ ≤⊤⁺) (_ ≤⊤⁺) = refl ≤⁺-antisym-≡ antisym [ p ] [ q ] = cong [_] (antisym p q) @@ -87,7 +87,7 @@ ≤⁺-reflexive ≤-reflexive [ p ] = [ ≤-reflexive p ] ≤⁺-reflexive ≤-reflexive ⊤⁺≈⊤⁺ = ⊤⁺ ≤⊤⁺ - ≤⁺-antisym : Antisymmetric _≈_ _≤_ Antisymmetric _≈⁺_ _≤⁺_ + ≤⁺-antisym : Antisymmetric _≈_ _≤_ Antisymmetric _≈⁺_ _≤⁺_ ≤⁺-antisym ≤-antisym [ p ] [ q ] = [ ≤-antisym p q ] ≤⁺-antisym ≤-antisym (_ ≤⊤⁺) (_ ≤⊤⁺) = ⊤⁺≈⊤⁺ diff --git a/master/Relation.Binary.Construct.Add.Supremum.Strict.html b/master/Relation.Binary.Construct.Add.Supremum.Strict.html index 09d291e759..8bdc1aa801 100644 --- a/master/Relation.Binary.Construct.Add.Supremum.Strict.html +++ b/master/Relation.Binary.Construct.Add.Supremum.Strict.html @@ -14,7 +14,7 @@ open import Relation.Binary.Structures using (IsStrictPartialOrder; IsDecStrictPartialOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Asymmetric; Transitive; Decidable; Irrelevant; Irreflexive; Trans; Trichotomous; tri≈; tri>; tri<; _Respectsˡ_; _Respectsʳ_; _Respects₂_) + using (Asymmetric; Transitive; Decidable; Irrelevant; Irreflexive; Trans; Trichotomous; tri≈; tri>; tri<; _Respectsˡ_; _Respectsʳ_; _Respects₂_) module Relation.Binary.Construct.Add.Supremum.Strict {a r} {A : Set a} (_<_ : Rel A r) where @@ -22,7 +22,7 @@ open import Level using (_⊔_) open import Data.Product.Base using (_,_; map) open import Function.Base -open import Relation.Nullary hiding (Irrelevant) +open import Relation.Nullary hiding (Irrelevant) import Relation.Nullary.Decidable as Dec open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong; subst) import Relation.Binary.PropositionalEquality.Properties as @@ -45,20 +45,20 @@ [<]-injective : {k l} [ k ] <⁺ [ l ] k < l [<]-injective [ p ] = p -<⁺-asym : Asymmetric _<_ Asymmetric _<⁺_ +<⁺-asym : Asymmetric _<_ Asymmetric _<⁺_ <⁺-asym <-asym [ p ] [ q ] = <-asym p q -<⁺-trans : Transitive _<_ Transitive _<⁺_ +<⁺-trans : Transitive _<_ Transitive _<⁺_ <⁺-trans <-trans [ p ] [ q ] = [ <-trans p q ] <⁺-trans <-trans [ p ] [ k ]<⊤⁺ = [ _ ]<⊤⁺ -<⁺-dec : Decidable _<_ Decidable _<⁺_ -<⁺-dec _<?_ [ k ] [ l ] = Dec.map′ [_] [<]-injective (k <? l) -<⁺-dec _<?_ [ k ] ⊤⁺ = yes [ k ]<⊤⁺ -<⁺-dec _<?_ ⊤⁺ [ l ] = no ()) -<⁺-dec _<?_ ⊤⁺ ⊤⁺ = no ()) +<⁺-dec : Decidable _<_ Decidable _<⁺_ +<⁺-dec _<?_ [ k ] [ l ] = Dec.map′ [_] [<]-injective (k <? l) +<⁺-dec _<?_ [ k ] ⊤⁺ = yes [ k ]<⊤⁺ +<⁺-dec _<?_ ⊤⁺ [ l ] = no ()) +<⁺-dec _<?_ ⊤⁺ ⊤⁺ = no ()) -<⁺-irrelevant : Irrelevant _<_ Irrelevant _<⁺_ +<⁺-irrelevant : Irrelevant _<_ Irrelevant _<⁺_ <⁺-irrelevant <-irr [ p ] [ q ] = cong _ (<-irr p q) <⁺-irrelevant <-irr [ k ]<⊤⁺ [ k ]<⊤⁺ = refl @@ -67,11 +67,11 @@ open NonStrict _≤_ - <⁺-transʳ : Trans _≤_ _<_ _<_ Trans _≤⁺_ _<⁺_ _<⁺_ + <⁺-transʳ : Trans _≤_ _<_ _<_ Trans _≤⁺_ _<⁺_ _<⁺_ <⁺-transʳ <-transʳ [ p ] [ q ] = [ <-transʳ p q ] <⁺-transʳ <-transʳ [ p ] [ k ]<⊤⁺ = [ _ ]<⊤⁺ - <⁺-transˡ : Trans _<_ _≤_ _<_ Trans _<⁺_ _≤⁺_ _<⁺_ + <⁺-transˡ : Trans _<_ _≤_ _<_ Trans _<⁺_ _≤⁺_ _<⁺_ <⁺-transˡ <-transˡ [ p ] [ q ] = [ <-transˡ p q ] <⁺-transˡ <-transˡ [ p ] ([ _ ] ≤⊤⁺) = [ _ ]<⊤⁺ <⁺-transˡ <-transˡ [ k ]<⊤⁺ (⊤⁺ ≤⊤⁺) = [ k ]<⊤⁺ @@ -79,25 +79,25 @@ ------------------------------------------------------------------------ -- Relational properties + propositional equality -<⁺-cmp-≡ : Trichotomous _≡_ _<_ Trichotomous _≡_ _<⁺_ -<⁺-cmp-≡ <-cmp ⊤⁺ ⊤⁺ = tri≈ ()) refl ()) -<⁺-cmp-≡ <-cmp ⊤⁺ [ l ] = tri> ()) ()) [ l ]<⊤⁺ -<⁺-cmp-≡ <-cmp [ k ] ⊤⁺ = tri< [ k ]<⊤⁺ ()) ()) +<⁺-cmp-≡ : Trichotomous _≡_ _<_ Trichotomous _≡_ _<⁺_ +<⁺-cmp-≡ <-cmp ⊤⁺ ⊤⁺ = tri≈ ()) refl ()) +<⁺-cmp-≡ <-cmp ⊤⁺ [ l ] = tri> ()) ()) [ l ]<⊤⁺ +<⁺-cmp-≡ <-cmp [ k ] ⊤⁺ = tri< [ k ]<⊤⁺ ()) ()) <⁺-cmp-≡ <-cmp [ k ] [ l ] with <-cmp k l -... | tri< a ¬b ¬c = tri< [ a ] (¬b []-injective) (¬c [<]-injective) -... | tri≈ ¬a refl ¬c = tri≈ (¬a [<]-injective) refl (¬c [<]-injective) -... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b []-injective) [ c ] +... | tri< a ¬b ¬c = tri< [ a ] (¬b []-injective) (¬c [<]-injective) +... | tri≈ ¬a refl ¬c = tri≈ (¬a [<]-injective) refl (¬c [<]-injective) +... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b []-injective) [ c ] -<⁺-irrefl-≡ : Irreflexive _≡_ _<_ Irreflexive _≡_ _<⁺_ +<⁺-irrefl-≡ : Irreflexive _≡_ _<_ Irreflexive _≡_ _<⁺_ <⁺-irrefl-≡ <-irrefl refl [ x ] = <-irrefl refl x -<⁺-respˡ-≡ : _<⁺_ Respectsˡ _≡_ +<⁺-respˡ-≡ : _<⁺_ Respectsˡ _≡_ <⁺-respˡ-≡ = subst (_<⁺ _) -<⁺-respʳ-≡ : _<⁺_ Respectsʳ _≡_ +<⁺-respʳ-≡ : _<⁺_ Respectsʳ _≡_ <⁺-respʳ-≡ = subst (_ <⁺_) -<⁺-resp-≡ : _<⁺_ Respects₂ _≡_ +<⁺-resp-≡ : _<⁺_ Respects₂ _≡_ <⁺-resp-≡ = <⁺-respʳ-≡ , <⁺-respˡ-≡ ------------------------------------------------------------------------ @@ -107,28 +107,28 @@ open Equality _≈_ - <⁺-cmp : Trichotomous _≈_ _<_ Trichotomous _≈⁺_ _<⁺_ - <⁺-cmp <-cmp ⊤⁺ ⊤⁺ = tri≈ ()) ⊤⁺≈⊤⁺ ()) - <⁺-cmp <-cmp ⊤⁺ [ l ] = tri> ()) ()) [ l ]<⊤⁺ - <⁺-cmp <-cmp [ k ] ⊤⁺ = tri< [ k ]<⊤⁺ ()) ()) + <⁺-cmp : Trichotomous _≈_ _<_ Trichotomous _≈⁺_ _<⁺_ + <⁺-cmp <-cmp ⊤⁺ ⊤⁺ = tri≈ ()) ⊤⁺≈⊤⁺ ()) + <⁺-cmp <-cmp ⊤⁺ [ l ] = tri> ()) ()) [ l ]<⊤⁺ + <⁺-cmp <-cmp [ k ] ⊤⁺ = tri< [ k ]<⊤⁺ ()) ()) <⁺-cmp <-cmp [ k ] [ l ] with <-cmp k l - ... | tri< a ¬b ¬c = tri< [ a ] (¬b [≈]-injective) (¬c [<]-injective) - ... | tri≈ ¬a b ¬c = tri≈ (¬a [<]-injective) [ b ] (¬c [<]-injective) - ... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b [≈]-injective) [ c ] + ... | tri< a ¬b ¬c = tri< [ a ] (¬b [≈]-injective) (¬c [<]-injective) + ... | tri≈ ¬a b ¬c = tri≈ (¬a [<]-injective) [ b ] (¬c [<]-injective) + ... | tri> ¬a ¬b c = tri> (¬a [<]-injective) (¬b [≈]-injective) [ c ] - <⁺-irrefl : Irreflexive _≈_ _<_ Irreflexive _≈⁺_ _<⁺_ + <⁺-irrefl : Irreflexive _≈_ _<_ Irreflexive _≈⁺_ _<⁺_ <⁺-irrefl <-irrefl [ p ] [ q ] = <-irrefl p q - <⁺-respˡ-≈⁺ : _<_ Respectsˡ _≈_ _<⁺_ Respectsˡ _≈⁺_ + <⁺-respˡ-≈⁺ : _<_ Respectsˡ _≈_ _<⁺_ Respectsˡ _≈⁺_ <⁺-respˡ-≈⁺ <-respˡ-≈ [ p ] [ q ] = [ <-respˡ-≈ p q ] <⁺-respˡ-≈⁺ <-respˡ-≈ [ p ] ([ l ]<⊤⁺) = [ _ ]<⊤⁺ <⁺-respˡ-≈⁺ <-respˡ-≈ ⊤⁺≈⊤⁺ q = q - <⁺-respʳ-≈⁺ : _<_ Respectsʳ _≈_ _<⁺_ Respectsʳ _≈⁺_ + <⁺-respʳ-≈⁺ : _<_ Respectsʳ _≈_ _<⁺_ Respectsʳ _≈⁺_ <⁺-respʳ-≈⁺ <-respʳ-≈ [ p ] [ q ] = [ <-respʳ-≈ p q ] <⁺-respʳ-≈⁺ <-respʳ-≈ ⊤⁺≈⊤⁺ q = q - <⁺-resp-≈⁺ : _<_ Respects₂ _≈_ _<⁺_ Respects₂ _≈⁺_ + <⁺-resp-≈⁺ : _<_ Respects₂ _≈_ _<⁺_ Respects₂ _≈⁺_ <⁺-resp-≈⁺ = map <⁺-respʳ-≈⁺ <⁺-respˡ-≈⁺ ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Always.html b/master/Relation.Binary.Construct.Always.html index 034e800ee8..cb6cc2324a 100644 --- a/master/Relation.Binary.Construct.Always.html +++ b/master/Relation.Binary.Construct.Always.html @@ -12,7 +12,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) open import Relation.Binary.Construct.Constant using (Const) open import Data.Unit.Polymorphic using (; tt) @@ -27,13 +27,13 @@ module _ {a} (A : Set a) where - refl : Reflexive {A = A} { = } Always + refl : Reflexive {A = A} { = } Always refl = _ - sym : Symmetric {A = A} { = } Always + sym : Symmetric {A = A} { = } Always sym _ = _ - trans : Transitive {A = A} { = } Always + trans : Transitive {A = A} { = } Always trans _ _ = _ isEquivalence : IsEquivalence { = } {A} Always diff --git a/master/Relation.Binary.Construct.Closure.Equivalence.html b/master/Relation.Binary.Construct.Closure.Equivalence.html index d96cb2d2ef..ac69f47af0 100644 --- a/master/Relation.Binary.Construct.Closure.Equivalence.html +++ b/master/Relation.Binary.Construct.Closure.Equivalence.html @@ -16,7 +16,7 @@ open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Transitive; Symmetric) + using (Reflexive; Transitive; Symmetric) open import Relation.Binary.Construct.Closure.ReflexiveTransitive as Star using (Star; ε; _◅◅_; reverse) open import Relation.Binary.Construct.Closure.Symmetric as SC @@ -40,13 +40,13 @@ module _ (_∼_ : Rel A ) where - reflexive : Reflexive (EqClosure _∼_) + reflexive : Reflexive (EqClosure _∼_) reflexive = ε - transitive : Transitive (EqClosure _∼_) + transitive : Transitive (EqClosure _∼_) transitive = _◅◅_ - symmetric : Symmetric (EqClosure _∼_) + symmetric : Symmetric (EqClosure _∼_) symmetric = reverse (SC.symmetric _∼_) isEquivalence : IsEquivalence (EqClosure _∼_) diff --git a/master/Relation.Binary.Construct.Closure.Reflexive.Properties.WithK.html b/master/Relation.Binary.Construct.Closure.Reflexive.Properties.WithK.html index 53655ef0ec..2b6bfe5c44 100644 --- a/master/Relation.Binary.Construct.Closure.Reflexive.Properties.WithK.html +++ b/master/Relation.Binary.Construct.Closure.Reflexive.Properties.WithK.html @@ -10,18 +10,18 @@ module Relation.Binary.Construct.Closure.Reflexive.Properties.WithK where open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Irrelevant; Irreflexive) +open import Relation.Binary.Definitions using (Irrelevant; Irreflexive) open import Relation.Binary.Construct.Closure.Reflexive open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.Construct.Closure.Reflexive.Properties public module _ {a } {A : Set a} {_∼_ : Rel A } where - irrel : Irrelevant _∼_ Irreflexive _≡_ _∼_ Irrelevant (ReflClosure _∼_) + irrel : Irrelevant _∼_ Irreflexive _≡_ _∼_ Irrelevant (ReflClosure _∼_) irrel irrel irrefl [ x∼y₁ ] [ x∼y₂ ] = cong [_] (irrel x∼y₁ x∼y₂) - irrel irrel irrefl [ x∼y ] refl = contradiction x∼y (irrefl refl) - irrel irrel irrefl refl [ x∼y ] = contradiction x∼y (irrefl refl) + irrel irrel irrefl [ x∼y ] refl = contradiction x∼y (irrefl refl) + irrel irrel irrefl refl [ x∼y ] = contradiction x∼y (irrefl refl) irrel irrel irrefl refl refl = refl \ No newline at end of file diff --git a/master/Relation.Binary.Construct.Closure.Reflexive.Properties.html b/master/Relation.Binary.Construct.Closure.Reflexive.Properties.html index 29a318ab6a..2317459a80 100644 --- a/master/Relation.Binary.Construct.Closure.Reflexive.Properties.html +++ b/master/Relation.Binary.Construct.Closure.Reflexive.Properties.html @@ -18,13 +18,13 @@ open import Relation.Binary.Structures using (IsPreorder; IsStrictPartialOrder; IsPartialOrder; IsDecStrictPartialOrder; IsDecPartialOrder; IsStrictTotalOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Symmetric; Transitive; Reflexive; Asymmetric; Antisymmetric; Trichotomous; Total; Decidable; DecidableEquality; tri<; tri≈; tri>; _Respectsˡ_; _Respectsʳ_; _Respects_; _Respects₂_) + using (Symmetric; Transitive; Reflexive; Asymmetric; Antisymmetric; Trichotomous; Total; Decidable; DecidableEquality; tri<; tri≈; tri>; _Respectsˡ_; _Respectsʳ_; _Respects_; _Respects₂_) open import Relation.Binary.Construct.Closure.Reflexive open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) import Relation.Binary.PropositionalEquality.Properties as open import Relation.Nullary import Relation.Nullary.Decidable as Dec -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable @@ -57,53 +57,53 @@ ⊎⇔Refl : {a b} (a b a ~ b) a ~ᵒ b ⊎⇔Refl = mk⇔ fromSum toSum - sym : Symmetric _~_ Symmetric _~ᵒ_ + sym : Symmetric _~_ Symmetric _~ᵒ_ sym ~-sym [ x∼y ] = [ ~-sym x∼y ] sym ~-sym refl = refl - trans : Transitive _~_ Transitive _~ᵒ_ + trans : Transitive _~_ Transitive _~ᵒ_ trans ~-trans [ x∼y ] [ x∼y₁ ] = [ ~-trans x∼y x∼y₁ ] trans ~-trans [ x∼y ] refl = [ x∼y ] trans ~-trans refl [ x∼y ] = [ x∼y ] trans ~-trans refl refl = refl - antisym : (_≈_ : Rel A p) Reflexive _≈_ - Asymmetric _~_ Antisymmetric _≈_ _~ᵒ_ - antisym _≈_ ref asym [ x∼y ] [ y∼x ] = contradiction x∼y (asym y∼x) + antisym : (_≈_ : Rel A p) Reflexive _≈_ + Asymmetric _~_ Antisymmetric _≈_ _~ᵒ_ + antisym _≈_ ref asym [ x∼y ] [ y∼x ] = contradiction x∼y (asym y∼x) antisym _≈_ ref asym [ x∼y ] refl = ref antisym _≈_ ref asym refl _ = ref - total : Trichotomous _≡_ _~_ Total _~ᵒ_ + total : Trichotomous _≡_ _~_ Total _~ᵒ_ total compare x y with compare x y - ... | tri< a _ _ = inj₁ [ a ] - ... | tri≈ _ refl _ = inj₁ refl - ... | tri> _ _ c = inj₂ [ c ] + ... | tri< a _ _ = inj₁ [ a ] + ... | tri≈ _ refl _ = inj₁ refl + ... | tri> _ _ c = inj₂ [ c ] - dec : DecidableEquality A Decidable _~_ Decidable _~ᵒ_ - dec ≡-dec ~-dec a b = Dec.map ⊎⇔Refl (≡-dec a b ⊎-dec ~-dec a b) + dec : DecidableEquality A Decidable _~_ Decidable _~ᵒ_ + dec ≡-dec ~-dec a b = Dec.map ⊎⇔Refl (≡-dec a b ⊎-dec ~-dec a b) - decidable : Trichotomous _≡_ _~_ Decidable _~ᵒ_ + decidable : Trichotomous _≡_ _~_ Decidable _~ᵒ_ decidable ~-tri a b with ~-tri a b - ... | tri< a~b _ _ = yes [ a~b ] - ... | tri≈ _ refl _ = yes refl - ... | tri> ¬a ¬b _ = no λ { refl ¬b refl ; [ p ] ¬a p } + ... | tri< a~b _ _ = yes [ a~b ] + ... | tri≈ _ refl _ = yes refl + ... | tri> ¬a ¬b _ = no λ { refl ¬b refl ; [ p ] ¬a p } - respˡ : {P : REL A B p} P Respectsˡ _~_ P Respectsˡ _~ᵒ_ + respˡ : {P : REL A B p} P Respectsˡ _~_ P Respectsˡ _~ᵒ_ respˡ p-respˡ-~ [ x∼y ] = p-respˡ-~ x∼y respˡ _ refl = id - respʳ : {P : REL B A p} P Respectsʳ _~_ P Respectsʳ _~ᵒ_ + respʳ : {P : REL B A p} P Respectsʳ _~_ P Respectsʳ _~ᵒ_ respʳ = respˡ -module _ {_~_ : Rel A } {P : Pred A p} where +module _ {_~_ : Rel A } {P : Pred A p} where - resp : P Respects _~_ P Respects (ReflClosure _~_) + resp : P Respects _~_ P Respects (ReflClosure _~_) resp p-resp-~ [ x∼y ] = p-resp-~ x∼y resp _ refl = id module _ {_~_ : Rel A } {P : Rel A p} where - resp₂ : P Respects₂ _~_ P Respects₂ (ReflClosure _~_) + resp₂ : P Respects₂ _~_ P Respects₂ (ReflClosure _~_) resp₂ = Product.map respˡ respʳ ------------------------------------------------------------------------ @@ -114,7 +114,7 @@ private _~ᵒ_ = ReflClosure _~_ - isPreorder : Transitive _~_ IsPreorder _≡_ _~ᵒ_ + isPreorder : Transitive _~_ IsPreorder _≡_ _~ᵒ_ isPreorder ~-trans = record { isEquivalence = ≡.isEquivalence ; reflexive = λ { refl refl } diff --git a/master/Relation.Binary.Construct.Closure.Reflexive.html b/master/Relation.Binary.Construct.Closure.Reflexive.html index ff9d1c33b4..acd4232e97 100644 --- a/master/Relation.Binary.Construct.Closure.Reflexive.html +++ b/master/Relation.Binary.Construct.Closure.Reflexive.html @@ -13,7 +13,7 @@ open import Level open import Function.Base using (_∋_) open import Relation.Binary.Core using (Rel; _=[_]⇒_; _⇒_) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) open import Relation.Binary.Construct.Constant.Core using (Const) open import Relation.Binary.PropositionalEquality.Core using (_≡_ ; refl) @@ -26,7 +26,7 @@ -- Definition data ReflClosure {A : Set a} (_∼_ : Rel A ) : Rel A (a ) where - refl : Reflexive (ReflClosure _∼_) + refl : Reflexive (ReflClosure _∼_) [_] : {x y} (x∼y : x y) ReflClosure _∼_ x y ------------------------------------------------------------------------ @@ -41,7 +41,7 @@ -- Properties -- The reflexive closure has no effect on reflexive relations. -drop-refl : {R : Rel A } Reflexive R ReflClosure R R +drop-refl : {R : Rel A } Reflexive R ReflClosure R R drop-refl rfl [ xRy ] = xRy drop-refl rfl refl = rfl diff --git a/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.Properties.html b/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.Properties.html index b376418358..32ed972665 100644 --- a/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.Properties.html +++ b/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.Properties.html @@ -13,7 +13,7 @@ open import Relation.Binary.Core using (Rel; _=[_]⇒_; _⇒_) open import Relation.Binary.Bundles using (Preorder) open import Relation.Binary.Structures using (IsPreorder) -open import Relation.Binary.Definitions using (Transitive; Reflexive) +open import Relation.Binary.Definitions using (Transitive; Reflexive) open import Relation.Binary.Construct.Closure.ReflexiveTransitive open import Relation.Binary.PropositionalEquality.Core as using (_≡_; refl; sym; cong; cong₂) @@ -71,7 +71,7 @@ -- fold fold-◅◅ : {i p} {I : Set i} - (P : Rel I p) (_⊕_ : Transitive P) ( : Reflexive P) + (P : Rel I p) (_⊕_ : Transitive P) ( : Reflexive P) (∀ {i j} (x : P i j) ( x) x) (∀ {i j k l} (x : P i j) (y : P j k) (z : P k l) ((x y) z) (x (y z))) @@ -93,7 +93,7 @@ reflexive : _≡_ Star T reflexive refl = ε - trans : Transitive (Star T) + trans : Transitive (Star T) trans = _◅◅_ isPreorder : IsPreorder _≡_ (Star T) diff --git a/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.html b/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.html index ebb55def84..d67b071e8d 100644 --- a/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.html +++ b/master/Relation.Binary.Construct.Closure.ReflexiveTransitive.html @@ -11,7 +11,7 @@ open import Relation.Binary.Core using (Rel; _=[_]⇒_; _⇒_) open import Relation.Binary.Definitions - using (Transitive; Trans; Sym; TransFlip; Reflexive) + using (Transitive; Trans; Sym; TransFlip; Reflexive) open import Function.Base open import Level using (_⊔_) @@ -20,7 +20,7 @@ -- Reflexive transitive closure. data Star {i t} {I : Set i} (T : Rel I t) : Rel I (i t) where - ε : Reflexive (Star T) + ε : Reflexive (Star T) _◅_ : {i j k} (x : T i j) (xs : Star T j k) Star T i k -- The type of _◅_ is Trans T (Star T) (Star T); The -- definition is expanded in order to be able to name @@ -30,7 +30,7 @@ infixr 5 _◅◅_ -_◅◅_ : {i t} {I : Set i} {T : Rel I t} Transitive (Star T) +_◅◅_ : {i t} {I : Set i} {T : Rel I t} Transitive (Star T) ε ◅◅ ys = ys (x xs) ◅◅ ys = x (xs ◅◅ ys) @@ -68,24 +68,24 @@ gfold : {i j t p} {I : Set i} {J : Set j} {T : Rel I t} (f : I J) (P : Rel J p) - Trans T (P on f) (P on f) - TransFlip (Star T) (P on f) (P on f) + Trans T (P on f) (P on f) + TransFlip (Star T) (P on f) (P on f) gfold f P _⊕_ ε = gfold f P _⊕_ (x xs) = x gfold f P _⊕_ xs fold : {i t p} {I : Set i} {T : Rel I t} (P : Rel I p) - Trans T P P Reflexive P Star T P + Trans T P P Reflexive P Star T P fold P _⊕_ = gfold id P _⊕_ gfoldl : {i j t p} {I : Set i} {J : Set j} {T : Rel I t} (f : I J) (P : Rel J p) - Trans (P on f) T (P on f) - Trans (P on f) (Star T) (P on f) + Trans (P on f) T (P on f) + Trans (P on f) (Star T) (P on f) gfoldl f P _⊕_ ε = gfoldl f P _⊕_ (x xs) = gfoldl f P _⊕_ ( x) xs foldl : {i t p} {I : Set i} {T : Rel I t} (P : Rel I p) - Trans P T P Reflexive P Star T P + Trans P T P Reflexive P Star T P foldl P _⊕_ = gfoldl id P _⊕_ concat : {i t} {I : Set i} {T : Rel I t} Star (Star T) Star T @@ -95,12 +95,12 @@ -- transitive closure is also symmetric. revApp : {i t u} {I : Set i} {T : Rel I t} {U : Rel I u} - Sym T U {i j k} Star T j i Star U j k Star U i k + Sym T U {i j k} Star T j i Star U j k Star U i k revApp rev ε ys = ys revApp rev (x xs) ys = revApp rev xs (rev x ys) reverse : {i t u} {I : Set i} {T : Rel I t} {U : Rel I u} - Sym T U Sym (Star T) (Star U) + Sym T U Sym (Star T) (Star U) reverse rev xs = revApp rev xs ε -- Reflexive transitive closures form a (generalised) monad. diff --git a/master/Relation.Binary.Construct.Closure.Symmetric.html b/master/Relation.Binary.Construct.Closure.Symmetric.html index 564933f11b..2579f5a9d5 100644 --- a/master/Relation.Binary.Construct.Closure.Symmetric.html +++ b/master/Relation.Binary.Construct.Closure.Symmetric.html @@ -12,7 +12,7 @@ open import Function.Base using (id; _on_) open import Level using (Level) open import Relation.Binary.Core using (Rel; _=[_]⇒_; _⇒_) -open import Relation.Binary.Definitions using (Symmetric) +open import Relation.Binary.Definitions using (Symmetric) import Relation.Binary.Construct.On as On private @@ -32,7 +32,7 @@ -- Properties -- Symmetric closures are symmetric. -symmetric : (R : Rel A ) Symmetric (SymClosure R) +symmetric : (R : Rel A ) Symmetric (SymClosure R) symmetric _ (fwd aRb) = bwd aRb symmetric _ (bwd bRa) = fwd bRa @@ -47,12 +47,12 @@ map : R S SymClosure R SymClosure S map = gmap id -fold : Symmetric S R S SymClosure R S +fold : Symmetric S R S SymClosure R S fold S-sym R⇒S (fwd aRb) = R⇒S aRb fold S-sym R⇒S (bwd bRa) = S-sym (R⇒S bRa) -- A generalised variant of `fold`. -gfold : Symmetric S (f : A B) R =[ f ]⇒ S SymClosure R =[ f ]⇒ S +gfold : Symmetric S (f : A B) R =[ f ]⇒ S SymClosure R =[ f ]⇒ S gfold {S = S} S-sym f R⇒S = fold (On.symmetric f S S-sym) R⇒S -- `return` could also be called `singleton`. diff --git a/master/Relation.Binary.Construct.Closure.SymmetricTransitive.html b/master/Relation.Binary.Construct.Closure.SymmetricTransitive.html index 797fa00362..e06b18fdc7 100644 --- a/master/Relation.Binary.Construct.Closure.SymmetricTransitive.html +++ b/master/Relation.Binary.Construct.Closure.SymmetricTransitive.html @@ -16,7 +16,7 @@ open import Relation.Binary.Structures using (IsPartialEquivalence; IsEquivalence) open import Relation.Binary.Definitions - using (Transitive; Symmetric; Reflexive) + using (Transitive; Symmetric; Reflexive) private variable @@ -31,13 +31,13 @@ forth⁺ : {x y z} x y Plus⇔ y z Plus⇔ x z back⁺ : {x y z} y x Plus⇔ y z Plus⇔ x z - trans : Transitive Plus⇔ + trans : Transitive Plus⇔ trans (forth r) rel′ = forth⁺ r rel′ trans (back r) rel′ = back⁺ r rel′ trans (forth⁺ r rel) rel′ = forth⁺ r (trans rel rel′) trans (back⁺ r rel) rel′ = back⁺ r (trans rel rel′) - sym : Symmetric Plus⇔ + sym : Symmetric Plus⇔ sym (forth r) = back r sym (back r) = forth r sym (forth⁺ r rel) = trans (sym rel) (back r) @@ -56,7 +56,7 @@ ; isPartialEquivalence = isPartialEquivalence } - module _ (refl : Reflexive _≤_) where + module _ (refl : Reflexive _≤_) where isEquivalence : IsEquivalence Plus⇔ isEquivalence = record diff --git a/master/Relation.Binary.Construct.Closure.Transitive.html b/master/Relation.Binary.Construct.Closure.Transitive.html index ac40896841..325893fe85 100644 --- a/master/Relation.Binary.Construct.Closure.Transitive.html +++ b/master/Relation.Binary.Construct.Closure.Transitive.html @@ -15,7 +15,7 @@ open import Level open import Relation.Binary.Core using (Rel; _=[_]⇒_; _⇒_) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive) + using (Reflexive; Symmetric; Transitive) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) private @@ -61,17 +61,17 @@ _∼⁺_ = TransClosure _∼_ module ∼⊆∼⁺ = Subrelation {_<₂_ = _∼⁺_} [_] - reflexive : Reflexive _∼_ Reflexive _∼⁺_ + reflexive : Reflexive _∼_ Reflexive _∼⁺_ reflexive refl = [ refl ] - symmetric : Symmetric _∼_ Symmetric _∼⁺_ + symmetric : Symmetric _∼_ Symmetric _∼⁺_ symmetric sym [ x∼y ] = [ sym x∼y ] symmetric sym (x∼y y∼⁺z) = symmetric sym y∼⁺z ∷ʳ sym x∼y - transitive : Transitive _∼⁺_ + transitive : Transitive _∼⁺_ transitive = _++_ - transitive⁻ : Transitive _∼_ _∼⁺_ _∼_ + transitive⁻ : Transitive _∼_ _∼⁺_ _∼_ transitive⁻ trans [ x∼y ] = x∼y transitive⁻ trans (x∼y x∼⁺y) = trans x∼y (transitive⁻ trans x∼⁺y) diff --git a/master/Relation.Binary.Construct.Composition.html b/master/Relation.Binary.Construct.Composition.html index 0238293180..65b2a7a810 100644 --- a/master/Relation.Binary.Construct.Composition.html +++ b/master/Relation.Binary.Construct.Composition.html @@ -15,7 +15,7 @@ open import Relation.Binary.Core using (Rel; REL; _⇒_) open import Relation.Binary.Structures using (IsPreorder) open import Relation.Binary.Definitions - using (_Respects_; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Reflexive; Transitive) + using (_Respects_; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Reflexive; Transitive) private variable @@ -38,41 +38,41 @@ module _ (L : Rel A ℓ₁) (R : Rel A ℓ₂) where - reflexive : Reflexive L Reflexive R Reflexive (L ; R) + reflexive : Reflexive L Reflexive R Reflexive (L ; R) reflexive L-refl R-refl = _ , L-refl , R-refl respects : {p} {P : A Set p} - P Respects L P Respects R P Respects (L ; R) + P Respects L P Respects R P Respects (L ; R) respects resp-L resp-R (k , Lik , Rkj) = resp-R Rkj resp-L Lik module _ { : Rel A } (L : REL A B ℓ₁) (R : REL B C ℓ₂) where - respectsˡ : L Respectsˡ (L ; R) Respectsˡ + respectsˡ : L Respectsˡ (L ; R) Respectsˡ respectsˡ i≈i′ (k , Lik , Rkj) = k , i≈i′ Lik , Rkj module _ { : Rel C } (L : REL A B ℓ₁) (R : REL B C ℓ₂) where - respectsʳ : R Respectsʳ (L ; R) Respectsʳ + respectsʳ : R Respectsʳ (L ; R) Respectsʳ respectsʳ j≈j′ (k , Lik , Rkj) = k , Lik , j≈j′ Rkj module _ { : Rel A } (L : REL A B ℓ₁) (R : REL B A ℓ₂) where - respects₂ : L Respectsˡ R Respectsʳ (L ; R) Respects₂ + respects₂ : L Respectsˡ R Respectsʳ (L ; R) Respects₂ respects₂ = respectsʳ L R , respectsˡ L R module _ { : REL A B } (L : REL A B ℓ₁) (R : Rel B ℓ₂) where - impliesˡ : Reflexive R ( L) ( L ; R) + impliesˡ : Reflexive R ( L) ( L ; R) impliesˡ R-refl ≈⇒L {i} {j} i≈j = j , ≈⇒L i≈j , R-refl module _ { : REL A B } (L : Rel A ℓ₁) (R : REL A B ℓ₂) where - impliesʳ : Reflexive L ( R) ( L ; R) + impliesʳ : Reflexive L ( R) ( L ; R) impliesʳ L-refl ≈⇒R {i} {j} i≈j = i , L-refl , ≈⇒R i≈j module _ (L : Rel A ℓ₁) (R : Rel A ℓ₂) (comm : R ; L L ; R) where - transitive : Transitive L Transitive R Transitive (L ; R) + transitive : Transitive L Transitive R Transitive (L ; R) transitive L-trans R-trans {i} {j} {k} (x , Lix , Rxj) (y , Ljy , Ryk) = let z , Lxz , Rzy = comm (j , Rxj , Ljy) in z , L-trans Lix Lxz , R-trans Rzy Ryk @@ -84,6 +84,6 @@ } where module = IsPreorder ; module = IsPreorder -transitive⇒≈;≈⊆≈ : ( : Rel A ) Transitive ( ; ) +transitive⇒≈;≈⊆≈ : ( : Rel A ) Transitive ( ; ) transitive⇒≈;≈⊆≈ _ trans (_ , l , r) = trans l r \ No newline at end of file diff --git a/master/Relation.Binary.Construct.Constant.html b/master/Relation.Binary.Construct.Constant.html index 87685d3877..022e411d87 100644 --- a/master/Relation.Binary.Construct.Constant.html +++ b/master/Relation.Binary.Construct.Constant.html @@ -12,7 +12,7 @@ open import Level open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) private variable @@ -30,13 +30,13 @@ module _ {a c} (A : Set a) {C : Set c} where - refl : C Reflexive {A = A} (Const C) + refl : C Reflexive {A = A} (Const C) refl c = c - sym : Symmetric {A = A} (Const C) + sym : Symmetric {A = A} (Const C) sym c = c - trans : Transitive {A = A} (Const C) + trans : Transitive {A = A} (Const C) trans c d = c isEquivalence : C IsEquivalence {A = A} (Const C) diff --git a/master/Relation.Binary.Construct.Flip.EqAndOrd.html b/master/Relation.Binary.Construct.Flip.EqAndOrd.html index 174a5f4b48..e45f1f399d 100644 --- a/master/Relation.Binary.Construct.Flip.EqAndOrd.html +++ b/master/Relation.Binary.Construct.Flip.EqAndOrd.html @@ -15,7 +15,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictPartialOrder; IsStrictTotalOrder; IsTotalPreorder) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Asymmetric; Total; _Respects_; _Respects₂_; Minimum; Maximum; Irreflexive; Antisymmetric; Trichotomous; Decidable; tri<; tri>; tri≈) + using (Reflexive; Symmetric; Transitive; Asymmetric; Total; _Respects_; _Respects₂_; Minimum; Maximum; Irreflexive; Antisymmetric; Trichotomous; Decidable; tri<; tri>; tri≈) module Relation.Binary.Construct.Flip.EqAndOrd where @@ -34,56 +34,56 @@ module _ ( : Rel A ) where - refl : Reflexive Reflexive (flip ) + refl : Reflexive Reflexive (flip ) refl refl = refl - sym : Symmetric Symmetric (flip ) + sym : Symmetric Symmetric (flip ) sym sym = sym - trans : Transitive Transitive (flip ) + trans : Transitive Transitive (flip ) trans trans = flip trans - asym : Asymmetric Asymmetric (flip ) + asym : Asymmetric Asymmetric (flip ) asym asym = asym - total : Total Total (flip ) + total : Total Total (flip ) total total x y = total y x - resp : {p} (P : A Set p) Symmetric - P Respects P Respects (flip ) + resp : {p} (P : A Set p) Symmetric + P Respects P Respects (flip ) resp _ sym resp = resp (sym ) - max : {} Minimum Maximum (flip ) + max : {} Minimum Maximum (flip ) max min = min - min : {} Maximum Minimum (flip ) + min : {} Maximum Minimum (flip ) min max = max module _ { : Rel A ℓ₁} ( : Rel A ℓ₂) where - reflexive : Symmetric ( ) ( flip ) + reflexive : Symmetric ( ) ( flip ) reflexive sym impl = impl sym - irrefl : Symmetric Irreflexive Irreflexive (flip ) + irrefl : Symmetric Irreflexive Irreflexive (flip ) irrefl sym irrefl x≈y y∼x = irrefl (sym x≈y) y∼x - antisym : Antisymmetric Antisymmetric (flip ) + antisym : Antisymmetric Antisymmetric (flip ) antisym antisym = flip antisym - compare : Trichotomous Trichotomous (flip ) + compare : Trichotomous Trichotomous (flip ) compare cmp x y with cmp x y - ... | tri< x<y x≉y y≮x = tri> y≮x x≉y x<y - ... | tri≈ x≮y x≈y y≮x = tri≈ y≮x x≈y x≮y - ... | tri> x≮y x≉y y<x = tri< y<x x≉y x≮y + ... | tri< x<y x≉y y≮x = tri> y≮x x≉y x<y + ... | tri≈ x≮y x≈y y≮x = tri≈ y≮x x≈y x≮y + ... | tri> x≮y x≉y y<x = tri< y<x x≉y x≮y module _ (∼₁ : Rel A ℓ₁) (∼₂ : Rel A ℓ₂) where - resp₂ : ∼₁ Respects₂ ∼₂ (flip ∼₁) Respects₂ ∼₂ + resp₂ : ∼₁ Respects₂ ∼₂ (flip ∼₁) Respects₂ ∼₂ resp₂ (resp₁ , resp₂) = resp₂ , resp₁ module _ ( : REL A B ) where - dec : Decidable Decidable (flip ) + dec : Decidable Decidable (flip ) dec dec = flip dec ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Flip.Ord.html b/master/Relation.Binary.Construct.Flip.Ord.html index d46b3c626d..0c5f430e5b 100644 --- a/master/Relation.Binary.Construct.Flip.Ord.html +++ b/master/Relation.Binary.Construct.Flip.Ord.html @@ -15,7 +15,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictPartialOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Asymmetric; Total; _Respects_; _Respects₂_; Minimum; Maximum; Irreflexive; Antisymmetric; Trichotomous; Decidable) + using (Reflexive; Symmetric; Transitive; Asymmetric; Total; _Respects_; _Respects₂_; Minimum; Maximum; Irreflexive; Antisymmetric; Trichotomous; Decidable) module Relation.Binary.Construct.Flip.Ord where @@ -34,29 +34,29 @@ module _ ( : Rel A ) where - reflexive : Reflexive Reflexive (flip ) + reflexive : Reflexive Reflexive (flip ) reflexive refl = refl - symmetric : Symmetric Symmetric (flip ) + symmetric : Symmetric Symmetric (flip ) symmetric sym = sym - transitive : Transitive Transitive (flip ) + transitive : Transitive Transitive (flip ) transitive trans = flip trans - asymmetric : Asymmetric Asymmetric (flip ) + asymmetric : Asymmetric Asymmetric (flip ) asymmetric asym = asym - total : Total Total (flip ) + total : Total Total (flip ) total total x y = total y x - respects : (P : A Set p) Symmetric - P Respects P Respects flip + respects : (P : A Set p) Symmetric + P Respects P Respects flip respects _ sym resp = resp (sym ) - max : {} Minimum Maximum (flip ) + max : {} Minimum Maximum (flip ) max min = min - min : {} Maximum Minimum (flip ) + min : {} Maximum Minimum (flip ) min max = max module _ ( : REL A B ℓ₁) ( : REL A B ℓ₂) where @@ -64,25 +64,25 @@ implies : flip flip implies impl = impl - irreflexive : Irreflexive Irreflexive (flip ) (flip ) + irreflexive : Irreflexive Irreflexive (flip ) (flip ) irreflexive irrefl = irrefl module _ ( : Rel A ℓ₁) ( : Rel A ℓ₂) where - antisymmetric : Antisymmetric Antisymmetric (flip ) (flip ) + antisymmetric : Antisymmetric Antisymmetric (flip ) (flip ) antisymmetric antisym = antisym - trichotomous : Trichotomous Trichotomous (flip ) (flip ) + trichotomous : Trichotomous Trichotomous (flip ) (flip ) trichotomous compare x y = compare y x module _ (∼₁ : Rel A ℓ₁) (∼₂ : Rel A ℓ₂) where - respects₂ : Symmetric ∼₂ ∼₁ Respects₂ ∼₂ flip ∼₁ Respects₂ flip ∼₂ + respects₂ : Symmetric ∼₂ ∼₁ Respects₂ ∼₂ flip ∼₁ Respects₂ flip ∼₂ respects₂ sym (resp₁ , resp₂) = (resp₂ sym , resp₁ sym) module _ ( : REL A B ) where - decidable : Decidable Decidable (flip ) + decidable : Decidable Decidable (flip ) decidable dec x y = dec y x ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.FromPred.html b/master/Relation.Binary.Construct.FromPred.html index f783a9c026..4c78d29c7d 100644 --- a/master/Relation.Binary.Construct.FromPred.html +++ b/master/Relation.Binary.Construct.FromPred.html @@ -11,12 +11,12 @@ open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid; Preorder) open import Relation.Binary.Structures using (IsPreorder) -open import Relation.Binary.Definitions using (_Respects_; Reflexive; Transitive) -open import Relation.Unary using (Pred) +open import Relation.Binary.Definitions using (_Respects_; Reflexive; Transitive) +open import Relation.Unary using (Pred) module Relation.Binary.Construct.FromPred {s₁ s₂} (S : Setoid s₁ s₂) -- The underlying equality - {p} (P : Pred (Setoid.Carrier S) p) -- The predicate + {p} (P : Pred (Setoid.Carrier S) p) -- The predicate where open import Function.Base @@ -32,23 +32,23 @@ ------------------------------------------------------------------------ -- Properties -reflexive : P Respects _≈_ _≈_ Resp +reflexive : P Respects _≈_ _≈_ Resp reflexive resp = resp -refl : P Respects _≈_ Reflexive Resp +refl : P Respects _≈_ Reflexive Resp refl resp = resp Eq.refl -trans : Transitive Resp +trans : Transitive Resp trans x⇒y y⇒z = y⇒z x⇒y -isPreorder : P Respects _≈_ IsPreorder _≈_ Resp +isPreorder : P Respects _≈_ IsPreorder _≈_ Resp isPreorder resp = record { isEquivalence = Eq.isEquivalence ; reflexive = reflexive resp ; trans = flip _∘′_ } -preorder : P Respects _≈_ Preorder _ _ _ +preorder : P Respects _≈_ Preorder _ _ _ preorder resp = record { isPreorder = isPreorder resp } diff --git a/master/Relation.Binary.Construct.FromRel.html b/master/Relation.Binary.Construct.FromRel.html index cf1bcb4c17..3d2d534de3 100644 --- a/master/Relation.Binary.Construct.FromRel.html +++ b/master/Relation.Binary.Construct.FromRel.html @@ -11,7 +11,7 @@ open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Bundles using (Setoid; Preorder) open import Relation.Binary.Structures using (IsPreorder) -open import Relation.Binary.Definitions using (_Respects_; Transitive) +open import Relation.Binary.Definitions using (_Respects_; Transitive) open Setoid using (Carrier) module Relation.Binary.Construct.FromRel @@ -33,20 +33,20 @@ ------------------------------------------------------------------------ -- Properties -reflexive : (∀ {a} (a R_) Respects _≈_) _≈_ Resp +reflexive : (∀ {a} (a R_) Respects _≈_) _≈_ Resp reflexive resp x≈y = resp x≈y -trans : Transitive Resp +trans : Transitive Resp trans x∼y y∼z = y∼z x∼y -isPreorder : (∀ {a} (a R_) Respects _≈_) IsPreorder _≈_ Resp +isPreorder : (∀ {a} (a R_) Respects _≈_) IsPreorder _≈_ Resp isPreorder resp = record { isEquivalence = Eq.isEquivalence ; reflexive = reflexive resp ; trans = trans } -preorder : (∀ {a} (a R_) Respects _≈_) Preorder _ _ _ +preorder : (∀ {a} (a R_) Respects _≈_) Preorder _ _ _ preorder resp = record { isPreorder = isPreorder resp } diff --git a/master/Relation.Binary.Construct.Interior.Symmetric.html b/master/Relation.Binary.Construct.Interior.Symmetric.html index 5effe5f3c4..c4169f13e2 100644 --- a/master/Relation.Binary.Construct.Interior.Symmetric.html +++ b/master/Relation.Binary.Construct.Interior.Symmetric.html @@ -34,40 +34,40 @@ -- Properties -- The symmetric interior is symmetric. -symmetric : Symmetric (SymInterior R) +symmetric : Symmetric (SymInterior R) symmetric (r , r′) = r′ , r -- The symmetric interior of R is greater than (or equal to) any other symmetric -- relation contained by R. -unfold : Symmetric S S R S SymInterior R +unfold : Symmetric S S R S SymInterior R unfold sym f s = f s , f (sym s) -- SymInterior preserves various properties. -reflexive : Reflexive R Reflexive (SymInterior R) +reflexive : Reflexive R Reflexive (SymInterior R) reflexive refl = refl , refl -trans : Trans R S T Trans S R T - Trans (SymInterior R) (SymInterior S) (SymInterior T) +trans : Trans R S T Trans S R T + Trans (SymInterior R) (SymInterior S) (SymInterior T) trans trans-rs trans-sr (r , r′) (s , s′) = trans-rs r s , trans-sr s′ r′ -transitive : Transitive R Transitive (SymInterior R) +transitive : Transitive R Transitive (SymInterior R) transitive tr = trans tr tr -- The symmetric interior of a strict relation is empty. -asymmetric⇒empty : Asymmetric R Empty (SymInterior R) +asymmetric⇒empty : Asymmetric R Empty (SymInterior R) asymmetric⇒empty asym (r , r′) = asym r r′ -- A reflexive transitive relation _≤_ gives rise to a poset in which the -- equivalence relation is SymInterior _≤_. -isEquivalence : Reflexive R Transitive R IsEquivalence (SymInterior R) +isEquivalence : Reflexive R Transitive R IsEquivalence (SymInterior R) isEquivalence refl trans = record { refl = reflexive refl ; sym = symmetric ; trans = transitive trans } -isPartialOrder : Reflexive R Transitive R IsPartialOrder (SymInterior R) R +isPartialOrder : Reflexive R Transitive R IsPartialOrder (SymInterior R) R isPartialOrder refl trans = record { isPreorder = record { isEquivalence = isEquivalence refl trans @@ -77,7 +77,7 @@ ; antisym = _,_ } -poset : {a} {A : Set a} {R : Rel A } Reflexive R Transitive R Poset a +poset : {a} {A : Set a} {R : Rel A } Reflexive R Transitive R Poset a poset {R = R} refl trans = record { _≤_ = R ; isPartialOrder = isPartialOrder refl trans diff --git a/master/Relation.Binary.Construct.Intersection.html b/master/Relation.Binary.Construct.Intersection.html index 5ab5cf883e..f2bf5f3158 100644 --- a/master/Relation.Binary.Construct.Intersection.html +++ b/master/Relation.Binary.Construct.Intersection.html @@ -17,8 +17,8 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsPreorder; IsPartialOrder; IsStrictPartialOrder) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Antisymmetric; Decidable; _Respects_; _Respectsˡ_; _Respectsʳ_; _Respects₂_; Minimum; Maximum; Irreflexive) -open import Relation.Nullary.Decidable using (yes; no; _×-dec_) + using (Reflexive; Symmetric; Transitive; Antisymmetric; Decidable; _Respects_; _Respectsˡ_; _Respectsʳ_; _Respects₂_; Minimum; Maximum; Irreflexive) +open import Relation.Nullary.Decidable using (yes; no; _×-dec_) private variable @@ -39,23 +39,23 @@ module _ (L : Rel A ℓ₁) (R : Rel A ℓ₂) where - reflexive : Reflexive L Reflexive R Reflexive (L R) + reflexive : Reflexive L Reflexive R Reflexive (L R) reflexive L-refl R-refl = L-refl , R-refl - symmetric : Symmetric L Symmetric R Symmetric (L R) + symmetric : Symmetric L Symmetric R Symmetric (L R) symmetric L-sym R-sym = map L-sym R-sym - transitive : Transitive L Transitive R Transitive (L R) + transitive : Transitive L Transitive R Transitive (L R) transitive L-trans R-trans = zip L-trans R-trans respects : {p} (P : A Set p) - P Respects L P Respects R P Respects (L R) + P Respects L P Respects R P Respects (L R) respects P resp (Lxy , Rxy) = [ x x Lxy) , x x Rxy) ] resp - min : {} Minimum L Minimum R Minimum (L R) + min : {} Minimum L Minimum R Minimum (L R) min L-min R-min = < L-min , R-min > - max : {} Maximum L Maximum R Maximum (L R) + max : {} Maximum L Maximum R Maximum (L R) max L-max R-max = < L-max , R-max > module _ ( : REL A B ℓ₁) {L : REL A B ℓ₂} {R : REL A B ℓ₃} where @@ -65,28 +65,28 @@ module _ ( : REL A B ℓ₁) (L : REL A B ℓ₂) (R : REL A B ℓ₃) where - irreflexive : Irreflexive L Irreflexive R Irreflexive (L R) + irreflexive : Irreflexive L Irreflexive R Irreflexive (L R) irreflexive irrefl x≈y (Lxy , Rxy) = [ x x x≈y Lxy) , x x x≈y Rxy) ] irrefl module _ ( : Rel A ℓ₁) (L : Rel A ℓ₂) (R : Rel A ℓ₃) where - respectsˡ : L Respectsˡ R Respectsˡ (L R) Respectsˡ + respectsˡ : L Respectsˡ R Respectsˡ (L R) Respectsˡ respectsˡ L-resp R-resp x≈y = map (L-resp x≈y) (R-resp x≈y) - respectsʳ : L Respectsʳ R Respectsʳ (L R) Respectsʳ + respectsʳ : L Respectsʳ R Respectsʳ (L R) Respectsʳ respectsʳ L-resp R-resp x≈y = map (L-resp x≈y) (R-resp x≈y) - respects₂ : L Respects₂ R Respects₂ (L R) Respects₂ + respects₂ : L Respects₂ R Respects₂ (L R) Respects₂ respects₂ ( , ) ( , ) = respectsʳ , respectsˡ - antisymmetric : Antisymmetric L Antisymmetric R Antisymmetric (L R) + antisymmetric : Antisymmetric L Antisymmetric R Antisymmetric (L R) antisymmetric (inj₁ L-antisym) (Lxy , _) (Lyx , _) = L-antisym Lxy Lyx antisymmetric (inj₂ R-antisym) (_ , Rxy) (_ , Ryx) = R-antisym Rxy Ryx module _ {L : REL A B ℓ₁} {R : REL A B ℓ₂} where - decidable : Decidable L Decidable R Decidable (L R) - decidable L? R? x y = L? x y ×-dec R? x y + decidable : Decidable L Decidable R Decidable (L R) + decidable L? R? x y = L? x y ×-dec R? x y ------------------------------------------------------------------------ -- Structures @@ -125,7 +125,7 @@ } where module Oₗ = IsPreorder Oₗ; module Oᵣ = IsPartialOrder Oᵣ isStrictPartialOrderˡ : IsStrictPartialOrder L - Transitive R R Respects₂ + Transitive R R Respects₂ IsStrictPartialOrder (L R) isStrictPartialOrderˡ { = } {L = L} {R = R} Oₗ transᵣ respᵣ = record { isEquivalence = Oₗ.isEquivalence @@ -134,7 +134,7 @@ ; <-resp-≈ = respects₂ L R Oₗ.<-resp-≈ respᵣ } where module Oₗ = IsStrictPartialOrder Oₗ -isStrictPartialOrderʳ : Transitive L L Respects₂ +isStrictPartialOrderʳ : Transitive L L Respects₂ IsStrictPartialOrder R IsStrictPartialOrder (L R) isStrictPartialOrderʳ {L = L} { = } {R = R} transₗ respₗ Oᵣ = record diff --git a/master/Relation.Binary.Construct.NaturalOrder.Left.html b/master/Relation.Binary.Construct.NaturalOrder.Left.html index a565f68b2c..145ac6a7ad 100644 --- a/master/Relation.Binary.Construct.NaturalOrder.Left.html +++ b/master/Relation.Binary.Construct.NaturalOrder.Left.html @@ -17,8 +17,8 @@ open import Relation.Binary.Structures using (IsEquivalence; IsPreorder; IsPartialOrder; IsDecPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Symmetric; Transitive; Reflexive; Antisymmetric; Total; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Decidable) -open import Relation.Nullary.Negation using (¬_) + using (Symmetric; Transitive; Reflexive; Antisymmetric; Total; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Decidable) +open import Relation.Nullary.Negation using (¬_) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning open import Relation.Binary.Lattice using (Infimum) @@ -47,10 +47,10 @@ x y where open IsMagma magma; open ≈-Reasoning setoid -refl : Symmetric _≈_ Idempotent _∙_ Reflexive _≤_ +refl : Symmetric _≈_ Idempotent _∙_ Reflexive _≤_ refl sym idem {x} = sym (idem x) -antisym : IsEquivalence _≈_ Commutative _∙_ Antisymmetric _≈_ _≤_ +antisym : IsEquivalence _≈_ Commutative _∙_ Antisymmetric _≈_ _≤_ antisym isEq comm {x} {y} x≤y y≤x = begin x ≈⟨ x≤y x y ≈⟨ comm x y @@ -58,10 +58,10 @@ y where open IsEquivalence isEq; open ≈-Reasoning (record { isEquivalence = isEq }) -total : Symmetric _≈_ Transitive _≈_ Selective _∙_ Commutative _∙_ Total _≤_ +total : Symmetric _≈_ Transitive _≈_ Selective _∙_ Commutative _∙_ Total _≤_ total sym trans sel comm x y = map sym x∙y≈y trans (sym x∙y≈y) (comm x y)) (sel x y) -trans : IsSemigroup _∙_ Transitive _≤_ +trans : IsSemigroup _∙_ Transitive _≤_ trans semi {x} {y} {z} x≤y y≤z = begin x ≈⟨ x≤y x y ≈⟨ ∙-cong S.refl y≤z @@ -70,14 +70,14 @@ x z where open module S = IsSemigroup semi; open ≈-Reasoning S.setoid -respʳ : IsMagma _∙_ _≤_ Respectsʳ _≈_ +respʳ : IsMagma _∙_ _≤_ Respectsʳ _≈_ respʳ magma {x} {y} {z} y≈z x≤y = begin x ≈⟨ x≤y x y ≈⟨ ∙-cong M.refl y≈z x z where open module M = IsMagma magma; open ≈-Reasoning M.setoid -respˡ : IsMagma _∙_ _≤_ Respectsˡ _≈_ +respˡ : IsMagma _∙_ _≤_ Respectsˡ _≈_ respˡ magma {x} {y} {z} y≈z y≤x = begin z ≈⟨ sym y≈z y ≈⟨ y≤x @@ -85,10 +85,10 @@ z x where open module M = IsMagma magma; open ≈-Reasoning M.setoid -resp₂ : IsMagma _∙_ _≤_ Respects₂ _≈_ +resp₂ : IsMagma _∙_ _≤_ Respects₂ _≈_ resp₂ magma = respʳ magma , respˡ magma -dec : Decidable _≈_ Decidable _≤_ +dec : Decidable _≈_ Decidable _≤_ dec _≟_ x y = x (x y) module _ (semi : IsSemilattice _∙_) where @@ -137,7 +137,7 @@ } where open IsSemilattice semilattice -isDecPartialOrder : IsSemilattice _∙_ Decidable _≈_ +isDecPartialOrder : IsSemilattice _∙_ Decidable _≈_ IsDecPartialOrder _≈_ _≤_ isDecPartialOrder semilattice _≟_ = record { isPartialOrder = isPartialOrder semilattice @@ -153,7 +153,7 @@ where open module S = IsSemilattice latt isDecTotalOrder : IsSemilattice _∙_ Selective _∙_ - Decidable _≈_ IsDecTotalOrder _≈_ _≤_ + Decidable _≈_ IsDecTotalOrder _≈_ _≤_ isDecTotalOrder latt sel _≟_ = record { isTotalOrder = isTotalOrder latt sel ; _≟_ = _≟_ @@ -173,7 +173,7 @@ { isPartialOrder = isPartialOrder latt } -decPoset : IsSemilattice _∙_ Decidable _≈_ DecPoset a +decPoset : IsSemilattice _∙_ Decidable _≈_ DecPoset a decPoset latt dec = record { isDecPartialOrder = isDecPartialOrder latt dec } @@ -184,7 +184,7 @@ } decTotalOrder : IsSemilattice _∙_ Selective _∙_ - Decidable _≈_ DecTotalOrder a + Decidable _≈_ DecTotalOrder a decTotalOrder latt sel dec = record { isDecTotalOrder = isDecTotalOrder latt sel dec } diff --git a/master/Relation.Binary.Construct.NaturalOrder.Right.html b/master/Relation.Binary.Construct.NaturalOrder.Right.html index e2b95ef85d..5a4fe012d8 100644 --- a/master/Relation.Binary.Construct.NaturalOrder.Right.html +++ b/master/Relation.Binary.Construct.NaturalOrder.Right.html @@ -17,9 +17,9 @@ open import Relation.Binary.Structures using (IsEquivalence; IsPreorder; IsPartialOrder; IsDecPartialOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Symmetric; Transitive; Reflexive; Antisymmetric; Total; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Decidable) + using (Symmetric; Transitive; Reflexive; Antisymmetric; Total; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Decidable) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) import Relation.Binary.Reasoning.Setoid as ≈-Reasoning module Relation.Binary.Construct.NaturalOrder.Right @@ -47,10 +47,10 @@ y x where open IsMagma magma; open ≈-Reasoning setoid -refl : Symmetric _≈_ Idempotent _∙_ Reflexive _≤_ +refl : Symmetric _≈_ Idempotent _∙_ Reflexive _≤_ refl sym idem {x} = sym (idem x) -antisym : IsEquivalence _≈_ Commutative _∙_ Antisymmetric _≈_ _≤_ +antisym : IsEquivalence _≈_ Commutative _∙_ Antisymmetric _≈_ _≤_ antisym isEq comm {x} {y} x≤y y≤x = begin x ≈⟨ x≤y y x ≈⟨ comm y x @@ -58,11 +58,11 @@ y where open ≈-Reasoning (record { isEquivalence = isEq }) -total : Symmetric _≈_ Transitive _≈_ Selective _∙_ Commutative _∙_ Total _≤_ +total : Symmetric _≈_ Transitive _≈_ Selective _∙_ Commutative _∙_ Total _≤_ total sym trans sel comm x y = map x∙y≈x trans (sym x∙y≈x) (comm x y)) sym (sel x y) -trans : IsSemigroup _∙_ Transitive _≤_ +trans : IsSemigroup _∙_ Transitive _≤_ trans semi {x} {y} {z} x≤y y≤z = begin x ≈⟨ x≤y y x ≈⟨ ∙-cong y≤z S.refl @@ -71,14 +71,14 @@ z x where open module S = IsSemigroup semi; open ≈-Reasoning S.setoid -respʳ : IsMagma _∙_ _≤_ Respectsʳ _≈_ +respʳ : IsMagma _∙_ _≤_ Respectsʳ _≈_ respʳ magma {x} {y} {z} y≈z x≤y = begin x ≈⟨ x≤y y x ≈⟨ ∙-cong y≈z M.refl z x where open module M = IsMagma magma; open ≈-Reasoning M.setoid -respˡ : IsMagma _∙_ _≤_ Respectsˡ _≈_ +respˡ : IsMagma _∙_ _≤_ Respectsˡ _≈_ respˡ magma {x} {y} {z} y≈z y≤x = begin z ≈⟨ sym y≈z y ≈⟨ y≤x @@ -86,10 +86,10 @@ x z where open module M = IsMagma magma; open ≈-Reasoning M.setoid -resp₂ : IsMagma _∙_ _≤_ Respects₂ _≈_ +resp₂ : IsMagma _∙_ _≤_ Respects₂ _≈_ resp₂ magma = respʳ magma , respˡ magma -dec : Decidable _≈_ Decidable _≤_ +dec : Decidable _≈_ Decidable _≤_ dec _≟_ x y = x (y x) ------------------------------------------------------------------------ @@ -110,7 +110,7 @@ } where open IsSemilattice semilattice -isDecPartialOrder : IsSemilattice _∙_ Decidable _≈_ +isDecPartialOrder : IsSemilattice _∙_ Decidable _≈_ IsDecPartialOrder _≈_ _≤_ isDecPartialOrder semilattice _≟_ = record { isPartialOrder = isPartialOrder semilattice @@ -126,7 +126,7 @@ where open module S = IsSemilattice latt isDecTotalOrder : IsSemilattice _∙_ Selective _∙_ - Decidable _≈_ IsDecTotalOrder _≈_ _≤_ + Decidable _≈_ IsDecTotalOrder _≈_ _≤_ isDecTotalOrder latt sel _≟_ = record { isTotalOrder = isTotalOrder latt sel ; _≟_ = _≟_ @@ -146,7 +146,7 @@ { isPartialOrder = isPartialOrder latt } -decPoset : IsSemilattice _∙_ Decidable _≈_ DecPoset a +decPoset : IsSemilattice _∙_ Decidable _≈_ DecPoset a decPoset latt dec = record { isDecPartialOrder = isDecPartialOrder latt dec } @@ -157,7 +157,7 @@ } decTotalOrder : IsSemilattice _∙_ Selective _∙_ - Decidable _≈_ DecTotalOrder a + Decidable _≈_ DecTotalOrder a decTotalOrder latt sel dec = record { isDecTotalOrder = isDecTotalOrder latt sel dec } diff --git a/master/Relation.Binary.Construct.NonStrictToStrict.html b/master/Relation.Binary.Construct.NonStrictToStrict.html index 28be3e3fb2..0e8964dad2 100644 --- a/master/Relation.Binary.Construct.NonStrictToStrict.html +++ b/master/Relation.Binary.Construct.NonStrictToStrict.html @@ -11,7 +11,7 @@ open import Relation.Binary.Structures using (IsPartialOrder; IsEquivalence; IsStrictPartialOrder; IsDecPartialOrder; IsDecStrictPartialOrder; IsTotalOrder; IsStrictTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Trichotomous; Antisymmetric; Symmetric; Total; Decidable; Irreflexive; Transitive; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Trans; Asymmetric; tri≈; tri<; tri>) + using (Trichotomous; Antisymmetric; Symmetric; Total; Decidable; Irreflexive; Transitive; _Respectsʳ_; _Respectsˡ_; _Respects₂_; Trans; Asymmetric; tri≈; tri<; tri>) module Relation.Binary.Construct.NonStrictToStrict {a ℓ₁ ℓ₂} {A : Set a} (_≈_ : Rel A ℓ₁) (_≤_ : Rel A ℓ₂) where @@ -19,13 +19,13 @@ open import Data.Product.Base using (_×_; _,_; proj₁; proj₂) open import Data.Sum.Base using (inj₁; inj₂) open import Function.Base using (_∘_; flip) -open import Relation.Nullary using (¬_; yes; no) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Nullary.Decidable using (¬?; _×-dec_) +open import Relation.Nullary using (¬_; yes; no) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (¬?; _×-dec_) private _≉_ : Rel A ℓ₁ - x y = ¬ (x y) + x y = ¬ (x y) ------------------------------------------------------------------------ -- _≤_ can be turned into _<_ as follows: @@ -47,74 +47,74 @@ ≤∧≉⇒< : {x y} x y x y x < y ≤∧≉⇒< = _,_ -<⇒≱ : Antisymmetric _≈_ _≤_ {x y} x < y ¬ (y x) +<⇒≱ : Antisymmetric _≈_ _≤_ {x y} x < y ¬ (y x) <⇒≱ antisym (x≤y , x≉y) y≤x = x≉y (antisym x≤y y≤x) -≤⇒≯ : Antisymmetric _≈_ _≤_ {x y} x y ¬ (y < x) +≤⇒≯ : Antisymmetric _≈_ _≤_ {x y} x y ¬ (y < x) ≤⇒≯ antisym x≤y y<x = <⇒≱ antisym y<x x≤y -≰⇒> : Symmetric _≈_ (_≈_ _≤_) Total _≤_ - {x y} ¬ (x y) y < x +≰⇒> : Symmetric _≈_ (_≈_ _≤_) Total _≤_ + {x y} ¬ (x y) y < x ≰⇒> sym refl total {x} {y} x≰y with total x y -... | inj₁ x≤y = contradiction x≤y x≰y +... | inj₁ x≤y = contradiction x≤y x≰y ... | inj₂ y≤x = y≤x , x≰y refl sym -≮⇒≥ : Symmetric _≈_ Decidable _≈_ _≈_ _≤_ Total _≤_ - {x y} ¬ (x < y) y x +≮⇒≥ : Symmetric _≈_ Decidable _≈_ _≈_ _≤_ Total _≤_ + {x y} ¬ (x < y) y x ≮⇒≥ sym _≟_ ≤-refl _≤?_ {x} {y} x≮y with x y | y ≤? x -... | yes x≈y | _ = ≤-refl (sym x≈y) +... | yes x≈y | _ = ≤-refl (sym x≈y) ... | _ | inj₁ y≤x = y≤x -... | no x≉y | inj₂ x≤y = contradiction (x≤y , x≉y) x≮y +... | no x≉y | inj₂ x≤y = contradiction (x≤y , x≉y) x≮y ------------------------------------------------------------------------ -- Relational properties -<-irrefl : Irreflexive _≈_ _<_ +<-irrefl : Irreflexive _≈_ _<_ <-irrefl x≈y (_ , x≉y) = x≉y x≈y -<-trans : IsPartialOrder _≈_ _≤_ Transitive _<_ +<-trans : IsPartialOrder _≈_ _≤_ Transitive _<_ <-trans po (x≤y , x≉y) (y≤z , y≉z) = (trans x≤y y≤z , x≉y antisym x≤y trans y≤z reflexive Eq.sym) where open IsPartialOrder po -<-≤-trans : Symmetric _≈_ Transitive _≤_ Antisymmetric _≈_ _≤_ - _≤_ Respectsʳ _≈_ Trans _<_ _≤_ _<_ +<-≤-trans : Symmetric _≈_ Transitive _≤_ Antisymmetric _≈_ _≤_ + _≤_ Respectsʳ _≈_ Trans _<_ _≤_ _<_ <-≤-trans sym trans antisym respʳ (x≤y , x≉y) y≤z = trans x≤y y≤z , x≈z x≉y (antisym x≤y (respʳ (sym x≈z) y≤z))) -≤-<-trans : Transitive _≤_ Antisymmetric _≈_ _≤_ - _≤_ Respectsˡ _≈_ Trans _≤_ _<_ _<_ +≤-<-trans : Transitive _≤_ Antisymmetric _≈_ _≤_ + _≤_ Respectsˡ _≈_ Trans _≤_ _<_ _<_ ≤-<-trans trans antisym respʳ x≤y (y≤z , y≉z) = trans x≤y y≤z , x≈z y≉z (antisym y≤z (respʳ x≈z x≤y))) -<-asym : Antisymmetric _≈_ _≤_ Asymmetric _<_ +<-asym : Antisymmetric _≈_ _≤_ Asymmetric _<_ <-asym antisym (x≤y , x≉y) (y≤x , _) = x≉y (antisym x≤y y≤x) -<-respˡ-≈ : Transitive _≈_ _≤_ Respectsˡ _≈_ _<_ Respectsˡ _≈_ +<-respˡ-≈ : Transitive _≈_ _≤_ Respectsˡ _≈_ _<_ Respectsˡ _≈_ <-respˡ-≈ trans respˡ y≈z (y≤x , y≉x) = respˡ y≈z y≤x , y≉x trans y≈z -<-respʳ-≈ : Symmetric _≈_ Transitive _≈_ - _≤_ Respectsʳ _≈_ _<_ Respectsʳ _≈_ +<-respʳ-≈ : Symmetric _≈_ Transitive _≈_ + _≤_ Respectsʳ _≈_ _<_ Respectsʳ _≈_ <-respʳ-≈ sym trans respʳ y≈z (x≤y , x≉y) = (respʳ y≈z x≤y) , λ x≈z x≉y (trans x≈z (sym y≈z)) -<-resp-≈ : IsEquivalence _≈_ _≤_ Respects₂ _≈_ _<_ Respects₂ _≈_ +<-resp-≈ : IsEquivalence _≈_ _≤_ Respects₂ _≈_ _<_ Respects₂ _≈_ <-resp-≈ eq (respʳ , respˡ) = <-respʳ-≈ sym trans respʳ , <-respˡ-≈ trans respˡ where open IsEquivalence eq -<-trichotomous : Symmetric _≈_ Decidable _≈_ - Antisymmetric _≈_ _≤_ Total _≤_ - Trichotomous _≈_ _<_ +<-trichotomous : Symmetric _≈_ Decidable _≈_ + Antisymmetric _≈_ _≤_ Total _≤_ + Trichotomous _≈_ _<_ <-trichotomous ≈-sym _≟_ antisym total x y with x y -... | yes x≈y = tri≈ (<-irrefl x≈y) x≈y (<-irrefl (≈-sym x≈y)) -... | no x≉y with total x y -... | inj₁ x≤y = tri< (x≤y , x≉y) x≉y (x≉y antisym x≤y proj₁) -... | inj₂ y≤x = tri> (x≉y flip antisym y≤x proj₁) x≉y (y≤x , x≉y ≈-sym) +... | yes x≈y = tri≈ (<-irrefl x≈y) x≈y (<-irrefl (≈-sym x≈y)) +... | no x≉y with total x y +... | inj₁ x≤y = tri< (x≤y , x≉y) x≉y (x≉y antisym x≤y proj₁) +... | inj₂ y≤x = tri> (x≉y flip antisym y≤x proj₁) x≉y (y≤x , x≉y ≈-sym) -<-decidable : Decidable _≈_ Decidable _≤_ Decidable _<_ -<-decidable _≟_ _≤?_ x y = x ≤? y ×-dec ¬? (x y) +<-decidable : Decidable _≈_ Decidable _≤_ Decidable _<_ +<-decidable _≟_ _≤?_ x y = x ≤? y ×-dec ¬? (x y) ------------------------------------------------------------------------ -- Structures @@ -136,7 +136,7 @@ ; _<?_ = <-decidable _≟_ _≤?_ } where open IsDecPartialOrder dpo -<-isStrictTotalOrder₁ : Decidable _≈_ IsTotalOrder _≈_ _≤_ +<-isStrictTotalOrder₁ : Decidable _≈_ IsTotalOrder _≈_ _≤_ IsStrictTotalOrder _≈_ _<_ <-isStrictTotalOrder₁ tot = record { isStrictPartialOrder = <-isStrictPartialOrder isPartialOrder diff --git a/master/Relation.Binary.Construct.On.html b/master/Relation.Binary.Construct.On.html index 7b8e891fe4..1bb65e7e42 100644 --- a/master/Relation.Binary.Construct.On.html +++ b/master/Relation.Binary.Construct.On.html @@ -19,7 +19,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsPreorder; IsPartialOrder; IsDecPartialOrder; IsStrictPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Reflexive; Irreflexive; Symmetric; Transitive; Antisymmetric; Asymmetric; Decidable; Total; Trichotomous; _Respects_; _Respects₂_) + using (Reflexive; Irreflexive; Symmetric; Transitive; Antisymmetric; Asymmetric; Decidable; Total; Trichotomous; _Respects_; _Respects₂_) private variable @@ -36,42 +36,42 @@ ( on f) ( on f) implies _ _ impl = impl - reflexive : ( : Rel A ) Reflexive Reflexive ( on f) + reflexive : ( : Rel A ) Reflexive Reflexive ( on f) reflexive _ refl = refl irreflexive : ( : Rel A ℓ₁) ( : Rel A ℓ₂) - Irreflexive Irreflexive ( on f) ( on f) + Irreflexive Irreflexive ( on f) ( on f) irreflexive _ _ irrefl = irrefl - symmetric : ( : Rel A ) Symmetric Symmetric ( on f) + symmetric : ( : Rel A ) Symmetric Symmetric ( on f) symmetric _ sym = sym - transitive : ( : Rel A ) Transitive Transitive ( on f) + transitive : ( : Rel A ) Transitive Transitive ( on f) transitive _ trans = trans antisymmetric : ( : Rel A ℓ₁) ( : Rel A ℓ₂) - Antisymmetric Antisymmetric ( on f) ( on f) + Antisymmetric Antisymmetric ( on f) ( on f) antisymmetric _ _ antisym = antisym - asymmetric : (< : Rel A ) Asymmetric < Asymmetric (< on f) + asymmetric : (< : Rel A ) Asymmetric < Asymmetric (< on f) asymmetric _ asym = asym respects : ( : Rel A ) (P : A Set p) - P Respects (P f) Respects ( on f) + P Respects (P f) Respects ( on f) respects _ _ resp = resp respects₂ : (∼₁ : Rel A ℓ₁) (∼₂ : Rel A ℓ₂) - ∼₁ Respects₂ ∼₂ (∼₁ on f) Respects₂ (∼₂ on f) + ∼₁ Respects₂ ∼₂ (∼₁ on f) Respects₂ (∼₂ on f) respects₂ _ _ (resp₁ , resp₂) = (resp₁ , resp₂) - decidable : ( : Rel A ) Decidable Decidable ( on f) + decidable : ( : Rel A ) Decidable Decidable ( on f) decidable _ dec x y = dec (f x) (f y) - total : ( : Rel A ) Total Total ( on f) + total : ( : Rel A ) Total Total ( on f) total _ tot x y = tot (f x) (f y) trichotomous : ( : Rel A ℓ₁) (< : Rel A ℓ₂) - Trichotomous < Trichotomous ( on f) (< on f) + Trichotomous < Trichotomous ( on f) (< on f) trichotomous _ _ compare x y = compare (f x) (f y) accessible : { : Rel A } {x} Acc (f x) Acc ( on f) x diff --git a/master/Relation.Binary.Construct.StrictToNonStrict.html b/master/Relation.Binary.Construct.StrictToNonStrict.html index 08ab3031ee..f3ed12dd42 100644 --- a/master/Relation.Binary.Construct.StrictToNonStrict.html +++ b/master/Relation.Binary.Construct.StrictToNonStrict.html @@ -15,7 +15,7 @@ open import Relation.Binary.Structures using (IsEquivalence; IsPreorder; IsStrictPartialOrder; IsPartialOrder; IsStrictTotalOrder; IsTotalOrder; IsDecTotalOrder) open import Relation.Binary.Definitions - using (Transitive; Symmetric; Irreflexive; Antisymmetric; Trichotomous; Decidable; Trans; Total; _Respects₂_; _Respectsʳ_; _Respectsˡ_; tri<; tri≈; tri>) + using (Transitive; Symmetric; Irreflexive; Antisymmetric; Trichotomous; Decidable; Trans; Total; _Respects₂_; _Respectsʳ_; _Respectsˡ_; tri<; tri≈; tri>) module Relation.Binary.Construct.StrictToNonStrict {a ℓ₁ ℓ₂} {A : Set a} @@ -27,7 +27,7 @@ open import Data.Empty open import Function.Base open import Relation.Binary.Consequences -open import Relation.Nullary.Decidable using (_⊎-dec_; yes; no) +open import Relation.Nullary.Decidable using (_⊎-dec_; yes; no) ------------------------------------------------------------------------ -- Conversion @@ -48,64 +48,64 @@ reflexive : _≈_ _≤_ reflexive = inj₂ -antisym : IsEquivalence _≈_ Transitive _<_ Irreflexive _≈_ _<_ - Antisymmetric _≈_ _≤_ +antisym : IsEquivalence _≈_ Transitive _<_ Irreflexive _≈_ _<_ + Antisymmetric _≈_ _≤_ antisym eq trans irrefl = as where module Eq = IsEquivalence eq - as : Antisymmetric _≈_ _≤_ + as : Antisymmetric _≈_ _≤_ as (inj₂ x≈y) _ = x≈y as (inj₁ _) (inj₂ y≈x) = Eq.sym y≈x as (inj₁ x<y) (inj₁ y<x) = ⊥-elim (trans∧irr⇒asym {_≈_ = _≈_} Eq.refl trans irrefl x<y y<x) -trans : IsEquivalence _≈_ _<_ Respects₂ _≈_ Transitive _<_ - Transitive _≤_ +trans : IsEquivalence _≈_ _<_ Respects₂ _≈_ Transitive _<_ + Transitive _≤_ trans eq (respʳ , respˡ) <-trans = tr where module Eq = IsEquivalence eq - tr : Transitive _≤_ + tr : Transitive _≤_ tr (inj₁ x<y) (inj₁ y<z) = inj₁ $ <-trans x<y y<z tr (inj₁ x<y) (inj₂ y≈z) = inj₁ $ respʳ y≈z x<y tr (inj₂ x≈y) (inj₁ y<z) = inj₁ $ respˡ (Eq.sym x≈y) y<z tr (inj₂ x≈y) (inj₂ y≈z) = inj₂ $ Eq.trans x≈y y≈z -<-≤-trans : Transitive _<_ _<_ Respectsʳ _≈_ Trans _<_ _≤_ _<_ +<-≤-trans : Transitive _<_ _<_ Respectsʳ _≈_ Trans _<_ _≤_ _<_ <-≤-trans trans respʳ x<y (inj₁ y<z) = trans x<y y<z <-≤-trans trans respʳ x<y (inj₂ y≈z) = respʳ y≈z x<y -≤-<-trans : Symmetric _≈_ Transitive _<_ _<_ Respectsˡ _≈_ Trans _≤_ _<_ _<_ +≤-<-trans : Symmetric _≈_ Transitive _<_ _<_ Respectsˡ _≈_ Trans _≤_ _<_ _<_ ≤-<-trans sym trans respˡ (inj₁ x<y) y<z = trans x<y y<z ≤-<-trans sym trans respˡ (inj₂ x≈y) y<z = respˡ (sym x≈y) y<z -≤-respʳ-≈ : Transitive _≈_ _<_ Respectsʳ _≈_ _≤_ Respectsʳ _≈_ +≤-respʳ-≈ : Transitive _≈_ _<_ Respectsʳ _≈_ _≤_ Respectsʳ _≈_ ≤-respʳ-≈ trans respʳ y′≈y (inj₁ x<y′) = inj₁ (respʳ y′≈y x<y′) ≤-respʳ-≈ trans respʳ y′≈y (inj₂ x≈y′) = inj₂ (trans x≈y′ y′≈y) -≤-respˡ-≈ : Symmetric _≈_ Transitive _≈_ _<_ Respectsˡ _≈_ _≤_ Respectsˡ _≈_ +≤-respˡ-≈ : Symmetric _≈_ Transitive _≈_ _<_ Respectsˡ _≈_ _≤_ Respectsˡ _≈_ ≤-respˡ-≈ sym trans respˡ x′≈x (inj₁ x′<y) = inj₁ (respˡ x′≈x x′<y) ≤-respˡ-≈ sym trans respˡ x′≈x (inj₂ x′≈y) = inj₂ (trans (sym x′≈x) x′≈y) -≤-resp-≈ : IsEquivalence _≈_ _<_ Respects₂ _≈_ _≤_ Respects₂ _≈_ +≤-resp-≈ : IsEquivalence _≈_ _<_ Respects₂ _≈_ _≤_ Respects₂ _≈_ ≤-resp-≈ eq (respʳ , respˡ) = ≤-respʳ-≈ Eq.trans respʳ , ≤-respˡ-≈ Eq.sym Eq.trans respˡ where module Eq = IsEquivalence eq -total : Trichotomous _≈_ _<_ Total _≤_ +total : Trichotomous _≈_ _<_ Total _≤_ total <-tri x y with <-tri x y -... | tri< x<y x≉y x≯y = inj₁ (inj₁ x<y) -... | tri≈ x≮y x≈y x≯y = inj₁ (inj₂ x≈y) -... | tri> x≮y x≉y x>y = inj₂ (inj₁ x>y) +... | tri< x<y x≉y x≯y = inj₁ (inj₁ x<y) +... | tri≈ x≮y x≈y x≯y = inj₁ (inj₂ x≈y) +... | tri> x≮y x≉y x>y = inj₂ (inj₁ x>y) -decidable : Decidable _≈_ Decidable _<_ Decidable _≤_ -decidable ≈-dec <-dec x y = <-dec x y ⊎-dec ≈-dec x y +decidable : Decidable _≈_ Decidable _<_ Decidable _≤_ +decidable ≈-dec <-dec x y = <-dec x y ⊎-dec ≈-dec x y -decidable′ : Trichotomous _≈_ _<_ Decidable _≤_ +decidable′ : Trichotomous _≈_ _<_ Decidable _≤_ decidable′ compare x y with compare x y -... | tri< x<y _ _ = yes (inj₁ x<y) -... | tri≈ _ x≈y _ = yes (inj₂ x≈y) -... | tri> x≮y x≉y _ = no [ x≮y , x≉y ]′ +... | tri< x<y _ _ = yes (inj₁ x<y) +... | tri≈ _ x≈y _ = yes (inj₂ x≈y) +... | tri> x≮y x≉y _ = no [ x≮y , x≉y ]′ ------------------------------------------------------------------------ -- Converting structures @@ -157,7 +157,7 @@ -- Version 1.4 -decidable' : Trichotomous _≈_ _<_ Decidable _≤_ +decidable' : Trichotomous _≈_ _<_ Decidable _≤_ decidable' = decidable′ {-# WARNING_ON_USAGE decidable' "Warning: decidable' (ending in an apostrophe) was deprecated in v1.4. diff --git a/master/Relation.Binary.Construct.Subst.Equality.html b/master/Relation.Binary.Construct.Subst.Equality.html index 77e5c4b6fe..b9238efd86 100644 --- a/master/Relation.Binary.Construct.Subst.Equality.html +++ b/master/Relation.Binary.Construct.Subst.Equality.html @@ -13,7 +13,7 @@ open import Data.Product.Base using (_,_) open import Relation.Binary.Core using (Rel; _⇔_) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) +open import Relation.Binary.Definitions using (Reflexive; Symmetric; Transitive) module Relation.Binary.Construct.Subst.Equality {a ℓ₁ ℓ₂} {A : Set a} {≈₁ : Rel A ℓ₁} {≈₂ : Rel A ℓ₂} @@ -25,13 +25,13 @@ ------------------------------------------------------------------------ -- Definitions -refl : Reflexive ≈₁ Reflexive ≈₂ +refl : Reflexive ≈₁ Reflexive ≈₂ refl refl = to refl -sym : Symmetric ≈₁ Symmetric ≈₂ +sym : Symmetric ≈₁ Symmetric ≈₂ sym sym = to ∘′ sym ∘′ from -trans : Transitive ≈₁ Transitive ≈₂ +trans : Transitive ≈₁ Transitive ≈₂ trans trans x≈y y≈z = to (trans (from x≈y) (from y≈z)) ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Construct.Union.html b/master/Relation.Binary.Construct.Union.html index 07ad08ca68..53a245390d 100644 --- a/master/Relation.Binary.Construct.Union.html +++ b/master/Relation.Binary.Construct.Union.html @@ -15,8 +15,8 @@ open import Level using (Level; _⊔_) open import Relation.Binary.Core using (REL; Rel; _⇒_) open import Relation.Binary.Definitions - using (Reflexive; Total; Minimum; Maximum; Symmetric; Irreflexive; Decidable; _Respects_; _Respectsˡ_; _Respectsʳ_; _Respects₂_) -open import Relation.Nullary.Decidable using (yes; no; _⊎-dec_) + using (Reflexive; Total; Minimum; Maximum; Symmetric; Irreflexive; Decidable; _Respects_; _Respectsˡ_; _Respectsʳ_; _Respects₂_) +open import Relation.Nullary.Decidable using (yes; no; _⊎-dec_) private variable @@ -37,42 +37,42 @@ module _ (L : Rel A ) (R : Rel A ) where - reflexive : Reflexive L Reflexive R Reflexive (L R) + reflexive : Reflexive L Reflexive R Reflexive (L R) reflexive (inj₁ L-refl) = inj₁ L-refl reflexive (inj₂ R-refl) = inj₂ R-refl - total : Total L Total R Total (L R) + total : Total L Total R Total (L R) total (inj₁ L-total) x y = [ inj₁ inj₁ , inj₂ inj₁ ] (L-total x y) total (inj₂ R-total) x y = [ inj₁ inj₂ , inj₂ inj₂ ] (R-total x y) - min : {} Minimum L Minimum R Minimum (L R) + min : {} Minimum L Minimum R Minimum (L R) min = [ inj₁ ∘_ , inj₂ ∘_ ] - max : {} Maximum L Maximum R Maximum (L R) + max : {} Maximum L Maximum R Maximum (L R) max = [ inj₁ ∘_ , inj₂ ∘_ ] module _ {L : Rel A } {R : Rel A } where - symmetric : Symmetric L Symmetric R Symmetric (L R) + symmetric : Symmetric L Symmetric R Symmetric (L R) symmetric L-sym R-sym = [ inj₁ L-sym , inj₂ R-sym ] respects : {p} {P : A Set p} - P Respects L P Respects R P Respects (L R) + P Respects L P Respects R P Respects (L R) respects resp-L resp-R = [ resp-L , resp-R ] module _ { : Rel A ℓ₁} (L : REL A B ℓ₂) (R : REL A B ℓ₃) where - respˡ : L Respectsˡ R Respectsˡ (L R) Respectsˡ + respˡ : L Respectsˡ R Respectsˡ (L R) Respectsˡ respˡ x≈y = Sum.map ( x≈y) ( x≈y) module _ { : Rel B ℓ₁} (L : REL A B ℓ₂) (R : REL A B ℓ₃) where - respʳ : L Respectsʳ R Respectsʳ (L R) Respectsʳ + respʳ : L Respectsʳ R Respectsʳ (L R) Respectsʳ respʳ x≈y = Sum.map ( x≈y) ( x≈y) module _ { : Rel A ℓ₁} {L : Rel A ℓ₂} {R : Rel A ℓ₃} where - resp₂ : L Respects₂ R Respects₂ (L R) Respects₂ + resp₂ : L Respects₂ R Respects₂ (L R) Respects₂ resp₂ ( , ) ( , ) = respʳ L R , respˡ L R module _ ( : REL A B ℓ₁) (L : REL A B ℓ₂) (R : REL A B ℓ₃) where @@ -80,11 +80,11 @@ implies : ( L) ( R) (L R) implies = [ inj₁ ∘_ , inj₂ ∘_ ] - irreflexive : Irreflexive L Irreflexive R Irreflexive (L R) + irreflexive : Irreflexive L Irreflexive R Irreflexive (L R) irreflexive L-irrefl R-irrefl x≈y = [ L-irrefl x≈y , R-irrefl x≈y ] module _ {L : REL A B ℓ₁} {R : REL A B ℓ₂} where - decidable : Decidable L Decidable R Decidable (L R) - decidable L? R? x y = L? x y ⊎-dec R? x y + decidable : Decidable L Decidable R Decidable (L R) + decidable L? R? x y = L? x y ⊎-dec R? x y \ No newline at end of file diff --git a/master/Relation.Binary.Definitions.html b/master/Relation.Binary.Definitions.html index 763b52bf19..beb982b18c 100644 --- a/master/Relation.Binary.Definitions.html +++ b/master/Relation.Binary.Definitions.html @@ -13,251 +13,249 @@ open import Agda.Builtin.Equality using (_≡_) -open import Data.Empty using () -open import Data.Maybe.Base using (Maybe) -open import Data.Product.Base using (_×_; ∃-syntax) -open import Data.Sum.Base using (_⊎_) -open import Function.Base using (_on_; flip) -open import Level -open import Relation.Binary.Core -open import Relation.Nullary as Nullary using (¬_; Dec) +open import Data.Product.Base using (_×_; ∃-syntax) +open import Data.Sum.Base using (_⊎_) +open import Function.Base using (_on_; flip) +open import Level +open import Relation.Binary.Core +open import Relation.Nullary as Nullary using (¬_; Dec) -private - variable - a b c ℓ₁ ℓ₂ ℓ₃ : Level - A : Set a - B : Set b - C : Set c +private + variable + a b c ℓ₁ ℓ₂ ℓ₃ : Level + A : Set a + B : Set b + C : Set c ------------------------------------------------------------------------- --- Definitions ------------------------------------------------------------------------- +------------------------------------------------------------------------ +-- Definitions +------------------------------------------------------------------------ --- Reflexivity - defined without an underlying equality. It could --- alternatively be defined as `_≈_ ⇒ _∼_` for some equality `_≈_`. +-- Reflexivity - defined without an underlying equality. It could +-- alternatively be defined as `_≈_ ⇒ _∼_` for some equality `_≈_`. --- Confusingly the convention in the library is to use the name "refl" --- for proofs of Reflexive and `reflexive` for proofs of type `_≈_ ⇒ _∼_`, --- e.g. in the definition of `IsEquivalence` later in this file. This --- convention is a legacy from the early days of the library. +-- Confusingly the convention in the library is to use the name "refl" +-- for proofs of Reflexive and `reflexive` for proofs of type `_≈_ ⇒ _∼_`, +-- e.g. in the definition of `IsEquivalence` later in this file. This +-- convention is a legacy from the early days of the library. -Reflexive : Rel A Set _ -Reflexive _∼_ = {x} x x +Reflexive : Rel A Set _ +Reflexive _∼_ = {x} x x --- Generalised symmetry. +-- Generalised symmetry. -Sym : REL A B ℓ₁ REL B A ℓ₂ Set _ -Sym P Q = P flip Q +Sym : REL A B ℓ₁ REL B A ℓ₂ Set _ +Sym P Q = P flip Q --- Symmetry. +-- Symmetry. -Symmetric : Rel A Set _ -Symmetric _∼_ = Sym _∼_ _∼_ +Symmetric : Rel A Set _ +Symmetric _∼_ = Sym _∼_ _∼_ --- Generalised transitivity. +-- Generalised transitivity. -Trans : REL A B ℓ₁ REL B C ℓ₂ REL A C ℓ₃ Set _ -Trans P Q R = {i j k} P i j Q j k R i k +Trans : REL A B ℓ₁ REL B C ℓ₂ REL A C ℓ₃ Set _ +Trans P Q R = {i j k} P i j Q j k R i k -RightTrans : REL A B ℓ₁ REL B B ℓ₂ Set _ -RightTrans R S = Trans R S R +RightTrans : REL A B ℓ₁ REL B B ℓ₂ Set _ +RightTrans R S = Trans R S R -LeftTrans : REL A A ℓ₁ REL A B ℓ₂ Set _ -LeftTrans S R = Trans S R R +LeftTrans : REL A A ℓ₁ REL A B ℓ₂ Set _ +LeftTrans S R = Trans S R R --- A flipped variant of generalised transitivity. +-- A flipped variant of generalised transitivity. -TransFlip : REL A B ℓ₁ REL B C ℓ₂ REL A C ℓ₃ Set _ -TransFlip P Q R = {i j k} Q j k P i j R i k +TransFlip : REL A B ℓ₁ REL B C ℓ₂ REL A C ℓ₃ Set _ +TransFlip P Q R = {i j k} Q j k P i j R i k --- Transitivity. +-- Transitivity. -Transitive : Rel A Set _ -Transitive _∼_ = Trans _∼_ _∼_ _∼_ +Transitive : Rel A Set _ +Transitive _∼_ = Trans _∼_ _∼_ _∼_ --- Generalised antisymmetry +-- Generalised antisymmetry -Antisym : REL A B ℓ₁ REL B A ℓ₂ REL A B ℓ₃ Set _ -Antisym R S E = {i j} R i j S j i E i j +Antisym : REL A B ℓ₁ REL B A ℓ₂ REL A B ℓ₃ Set _ +Antisym R S E = {i j} R i j S j i E i j --- Antisymmetry. +-- Antisymmetry. -Antisymmetric : Rel A ℓ₁ Rel A ℓ₂ Set _ -Antisymmetric _≈_ _≤_ = Antisym _≤_ _≤_ _≈_ +Antisymmetric : Rel A ℓ₁ Rel A ℓ₂ Set _ +Antisymmetric _≈_ _≤_ = Antisym _≤_ _≤_ _≈_ --- Irreflexivity - this is defined terms of the underlying equality. +-- Irreflexivity - this is defined terms of the underlying equality. -Irreflexive : REL A B ℓ₁ REL A B ℓ₂ Set _ -Irreflexive _≈_ _<_ = {x y} x y ¬ (x < y) +Irreflexive : REL A B ℓ₁ REL A B ℓ₂ Set _ +Irreflexive _≈_ _<_ = {x y} x y ¬ (x < y) --- Asymmetry. +-- Asymmetry. -Asymmetric : Rel A Set _ -Asymmetric _<_ = {x y} x < y ¬ (y < x) +Asymmetric : Rel A Set _ +Asymmetric _<_ = {x y} x < y ¬ (y < x) --- Density +-- Density -Dense : Rel A Set _ -Dense _<_ = {x y} x < y ∃[ z ] x < z × z < y +Dense : Rel A Set _ +Dense _<_ = {x y} x < y ∃[ z ] x < z × z < y --- Generalised connex - at least one of the two relations holds. +-- Generalised connex - at least one of the two relations holds. -Connex : REL A B ℓ₁ REL B A ℓ₂ Set _ -Connex P Q = x y P x y Q y x +Connex : REL A B ℓ₁ REL B A ℓ₂ Set _ +Connex P Q = x y P x y Q y x --- Totality. +-- Totality. -Total : Rel A Set _ -Total _∼_ = Connex _∼_ _∼_ +Total : Rel A Set _ +Total _∼_ = Connex _∼_ _∼_ --- Generalised trichotomy - exactly one of three types has a witness. +-- Generalised trichotomy - exactly one of three types has a witness. -data Tri (A : Set a) (B : Set b) (C : Set c) : Set (a b c) where - tri< : ( a : A) (¬b : ¬ B) (¬c : ¬ C) Tri A B C - tri≈ : (¬a : ¬ A) ( b : B) (¬c : ¬ C) Tri A B C - tri> : (¬a : ¬ A) (¬b : ¬ B) ( c : C) Tri A B C +data Tri (A : Set a) (B : Set b) (C : Set c) : Set (a b c) where + tri< : ( a : A) (¬b : ¬ B) (¬c : ¬ C) Tri A B C + tri≈ : (¬a : ¬ A) ( b : B) (¬c : ¬ C) Tri A B C + tri> : (¬a : ¬ A) (¬b : ¬ B) ( c : C) Tri A B C --- Trichotomy. +-- Trichotomy. -Trichotomous : Rel A ℓ₁ Rel A ℓ₂ Set _ -Trichotomous _≈_ _<_ = x y Tri (x < y) (x y) (x > y) - where _>_ = flip _<_ +Trichotomous : Rel A ℓ₁ Rel A ℓ₂ Set _ +Trichotomous _≈_ _<_ = x y Tri (x < y) (x y) (x > y) + where _>_ = flip _<_ --- Generalised maximum element. +-- Generalised maximum element. -Max : REL A B B Set _ -Max _≤_ T = x x T +Max : REL A B B Set _ +Max _≤_ T = x x T --- Maximum element. +-- Maximum element. -Maximum : Rel A A Set _ -Maximum = Max +Maximum : Rel A A Set _ +Maximum = Max --- Generalised minimum element. +-- Generalised minimum element. -Min : REL A B A Set _ -Min R = Max (flip R) +Min : REL A B A Set _ +Min R = Max (flip R) --- Minimum element. +-- Minimum element. -Minimum : Rel A A Set _ -Minimum = Min +Minimum : Rel A A Set _ +Minimum = Min --- Definitions for apartness relations +-- Definitions for apartness relations --- Note that Cotransitive's arguments are permuted with respect to Transitive's. -Cotransitive : Rel A Set _ -Cotransitive _#_ = {x y} x # y z (x # z) (z # y) +-- Note that Cotransitive's arguments are permuted with respect to Transitive's. +Cotransitive : Rel A Set _ +Cotransitive _#_ = {x y} x # y z (x # z) (z # y) -Tight : Rel A ℓ₁ Rel A ℓ₂ Set _ -Tight _≈_ _#_ = x y (¬ x # y x y) × (x y ¬ x # y) +Tight : Rel A ℓ₁ Rel A ℓ₂ Set _ +Tight _≈_ _#_ = x y (¬ x # y x y) × (x y ¬ x # y) --- Properties of order morphisms, aka order-preserving maps +-- Properties of order morphisms, aka order-preserving maps -Monotonic₁ : Rel A ℓ₁ Rel B ℓ₂ (A B) Set _ -Monotonic₁ _≤_ _⊑_ f = f Preserves _≤_ _⊑_ +Monotonic₁ : Rel A ℓ₁ Rel B ℓ₂ (A B) Set _ +Monotonic₁ _≤_ _⊑_ f = f Preserves _≤_ _⊑_ -Antitonic₁ : Rel A ℓ₁ Rel B ℓ₂ (A B) Set _ -Antitonic₁ _≤_ _⊑_ f = f Preserves (flip _≤_) _⊑_ +Antitonic₁ : Rel A ℓ₁ Rel B ℓ₂ (A B) Set _ +Antitonic₁ _≤_ _⊑_ f = f Preserves (flip _≤_) _⊑_ -Monotonic₂ : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ -Monotonic₂ _≤_ _⊑_ _≼_ = Preserves₂ _≤_ _⊑_ _≼_ +Monotonic₂ : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ +Monotonic₂ _≤_ _⊑_ _≼_ = Preserves₂ _≤_ _⊑_ _≼_ -MonotonicAntitonic : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ -MonotonicAntitonic _≤_ _⊑_ _≼_ = Preserves₂ _≤_ (flip _⊑_) _≼_ +MonotonicAntitonic : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ +MonotonicAntitonic _≤_ _⊑_ _≼_ = Preserves₂ _≤_ (flip _⊑_) _≼_ -AntitonicMonotonic : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ -AntitonicMonotonic _≤_ _⊑_ _≼_ = Preserves₂ (flip _≤_) _⊑_ _≼_ +AntitonicMonotonic : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ +AntitonicMonotonic _≤_ _⊑_ _≼_ = Preserves₂ (flip _≤_) _⊑_ _≼_ -Antitonic₂ : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ -Antitonic₂ _≤_ _⊑_ _≼_ = Preserves₂ (flip _≤_) (flip _⊑_) _≼_ +Antitonic₂ : Rel A ℓ₁ Rel B ℓ₂ Rel C ℓ₃ (A B C) Set _ +Antitonic₂ _≤_ _⊑_ _≼_ = Preserves₂ (flip _≤_) (flip _⊑_) _≼_ -Adjoint : Rel A ℓ₁ Rel B ℓ₂ (A B) (B A) Set _ -Adjoint _≤_ _⊑_ f g = {x y} (f x y x g y) × (x g y f x y) +Adjoint : Rel A ℓ₁ Rel B ℓ₂ (A B) (B A) Set _ +Adjoint _≤_ _⊑_ f g = {x y} (f x y x g y) × (x g y f x y) --- Unary relations respecting a binary relation. +-- Unary relations respecting a binary relation. -_⟶_Respects_ : (A Set ℓ₁) (B Set ℓ₂) REL A B ℓ₃ Set _ -P Q Respects _∼_ = {x y} x y P x Q y +_⟶_Respects_ : (A Set ℓ₁) (B Set ℓ₂) REL A B ℓ₃ Set _ +P Q Respects _∼_ = {x y} x y P x Q y --- Unary relation respects a binary relation. +-- Unary relation respects a binary relation. -_Respects_ : (A Set ℓ₁) Rel A ℓ₂ Set _ -P Respects _∼_ = P P Respects _∼_ +_Respects_ : (A Set ℓ₁) Rel A ℓ₂ Set _ +P Respects _∼_ = P P Respects _∼_ --- Right respecting - relatedness is preserved on the right by equality. +-- Right respecting - relatedness is preserved on the right by equality. -_Respectsʳ_ : REL A B ℓ₁ Rel B ℓ₂ Set _ -_∼_ Respectsʳ _≈_ = {x} (x ∼_) Respects _≈_ +_Respectsʳ_ : REL A B ℓ₁ Rel B ℓ₂ Set _ +_∼_ Respectsʳ _≈_ = {x} (x ∼_) Respects _≈_ --- Left respecting - relatedness is preserved on the left by equality. +-- Left respecting - relatedness is preserved on the left by equality. -_Respectsˡ_ : REL A B ℓ₁ Rel A ℓ₂ Set _ -P Respectsˡ _∼_ = {y} (flip P y) Respects _∼_ +_Respectsˡ_ : REL A B ℓ₁ Rel A ℓ₂ Set _ +P Respectsˡ _∼_ = {y} (flip P y) Respects _∼_ --- Respecting - relatedness is preserved on both sides by equality +-- Respecting - relatedness is preserved on both sides by equality -_Respects₂_ : Rel A ℓ₁ Rel A ℓ₂ Set _ -P Respects₂ _∼_ = (P Respectsʳ _∼_) × (P Respectsˡ _∼_) +_Respects₂_ : Rel A ℓ₁ Rel A ℓ₂ Set _ +P Respects₂ _∼_ = (P Respectsʳ _∼_) × (P Respectsˡ _∼_) --- Substitutivity - any two related elements satisfy exactly the same --- set of unary relations. Note that only the various derivatives --- of propositional equality can satisfy this property. +-- Substitutivity - any two related elements satisfy exactly the same +-- set of unary relations. Note that only the various derivatives +-- of propositional equality can satisfy this property. -Substitutive : Rel A ℓ₁ (ℓ₂ : Level) Set _ -Substitutive {A = A} _∼_ p = (P : A Set p) P Respects _∼_ +Substitutive : Rel A ℓ₁ (ℓ₂ : Level) Set _ +Substitutive {A = A} _∼_ p = (P : A Set p) P Respects _∼_ --- Irrelevancy - all proofs that a given pair of elements are related --- are indistinguishable. +-- Irrelevancy - all proofs that a given pair of elements are related +-- are indistinguishable. -Irrelevant : REL A B Set _ -Irrelevant _∼_ = {x y} Nullary.Irrelevant (x y) +Irrelevant : REL A B Set _ +Irrelevant _∼_ = {x y} Nullary.Irrelevant (x y) --- Recomputability - we can rebuild a relevant proof given an --- irrelevant one. +-- Recomputability - we can rebuild a relevant proof given an +-- irrelevant one. -Recomputable : REL A B Set _ -Recomputable _∼_ = {x y} Nullary.Recomputable (x y) +Recomputable : REL A B Set _ +Recomputable _∼_ = {x y} Nullary.Recomputable (x y) --- Stability +-- Stability -Stable : REL A B Set _ -Stable _∼_ = x y Nullary.Stable (x y) +Stable : REL A B Set _ +Stable _∼_ = x y Nullary.Stable (x y) --- Weak decidability - it is sometimes possible to determine if a given --- pair of elements are related. +-- Weak decidability - it is sometimes possible to determine if a given +-- pair of elements are related. -WeaklyDecidable : REL A B Set _ -WeaklyDecidable _∼_ = x y Nullary.WeaklyDecidable (x y) +WeaklyDecidable : REL A B Set _ +WeaklyDecidable _∼_ = x y Nullary.WeaklyDecidable (x y) --- Decidability - it is possible to determine whether a given pair of --- elements are related. +-- Decidability - it is possible to determine whether a given pair of +-- elements are related. -Decidable : REL A B Set _ -Decidable _∼_ = x y Dec (x y) +Decidable : REL A B Set _ +Decidable _∼_ = x y Dec (x y) --- Propositional equality is decidable for the type. +-- Propositional equality is decidable for the type. -DecidableEquality : (A : Set a) Set _ -DecidableEquality A = Decidable {A = A} _≡_ +DecidableEquality : (A : Set a) Set _ +DecidableEquality A = Decidable {A = A} _≡_ --- Universal - all pairs of elements are related +-- Universal - all pairs of elements are related -Universal : REL A B Set _ -Universal _∼_ = x y x y +Universal : REL A B Set _ +Universal _∼_ = x y x y --- Empty - no elements are related +-- Empty - no elements are related -Empty : REL A B Set _ -Empty _∼_ = {x y} x y +Empty : REL A B Set _ +Empty _∼_ = {x y} ¬ (x y) --- Non-emptiness - at least one pair of elements are related. +-- Non-emptiness - at least one pair of elements are related. -record NonEmpty {A : Set a} {B : Set b} - (T : REL A B ) : Set (a b ) where - constructor nonEmpty - field - {x} : A - {y} : B - proof : T x y +record NonEmpty {A : Set a} {B : Set b} + (T : REL A B ) : Set (a b ) where + constructor nonEmpty + field + {x} : A + {y} : B + proof : T x y \ No newline at end of file diff --git a/master/Relation.Binary.HeterogeneousEquality.html b/master/Relation.Binary.HeterogeneousEquality.html index 7a040c1ad9..bd08c8eed8 100644 --- a/master/Relation.Binary.HeterogeneousEquality.html +++ b/master/Relation.Binary.HeterogeneousEquality.html @@ -15,12 +15,12 @@ open import Function.Base open import Function.Bundles using (Inverse) open import Level -open import Relation.Nullary hiding (Irrelevant) -open import Relation.Unary using (Pred) +open import Relation.Nullary hiding (Irrelevant) +open import Relation.Unary using (Pred) open import Relation.Binary.Core using (Rel; REL; _⇒_) open import Relation.Binary.Bundles using (Setoid; DecSetoid; Preorder) open import Relation.Binary.Structures using (IsEquivalence; IsPreorder) -open import Relation.Binary.Definitions using (Substitutive; Irrelevant; Decidable; _Respects₂_; Trans; Reflexive) +open import Relation.Binary.Definitions using (Substitutive; Irrelevant; Decidable; _Respects₂_; Trans; Reflexive) open import Relation.Binary.Consequences open import Relation.Binary.Indexed.Heterogeneous using (IndexedSetoid) @@ -49,7 +49,7 @@ -- Nonequality. _≇_ : {A : Set a} A {B : Set b} B Set a -x y = ¬ x y +x y = ¬ x y ------------------------------------------------------------------------ -- Conversion @@ -75,13 +75,13 @@ trans : {x : A} {y : B} {z : C} x y y z x z trans refl eq = eq -subst : Substitutive {A = A} x y x y) +subst : Substitutive {A = A} x y x y) subst P refl p = p subst₂ : (_∼_ : REL A B r) {x y u v} x y u v x u y v subst₂ _∼_ refl refl z = z -subst-removable : (P : Pred A p) {x y} (eq : x y) (z : P x) +subst-removable : (P : Pred A p) {x y} (eq : x y) (z : P x) subst P eq z z subst-removable P refl z = refl @@ -89,7 +89,7 @@ subst₂ _∼_ eq₁ eq₂ z z subst₂-removable _∼_ refl refl z = refl -≡-subst-removable : (P : Pred A p) {x y} (eq : x y) (z : P x) +≡-subst-removable : (P : Pred A p) {x y} (eq : x y) (z : P x) ≡.subst P eq z z ≡-subst-removable P refl z = refl @@ -105,7 +105,7 @@ (f : (x : A) (y : B x) C x y) x y u v f x u f y v cong₂ f refl refl = refl -resp₂ : ( : Rel A ) Respects₂ x y x y) +resp₂ : ( : Rel A ) Respects₂ x y x y) resp₂ _∼_ = subst⇒resp₂ _∼_ subst module _ {I : Set } (A : I Set a) {B : {k : I} A k Set b} where @@ -140,7 +140,7 @@ ------------------------------------------------------------------------ --Proof irrelevance -≅-irrelevant : {A B : Set } Irrelevant ((A B Set ) λ a a ≅_) +≅-irrelevant : {A B : Set } Irrelevant ((A B Set ) λ a a ≅_) ≅-irrelevant refl refl = refl module _ {A C : Set a} {B D : Set } @@ -193,7 +193,7 @@ ; inverse = { ≡.refl refl }) , λ { refl ≡.refl } } -decSetoid : Decidable {A = A} {B = A} x y x y) +decSetoid : Decidable {A = A} {B = A} x y x y) DecSetoid _ _ decSetoid dec = record { _≈_ = λ x y x y @@ -241,7 +241,7 @@ start : {x : A} {y : B} x IsRelatedTo y x y start (relTo x≅y) = x≅y - ≡-go : {A : Set a} Trans {A = A} {C = A} _≡_ _IsRelatedTo_ _IsRelatedTo_ + ≡-go : {A : Set a} Trans {A = A} {C = A} _≡_ _IsRelatedTo_ _IsRelatedTo_ ≡-go x≡y (relTo y≅z) = relTo (trans (reflexive x≡y) y≅z) -- Combinators with one heterogeneous relation diff --git a/master/Relation.Binary.Indexed.Heterogeneous.Definitions.html b/master/Relation.Binary.Indexed.Heterogeneous.Definitions.html index cb01e019ff..d2cfd2549e 100644 --- a/master/Relation.Binary.Indexed.Heterogeneous.Definitions.html +++ b/master/Relation.Binary.Indexed.Heterogeneous.Definitions.html @@ -25,11 +25,11 @@ -- Simple properties of indexed binary relations Reflexive : (A : I Set a) IRel A Set _ -Reflexive _ _∼_ = {i} B.Reflexive (_∼_ {i}) +Reflexive _ _∼_ = {i} B.Reflexive (_∼_ {i}) Symmetric : (A : I Set a) IRel A Set _ -Symmetric _ _∼_ = {i j} B.Sym (_∼_ {i} {j}) _∼_ +Symmetric _ _∼_ = {i j} B.Sym (_∼_ {i} {j}) _∼_ Transitive : (A : I Set a) IRel A Set _ -Transitive _ _∼_ = {i j k} B.Trans _∼_ (_∼_ {j}) (_∼_ {i} {k}) +Transitive _ _∼_ = {i j k} B.Trans _∼_ (_∼_ {j}) (_∼_ {i} {k}) \ No newline at end of file diff --git a/master/Relation.Binary.Indexed.Homogeneous.Bundles.html b/master/Relation.Binary.Indexed.Homogeneous.Bundles.html index de3ed6b83e..89e30ce2b9 100644 --- a/master/Relation.Binary.Indexed.Homogeneous.Bundles.html +++ b/master/Relation.Binary.Indexed.Homogeneous.Bundles.html @@ -15,7 +15,7 @@ open import Level using (suc; _⊔_) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles as B -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) open import Relation.Binary.Indexed.Homogeneous.Core open import Relation.Binary.Indexed.Homogeneous.Structures @@ -44,7 +44,7 @@ _≈_ = Lift Carrierᵢ _≈ᵢ_ _≉_ : Rel Carrier _ - x y = ¬ (x y) + x y = ¬ (x y) setoid : B.Setoid _ _ setoid = record diff --git a/master/Relation.Binary.Indexed.Homogeneous.Definitions.html b/master/Relation.Binary.Indexed.Homogeneous.Definitions.html index 0c9e99f97b..ddae0d838b 100644 --- a/master/Relation.Binary.Indexed.Homogeneous.Definitions.html +++ b/master/Relation.Binary.Indexed.Homogeneous.Definitions.html @@ -36,19 +36,19 @@ Implies _∼₁_ _∼₂_ = {i} _∼₁_ (_∼₂_ {i}) Reflexive : IRel A Set _ - Reflexive _∼_ = {i} B.Reflexive (_∼_ {i}) + Reflexive _∼_ = {i} B.Reflexive (_∼_ {i}) Symmetric : IRel A Set _ - Symmetric _∼_ = {i} B.Symmetric (_∼_ {i}) + Symmetric _∼_ = {i} B.Symmetric (_∼_ {i}) Transitive : IRel A Set _ - Transitive _∼_ = {i} B.Transitive (_∼_ {i}) + Transitive _∼_ = {i} B.Transitive (_∼_ {i}) Antisymmetric : IRel A ℓ₁ IRel A ℓ₂ Set _ - Antisymmetric _≈_ _∼_ = {i} B.Antisymmetric _≈_ (_∼_ {i}) + Antisymmetric _≈_ _∼_ = {i} B.Antisymmetric _≈_ (_∼_ {i}) Decidable : IRel A Set _ - Decidable _∼_ = {i} B.Decidable (_∼_ {i}) + Decidable _∼_ = {i} B.Decidable (_∼_ {i}) Respects : IPred A ℓ₁ IRel A ℓ₂ Set _ Respects P _∼_ = {i} {x y : A i} x y P x P y diff --git a/master/Relation.Binary.Indexed.Homogeneous.Structures.html b/master/Relation.Binary.Indexed.Homogeneous.Structures.html index 35dc697cf8..5733e71cc3 100644 --- a/master/Relation.Binary.Indexed.Homogeneous.Structures.html +++ b/master/Relation.Binary.Indexed.Homogeneous.Structures.html @@ -48,13 +48,13 @@ reflexive : _≡_ (Lift A _≈ᵢ_) reflexive ≡.refl i = reflᵢ - refl : B.Reflexive (Lift A _≈ᵢ_) + refl : B.Reflexive (Lift A _≈ᵢ_) refl i = reflᵢ - sym : B.Symmetric (Lift A _≈ᵢ_) + sym : B.Symmetric (Lift A _≈ᵢ_) sym x≈y i = symᵢ (x≈y i) - trans : B.Transitive (Lift A _≈ᵢ_) + trans : B.Transitive (Lift A _≈ᵢ_) trans x≈y y≈z i = transᵢ (x≈y i) (y≈z i) isEquivalence : B.IsEquivalence (Lift A _≈ᵢ_) @@ -103,19 +103,19 @@ reflexive : Lift A _≈ᵢ_ Lift A _∼ᵢ_ reflexive x≈y i = reflexiveᵢ (x≈y i) - refl : B.Reflexive (Lift A _∼ᵢ_) + refl : B.Reflexive (Lift A _∼ᵢ_) refl i = reflᵢ - trans : B.Transitive (Lift A _∼ᵢ_) + trans : B.Transitive (Lift A _∼ᵢ_) trans x≈y y≈z i = transᵢ (x≈y i) (y≈z i) - ∼-respˡ-≈ : (Lift A _∼ᵢ_) B.Respectsˡ (Lift A _≈ᵢ_) + ∼-respˡ-≈ : (Lift A _∼ᵢ_) B.Respectsˡ (Lift A _≈ᵢ_) ∼-respˡ-≈ x≈y x∼z i = ∼ᵢ-respˡ-≈ᵢ (x≈y i) (x∼z i) - ∼-respʳ-≈ : (Lift A _∼ᵢ_) B.Respectsʳ (Lift A _≈ᵢ_) + ∼-respʳ-≈ : (Lift A _∼ᵢ_) B.Respectsʳ (Lift A _≈ᵢ_) ∼-respʳ-≈ x≈y z∼x i = ∼ᵢ-respʳ-≈ᵢ (x≈y i) (z∼x i) - ∼-resp-≈ : (Lift A _∼ᵢ_) B.Respects₂ (Lift A _≈ᵢ_) + ∼-resp-≈ : (Lift A _∼ᵢ_) B.Respects₂ (Lift A _≈ᵢ_) ∼-resp-≈ = ∼-respʳ-≈ , ∼-respˡ-≈ isPreorder : B.IsPreorder (Lift A _≈ᵢ_) (Lift A _∼ᵢ_) @@ -145,7 +145,7 @@ ; ∼-resp-≈ to ≤-resp-≈ ) - antisym : B.Antisymmetric (Lift A _≈ᵢ_) (Lift A _≤ᵢ_) + antisym : B.Antisymmetric (Lift A _≈ᵢ_) (Lift A _≤ᵢ_) antisym x≤y y≤x i = antisymᵢ (x≤y i) (y≤x i) isPartialOrder : B.IsPartialOrder (Lift A _≈ᵢ_) (Lift A _≤ᵢ_) diff --git a/master/Relation.Binary.Lattice.Properties.JoinSemilattice.html b/master/Relation.Binary.Lattice.Properties.JoinSemilattice.html index 34b67c6c08..6c9f4ca3d9 100644 --- a/master/Relation.Binary.Lattice.Properties.JoinSemilattice.html +++ b/master/Relation.Binary.Lattice.Properties.JoinSemilattice.html @@ -21,10 +21,10 @@ open import Function.Base using (_∘_; flip) open import Relation.Binary.Core using (_Preserves₂_⟶_⟶_) open import Relation.Binary.Structures using (IsDecPartialOrder) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.Properties.Poset poset -open import Relation.Nullary using (¬_; yes; no) -open import Relation.Nullary.Negation using (contraposition) +open import Relation.Nullary using (¬_; yes; no) +open import Relation.Nullary.Negation using (contraposition) import Relation.Binary.Reasoning.PartialOrder as PoR @@ -114,12 +114,12 @@ ------------------------------------------------------------------------ -- If ≈ is decidable then so is ≤ -≈-dec⇒≤-dec : Decidable _≈_ Decidable _≤_ +≈-dec⇒≤-dec : Decidable _≈_ Decidable _≤_ ≈-dec⇒≤-dec _≟_ x y with (x y) y -... | yes x∨y≈y = yes (trans (x≤x∨y x y) (reflexive x∨y≈y)) -... | no x∨y≉y = no (contraposition x≤y⇒x∨y≈y x∨y≉y) +... | yes x∨y≈y = yes (trans (x≤x∨y x y) (reflexive x∨y≈y)) +... | no x∨y≉y = no (contraposition x≤y⇒x∨y≈y x∨y≉y) -≈-dec⇒isDecPartialOrder : Decidable _≈_ IsDecPartialOrder _≈_ _≤_ +≈-dec⇒isDecPartialOrder : Decidable _≈_ IsDecPartialOrder _≈_ _≤_ ≈-dec⇒isDecPartialOrder _≟_ = record { isPartialOrder = isPartialOrder ; _≟_ = _≟_ diff --git a/master/Relation.Binary.Lattice.Properties.MeetSemilattice.html b/master/Relation.Binary.Lattice.Properties.MeetSemilattice.html index 201d42d04b..f41f12a7c0 100644 --- a/master/Relation.Binary.Lattice.Properties.MeetSemilattice.html +++ b/master/Relation.Binary.Lattice.Properties.MeetSemilattice.html @@ -17,7 +17,7 @@ open import Algebra.Definitions _≈_ open import Function.Base using (flip) open import Relation.Binary.Structures using (IsDecPartialOrder) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.Properties.Poset poset import Relation.Binary.Lattice.Properties.JoinSemilattice as J @@ -49,10 +49,10 @@ -- If ≈ is decidable then so is ≤ -≈-dec⇒≤-dec : Decidable _≈_ Decidable _≤_ +≈-dec⇒≤-dec : Decidable _≈_ Decidable _≤_ ≈-dec⇒≤-dec _≟_ = flip (≈-dec⇒≥-dec _≟_) -≈-dec⇒isDecPartialOrder : Decidable _≈_ IsDecPartialOrder _≈_ _≤_ +≈-dec⇒isDecPartialOrder : Decidable _≈_ IsDecPartialOrder _≈_ _≤_ ≈-dec⇒isDecPartialOrder _≟_ = record { isPartialOrder = isPartialOrder ; _≟_ = _≟_ diff --git a/master/Relation.Binary.Lattice.Structures.html b/master/Relation.Binary.Lattice.Structures.html index cc36c78faa..777c4ed4e7 100644 --- a/master/Relation.Binary.Lattice.Structures.html +++ b/master/Relation.Binary.Lattice.Structures.html @@ -12,7 +12,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsPartialOrder) -open import Relation.Binary.Definitions using (Minimum; Maximum) +open import Relation.Binary.Definitions using (Minimum; Maximum) module Relation.Binary.Lattice.Structures {a ℓ₁ ℓ₂} {A : Set a} @@ -52,7 +52,7 @@ : Set (a ℓ₁ ℓ₂) where field isJoinSemilattice : IsJoinSemilattice _∨_ - minimum : Minimum _≤_ + minimum : Minimum _≤_ open IsJoinSemilattice isJoinSemilattice public @@ -81,7 +81,7 @@ : Set (a ℓ₁ ℓ₂) where field isMeetSemilattice : IsMeetSemilattice _∧_ - maximum : Maximum _≤_ + maximum : Maximum _≤_ open IsMeetSemilattice isMeetSemilattice public @@ -130,8 +130,8 @@ : Set (a ℓ₁ ℓ₂) where field isLattice : IsLattice _∨_ _∧_ - maximum : Maximum _≤_ - minimum : Minimum _≤_ + maximum : Maximum _≤_ + minimum : Minimum _≤_ open IsLattice isLattice public diff --git a/master/Relation.Binary.Morphism.Construct.Composition.html b/master/Relation.Binary.Morphism.Construct.Composition.html index e7c752258b..528e909525 100644 --- a/master/Relation.Binary.Morphism.Construct.Composition.html +++ b/master/Relation.Binary.Morphism.Construct.Composition.html @@ -12,7 +12,7 @@ open import Level using (Level) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid; Preorder; Poset) -open import Relation.Binary.Definitions using (Transitive) +open import Relation.Binary.Definitions using (Transitive) open import Relation.Binary.Morphism.Bundles open import Relation.Binary.Morphism.Structures @@ -45,7 +45,7 @@ ; injective = F.injective G.injective } where module F = IsRelMonomorphism m₁; module G = IsRelMonomorphism m₂ -isRelIsomorphism : Transitive ≈₃ +isRelIsomorphism : Transitive ≈₃ IsRelIsomorphism ≈₁ ≈₂ f IsRelIsomorphism ≈₂ ≈₃ g IsRelIsomorphism ≈₁ ≈₃ (g f) @@ -102,7 +102,7 @@ ; cancel = F.cancel G.cancel } where module F = IsOrderMonomorphism m₁; module G = IsOrderMonomorphism m₂ -isOrderIsomorphism : Transitive ≈₃ +isOrderIsomorphism : Transitive ≈₃ IsOrderIsomorphism ≈₁ ≈₂ ∼₁ ∼₂ f IsOrderIsomorphism ≈₂ ≈₃ ∼₂ ∼₃ g IsOrderIsomorphism ≈₁ ≈₃ ∼₁ ∼₃ (g f) diff --git a/master/Relation.Binary.Morphism.Construct.Constant.html b/master/Relation.Binary.Morphism.Construct.Constant.html index e8e77cb3d1..6cfab695bd 100644 --- a/master/Relation.Binary.Morphism.Construct.Constant.html +++ b/master/Relation.Binary.Morphism.Construct.Constant.html @@ -11,7 +11,7 @@ open import Level using (Level) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid; Preorder) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) open import Relation.Binary.Morphism.Structures open import Relation.Binary.Morphism.Bundles @@ -28,7 +28,7 @@ module _ (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) where - isRelHomomorphism : Reflexive ≈₂ + isRelHomomorphism : Reflexive ≈₂ x IsRelHomomorphism ≈₁ ≈₂ (const x) isRelHomomorphism refl x = record { cong = const refl @@ -47,7 +47,7 @@ module _ (≈₁ : Rel A ℓ₁) (≈₂ : Rel B ℓ₂) (∼₁ : Rel A ℓ₃) (∼₂ : Rel B ℓ₄) where - isOrderHomomorphism : Reflexive ≈₂ Reflexive ∼₂ + isOrderHomomorphism : Reflexive ≈₂ Reflexive ∼₂ x IsOrderHomomorphism ≈₁ ≈₂ ∼₁ ∼₂ (const x) isOrderHomomorphism ≈-refl ∼-refl x = record { cong = const ≈-refl diff --git a/master/Relation.Binary.Morphism.Construct.Identity.html b/master/Relation.Binary.Morphism.Construct.Identity.html index 120a8ce9da..7abff477a8 100644 --- a/master/Relation.Binary.Morphism.Construct.Identity.html +++ b/master/Relation.Binary.Morphism.Construct.Identity.html @@ -13,7 +13,7 @@ open import Level using (Level) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Bundles using (Setoid; Preorder; Poset) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) open import Relation.Binary.Morphism.Structures open import Relation.Binary.Morphism.Bundles @@ -42,7 +42,7 @@ ; injective = Id.injective } - isRelIsomorphism : Reflexive IsRelIsomorphism id + isRelIsomorphism : Reflexive IsRelIsomorphism id isRelIsomorphism refl = record { isMonomorphism = isRelMonomorphism ; surjective = Id.surjective @@ -84,7 +84,7 @@ ; cancel = id } - isOrderIsomorphism : Reflexive IsOrderIsomorphism id + isOrderIsomorphism : Reflexive IsOrderIsomorphism id isOrderIsomorphism refl = record { isOrderMonomorphism = isOrderMonomorphism ; surjective = Id.surjective diff --git a/master/Relation.Binary.Morphism.OrderMonomorphism.html b/master/Relation.Binary.Morphism.OrderMonomorphism.html index ee99d2a187..0a11516fb5 100644 --- a/master/Relation.Binary.Morphism.OrderMonomorphism.html +++ b/master/Relation.Binary.Morphism.OrderMonomorphism.html @@ -17,7 +17,7 @@ open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictPartialOrder; IsStrictTotalOrder) open import Relation.Binary.Definitions - using (Irreflexive; Antisymmetric; Trichotomous; tri<; tri≈; tri>; _Respectsˡ_; _Respectsʳ_; _Respects₂_) + using (Irreflexive; Antisymmetric; Trichotomous; tri<; tri≈; tri>; _Respectsˡ_; _Respectsʳ_; _Respects₂_) open import Relation.Binary.Morphism import Relation.Binary.Morphism.RelMonomorphism as RawRelation @@ -44,25 +44,25 @@ reflexive : _≈₂_ _≲₂_ _≈₁_ _≲₁_ reflexive refl x≈y = cancel (refl (cong x≈y)) -irrefl : Irreflexive _≈₂_ _≲₂_ Irreflexive _≈₁_ _≲₁_ +irrefl : Irreflexive _≈₂_ _≲₂_ Irreflexive _≈₁_ _≲₁_ irrefl irrefl x≈y x∼y = irrefl (cong x≈y) (mono x∼y) -antisym : Antisymmetric _≈₂_ _≲₂_ Antisymmetric _≈₁_ _≲₁_ +antisym : Antisymmetric _≈₂_ _≲₂_ Antisymmetric _≈₁_ _≲₁_ antisym antisym x∼y y∼x = injective (antisym (mono x∼y) (mono y∼x)) -compare : Trichotomous _≈₂_ _≲₂_ Trichotomous _≈₁_ _≲₁_ +compare : Trichotomous _≈₂_ _≲₂_ Trichotomous _≈₁_ _≲₁_ compare compare x y with compare x y -... | tri< a ¬b ¬c = tri< (cancel a) (¬b cong) (¬c mono) -... | tri≈ ¬a b ¬c = tri≈ (¬a mono) (injective b) (¬c mono) -... | tri> ¬a ¬b c = tri> (¬a mono) (¬b cong) (cancel c) +... | tri< a ¬b ¬c = tri< (cancel a) (¬b cong) (¬c mono) +... | tri≈ ¬a b ¬c = tri≈ (¬a mono) (injective b) (¬c mono) +... | tri> ¬a ¬b c = tri> (¬a mono) (¬b cong) (cancel c) -respˡ : _≲₂_ Respectsˡ _≈₂_ _≲₁_ Respectsˡ _≈₁_ +respˡ : _≲₂_ Respectsˡ _≈₂_ _≲₁_ Respectsˡ _≈₁_ respˡ resp x≈y x∼z = cancel (resp (cong x≈y) (mono x∼z)) -respʳ : _≲₂_ Respectsʳ _≈₂_ _≲₁_ Respectsʳ _≈₁_ +respʳ : _≲₂_ Respectsʳ _≈₂_ _≲₁_ Respectsʳ _≈₁_ respʳ resp x≈y y∼z = cancel (resp (cong x≈y) (mono y∼z)) -resp : _≲₂_ Respects₂ _≈₂_ _≲₁_ Respects₂ _≈₁_ +resp : _≲₂_ Respects₂ _≈₂_ _≲₁_ Respects₂ _≈₁_ resp = map respʳ respˡ ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Morphism.RelMonomorphism.html b/master/Relation.Binary.Morphism.RelMonomorphism.html index 638ecad816..e312a6cce1 100644 --- a/master/Relation.Binary.Morphism.RelMonomorphism.html +++ b/master/Relation.Binary.Morphism.RelMonomorphism.html @@ -14,7 +14,7 @@ open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence) open import Relation.Binary.Definitions - using (Reflexive; Symmetric; Transitive; Total; Asymmetric; Decidable) + using (Reflexive; Symmetric; Transitive; Total; Asymmetric; Decidable) open import Relation.Binary.Morphism module Relation.Binary.Morphism.RelMonomorphism @@ -24,7 +24,7 @@ where open import Data.Sum.Base as Sum -open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Decidable using (yes; no) open import Relation.Nullary.Decidable open IsRelMonomorphism isMonomorphism @@ -32,23 +32,23 @@ ------------------------------------------------------------------------ -- Properties -refl : Reflexive _∼₂_ Reflexive _∼₁_ +refl : Reflexive _∼₂_ Reflexive _∼₁_ refl refl = injective refl -sym : Symmetric _∼₂_ Symmetric _∼₁_ +sym : Symmetric _∼₂_ Symmetric _∼₁_ sym sym x∼y = injective (sym (cong x∼y)) -trans : Transitive _∼₂_ Transitive _∼₁_ +trans : Transitive _∼₂_ Transitive _∼₁_ trans trans x∼y y∼z = injective (trans (cong x∼y) (cong y∼z)) -total : Total _∼₂_ Total _∼₁_ +total : Total _∼₂_ Total _∼₁_ total total x y = Sum.map injective injective (total x y ) -asym : Asymmetric _∼₂_ Asymmetric _∼₁_ +asym : Asymmetric _∼₂_ Asymmetric _∼₁_ asym asym x∼y y∼x = asym (cong x∼y) (cong y∼x) -dec : Decidable _∼₂_ Decidable _∼₁_ -dec _∼?_ x y = map′ injective cong ( x ∼? y ) +dec : Decidable _∼₂_ Decidable _∼₁_ +dec _∼?_ x y = map′ injective cong ( x ∼? y ) ------------------------------------------------------------------------ -- Structures diff --git a/master/Relation.Binary.Properties.ApartnessRelation.html b/master/Relation.Binary.Properties.ApartnessRelation.html index 67a7a92a44..d1a6566314 100644 --- a/master/Relation.Binary.Properties.ApartnessRelation.html +++ b/master/Relation.Binary.Properties.ApartnessRelation.html @@ -16,13 +16,13 @@ where open import Function.Base using (_∘₂_) -open import Relation.Binary.Definitions using (Reflexive) +open import Relation.Binary.Definitions using (Reflexive) open import Relation.Binary.Consequences using (sym⇒¬-sym; cotrans⇒¬-trans) open import Relation.Binary.Structures using (IsEquivalence; IsApartnessRelation) -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) -¬#-isEquivalence : Reflexive _≈_ IsApartnessRelation _≈_ _#_ - IsEquivalence (¬_ ∘₂ _#_) +¬#-isEquivalence : Reflexive _≈_ IsApartnessRelation _≈_ _#_ + IsEquivalence (¬_ ∘₂ _#_) ¬#-isEquivalence re apart = record { refl = irrefl re ; sym = λ {a} {b} sym⇒¬-sym sym {a} {b} diff --git a/master/Relation.Binary.Properties.DecSetoid.html b/master/Relation.Binary.Properties.DecSetoid.html index f1214c9307..40b9513b01 100644 --- a/master/Relation.Binary.Properties.DecSetoid.html +++ b/master/Relation.Binary.Properties.DecSetoid.html @@ -14,21 +14,21 @@ open import Data.Product using (_,_) open import Data.Sum using (inj₁; inj₂) open import Relation.Binary.Definitions - using (Cotransitive; Tight) + using (Cotransitive; Tight) import Relation.Binary.Properties.Setoid as SetoidProperties open import Relation.Binary.Structures using (IsApartnessRelation; IsDecEquivalence) open import Relation.Nullary.Decidable.Core - using (yes; no; decidable-stable) + using (yes; no; decidable-stable) open DecSetoid S using (_≈_; _≉_; _≟_; setoid; trans) open SetoidProperties setoid -≉-cotrans : Cotransitive _≉_ +≉-cotrans : Cotransitive _≉_ ≉-cotrans {x} {y} x≉y z with x z | z y -... | _ | no z≉y = inj₂ z≉y -... | no x≉z | _ = inj₁ x≉z -... | yes x≈z | yes z≈y = inj₁ λ _ x≉y (trans x≈z z≈y) +... | _ | no z≉y = inj₂ z≉y +... | no x≉z | _ = inj₁ x≉z +... | yes x≈z | yes z≈y = inj₁ λ _ x≉y (trans x≈z z≈y) ≉-isApartnessRelation : IsApartnessRelation _≈_ _≉_ ≉-isApartnessRelation = record @@ -40,6 +40,6 @@ ≉-apartnessRelation : ApartnessRelation c ≉-apartnessRelation = record { isApartnessRelation = ≉-isApartnessRelation } -≉-tight : Tight _≈_ _≉_ -≉-tight x y = decidable-stable (x y) , ≉-irrefl +≉-tight : Tight _≈_ _≉_ +≉-tight x y = decidable-stable (x y) , ≉-irrefl \ No newline at end of file diff --git a/master/Relation.Binary.Properties.DecTotalOrder.html b/master/Relation.Binary.Properties.DecTotalOrder.html index 58ba3b5283..e250f2af5f 100644 --- a/master/Relation.Binary.Properties.DecTotalOrder.html +++ b/master/Relation.Binary.Properties.DecTotalOrder.html @@ -20,7 +20,7 @@ import Relation.Binary.Construct.Flip.EqAndOrd as EqAndOrd import Relation.Binary.Construct.NonStrictToStrict _≈_ _≤_ as ToStrict import Relation.Binary.Properties.TotalOrder totalOrder as TotalOrderProperties -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) ------------------------------------------------------------------------ -- _≥_ - the flipped relation is also a total order diff --git a/master/Relation.Binary.Properties.Poset.html b/master/Relation.Binary.Properties.Poset.html index 8874cc6eec..73e4fedfaa 100644 --- a/master/Relation.Binary.Properties.Poset.html +++ b/master/Relation.Binary.Properties.Poset.html @@ -14,10 +14,10 @@ open import Relation.Binary.Structures using (IsPartialOrder; IsStrictPartialOrder; IsDecPartialOrder) open import Relation.Binary.Definitions - using (_Respectsˡ_; _Respectsʳ_; Decidable) + using (_Respectsˡ_; _Respectsʳ_; Decidable) import Relation.Binary.Consequences as Consequences -open import Relation.Nullary using (¬_; yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary using (¬_; yes; no) +open import Relation.Nullary.Negation using (contradiction) module Relation.Binary.Properties.Poset {p₁ p₂ p₃} (P : Poset p₁ p₂ p₃) where @@ -59,10 +59,10 @@ ------------------------------------------------------------------------ -- Negated order -≰-respˡ-≈ : _≰_ Respectsˡ _≈_ +≰-respˡ-≈ : _≰_ Respectsˡ _≈_ ≰-respˡ-≈ x≈y = _∘ ≤-respˡ-≈ (Eq.sym x≈y) -≰-respʳ-≈ : _≰_ Respectsʳ _≈_ +≰-respʳ-≈ : _≰_ Respectsʳ _≈_ ≰-respʳ-≈ x≈y = _∘ ≤-respʳ-≈ (Eq.sym x≈y) ------------------------------------------------------------------------ @@ -104,13 +104,13 @@ ------------------------------------------------------------------------ -- If ≤ is decidable then so is ≈ -≤-dec⇒≈-dec : Decidable _≤_ Decidable _≈_ +≤-dec⇒≈-dec : Decidable _≤_ Decidable _≈_ ≤-dec⇒≈-dec _≤?_ x y with x ≤? y | y ≤? x -... | yes x≤y | yes y≤x = yes (antisym x≤y y≤x) -... | yes x≤y | no y≰x = no λ x≈y contradiction (reflexive (Eq.sym x≈y)) y≰x -... | no x≰y | _ = no λ x≈y contradiction (reflexive x≈y) x≰y +... | yes x≤y | yes y≤x = yes (antisym x≤y y≤x) +... | yes x≤y | no y≰x = no λ x≈y contradiction (reflexive (Eq.sym x≈y)) y≰x +... | no x≰y | _ = no λ x≈y contradiction (reflexive x≈y) x≰y -≤-dec⇒isDecPartialOrder : Decidable _≤_ IsDecPartialOrder _≈_ _≤_ +≤-dec⇒isDecPartialOrder : Decidable _≤_ IsDecPartialOrder _≈_ _≤_ ≤-dec⇒isDecPartialOrder _≤?_ = record { isPartialOrder = isPartialOrder ; _≟_ = ≤-dec⇒≈-dec _≤?_ diff --git a/master/Relation.Binary.Properties.Setoid.html b/master/Relation.Binary.Properties.Setoid.html index 08afc890bd..5e485f5f62 100644 --- a/master/Relation.Binary.Properties.Setoid.html +++ b/master/Relation.Binary.Properties.Setoid.html @@ -9,12 +9,12 @@ open import Data.Product.Base using (_,_) open import Function.Base using (_∘_; id; _$_; flip) -open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) open import Relation.Binary.Core using (_⇒_) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Bundles using (Setoid; Preorder; Poset) open import Relation.Binary.Definitions - using (Symmetric; _Respectsˡ_; _Respectsʳ_; _Respects₂_; Irreflexive) + using (Symmetric; _Respectsˡ_; _Respectsʳ_; _Respects₂_; Irreflexive) open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder) open import Relation.Binary.Construct.Composition using (_;_; impliesˡ; transitive⇒≈;≈⊆≈) @@ -69,20 +69,20 @@ ------------------------------------------------------------------------ -- Properties of _≉_ -≉-sym : Symmetric _≉_ +≉-sym : Symmetric _≉_ ≉-sym x≉y = x≉y sym -≉-respˡ : _≉_ Respectsˡ _≈_ +≉-respˡ : _≉_ Respectsˡ _≈_ ≉-respˡ x≈x′ x≉y = x≉y trans x≈x′ -≉-respʳ : _≉_ Respectsʳ _≈_ +≉-respʳ : _≉_ Respectsʳ _≈_ ≉-respʳ y≈y′ x≉y x≈y′ = x≉y $ trans x≈y′ (sym y≈y′) -≉-resp₂ : _≉_ Respects₂ _≈_ +≉-resp₂ : _≉_ Respects₂ _≈_ ≉-resp₂ = ≉-respʳ , ≉-respˡ -≉-irrefl : Irreflexive _≈_ _≉_ -≉-irrefl x≈y x≉y = contradiction x≈y x≉y +≉-irrefl : Irreflexive _≈_ _≉_ +≉-irrefl x≈y x≉y = contradiction x≈y x≉y ------------------------------------------------------------------------ -- Equality is closed under composition @@ -96,9 +96,9 @@ ------------------------------------------------------------------------ -- Other properties -respʳ-flip : _≈_ Respectsʳ (flip _≈_) +respʳ-flip : _≈_ Respectsʳ (flip _≈_) respʳ-flip y≈z x≈z = trans x≈z (sym y≈z) -respˡ-flip : _≈_ Respectsˡ (flip _≈_) +respˡ-flip : _≈_ Respectsˡ (flip _≈_) respˡ-flip = trans \ No newline at end of file diff --git a/master/Relation.Binary.Properties.TotalOrder.html b/master/Relation.Binary.Properties.TotalOrder.html index 96134b0b3a..6efbffbea1 100644 --- a/master/Relation.Binary.Properties.TotalOrder.html +++ b/master/Relation.Binary.Properties.TotalOrder.html @@ -8,7 +8,7 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Bundles using (TotalOrder; DecTotalOrder) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.Structures using (IsTotalOrder) module Relation.Binary.Properties.TotalOrder @@ -26,7 +26,7 @@ ------------------------------------------------------------------------ -- Total orders are almost decidable total orders -decTotalOrder : Decidable _≈_ DecTotalOrder _ _ _ +decTotalOrder : Decidable _≈_ DecTotalOrder _ _ _ decTotalOrder = record { isDecTotalOrder = record { isTotalOrder = isTotalOrder diff --git a/master/Relation.Binary.PropositionalEquality.Core.html b/master/Relation.Binary.PropositionalEquality.Core.html index addfd433fe..8e59df13ad 100644 --- a/master/Relation.Binary.PropositionalEquality.Core.html +++ b/master/Relation.Binary.PropositionalEquality.Core.html @@ -17,7 +17,7 @@ open import Level open import Relation.Binary.Core open import Relation.Binary.Definitions -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) private variable @@ -31,7 +31,7 @@ infix 4 _≢_ _≢_ : {A : Set a} Rel A a -x y = ¬ x y +x y = ¬ x y ------------------------------------------------------------------------ -- Pointwise equality @@ -72,33 +72,33 @@ ------------------------------------------------------------------------ -- Properties of _≡_ -sym : Symmetric {A = A} _≡_ +sym : Symmetric {A = A} _≡_ sym refl = refl -trans : Transitive {A = A} _≡_ +trans : Transitive {A = A} _≡_ trans refl eq = eq -subst : Substitutive {A = A} _≡_ +subst : Substitutive {A = A} _≡_ subst P refl p = p subst₂ : (_∼_ : REL A B ) {x y u v} x y u v x u y v subst₂ _ refl refl p = p -resp : (P : A Set ) P Respects _≡_ +resp : (P : A Set ) P Respects _≡_ resp P refl p = p -respˡ : ( : Rel A ) Respectsˡ _≡_ +respˡ : ( : Rel A ) Respectsˡ _≡_ respˡ _∼_ refl x∼y = x∼y -respʳ : ( : Rel A ) Respectsʳ _≡_ +respʳ : ( : Rel A ) Respectsʳ _≡_ respʳ _∼_ refl x∼y = x∼y -resp₂ : ( : Rel A ) Respects₂ _≡_ +resp₂ : ( : Rel A ) Respects₂ _≡_ resp₂ _∼_ = respʳ _∼_ , respˡ _∼_ ------------------------------------------------------------------------ -- Properties of _≢_ -≢-sym : Symmetric {A = A} _≢_ +≢-sym : Symmetric {A = A} _≢_ ≢-sym x≢y = x≢y sym \ No newline at end of file diff --git a/master/Relation.Binary.PropositionalEquality.Properties.html b/master/Relation.Binary.PropositionalEquality.Properties.html index 4b50e74598..4166d244cf 100644 --- a/master/Relation.Binary.PropositionalEquality.Properties.html +++ b/master/Relation.Binary.PropositionalEquality.Properties.html @@ -20,10 +20,10 @@ open import Relation.Binary.Structures using (IsEquivalence; IsDecEquivalence; IsPreorder; IsPartialOrder) open import Relation.Binary.Definitions - using (DecidableEquality) + using (DecidableEquality) import Relation.Binary.Properties.Setoid as Setoid open import Relation.Binary.PropositionalEquality.Core -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) open import Relation.Binary.Reasoning.Syntax @@ -109,7 +109,7 @@ cong₂ _∙_ p refl cong (_∙ u) p cong₂-reflʳ refl = refl -module _ {P : Pred A p} {x y : A} where +module _ {P : Pred A p} {x y : A} where subst-injective : (x≡y : x y) {p q : P x} subst P x≡y p subst P x≡y q p q @@ -127,7 +127,7 @@ subst P (sym x≡y) (subst P x≡y p) p subst-sym-subst refl = refl -subst-∘ : {x y : A} {P : Pred B p} {f : A B} +subst-∘ : {x y : A} {P : Pred B p} {f : A B} (x≡y : x y) {p : P (f x)} subst (P f) x≡y p subst P (cong f x≡y) p subst-∘ refl = refl @@ -158,7 +158,7 @@ ; trans = trans } -isDecEquivalence : DecidableEquality A IsDecEquivalence _≡_ +isDecEquivalence : DecidableEquality A IsDecEquivalence _≡_ isDecEquivalence _≟_ = record { isEquivalence = isEquivalence ; _≟_ = _≟_ @@ -171,7 +171,7 @@ ; isEquivalence = isEquivalence } -decSetoid : DecidableEquality A DecSetoid _ _ +decSetoid : DecidableEquality A DecSetoid _ _ decSetoid _≟_ = record { _≈_ = _≡_ ; isDecEquivalence = isDecEquivalence _≟_ diff --git a/master/Relation.Binary.PropositionalEquality.WithK.html b/master/Relation.Binary.PropositionalEquality.WithK.html index 36a7c01e3b..9d72b1bf75 100644 --- a/master/Relation.Binary.PropositionalEquality.WithK.html +++ b/master/Relation.Binary.PropositionalEquality.WithK.html @@ -11,7 +11,7 @@ module Relation.Binary.PropositionalEquality.WithK where open import Axiom.UniquenessOfIdentityProofs.WithK -open import Relation.Binary.Definitions using (Irrelevant) +open import Relation.Binary.Definitions using (Irrelevant) open import Relation.Binary.PropositionalEquality.Core ------------------------------------------------------------------------ @@ -29,6 +29,6 @@ ------------------------------------------------------------------------ -- Proof irrelevance -≡-irrelevant : {a} {A : Set a} Irrelevant {A = A} _≡_ +≡-irrelevant : {a} {A : Set a} Irrelevant {A = A} _≡_ ≡-irrelevant = uip \ No newline at end of file diff --git a/master/Relation.Binary.PropositionalEquality.html b/master/Relation.Binary.PropositionalEquality.html index eeb7475bae..0067ce78d2 100644 --- a/master/Relation.Binary.PropositionalEquality.html +++ b/master/Relation.Binary.PropositionalEquality.html @@ -14,10 +14,10 @@ import Function.Dependent.Bundles as Dependent open import Function.Indexed.Relation.Binary.Equality using (≡-setoid) open import Level using (Level; _⊔_) -open import Relation.Nullary using (Irrelevant) -open import Relation.Nullary.Decidable using (yes; no; dec-yes-irr; dec-no) +open import Relation.Nullary using (Irrelevant) +open import Relation.Nullary.Decidable using (yes; no; dec-yes-irr; dec-no) open import Relation.Binary.Bundles using (Setoid) -open import Relation.Binary.Definitions using (DecidableEquality) +open import Relation.Binary.Definitions using (DecidableEquality) open import Relation.Binary.Indexed.Heterogeneous using (IndexedSetoid) import Relation.Binary.Indexed.Heterogeneous.Construct.Trivial @@ -83,13 +83,13 @@ f≡id (f x) where open ≡-Reasoning; fx≡x = f≡id x; f²x≡x = f≡id (f x) -module _ (_≟_ : DecidableEquality A) {x y : A} where +module _ (_≟_ : DecidableEquality A) {x y : A} where - ≡-≟-identity : (eq : x y) x y yes eq - ≡-≟-identity eq = dec-yes-irr (x y) (Decidable⇒UIP.≡-irrelevant _≟_) eq + ≡-≟-identity : (eq : x y) x y yes eq + ≡-≟-identity eq = dec-yes-irr (x y) (Decidable⇒UIP.≡-irrelevant _≟_) eq - ≢-≟-identity : (x≢y : x y) x y no x≢y - ≢-≟-identity = dec-no (x y) + ≢-≟-identity : (x≢y : x y) x y no x≢y + ≢-≟-identity = dec-no (x y) ------------------------------------------------------------------------ @@ -124,7 +124,7 @@ -- Version 2.0 isPropositional : Set a Set a -isPropositional = Irrelevant +isPropositional = Irrelevant {-# WARNING_ON_USAGE isPropositional "Warning: isPropositional was deprecated in v2.0. diff --git a/master/Relation.Binary.Reasoning.Base.Apartness.html b/master/Relation.Binary.Reasoning.Base.Apartness.html index e2f14372a3..0236281574 100644 --- a/master/Relation.Binary.Reasoning.Base.Apartness.html +++ b/master/Relation.Binary.Reasoning.Base.Apartness.html @@ -10,10 +10,10 @@ open import Level using (Level; _⊔_) open import Function.Base using (case_of_) -open import Relation.Nullary.Decidable using (Dec; yes; no) +open import Relation.Nullary.Decidable using (Dec; yes; no) open import Relation.Binary.Core using (Rel) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Binary.Definitions using (Reflexive; Transitive; Symmetric; Trans) +open import Relation.Binary.Definitions using (Reflexive; Transitive; Symmetric; Trans) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Reasoning.Syntax @@ -21,8 +21,8 @@ module Relation.Binary.Reasoning.Base.Apartness {a ℓ₁ ℓ₂} {A : Set a} {_≈_ : Rel A ℓ₁} {_#_ : Rel A ℓ₂} (≈-equiv : IsEquivalence _≈_) - (#-trans : Transitive _#_) (#-sym : Symmetric _#_) - (#-≈-trans : Trans _#_ _≈_ _#_) (≈-#-trans : Trans _≈_ _#_ _#_) + (#-trans : Transitive _#_) (#-sym : Symmetric _#_) + (#-≈-trans : Trans _#_ _≈_ _#_) (≈-#-trans : Trans _≈_ _#_ _#_) where module Eq = IsEquivalence ≈-equiv @@ -37,22 +37,22 @@ apartness : (x#y : x # y) x IsRelatedTo y equals : (x≈y : x y) x IsRelatedTo y -≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ +≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ ≡-go x≡y nothing = nothing ≡-go x≡y (apartness y#z) = apartness (case x≡y of λ where ≡.refl y#z) ≡-go x≡y (equals y≈z) = equals (case x≡y of λ where ≡.refl y≈z) -≈-go : Trans _≈_ _IsRelatedTo_ _IsRelatedTo_ +≈-go : Trans _≈_ _IsRelatedTo_ _IsRelatedTo_ ≈-go x≈y nothing = nothing ≈-go x≈y (apartness y#z) = apartness (≈-#-trans x≈y y#z) ≈-go x≈y (equals y≈z) = equals (Eq.trans x≈y y≈z) -#-go : Trans _#_ _IsRelatedTo_ _IsRelatedTo_ +#-go : Trans _#_ _IsRelatedTo_ _IsRelatedTo_ #-go x#y nothing = nothing #-go x#y (apartness y#z) = nothing #-go x#y (equals y≈z) = apartness (#-≈-trans x#y y≈z) -stop : Reflexive _IsRelatedTo_ +stop : Reflexive _IsRelatedTo_ stop = equals Eq.refl ------------------------------------------------------------------------ @@ -61,10 +61,10 @@ data IsApartness {x y} : x IsRelatedTo y Set (a ℓ₁ ℓ₂) where isApartness : x#y IsApartness (apartness x#y) -IsApartness? : {x y} (x#y : x IsRelatedTo y) Dec (IsApartness x#y) -IsApartness? nothing = no λ() -IsApartness? (apartness x#y) = yes (isApartness x#y) -IsApartness? (equals x≈y) = no ()) +IsApartness? : {x y} (x#y : x IsRelatedTo y) Dec (IsApartness x#y) +IsApartness? nothing = no λ() +IsApartness? (apartness x#y) = yes (isApartness x#y) +IsApartness? (equals x≈y) = no ()) extractApartness : {x y} {x#y : x IsRelatedTo y} IsApartness x#y x # y extractApartness (isApartness x#y) = x#y @@ -82,10 +82,10 @@ data IsEquality {x y} : x IsRelatedTo y Set (a ℓ₁ ℓ₂) where isEquality : x≈y IsEquality (equals x≈y) -IsEquality? : {x y} (x≲y : x IsRelatedTo y) Dec (IsEquality x≲y) -IsEquality? nothing = no λ() -IsEquality? (apartness _) = no λ() -IsEquality? (equals x≈y) = yes (isEquality x≈y) +IsEquality? : {x y} (x≲y : x IsRelatedTo y) Dec (IsEquality x≲y) +IsEquality? nothing = no λ() +IsEquality? (apartness _) = no λ() +IsEquality? (equals x≈y) = yes (isEquality x≈y) extractEquality : {x y} {x≲y : x IsRelatedTo y} IsEquality x≲y x y extractEquality (isEquality x≈y) = x≈y diff --git a/master/Relation.Binary.Reasoning.Base.Double.html b/master/Relation.Binary.Reasoning.Base.Double.html index 6c2f03fa97..a7059ad673 100644 --- a/master/Relation.Binary.Reasoning.Base.Double.html +++ b/master/Relation.Binary.Reasoning.Base.Double.html @@ -13,9 +13,9 @@ open import Level using (_⊔_) open import Function.Base using (case_of_) -open import Relation.Nullary.Decidable.Core using (Dec; yes; no) +open import Relation.Nullary.Decidable.Core using (Dec; yes; no) open import Relation.Binary.Core using (Rel; _⇒_) -open import Relation.Binary.Definitions using (Reflexive; Trans) +open import Relation.Binary.Definitions using (Reflexive; Trans) open import Relation.Binary.Structures using (IsPreorder) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Reasoning.Syntax @@ -40,19 +40,19 @@ start (equals x≈y) = reflexive x≈y start (nonstrict x≲y) = x≲y -≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ +≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ ≡-go x≡y (equals y≈z) = equals (case x≡y of λ where ≡.refl y≈z) ≡-go x≡y (nonstrict y≤z) = nonstrict (case x≡y of λ where ≡.refl y≤z) -≲-go : Trans _≲_ _IsRelatedTo_ _IsRelatedTo_ +≲-go : Trans _≲_ _IsRelatedTo_ _IsRelatedTo_ ≲-go x≲y (equals y≈z) = nonstrict (∼-respʳ-≈ y≈z x≲y) ≲-go x≲y (nonstrict y≲z) = nonstrict (trans x≲y y≲z) -≈-go : Trans _≈_ _IsRelatedTo_ _IsRelatedTo_ +≈-go : Trans _≈_ _IsRelatedTo_ _IsRelatedTo_ ≈-go x≈y (equals y≈z) = equals (Eq.trans x≈y y≈z) ≈-go x≈y (nonstrict y≲z) = nonstrict (∼-respˡ-≈ (Eq.sym x≈y) y≲z) -stop : Reflexive _IsRelatedTo_ +stop : Reflexive _IsRelatedTo_ stop = equals Eq.refl ------------------------------------------------------------------------ @@ -62,9 +62,9 @@ data IsEquality {x y} : x IsRelatedTo y Set (a ℓ₁ ℓ₂) where isEquality : x≈y IsEquality (equals x≈y) -IsEquality? : {x y} (x≲y : x IsRelatedTo y) Dec (IsEquality x≲y) -IsEquality? (nonstrict _) = no λ() -IsEquality? (equals x≈y) = yes (isEquality x≈y) +IsEquality? : {x y} (x≲y : x IsRelatedTo y) Dec (IsEquality x≲y) +IsEquality? (nonstrict _) = no λ() +IsEquality? (equals x≈y) = yes (isEquality x≈y) extractEquality : {x y} {x≲y : x IsRelatedTo y} IsEquality x≲y x y extractEquality (isEquality x≈y) = x≈y diff --git a/master/Relation.Binary.Reasoning.Base.Partial.html b/master/Relation.Binary.Reasoning.Base.Partial.html index 7c6dd50d4a..19d3b3b107 100644 --- a/master/Relation.Binary.Reasoning.Base.Partial.html +++ b/master/Relation.Binary.Reasoning.Base.Partial.html @@ -10,14 +10,14 @@ open import Function.Base using (case_of_) open import Level using (_⊔_) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Transitive; Trans; Reflexive) -open import Relation.Nullary.Decidable using (Dec; yes; no) +open import Relation.Binary.Definitions using (Transitive; Trans; Reflexive) +open import Relation.Nullary.Decidable using (Dec; yes; no) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Reasoning.Syntax module Relation.Binary.Reasoning.Base.Partial - {a } {A : Set a} (_∼_ : Rel A ) (trans : Transitive _∼_) + {a } {A : Set a} (_∼_ : Rel A ) (trans : Transitive _∼_) where ------------------------------------------------------------------------ @@ -32,11 +32,11 @@ singleStep : x x IsRelatedTo x multiStep : {x y} (x∼y : x y) x IsRelatedTo y -∼-go : Trans _∼_ _IsRelatedTo_ _IsRelatedTo_ +∼-go : Trans _∼_ _IsRelatedTo_ _IsRelatedTo_ ∼-go x∼y (singleStep y) = multiStep x∼y ∼-go x∼y (multiStep y∼z) = multiStep (trans x∼y y∼z) -stop : Reflexive _IsRelatedTo_ +stop : Reflexive _IsRelatedTo_ stop = singleStep _ ------------------------------------------------------------------------ @@ -46,9 +46,9 @@ data IsMultiStep {x y} : x IsRelatedTo y Set (a ) where isMultiStep : x∼y IsMultiStep (multiStep x∼y) -IsMultiStep? : {x y} (x∼y : x IsRelatedTo y) Dec (IsMultiStep x∼y) -IsMultiStep? (multiStep x<y) = yes (isMultiStep x<y) -IsMultiStep? (singleStep _) = no λ() +IsMultiStep? : {x y} (x∼y : x IsRelatedTo y) Dec (IsMultiStep x∼y) +IsMultiStep? (multiStep x<y) = yes (isMultiStep x<y) +IsMultiStep? (singleStep _) = no λ() extractMultiStep : {x y} {x∼y : x IsRelatedTo y} IsMultiStep x∼y x y extractMultiStep (isMultiStep x≈y) = x≈y diff --git a/master/Relation.Binary.Reasoning.Base.Single.html b/master/Relation.Binary.Reasoning.Base.Single.html index 69c1f2bdeb..47b18500f0 100644 --- a/master/Relation.Binary.Reasoning.Base.Single.html +++ b/master/Relation.Binary.Reasoning.Base.Single.html @@ -10,13 +10,13 @@ open import Level using (_⊔_) open import Function.Base using (case_of_) open import Relation.Binary.Core using (Rel; _⇒_) -open import Relation.Binary.Definitions using (Reflexive; Transitive; Trans) +open import Relation.Binary.Definitions using (Reflexive; Transitive; Trans) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Reasoning.Syntax module Relation.Binary.Reasoning.Base.Single {a } {A : Set a} (_∼_ : Rel A ) - (refl : Reflexive _∼_) (trans : Transitive _∼_) + (refl : Reflexive _∼_) (trans : Transitive _∼_) where ------------------------------------------------------------------------ @@ -33,13 +33,13 @@ start : _IsRelatedTo_ _∼_ start (relTo x∼y) = x∼y -∼-go : Trans _∼_ _IsRelatedTo_ _IsRelatedTo_ +∼-go : Trans _∼_ _IsRelatedTo_ _IsRelatedTo_ ∼-go x∼y (relTo y∼z) = relTo (trans x∼y y∼z) -≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ +≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ ≡-go x≡y (relTo y∼z) = relTo (case x≡y of λ where ≡.refl y∼z) -stop : Reflexive _IsRelatedTo_ +stop : Reflexive _IsRelatedTo_ stop = relTo refl ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Reasoning.Base.Triple.html b/master/Relation.Binary.Reasoning.Base.Triple.html index 60de78ef9d..385e4a490f 100644 --- a/master/Relation.Binary.Reasoning.Base.Triple.html +++ b/master/Relation.Binary.Reasoning.Base.Triple.html @@ -15,20 +15,20 @@ open import Level using (_⊔_) open import Function.Base using (case_of_) open import Relation.Nullary.Decidable.Core - using (Dec; yes; no) + using (Dec; yes; no) open import Relation.Binary.Core using (Rel; _⇒_) open import Relation.Binary.Structures using (IsPreorder) open import Relation.Binary.Definitions - using (Transitive; _Respects₂_; Reflexive; Trans; Irreflexive; Asymmetric) + using (Transitive; _Respects₂_; Reflexive; Trans; Irreflexive; Asymmetric) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Reasoning.Syntax module Relation.Binary.Reasoning.Base.Triple {a ℓ₁ ℓ₂ ℓ₃} {A : Set a} {_≈_ : Rel A ℓ₁} {_≤_ : Rel A ℓ₂} {_<_ : Rel A ℓ₃} (isPreorder : IsPreorder _≈_ _≤_) - (<-asym : Asymmetric _<_) (<-trans : Transitive _<_) (<-resp-≈ : _<_ Respects₂ _≈_) + (<-asym : Asymmetric _<_) (<-trans : Transitive _<_) (<-resp-≈ : _<_ Respects₂ _≈_) (<⇒≤ : _<_ _≤_) - (<-≤-trans : Trans _<_ _≤_ _<_) (≤-<-trans : Trans _≤_ _<_ _<_) + (<-≤-trans : Trans _<_ _≤_ _<_) (≤-<-trans : Trans _≤_ _<_ _<_) where open IsPreorder isPreorder @@ -48,27 +48,27 @@ start (nonstrict x≤y) = x≤y start (strict x<y) = <⇒≤ x<y -≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ +≡-go : Trans _≡_ _IsRelatedTo_ _IsRelatedTo_ ≡-go x≡y (equals y≈z) = equals (case x≡y of λ where ≡.refl y≈z) ≡-go x≡y (nonstrict y≤z) = nonstrict (case x≡y of λ where ≡.refl y≤z) ≡-go x≡y (strict y<z) = strict (case x≡y of λ where ≡.refl y<z) -≈-go : Trans _≈_ _IsRelatedTo_ _IsRelatedTo_ +≈-go : Trans _≈_ _IsRelatedTo_ _IsRelatedTo_ ≈-go x≈y (equals y≈z) = equals (Eq.trans x≈y y≈z) ≈-go x≈y (nonstrict y≤z) = nonstrict (∼-respˡ-≈ (Eq.sym x≈y) y≤z) ≈-go x≈y (strict y<z) = strict (proj₂ <-resp-≈ (Eq.sym x≈y) y<z) -≤-go : Trans _≤_ _IsRelatedTo_ _IsRelatedTo_ +≤-go : Trans _≤_ _IsRelatedTo_ _IsRelatedTo_ ≤-go x≤y (equals y≈z) = nonstrict (∼-respʳ-≈ y≈z x≤y) ≤-go x≤y (nonstrict y≤z) = nonstrict (trans x≤y y≤z) ≤-go x≤y (strict y<z) = strict (≤-<-trans x≤y y<z) -<-go : Trans _<_ _IsRelatedTo_ _IsRelatedTo_ +<-go : Trans _<_ _IsRelatedTo_ _IsRelatedTo_ <-go x<y (equals y≈z) = strict (proj₁ <-resp-≈ y≈z x<y) <-go x<y (nonstrict y≤z) = strict (<-≤-trans x<y y≤z) <-go x<y (strict y<z) = strict (<-trans x<y y<z) -stop : Reflexive _IsRelatedTo_ +stop : Reflexive _IsRelatedTo_ stop = equals Eq.refl @@ -79,10 +79,10 @@ data IsStrict {x y} : x IsRelatedTo y Set (a ℓ₁ ℓ₂ ℓ₃) where isStrict : x<y IsStrict (strict x<y) -IsStrict? : {x y} (x≲y : x IsRelatedTo y) Dec (IsStrict x≲y) -IsStrict? (strict x<y) = yes (isStrict x<y) -IsStrict? (nonstrict _) = no λ() -IsStrict? (equals _) = no λ() +IsStrict? : {x y} (x≲y : x IsRelatedTo y) Dec (IsStrict x≲y) +IsStrict? (strict x<y) = yes (isStrict x<y) +IsStrict? (nonstrict _) = no λ() +IsStrict? (equals _) = no λ() extractStrict : {x y} {x≲y : x IsRelatedTo y} IsStrict x≲y x < y extractStrict (isStrict x<y) = x<y @@ -100,10 +100,10 @@ data IsEquality {x y} : x IsRelatedTo y Set (a ℓ₁ ℓ₂ ℓ₃) where isEquality : x≈y IsEquality (equals x≈y) -IsEquality? : {x y} (x≲y : x IsRelatedTo y) Dec (IsEquality x≲y) -IsEquality? (strict _) = no λ() -IsEquality? (nonstrict _) = no λ() -IsEquality? (equals x≈y) = yes (isEquality x≈y) +IsEquality? : {x y} (x≲y : x IsRelatedTo y) Dec (IsEquality x≲y) +IsEquality? (strict _) = no λ() +IsEquality? (nonstrict _) = no λ() +IsEquality? (equals x≈y) = yes (isEquality x≈y) extractEquality : {x y} {x≲y : x IsRelatedTo y} IsEquality x≲y x y extractEquality (isEquality x≈y) = x≈y diff --git a/master/Relation.Binary.Reasoning.MultiSetoid.html b/master/Relation.Binary.Reasoning.MultiSetoid.html index e96f0565b8..0e8592a498 100644 --- a/master/Relation.Binary.Reasoning.MultiSetoid.html +++ b/master/Relation.Binary.Reasoning.MultiSetoid.html @@ -30,7 +30,7 @@ open import Level using (Level; _⊔_) open import Function.Base using (case_of_) open import Relation.Binary.Core using (_⇒_) -open import Relation.Binary.Definitions using (Trans; Reflexive) +open import Relation.Binary.Definitions using (Trans; Reflexive) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Reasoning.Syntax @@ -51,13 +51,13 @@ start : IsRelatedTo _≈_ start (relTo x≈y) = x≈y - ≡-go : Trans _≡_ IsRelatedTo IsRelatedTo + ≡-go : Trans _≡_ IsRelatedTo IsRelatedTo ≡-go x≡y (relTo y∼z) = relTo (case x≡y of λ where ≡.refl y∼z) - ≈-go : Trans _≈_ IsRelatedTo IsRelatedTo + ≈-go : Trans _≈_ IsRelatedTo IsRelatedTo ≈-go x≈y (relTo y≈z) = relTo (trans x≈y y≈z) - end : Reflexive IsRelatedTo + end : Reflexive IsRelatedTo end = relTo refl ------------------------------------------------------------------------ diff --git a/master/Relation.Binary.Reasoning.Syntax.html b/master/Relation.Binary.Reasoning.Syntax.html index 8c91ca2247..39e000cd34 100644 --- a/master/Relation.Binary.Reasoning.Syntax.html +++ b/master/Relation.Binary.Reasoning.Syntax.html @@ -9,11 +9,11 @@ open import Level using (Level; _⊔_; suc) open import Relation.Nullary.Decidable.Core - using (Dec; True; toWitness) -open import Relation.Nullary.Negation.Core using (contradiction) + using (Dec; True; toWitness) +open import Relation.Nullary.Negation.Core using (contradiction) open import Relation.Binary.Core using (Rel; REL; _⇒_) open import Relation.Binary.Definitions - using (_Respectsʳ_; Asymmetric; Trans; Sym; Reflexive) + using (_Respectsʳ_; Asymmetric; Trans; Sym; Reflexive) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) @@ -64,7 +64,7 @@ field S : Rel A ℓ₂ IsS : R x y Set ℓ₃ - IsS? : (xRy : R x y) Dec (IsS xRy) + IsS? : (xRy : R x y) Dec (IsS xRy) extract : {xRy : R x y} IsS xRy S x y module begin-subrelation-syntax @@ -75,8 +75,8 @@ infix 1 begin_ - begin_ : {x y} (xRy : R x y) {s : True (IsS? xRy)} S x y - begin_ r {s} = extract (toWitness s) + begin_ : {x y} (xRy : R x y) {s : True (IsS? xRy)} S x y + begin_ r {s} = extract (toWitness s) -- Begin equality syntax module begin-equality-syntax @@ -108,7 +108,7 @@ module begin-membership-syntax (R : Rel A ℓ₁) (_∈_ : REL B A ℓ₂) - (resp : _∈_ Respectsʳ R) where + (resp : _∈_ Respectsʳ R) where infix 1 step-∈ @@ -125,19 +125,19 @@ module begin-contradiction-syntax (R : Rel A ℓ₁) (sub : SubRelation R ℓ₂ ℓ₃) - (asym : Asymmetric (SubRelation.S sub)) + (asym : Asymmetric (SubRelation.S sub)) where open SubRelation sub infix 1 begin-contradiction_ - begin-contradiction_ : (xRx : R x x) {s : True (IsS? xRx)} + begin-contradiction_ : (xRx : R x x) {s : True (IsS? xRx)} {b} {B : Set b} B - begin-contradiction_ {x} r {s} = contradiction x<x (asym x<x) + begin-contradiction_ {x} r {s} = contradiction x<x (asym x<x) where x<x : S x x - x<x = extract (toWitness s) + x<x = extract (toWitness s) ------------------------------------------------------------------------ -- Syntax for continuing a chain of reasoning steps @@ -164,7 +164,7 @@ {R : REL A B ℓ₂} (S : REL B C ℓ₁) (T : REL A C ℓ₃) - (step : Trans R S T) + (step : Trans R S T) where forward : (x : A) {y z} S y z R x y T x z @@ -252,7 +252,7 @@ module _ {U : REL B A ℓ₄} - (sym : Sym U R) + (sym : Sym U R) where backward : x {y z} S y z U y x T x z @@ -388,7 +388,7 @@ -- is not required. module ≡-syntax (R : REL A B ℓ₁) - (step : Trans _≡_ R R) + (step : Trans _≡_ R R) where infixr 2 step-≡-⟩ step-≡-∣ step-≡-⟨ @@ -425,7 +425,7 @@ module ≡-noncomputing-syntax (R : REL A B ℓ₁) where private - step : Trans _≡_ R R + step : Trans _≡_ R R step ≡.refl xRy = xRy open ≡-syntax R step public @@ -436,7 +436,7 @@ module end-syntax (R : Rel A ℓ₁) - (reflexive : Reflexive R) + (reflexive : Reflexive R) where infix 3 _∎ diff --git a/master/Relation.Binary.Rewriting.html b/master/Relation.Binary.Rewriting.html index 8721bb7635..188ccb2e89 100644 --- a/master/Relation.Binary.Rewriting.html +++ b/master/Relation.Binary.Rewriting.html @@ -24,7 +24,7 @@ open import Relation.Binary.Construct.Closure.Symmetric using (fwd; bwd) open import Relation.Binary.Construct.Closure.Transitive using (Plus; [_]; _∼⁺⟨_⟩_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) -- The following definitions are taken from Klop [5] module _ {a } {A : Set a} (_⟶_ : Rel A ) where @@ -35,7 +35,7 @@ _↔_ = EqClosure _⟶_ IsNormalForm : A Set _ - IsNormalForm a = ¬ λ b (a b) + IsNormalForm a = ¬ λ b (a b) HasNormalForm : A Set _ HasNormalForm b = λ a IsNormalForm a × (b —↠ a) diff --git a/master/Relation.Binary.Structures.Biased.html b/master/Relation.Binary.Structures.Biased.html index 86e89df73a..3262a77c8a 100644 --- a/master/Relation.Binary.Structures.Biased.html +++ b/master/Relation.Binary.Structures.Biased.html @@ -32,8 +32,8 @@ record IsStrictTotalOrderᶜ (_<_ : Rel A ℓ₂) : Set (a ℓ₂) where field isEquivalence : IsEquivalence - trans : Transitive _<_ - compare : Trichotomous _≈_ _<_ + trans : Transitive _<_ + compare : Trichotomous _≈_ _<_ isStrictTotalOrderᶜ : IsStrictTotalOrder _<_ isStrictTotalOrderᶜ = record diff --git a/master/Relation.Binary.Structures.html b/master/Relation.Binary.Structures.html index acc80d9cbb..d8034bcf1f 100644 --- a/master/Relation.Binary.Structures.html +++ b/master/Relation.Binary.Structures.html @@ -18,7 +18,7 @@ open import Data.Product.Base using (proj₁; proj₂; _,_) open import Level using (Level; _⊔_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open import Relation.Binary.Consequences open import Relation.Binary.Definitions @@ -35,8 +35,8 @@ record IsPartialEquivalence : Set (a ) where field - sym : Symmetric _≈_ - trans : Transitive _≈_ + sym : Symmetric _≈_ + trans : Transitive _≈_ -- The preorders of this library are defined in terms of an underlying -- equivalence relation, and hence equivalence relations are not @@ -47,9 +47,9 @@ record IsEquivalence : Set (a ) where field - refl : Reflexive _≈_ - sym : Symmetric _≈_ - trans : Transitive _≈_ + refl : Reflexive _≈_ + sym : Symmetric _≈_ + trans : Transitive _≈_ reflexive : _≡_ _≈_ reflexive ≡.refl = refl @@ -65,7 +65,7 @@ infix 4 _≟_ field isEquivalence : IsEquivalence - _≟_ : Decidable _≈_ + _≟_ : Decidable _≈_ open IsEquivalence isEquivalence public @@ -79,20 +79,20 @@ isEquivalence : IsEquivalence -- Reflexivity is expressed in terms of the underlying equality: reflexive : _≈_ _≲_ - trans : Transitive _≲_ + trans : Transitive _≲_ module Eq = IsEquivalence isEquivalence - refl : Reflexive _≲_ + refl : Reflexive _≲_ refl = reflexive Eq.refl - ≲-respˡ-≈ : _≲_ Respectsˡ _≈_ + ≲-respˡ-≈ : _≲_ Respectsˡ _≈_ ≲-respˡ-≈ x≈y x∼z = trans (reflexive (Eq.sym x≈y)) x∼z - ≲-respʳ-≈ : _≲_ Respectsʳ _≈_ + ≲-respʳ-≈ : _≲_ Respectsʳ _≈_ ≲-respʳ-≈ x≈y z∼x = trans z∼x (reflexive x≈y) - ≲-resp-≈ : _≲_ Respects₂ _≈_ + ≲-resp-≈ : _≲_ Respects₂ _≈_ ≲-resp-≈ = ≲-respʳ-≈ , ≲-respˡ-≈ ∼-respˡ-≈ = ≲-respˡ-≈ @@ -115,7 +115,7 @@ record IsTotalPreorder (_≲_ : Rel A ℓ₂) : Set (a ℓ₂) where field isPreorder : IsPreorder _≲_ - total : Total _≲_ + total : Total _≲_ open IsPreorder isPreorder public @@ -127,7 +127,7 @@ record IsPartialOrder (_≤_ : Rel A ℓ₂) : Set (a ℓ₂) where field isPreorder : IsPreorder _≤_ - antisym : Antisymmetric _≈_ _≤_ + antisym : Antisymmetric _≈_ _≤_ open IsPreorder isPreorder public renaming @@ -141,8 +141,8 @@ infix 4 _≟_ _≤?_ field isPartialOrder : IsPartialOrder _≤_ - _≟_ : Decidable _≈_ - _≤?_ : Decidable _≤_ + _≟_ : Decidable _≈_ + _≤?_ : Decidable _≤_ open IsPartialOrder isPartialOrder public hiding (module Eq) @@ -161,19 +161,19 @@ record IsStrictPartialOrder (_<_ : Rel A ℓ₂) : Set (a ℓ₂) where field isEquivalence : IsEquivalence - irrefl : Irreflexive _≈_ _<_ - trans : Transitive _<_ - <-resp-≈ : _<_ Respects₂ _≈_ + irrefl : Irreflexive _≈_ _<_ + trans : Transitive _<_ + <-resp-≈ : _<_ Respects₂ _≈_ module Eq = IsEquivalence isEquivalence - asym : Asymmetric _<_ + asym : Asymmetric _<_ asym {x} {y} = trans∧irr⇒asym Eq.refl trans irrefl {x = x} {y} - <-respʳ-≈ : _<_ Respectsʳ _≈_ + <-respʳ-≈ : _<_ Respectsʳ _≈_ <-respʳ-≈ = proj₁ <-resp-≈ - <-respˡ-≈ : _<_ Respectsˡ _≈_ + <-respˡ-≈ : _<_ Respectsˡ _≈_ <-respˡ-≈ = proj₂ <-resp-≈ @@ -181,8 +181,8 @@ infix 4 _≟_ _<?_ field isStrictPartialOrder : IsStrictPartialOrder _<_ - _≟_ : Decidable _≈_ - _<?_ : Decidable _<_ + _≟_ : Decidable _≈_ + _<?_ : Decidable _<_ private module SPO = IsStrictPartialOrder isStrictPartialOrder @@ -207,7 +207,7 @@ record IsTotalOrder (_≤_ : Rel A ℓ₂) : Set (a ℓ₂) where field isPartialOrder : IsPartialOrder _≤_ - total : Total _≤_ + total : Total _≤_ open IsPartialOrder isPartialOrder public @@ -222,8 +222,8 @@ infix 4 _≟_ _≤?_ field isTotalOrder : IsTotalOrder _≤_ - _≟_ : Decidable _≈_ - _≤?_ : Decidable _≤_ + _≟_ : Decidable _≈_ + _≤?_ : Decidable _≤_ open IsTotalOrder isTotalOrder public hiding (module Eq) @@ -254,7 +254,7 @@ record IsStrictTotalOrder (_<_ : Rel A ℓ₂) : Set (a ℓ₂) where field isStrictPartialOrder : IsStrictPartialOrder _<_ - compare : Trichotomous _≈_ _<_ + compare : Trichotomous _≈_ _<_ open IsStrictPartialOrder isStrictPartialOrder public hiding (module Eq) @@ -263,10 +263,10 @@ -- it implies decidability. infix 4 _≟_ _<?_ - _≟_ : Decidable _≈_ + _≟_ : Decidable _≈_ _≟_ = tri⇒dec≈ compare - _<?_ : Decidable _<_ + _<?_ : Decidable _<_ _<?_ = tri⇒dec< compare isDecStrictPartialOrder : IsDecStrictPartialOrder _<_ @@ -300,7 +300,7 @@ record IsDenseLinearOrder (_<_ : Rel A ℓ₂) : Set (a ℓ₂) where field isStrictTotalOrder : IsStrictTotalOrder _<_ - dense : Dense _<_ + dense : Dense _<_ open IsStrictTotalOrder isStrictTotalOrder public @@ -311,10 +311,10 @@ record IsApartnessRelation (_#_ : Rel A ℓ₂) : Set (a ℓ₂) where field - irrefl : Irreflexive _≈_ _#_ - sym : Symmetric _#_ - cotrans : Cotransitive _#_ + irrefl : Irreflexive _≈_ _#_ + sym : Symmetric _#_ + cotrans : Cotransitive _#_ _¬#_ : A A Set _ - x ¬# y = ¬ (x # y) + x ¬# y = ¬ (x # y) \ No newline at end of file diff --git a/master/Relation.Nary.html b/master/Relation.Nary.html index 2c62677fc4..a94a5762b2 100644 --- a/master/Relation.Nary.html +++ b/master/Relation.Nary.html @@ -25,8 +25,8 @@ open import Data.Sum.Base using (_⊎_) open import Function.Base using (_$_; _∘′_) open import Function.Nary.NonDependent -open import Relation.Nullary.Negation using (¬_) -open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _because_; _×-dec_) +open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Decidable as Dec using (Dec; yes; no; _because_; _×-dec_) import Relation.Unary as Unary open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong; subst) @@ -64,17 +64,17 @@ -- existential quantifier ∃⟨_⟩ : {n ls r} {as : Sets n ls} as Set r Set (r ( n ls)) -∃⟨_⟩ = quantₙ Unary.Satisfiable _ +∃⟨_⟩ = quantₙ Unary.Satisfiable _ -- explicit universal quantifiers Π[_] : {n ls r} {as : Sets n ls} as Set r Set (r ( n ls)) -Π[_] = quantₙ Unary.Universal _ +Π[_] = quantₙ Unary.Universal _ -- implicit universal quantifiers ∀[_] : {n ls r} {as : Sets n ls} as Set r Set (r ( n ls)) -∀[_] = quantₙ Unary.IUniversal _ +∀[_] = quantₙ Unary.IUniversal _ -- ≟-mapₙ : ∀ n. (con : A₁ → ⋯ → Aₙ → R) → -- Injectiveₙ n con → @@ -83,10 +83,10 @@ -- Dec (con a₁₁ ⋯ aₙ₁ ≡ con a₁₂ ⋯ aₙ₂) ≟-mapₙ : n {ls} {as : Sets n ls} (con : Arrows n as R) Injectiveₙ n con - {l r} Arrows n (Dec <$> Equalₙ n l r) (Dec (uncurryₙ n con l uncurryₙ n con r)) + {l r} Arrows n (Dec <$> Equalₙ n l r) (Dec (uncurryₙ n con l uncurryₙ n con r)) ≟-mapₙ n con con-inj = curryₙ n λ a?s let as? = Product-dec n a?s in - Dec.map′ (cong (uncurryₙ n con) ∘′ fromEqualₙ n) con-inj as? + Dec.map′ (cong (uncurryₙ n con) ∘′ fromEqualₙ n) con-inj as? ------------------------------------------------------------------------ -- Substitution @@ -156,7 +156,7 @@ -- negation : {n ls r} {as : Sets n ls} as Set r as Set r - = liftₙ 1 _ ¬_ + = liftₙ 1 _ ¬_ apply⊤ₙ : {n ls r} {as : Sets n ls} {R : as Set r} @@ -183,12 +183,12 @@ -- Decidability Decidable : {n ls r} {as : Sets n ls} as Set r Set (r n ls) -Decidable R = Π[ mapₙ _ Dec R ] +Decidable R = Π[ mapₙ _ Dec R ] -- erasure ⌊_⌋ : {n ls r} {as : Sets n ls} {R : as Set r} Decidable R as Set r -⌊_⌋ {zero} R? = Lift _ (Dec.True R?) +⌊_⌋ {zero} R? = Lift _ (Dec.True R?) ⌊_⌋ {suc n} R? a = R? a -- equivalence between R and its erasure @@ -196,14 +196,14 @@ fromWitness : {n ls r} {as : Sets n ls} (R : as Set r) (R? : Decidable R) ∀[ R? R ] fromWitness {zero} R R? with R? -... | yes r = λ _ r -... | false because _ = λ () +... | yes r = λ _ r +... | false because _ = λ () fromWitness {suc n} R R? = fromWitness (R _) (R? _) toWitness : {n ls r} {as : Sets n ls} (R : as Set r) (R? : Decidable R) ∀[ R R? ] toWitness {zero} R R? with R? -... | true because _ = _ -... | no ¬r = ⊥-elim ∘′ ¬r +... | true because _ = _ +... | no ¬r = ⊥-elim ∘′ ¬r toWitness {suc n} R R? = toWitness (R _) (R? _) \ No newline at end of file diff --git a/master/Relation.Nullary.Decidable.Core.html b/master/Relation.Nullary.Decidable.Core.html index 55981686b3..11b974ec7d 100644 --- a/master/Relation.Nullary.Decidable.Core.html +++ b/master/Relation.Nullary.Decidable.Core.html @@ -12,189 +12,194 @@ module Relation.Nullary.Decidable.Core where -open import Level using (Level; Lift) -open import Data.Bool.Base using (Bool; T; false; true; not; _∧_; _∨_) -open import Data.Unit.Polymorphic.Base using () -open import Data.Empty.Irrelevant using (⊥-elim) -open import Data.Product.Base using (_×_) -open import Data.Sum.Base using (_⊎_) -open import Function.Base using (_∘_; const; _$_; flip) -open import Relation.Nullary.Reflects -open import Relation.Nullary.Negation.Core - using (¬_; Stable; negated-stable; contradiction; DoubleNegation) +open import Agda.Builtin.Equality using (_≡_) +open import Level using (Level; Lift) +open import Data.Bool.Base using (Bool; T; false; true; not; _∧_; _∨_) +open import Data.Unit.Polymorphic.Base using () +open import Data.Product.Base using (_×_) +open import Data.Sum.Base using (_⊎_) +open import Function.Base using (_∘_; const; _$_; flip) +open import Relation.Nullary.Recomputable as Recomputable hiding (recompute-constant) +open import Relation.Nullary.Reflects as Reflects hiding (recompute; recompute-constant) +open import Relation.Nullary.Negation.Core + using (¬_; Stable; negated-stable; contradiction; DoubleNegation) -private - variable - a b : Level - A B : Set a ------------------------------------------------------------------------- --- Definition. +private + variable + a b : Level + A B : Set a --- Decidability proofs have two parts: the `does` term which contains --- the boolean result and the `proof` term which contains a proof that --- reflects the boolean result. This definition allows the boolean --- part of the decision procedure to compute independently from the --- proof. This leads to better computational behaviour when we only care --- about the result and not the proof. See README.Design.Decidability --- for further details. +------------------------------------------------------------------------ +-- Definition. -infix 2 _because_ +-- Decidability proofs have two parts: the `does` term which contains +-- the boolean result and the `proof` term which contains a proof that +-- reflects the boolean result. This definition allows the boolean +-- part of the decision procedure to compute independently from the +-- proof. This leads to better computational behaviour when we only care +-- about the result and not the proof. See README.Design.Decidability +-- for further details. -record Dec (A : Set a) : Set a where - constructor _because_ - field - does : Bool - proof : Reflects A does +infix 2 _because_ -open Dec public - -pattern yes a = true because ofʸ a -pattern no ¬a = false because ofⁿ ¬a - ------------------------------------------------------------------------- --- Flattening - -module _ {A : Set a} where - - From-yes : Dec A Set a - From-yes (true because _) = A - From-yes (false because _) = - - From-no : Dec A Set a - From-no (false because _) = ¬ A - From-no (true because _) = - ------------------------------------------------------------------------- --- Recompute - --- Given an irrelevant proof of a decidable type, a proof can --- be recomputed and subsequently used in relevant contexts. -recompute : Dec A .A A -recompute (yes a) _ = a -recompute (no ¬a) a = ⊥-elim (¬a a) +record Dec (A : Set a) : Set a where + constructor _because_ + field + does : Bool + proof : Reflects A does ------------------------------------------------------------------------- --- Interaction with negation, sum, product etc. +open Dec public -infixr 1 _⊎-dec_ -infixr 2 _×-dec_ _→-dec_ +pattern yes a = true because ofʸ a +pattern no ¬a = false because ofⁿ ¬a -T? : x Dec (T x) -T? x = x because T-reflects x +------------------------------------------------------------------------ +-- Flattening -¬? : Dec A Dec (¬ A) -does (¬? a?) = not (does a?) -proof (¬? a?) = ¬-reflects (proof a?) +module _ {A : Set a} where -_×-dec_ : Dec A Dec B Dec (A × B) -does (a? ×-dec b?) = does a? does b? -proof (a? ×-dec b?) = proof a? ×-reflects proof b? + From-yes : Dec A Set a + From-yes (true because _) = A + From-yes (false because _) = -_⊎-dec_ : Dec A Dec B Dec (A B) -does (a? ⊎-dec b?) = does a? does b? -proof (a? ⊎-dec b?) = proof a? ⊎-reflects proof b? + From-no : Dec A Set a + From-no (false because _) = ¬ A + From-no (true because _) = -_→-dec_ : Dec A Dec B Dec (A B) -does (a? →-dec b?) = not (does a?) does b? -proof (a? →-dec b?) = proof a? →-reflects proof b? +------------------------------------------------------------------------ +-- Recompute ------------------------------------------------------------------------- --- Relationship with booleans +-- Given an irrelevant proof of a decidable type, a proof can +-- be recomputed and subsequently used in relevant contexts. --- `isYes` is a stricter version of `does`. The lack of computation --- means that we can recover the proposition `P` from `isYes a?` by --- unification. This is useful when we are using the decision procedure --- for proof automation. +recompute : Dec A Recomputable A +recompute = Reflects.recompute proof -isYes : Dec A Bool -isYes (true because _) = true -isYes (false because _) = false +recompute-constant : (a? : Dec A) (p q : A) recompute a? p recompute a? q +recompute-constant = Recomputable.recompute-constant recompute -isNo : Dec A Bool -isNo = not isYes +------------------------------------------------------------------------ +-- Interaction with negation, sum, product etc. -True : Dec A Set -True = T isYes +infixr 1 _⊎-dec_ +infixr 2 _×-dec_ _→-dec_ -False : Dec A Set -False = T isNo +T? : x Dec (T x) +T? x = x because T-reflects x --- The traditional name for isYes is ⌊_⌋, indicating the stripping of evidence. -⌊_⌋ = isYes +¬? : Dec A Dec (¬ A) +does (¬? a?) = not (does a?) +proof (¬? a?) = ¬-reflects (proof a?) ------------------------------------------------------------------------- --- Witnesses +_×-dec_ : Dec A Dec B Dec (A × B) +does (a? ×-dec b?) = does a? does b? +proof (a? ×-dec b?) = proof a? ×-reflects proof b? --- Gives a witness to the "truth". -toWitness : {a? : Dec A} True a? A -toWitness {a? = true because [a]} _ = invert [a] -toWitness {a? = false because _ } () +_⊎-dec_ : Dec A Dec B Dec (A B) +does (a? ⊎-dec b?) = does a? does b? +proof (a? ⊎-dec b?) = proof a? ⊎-reflects proof b? --- Establishes a "truth", given a witness. -fromWitness : {a? : Dec A} A True a? -fromWitness {a? = true because _ } = const _ -fromWitness {a? = false because [¬a]} = invert [¬a] +_→-dec_ : Dec A Dec B Dec (A B) +does (a? →-dec b?) = not (does a?) does b? +proof (a? →-dec b?) = proof a? →-reflects proof b? --- Variants for False. -toWitnessFalse : {a? : Dec A} False a? ¬ A -toWitnessFalse {a? = true because _ } () -toWitnessFalse {a? = false because [¬a]} _ = invert [¬a] +------------------------------------------------------------------------ +-- Relationship with booleans -fromWitnessFalse : {a? : Dec A} ¬ A False a? -fromWitnessFalse {a? = true because [a]} = flip _$_ (invert [a]) -fromWitnessFalse {a? = false because _ } = const _ +-- `isYes` is a stricter version of `does`. The lack of computation +-- means that we can recover the proposition `P` from `isYes a?` by +-- unification. This is useful when we are using the decision procedure +-- for proof automation. --- If a decision procedure returns "yes", then we can extract the --- proof using from-yes. -from-yes : (a? : Dec A) From-yes a? -from-yes (true because [a]) = invert [a] -from-yes (false because _ ) = _ +isYes : Dec A Bool +isYes (true because _) = true +isYes (false because _) = false --- If a decision procedure returns "no", then we can extract the proof --- using from-no. -from-no : (a? : Dec A) From-no a? -from-no (false because [¬a]) = invert [¬a] -from-no (true because _ ) = _ +isNo : Dec A Bool +isNo = not isYes ------------------------------------------------------------------------- --- Maps +True : Dec A Set +True = T isYes -map′ : (A B) (B A) Dec A Dec B -does (map′ A→B B→A a?) = does a? -proof (map′ A→B B→A (true because [a])) = ofʸ (A→B (invert [a])) -proof (map′ A→B B→A (false because [¬a])) = ofⁿ (invert [¬a] B→A) +False : Dec A Set +False = T isNo ------------------------------------------------------------------------- --- Relationship with double-negation +-- The traditional name for isYes is ⌊_⌋, indicating the stripping of evidence. +⌊_⌋ = isYes --- Decidable predicates are stable. +------------------------------------------------------------------------ +-- Witnesses -decidable-stable : Dec A Stable A -decidable-stable (yes a) ¬¬a = a -decidable-stable (no ¬a) ¬¬a = contradiction ¬a ¬¬a +-- Gives a witness to the "truth". +toWitness : {a? : Dec A} True a? A +toWitness {a? = true because [a]} _ = invert [a] +toWitness {a? = false because _ } () -¬-drop-Dec : Dec (¬ ¬ A) Dec (¬ A) -¬-drop-Dec ¬¬a? = map′ negated-stable contradiction (¬? ¬¬a?) +-- Establishes a "truth", given a witness. +fromWitness : {a? : Dec A} A True a? +fromWitness {a? = true because _ } = const _ +fromWitness {a? = false because [¬a]} = invert [¬a] --- A double-negation-translated variant of excluded middle (or: every --- nullary relation is decidable in the double-negation monad). +-- Variants for False. +toWitnessFalse : {a? : Dec A} False a? ¬ A +toWitnessFalse {a? = true because _ } () +toWitnessFalse {a? = false because [¬a]} _ = invert [¬a] -¬¬-excluded-middle : DoubleNegation (Dec A) -¬¬-excluded-middle ¬?a = ¬?a (no a ¬?a (yes a))) +fromWitnessFalse : {a? : Dec A} ¬ A False a? +fromWitnessFalse {a? = true because [a]} = flip _$_ (invert [a]) +fromWitnessFalse {a? = false because _ } = const _ +-- If a decision procedure returns "yes", then we can extract the +-- proof using from-yes. +from-yes : (a? : Dec A) From-yes a? +from-yes (true because [a]) = invert [a] +from-yes (false because _ ) = _ ------------------------------------------------------------------------- --- DEPRECATED NAMES ------------------------------------------------------------------------- --- Please use the new names as continuing support for the old names is --- not guaranteed. +-- If a decision procedure returns "no", then we can extract the proof +-- using from-no. +from-no : (a? : Dec A) From-no a? +from-no (false because [¬a]) = invert [¬a] +from-no (true because _ ) = _ --- Version 2.0 +------------------------------------------------------------------------ +-- Maps -excluded-middle = ¬¬-excluded-middle -{-# WARNING_ON_USAGE excluded-middle -"Warning: excluded-middle was deprecated in v2.0. +map′ : (A B) (B A) Dec A Dec B +does (map′ A→B B→A a?) = does a? +proof (map′ A→B B→A (true because [a])) = of (A→B (invert [a])) +proof (map′ A→B B→A (false because [¬a])) = of (invert [¬a] B→A) + +------------------------------------------------------------------------ +-- Relationship with double-negation + +-- Decidable predicates are stable. + +decidable-stable : Dec A Stable A +decidable-stable (true because [a]) ¬¬a = invert [a] +decidable-stable (false because [¬a]) ¬¬a = contradiction (invert [¬a]) ¬¬a + +¬-drop-Dec : Dec (¬ ¬ A) Dec (¬ A) +¬-drop-Dec ¬¬a? = map′ negated-stable contradiction (¬? ¬¬a?) + +-- A double-negation-translated variant of excluded middle (or: every +-- nullary relation is decidable in the double-negation monad). + +¬¬-excluded-middle : DoubleNegation (Dec A) +¬¬-excluded-middle ¬?a = ¬?a (no a ¬?a (yes a))) + + +------------------------------------------------------------------------ +-- DEPRECATED NAMES +------------------------------------------------------------------------ +-- Please use the new names as continuing support for the old names is +-- not guaranteed. + +-- Version 2.0 + +excluded-middle = ¬¬-excluded-middle +{-# WARNING_ON_USAGE excluded-middle +"Warning: excluded-middle was deprecated in v2.0. Please use ¬¬-excluded-middle instead." -#-} +#-} \ No newline at end of file diff --git a/master/Relation.Nullary.Decidable.html b/master/Relation.Nullary.Decidable.html index 74bf6beace..af9162c5f3 100644 --- a/master/Relation.Nullary.Decidable.html +++ b/master/Relation.Nullary.Decidable.html @@ -10,79 +10,75 @@ module Relation.Nullary.Decidable where open import Level using (Level) -open import Data.Bool.Base using (true; false; if_then_else_) -open import Data.Empty using (⊥-elim) -open import Data.Product.Base using (; _,_) -open import Function.Base -open import Function.Bundles using - (Injection; module Injection; module Equivalence; _⇔_; _↔_; mk↔ₛ′) -open import Relation.Binary.Bundles using (Setoid; module Setoid) -open import Relation.Binary.Definitions using (Decidable) -open import Relation.Nullary -open import Relation.Nullary.Reflects using (invert) -open import Relation.Binary.PropositionalEquality.Core - using (_≡_; refl; sym; trans; cong′) - -private - variable - a b ℓ₁ ℓ₂ : Level - A B : Set a - ------------------------------------------------------------------------- --- Re-exporting the core definitions - -open import Relation.Nullary.Decidable.Core public - ------------------------------------------------------------------------- --- Maps - -map : A B Dec A Dec B -map A⇔B = map′ to from - where open Equivalence A⇔B - --- If there is an injection from one setoid to another, and the --- latter's equivalence relation is decidable, then the former's --- equivalence relation is also decidable. -via-injection : {S : Setoid a ℓ₁} {T : Setoid b ℓ₂} - (inj : Injection S T) (open Injection inj) - Decidable Eq₂._≈_ Decidable Eq₁._≈_ -via-injection inj _≟_ x y = map′ injective cong (to x to y) - where open Injection inj - ------------------------------------------------------------------------- --- A lemma relating True and Dec - -True-↔ : (a? : Dec A) Irrelevant A True a? A -True-↔ (true because [a]) irr = mk↔ₛ′ _ invert [a]) _ (irr (invert [a])) cong′ -True-↔ (false because ofⁿ ¬a) _ = mk↔ₛ′ ()) (invert (ofⁿ ¬a)) (⊥-elim ¬a) λ () - ------------------------------------------------------------------------- --- Result of decidability - -isYes≗does : (a? : Dec A) isYes a? does a? -isYes≗does (true because _) = refl -isYes≗does (false because _) = refl - -dec-true : (a? : Dec A) A does a? true -dec-true (true because _ ) a = refl -dec-true (false because [¬a]) a = ⊥-elim (invert [¬a] a) - -dec-false : (a? : Dec A) ¬ A does a? false -dec-false (false because _ ) ¬a = refl -dec-false (true because [a]) ¬a = ⊥-elim (¬a (invert [a])) - -dec-yes : (a? : Dec A) A λ a a? yes a -dec-yes a? a with dec-true a? a -dec-yes (yes a′) a | refl = a′ , refl - -dec-no : (a? : Dec A) (¬a : ¬ A) a? no ¬a -dec-no a? ¬a with dec-false a? ¬a -dec-no (no _) _ | refl = refl - -dec-yes-irr : (a? : Dec A) Irrelevant A (a : A) a? yes a -dec-yes-irr a? irr a with dec-yes a? a -... | a′ , eq rewrite irr a a′ = eq - -⌊⌋-map′ : t f (a? : Dec A) map′ {B = B} t f a? a? -⌊⌋-map′ t f a? = trans (isYes≗does (map′ t f a?)) (sym (isYes≗does a?)) +open import Data.Bool.Base using (true; false) +open import Data.Product.Base using (; _,_) +open import Function.Bundles using + (Injection; module Injection; module Equivalence; _⇔_; _↔_; mk↔ₛ′) +open import Relation.Binary.Bundles using (Setoid; module Setoid) +open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary using (Irrelevant) +open import Relation.Nullary.Negation.Core using (¬_; contradiction) +open import Relation.Nullary.Reflects using (invert) +open import Relation.Binary.PropositionalEquality.Core + using (_≡_; refl; sym; trans; cong′) + +private + variable + a b ℓ₁ ℓ₂ : Level + A B : Set a + +------------------------------------------------------------------------ +-- Re-exporting the core definitions + +open import Relation.Nullary.Decidable.Core public + +------------------------------------------------------------------------ +-- Maps + +map : A B Dec A Dec B +map A⇔B = map′ to from + where open Equivalence A⇔B + +-- If there is an injection from one setoid to another, and the +-- latter's equivalence relation is decidable, then the former's +-- equivalence relation is also decidable. +via-injection : {S : Setoid a ℓ₁} {T : Setoid b ℓ₂} + (inj : Injection S T) (open Injection inj) + Decidable Eq₂._≈_ Decidable Eq₁._≈_ +via-injection inj _≟_ x y = map′ injective cong (to x to y) + where open Injection inj + +------------------------------------------------------------------------ +-- A lemma relating True and Dec + +True-↔ : (a? : Dec A) Irrelevant A True a? A +True-↔ (true because [a]) irr = let a = invert [a] in mk↔ₛ′ _ a) _ (irr a) cong′ +True-↔ (false because [¬a]) _ = let ¬a = invert [¬a] in mk↔ₛ′ ()) ¬a a contradiction a ¬a) λ () + +------------------------------------------------------------------------ +-- Result of decidability + +isYes≗does : (a? : Dec A) isYes a? does a? +isYes≗does (true because _) = refl +isYes≗does (false because _) = refl + +dec-true : (a? : Dec A) A does a? true +dec-true (true because _ ) a = refl +dec-true (false because [¬a]) a = contradiction a (invert [¬a]) + +dec-false : (a? : Dec A) ¬ A does a? false +dec-false (false because _ ) ¬a = refl +dec-false (true because [a]) ¬a = contradiction (invert [a]) ¬a + +dec-yes : (a? : Dec A) A λ a a? yes a +dec-yes a? a with yes a′a? | refldec-true a? a = a′ , refl + +dec-no : (a? : Dec A) (¬a : ¬ A) a? no ¬a +dec-no a? ¬a with no _a? | refldec-false a? ¬a = refl + +dec-yes-irr : (a? : Dec A) Irrelevant A (a : A) a? yes a +dec-yes-irr a? irr a with a′ , eqdec-yes a? a rewrite irr a a′ = eq + +⌊⌋-map′ : t f (a? : Dec A) map′ {B = B} t f a? a? +⌊⌋-map′ t f a? = trans (isYes≗does (map′ t f a?)) (sym (isYes≗does a?)) \ No newline at end of file diff --git a/master/Relation.Nullary.Negation.Core.html b/master/Relation.Nullary.Negation.Core.html index 19bb4a448a..9c4b14981f 100644 --- a/master/Relation.Nullary.Negation.Core.html +++ b/master/Relation.Nullary.Negation.Core.html @@ -9,69 +9,72 @@ module Relation.Nullary.Negation.Core where -open import Data.Bool.Base using (not) -open import Data.Empty using (; ⊥-elim) -open import Data.Sum.Base using (_⊎_; [_,_]; inj₁; inj₂) -open import Function.Base using (flip; _$_; _∘_; const) -open import Level +open import Data.Empty using (; ⊥-elim-irr) +open import Data.Sum.Base using (_⊎_; [_,_]; inj₁; inj₂) +open import Function.Base using (flip; _∘_; const) +open import Level -private - variable - a p q w : Level - A B C : Set a - Whatever : Set w +private + variable + a p q w : Level + A B C : Set a + Whatever : Set w ------------------------------------------------------------------------- --- Negation. +------------------------------------------------------------------------ +-- Negation. -infix 3 ¬_ -¬_ : Set a Set a -¬ A = A +infix 3 ¬_ +¬_ : Set a Set a +¬ A = A ------------------------------------------------------------------------- --- Stability. +------------------------------------------------------------------------ +-- Stability. --- Double-negation -DoubleNegation : Set a Set a -DoubleNegation A = ¬ ¬ A +-- Double-negation +DoubleNegation : Set a Set a +DoubleNegation A = ¬ ¬ A --- Stability under double-negation. -Stable : Set a Set a -Stable A = ¬ ¬ A A +-- Stability under double-negation. +Stable : Set a Set a +Stable A = ¬ ¬ A A ------------------------------------------------------------------------- --- Relationship to sum +------------------------------------------------------------------------ +-- Relationship to sum -infixr 1 _¬-⊎_ -_¬-⊎_ : ¬ A ¬ B ¬ (A B) -_¬-⊎_ = [_,_] +infixr 1 _¬-⊎_ +_¬-⊎_ : ¬ A ¬ B ¬ (A B) +_¬-⊎_ = [_,_] ------------------------------------------------------------------------- --- Uses of negation +------------------------------------------------------------------------ +-- Uses of negation -contradiction : A ¬ A Whatever -contradiction a ¬a = ⊥-elim (¬a a) +contradiction-irr : .A ¬ A Whatever +contradiction-irr a ¬a = ⊥-elim-irr (¬a a) -contradiction₂ : A B ¬ A ¬ B Whatever -contradiction₂ (inj₁ a) ¬a ¬b = contradiction a ¬a -contradiction₂ (inj₂ b) ¬a ¬b = contradiction b ¬b +contradiction : A ¬ A Whatever +contradiction a = contradiction-irr a -contraposition : (A B) ¬ B ¬ A -contraposition f ¬b a = contradiction (f a) ¬b +contradiction₂ : A B ¬ A ¬ B Whatever +contradiction₂ (inj₁ a) ¬a ¬b = contradiction a ¬a +contradiction₂ (inj₂ b) ¬a ¬b = contradiction b ¬b --- Everything is stable in the double-negation monad. -stable : ¬ ¬ Stable A -stable ¬[¬¬a→a] = ¬[¬¬a→a] ¬¬a ⊥-elim (¬¬a (¬[¬¬a→a] const))) +contraposition : (A B) ¬ B ¬ A +contraposition f ¬b a = contradiction (f a) ¬b --- Negated predicates are stable. -negated-stable : Stable (¬ A) -negated-stable ¬¬¬a a = ¬¬¬a (_$ a) +-- Everything is stable in the double-negation monad. +stable : ¬ ¬ Stable A +stable ¬[¬¬a→a] = ¬[¬¬a→a] (contradiction (¬[¬¬a→a] const)) -¬¬-map : (A B) ¬ ¬ A ¬ ¬ B -¬¬-map f = contraposition (contraposition f) +-- Negated predicates are stable. +negated-stable : Stable (¬ A) +negated-stable ¬¬¬a a = ¬¬¬a (contradiction a) + +¬¬-map : (A B) ¬ ¬ A ¬ ¬ B +¬¬-map f = contraposition (contraposition f) + +-- Note also the following use of flip: +private + note : (A ¬ B) B ¬ A + note = flip --- Note also the following use of flip: -private - note : (A ¬ B) B ¬ A - note = flip \ No newline at end of file diff --git a/master/Relation.Nullary.Negation.html b/master/Relation.Nullary.Negation.html index 6eedd3b359..704a4b48ed 100644 --- a/master/Relation.Nullary.Negation.html +++ b/master/Relation.Nullary.Negation.html @@ -9,103 +9,102 @@ module Relation.Nullary.Negation where -open import Effect.Monad using (RawMonad; mkRawMonad) -open import Data.Bool.Base using (Bool; false; true; if_then_else_; not) -open import Data.Empty using (⊥-elim) -open import Data.Product.Base as Product using (_,_; Σ; Σ-syntax; ; curry; uncurry) -open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂; [_,_]) -open import Function.Base using (flip; _∘_; const; _∘′_) -open import Level using (Level) -open import Relation.Nullary.Decidable.Core using (Dec; yes; no; ¬¬-excluded-middle) -open import Relation.Unary using (Universal; Pred) - -private - variable - a b c d p w : Level - A B C D : Set a - P : Pred A p - Whatever : Set w - ------------------------------------------------------------------------- --- Re-export public definitions - -open import Relation.Nullary.Negation.Core public - ------------------------------------------------------------------------- --- Quantifier juggling - -∃⟶¬∀¬ : P ¬ (∀ x ¬ P x) -∃⟶¬∀¬ = flip uncurry - -∀⟶¬∃¬ : (∀ x P x) ¬ λ x ¬ P x -∀⟶¬∃¬ ∀xPx (x , ¬Px) = ¬Px (∀xPx x) - -¬∃⟶∀¬ : ¬ x P x) x ¬ P x -¬∃⟶∀¬ = curry - -∀¬⟶¬∃ : (∀ x ¬ P x) ¬ x P x) -∀¬⟶¬∃ = uncurry - -∃¬⟶¬∀ : x ¬ P x) ¬ (∀ x P x) -∃¬⟶¬∀ = flip ∀⟶¬∃¬ - ------------------------------------------------------------------------- --- Double Negation - --- Double-negation is a monad (if we assume that all elements of ¬ ¬ P --- are equal). - -¬¬-Monad : RawMonad {a} DoubleNegation -¬¬-Monad = mkRawMonad - DoubleNegation - contradiction - x f negated-stable (¬¬-map f x)) - -¬¬-push : DoubleNegation Π[ P ] Π[ DoubleNegation P ] -¬¬-push ¬¬∀P a ¬Pa = ¬¬∀P ∀P ¬Pa (∀P a)) - --- If Whatever is instantiated with ¬ ¬ something, then this function --- is call with current continuation in the double-negation monad, or, --- if you will, a double-negation translation of Peirce's law. --- --- In order to prove ¬ ¬ P one can assume ¬ P and prove ⊥. However, --- sometimes it is nice to avoid leaving the double-negation monad; in --- that case this function can be used (with Whatever instantiated to --- ⊥). - -call/cc : ((A Whatever) DoubleNegation A) DoubleNegation A -call/cc hyp ¬a = hyp a ⊥-elim (¬a a)) ¬a - --- The "independence of premise" rule, in the double-negation monad. --- It is assumed that the index set (A) is inhabited. - -independence-of-premise : A (B Σ A P) DoubleNegation (Σ[ x A ] (B P x)) -independence-of-premise {A = A} {B = B} {P = P} q f = ¬¬-map helper ¬¬-excluded-middle - where - helper : Dec B Σ[ x A ] (B P x) - helper (yes p) = Product.map₂ const (f p) - helper (no ¬p) = (q , ⊥-elim ∘′ ¬p) - --- The independence of premise rule for binary sums. - -independence-of-premise-⊎ : (A B C) DoubleNegation ((A B) (A C)) -independence-of-premise-⊎ {A = A} {B = B} {C = C} f = ¬¬-map helper ¬¬-excluded-middle - where - helper : Dec A (A B) (A C) - helper (yes p) = Sum.map const const (f p) - helper (no ¬p) = inj₁ (⊥-elim ∘′ ¬p) - -private - - -- Note that independence-of-premise-⊎ is a consequence of - -- independence-of-premise (for simplicity it is assumed that Q and - -- R have the same type here): - - corollary : {B C : Set b} (A B C) DoubleNegation ((A B) (A C)) - corollary {A = A} {B = B} {C = C} f = - ¬¬-map helper (independence-of-premise true ([ _,_ true , _,_ false ] ∘′ f)) - where - helper : b A if b then B else C) (A B) (A C) - helper (true , f) = inj₁ f - helper (false , f) = inj₂ f +open import Data.Bool.Base using (Bool; false; true; if_then_else_) +open import Data.Product.Base as Product using (_,_; Σ; Σ-syntax; ; curry; uncurry) +open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂; [_,_]) +open import Effect.Monad using (RawMonad; mkRawMonad) +open import Function.Base using (flip; _∘_; const; _∘′_) +open import Level using (Level) +open import Relation.Nullary.Decidable.Core using (Dec; yes; no; ¬¬-excluded-middle) +open import Relation.Unary using (Universal; Pred) + +private + variable + a b c d p w : Level + A B C D : Set a + P : Pred A p + Whatever : Set w + +------------------------------------------------------------------------ +-- Re-export public definitions + +open import Relation.Nullary.Negation.Core public + +------------------------------------------------------------------------ +-- Quantifier juggling + +∃⟶¬∀¬ : P ¬ (∀ x ¬ P x) +∃⟶¬∀¬ = flip uncurry + +∀⟶¬∃¬ : (∀ x P x) ¬ λ x ¬ P x +∀⟶¬∃¬ ∀xPx (x , ¬Px) = ¬Px (∀xPx x) + +¬∃⟶∀¬ : ¬ x P x) x ¬ P x +¬∃⟶∀¬ = curry + +∀¬⟶¬∃ : (∀ x ¬ P x) ¬ x P x) +∀¬⟶¬∃ = uncurry + +∃¬⟶¬∀ : x ¬ P x) ¬ (∀ x P x) +∃¬⟶¬∀ = flip ∀⟶¬∃¬ + +------------------------------------------------------------------------ +-- Double Negation + +-- Double-negation is a monad (if we assume that all elements of ¬ ¬ P +-- are equal). + +¬¬-Monad : RawMonad {a} DoubleNegation +¬¬-Monad = mkRawMonad + DoubleNegation + contradiction + x f negated-stable (¬¬-map f x)) + +¬¬-push : DoubleNegation Π[ P ] Π[ DoubleNegation P ] +¬¬-push ¬¬∀P a ¬Pa = ¬¬∀P ∀P ¬Pa (∀P a)) + +-- If Whatever is instantiated with ¬ ¬ something, then this function +-- is call with current continuation in the double-negation monad, or, +-- if you will, a double-negation translation of Peirce's law. +-- +-- In order to prove ¬ ¬ P one can assume ¬ P and prove ⊥. However, +-- sometimes it is nice to avoid leaving the double-negation monad; in +-- that case this function can be used (with Whatever instantiated to +-- ⊥). + +call/cc : ((A Whatever) DoubleNegation A) DoubleNegation A +call/cc hyp ¬a = hyp (flip contradiction ¬a) ¬a + +-- The "independence of premise" rule, in the double-negation monad. +-- It is assumed that the index set (A) is inhabited. + +independence-of-premise : A (B Σ A P) DoubleNegation (Σ[ x A ] (B P x)) +independence-of-premise {A = A} {B = B} {P = P} q f = ¬¬-map helper ¬¬-excluded-middle + where + helper : Dec B Σ[ x A ] (B P x) + helper (yes p) = Product.map₂ const (f p) + helper (no ¬p) = (q , flip contradiction ¬p) + +-- The independence of premise rule for binary sums. + +independence-of-premise-⊎ : (A B C) DoubleNegation ((A B) (A C)) +independence-of-premise-⊎ {A = A} {B = B} {C = C} f = ¬¬-map helper ¬¬-excluded-middle + where + helper : Dec A (A B) (A C) + helper (yes p) = Sum.map const const (f p) + helper (no ¬p) = inj₁ (flip contradiction ¬p) + +private + + -- Note that independence-of-premise-⊎ is a consequence of + -- independence-of-premise (for simplicity it is assumed that Q and + -- R have the same type here): + + corollary : {B C : Set b} (A B C) DoubleNegation ((A B) (A C)) + corollary {A = A} {B = B} {C = C} f = + ¬¬-map helper (independence-of-premise true ([ _,_ true , _,_ false ] ∘′ f)) + where + helper : b A if b then B else C) (A B) (A C) + helper (true , f) = inj₁ f + helper (false , f) = inj₂ f \ No newline at end of file diff --git a/master/Relation.Nullary.Recomputable.html b/master/Relation.Nullary.Recomputable.html new file mode 100644 index 0000000000..851df29ee7 --- /dev/null +++ b/master/Relation.Nullary.Recomputable.html @@ -0,0 +1,65 @@ + +Relation.Nullary.Recomputable
------------------------------------------------------------------------
+-- The Agda standard library
+--
+-- Recomputable types and their algebra as Harrop formulas
+------------------------------------------------------------------------
+
+{-# OPTIONS --cubical-compatible --safe #-}
+
+module Relation.Nullary.Recomputable where
+
+open import Agda.Builtin.Equality using (_≡_; refl)
+open import Data.Empty using ()
+open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
+open import Level using (Level)
+open import Relation.Nullary.Negation.Core using (¬_)
+
+private
+  variable
+    a b : Level
+    A : Set a
+    B : Set b
+
+------------------------------------------------------------------------
+-- Definition
+--
+-- The idea of being 'recomputable' is that, given an *irrelevant* proof
+-- of a proposition `A` (signalled by being a value of type `.A`, all of
+-- whose inhabitants are identified up to definitional equality, and hence
+-- do *not* admit pattern-matching), one may 'promote' such a value to a
+-- 'genuine' value of `A`, available for subsequent eg. pattern-matching.
+
+Recomputable : (A : Set a)  Set a
+Recomputable A = .A  A
+
+------------------------------------------------------------------------
+-- Fundamental property: 'promotion' is a constant function
+
+recompute-constant : (r : Recomputable A) (p q : A)  r p  r q
+recompute-constant r p q = refl
+
+------------------------------------------------------------------------
+-- Constructions
+
+⊥-recompute : Recomputable 
+⊥-recompute ()
+
+_×-recompute_ : Recomputable A  Recomputable B  Recomputable (A × B)
+(rA ×-recompute rB) p = rA (p .proj₁) , rB (p .proj₂)
+
+_→-recompute_ : (A : Set a)  Recomputable B  Recomputable (A  B)
+(A →-recompute rB) f a = rB (f a)
+
+Π-recompute : (B : A  Set b)  (∀ x  Recomputable (B x))  Recomputable (∀ x  B x)
+Π-recompute B rB f a = rB a (f a)
+
+∀-recompute : (B : A  Set b)  (∀ {x}  Recomputable (B x))  Recomputable (∀ {x}  B x)
+∀-recompute B rB f = rB f
+
+-- corollary: negated propositions are Recomputable
+
+¬-recompute : Recomputable (¬ A)
+¬-recompute {A = A} = A →-recompute ⊥-recompute
+
+
\ No newline at end of file diff --git a/master/Relation.Nullary.Reflects.html b/master/Relation.Nullary.Reflects.html index fe31e5baf9..365c7dc21e 100644 --- a/master/Relation.Nullary.Reflects.html +++ b/master/Relation.Nullary.Reflects.html @@ -12,95 +12,108 @@ open import Agda.Builtin.Equality open import Data.Bool.Base -open import Data.Unit.Base using () -open import Data.Empty -open import Data.Sum.Base using (_⊎_; inj₁; inj₂) -open import Data.Product.Base using (_×_; _,_; proj₁; proj₂) -open import Level using (Level) -open import Function.Base using (_$_; _∘_; const; id) - -open import Relation.Nullary.Negation.Core - -private - variable - a : Level - A B : Set a - ------------------------------------------------------------------------- --- `Reflects` idiom. - --- The truth value of A is reflected by a boolean value. --- `Reflects A b` is equivalent to `if b then A else ¬ A`. - -data Reflects (A : Set a) : Bool Set a where - ofʸ : ( a : A) Reflects A true - ofⁿ : (¬a : ¬ A) Reflects A false - ------------------------------------------------------------------------- --- Constructors and destructors - --- These lemmas are intended to be used mostly when `b` is a value, so --- that the `if` expressions have already been evaluated away. --- In this case, `of` works like the relevant constructor (`ofⁿ` or --- `ofʸ`), and `invert` strips off the constructor to just give either --- the proof of `A` or the proof of `¬ A`. - -of : {b} if b then A else ¬ A Reflects A b -of {b = false} ¬a = ofⁿ ¬a -of {b = true } a = ofʸ a - -invert : {b} Reflects A b if b then A else ¬ A -invert (ofʸ a) = a -invert (ofⁿ ¬a) = ¬a - ------------------------------------------------------------------------- --- Interaction with negation, product, sums etc. - -infixr 1 _⊎-reflects_ -infixr 2 _×-reflects_ _→-reflects_ - -T-reflects : b Reflects (T b) b -T-reflects true = of _ -T-reflects false = of id - --- If we can decide A, then we can decide its negation. -¬-reflects : {b} Reflects A b Reflects (¬ A) (not b) -¬-reflects (ofʸ a) = ofⁿ (_$ a) -¬-reflects (ofⁿ ¬a) = ofʸ ¬a - --- If we can decide A and Q then we can decide their product -_×-reflects_ : {a b} Reflects A a Reflects B b - Reflects (A × B) (a b) -ofʸ a ×-reflects ofʸ b = ofʸ (a , b) -ofʸ a ×-reflects ofⁿ ¬b = ofⁿ (¬b proj₂) -ofⁿ ¬a ×-reflects _ = ofⁿ (¬a proj₁) - -_⊎-reflects_ : {a b} Reflects A a Reflects B b - Reflects (A B) (a b) -ofʸ a ⊎-reflects _ = ofʸ (inj₁ a) -ofⁿ ¬a ⊎-reflects ofʸ b = ofʸ (inj₂ b) -ofⁿ ¬a ⊎-reflects ofⁿ ¬b = ofⁿ (¬a ¬-⊎ ¬b) - -_→-reflects_ : {a b} Reflects A a Reflects B b - Reflects (A B) (not a b) -ofʸ a →-reflects ofʸ b = ofʸ (const b) -ofʸ a →-reflects ofⁿ ¬b = ofⁿ (¬b (_$ a)) -ofⁿ ¬a →-reflects _ = ofʸ (⊥-elim ¬a) - ------------------------------------------------------------------------- --- Other lemmas - -fromEquivalence : {b} (T b A) (A T b) Reflects A b -fromEquivalence {b = true} sound complete = ofʸ (sound _) -fromEquivalence {b = false} sound complete = ofⁿ complete - --- `Reflects` is deterministic. -det : {b b′} Reflects A b Reflects A b′ b b′ -det (ofʸ a) (ofʸ _) = refl -det (ofʸ a) (ofⁿ ¬a) = contradiction a ¬a -det (ofⁿ ¬a) (ofʸ a) = contradiction a ¬a -det (ofⁿ ¬a) (ofⁿ _) = refl - -T-reflects-elim : {a b} Reflects (T a) b b a -T-reflects-elim {a} r = det r (T-reflects a) +open import Data.Sum.Base using (_⊎_; inj₁; inj₂) +open import Data.Product.Base using (_×_; _,_; proj₁; proj₂) +open import Level using (Level) +open import Function.Base using (_$_; _∘_; const; id) +open import Relation.Nullary.Negation.Core + using (¬_; contradiction-irr; contradiction; _¬-⊎_) +open import Relation.Nullary.Recomputable as Recomputable using (Recomputable) + +private + variable + a : Level + A B : Set a + +------------------------------------------------------------------------ +-- `Reflects` idiom. + +-- The truth value of A is reflected by a boolean value. +-- `Reflects A b` is equivalent to `if b then A else ¬ A`. + +data Reflects (A : Set a) : Bool Set a where + ofʸ : ( a : A) Reflects A true + ofⁿ : (¬a : ¬ A) Reflects A false + +------------------------------------------------------------------------ +-- Constructors and destructors + +-- These lemmas are intended to be used mostly when `b` is a value, so +-- that the `if` expressions have already been evaluated away. +-- In this case, `of` works like the relevant constructor (`ofⁿ` or +-- `ofʸ`), and `invert` strips off the constructor to just give either +-- the proof of `A` or the proof of `¬ A`. + +of : {b} if b then A else ¬ A Reflects A b +of {b = false} ¬a = ofⁿ ¬a +of {b = true } a = ofʸ a + +invert : {b} Reflects A b if b then A else ¬ A +invert (ofʸ a) = a +invert (ofⁿ ¬a) = ¬a + +------------------------------------------------------------------------ +-- recompute + +-- Given an irrelevant proof of a reflected type, a proof can +-- be recomputed and subsequently used in relevant contexts. + +recompute : {b} Reflects A b Recomputable A +recompute (ofʸ a) _ = a +recompute (ofⁿ ¬a) a = contradiction-irr a ¬a + +recompute-constant : {b} (r : Reflects A b) (p q : A) + recompute r p recompute r q +recompute-constant = Recomputable.recompute-constant recompute + +------------------------------------------------------------------------ +-- Interaction with negation, product, sums etc. + +infixr 1 _⊎-reflects_ +infixr 2 _×-reflects_ _→-reflects_ + +T-reflects : b Reflects (T b) b +T-reflects true = of _ +T-reflects false = of id + +-- If we can decide A, then we can decide its negation. +¬-reflects : {b} Reflects A b Reflects (¬ A) (not b) +¬-reflects (ofʸ a) = of (_$ a) +¬-reflects (ofⁿ ¬a) = of ¬a + +-- If we can decide A and Q then we can decide their product +_×-reflects_ : {a b} Reflects A a Reflects B b + Reflects (A × B) (a b) +ofʸ a ×-reflects ofʸ b = of (a , b) +ofʸ a ×-reflects ofⁿ ¬b = of (¬b proj₂) +ofⁿ ¬a ×-reflects _ = of (¬a proj₁) + +_⊎-reflects_ : {a b} Reflects A a Reflects B b + Reflects (A B) (a b) +ofʸ a ⊎-reflects _ = of (inj₁ a) +ofⁿ ¬a ⊎-reflects ofʸ b = of (inj₂ b) +ofⁿ ¬a ⊎-reflects ofⁿ ¬b = of (¬a ¬-⊎ ¬b) + +_→-reflects_ : {a b} Reflects A a Reflects B b + Reflects (A B) (not a b) +ofʸ a →-reflects ofʸ b = of (const b) +ofʸ a →-reflects ofⁿ ¬b = of (¬b (_$ a)) +ofⁿ ¬a →-reflects _ = of a contradiction a ¬a) + +------------------------------------------------------------------------ +-- Other lemmas + +fromEquivalence : {b} (T b A) (A T b) Reflects A b +fromEquivalence {b = true} sound complete = of (sound _) +fromEquivalence {b = false} sound complete = of complete + +-- `Reflects` is deterministic. +det : {b b′} Reflects A b Reflects A b′ b b′ +det (ofʸ a) (ofʸ _) = refl +det (ofʸ a) (ofⁿ ¬a) = contradiction a ¬a +det (ofⁿ ¬a) (ofʸ a) = contradiction a ¬a +det (ofⁿ ¬a) (ofⁿ _) = refl + +T-reflects-elim : {a b} Reflects (T a) b b a +T-reflects-elim {a} r = det r (T-reflects a) \ No newline at end of file diff --git a/master/Relation.Nullary.Universe.html b/master/Relation.Nullary.Universe.html index 1512f44234..8d6d725dc1 100644 --- a/master/Relation.Nullary.Universe.html +++ b/master/Relation.Nullary.Universe.html @@ -56,7 +56,7 @@ setoid (F₁ F₂) P = (setoid F₁ P) ×ₛ (setoid F₂ P) setoid (P₁ F₂) P = ≡-setoid P₁ (Trivial.indexedSetoid (setoid F₂ P)) - setoid (¬¬ F) P = Always.setoid (¬ ¬ F P) _ + setoid (¬¬ F) P = Always.setoid (¬ ¬ F P) _ ⟦_⟧ : {p} PropF p (Set p Set p) F P = Setoid.Carrier (setoid F P) @@ -72,7 +72,7 @@ map (F₁ F₂) f FP = Sum.map (map F₁ f) (map F₂ f) FP map (F₁ F₂) f FP = Product.map (map F₁ f) (map F₂ f) FP map (P₁ F₂) f FP = map F₂ f FP -map (¬¬ F) f FP = ¬¬-map (map F f) FP +map (¬¬ F) f FP = ¬¬-map (map F f) FP map-id : {p} (F : PropF p) {P} F P F map F id id map-id Id x = refl @@ -117,15 +117,15 @@ -- Some lemmas about double negation. private - open module M {a} = RawMonad (¬¬-Monad {a = a}) + open module M {a} = RawMonad (¬¬-Monad {a = a}) ¬¬-pull : {p} (F : PropF p) {P} - F (¬ ¬ P) ¬ ¬ F P + F (¬ ¬ P) ¬ ¬ F P ¬¬-pull = sequence rawApplicative f f lower) f g g x ⊥-elim (f x y g _ y))))) ¬¬-remove : {p} (F : PropF p) {P} - ¬ ¬ F (¬ ¬ P) ¬ ¬ F P -¬¬-remove F = negated-stable ¬¬-pull (¬¬ F) + ¬ ¬ F (¬ ¬ P) ¬ ¬ F P +¬¬-remove F = negated-stable ¬¬-pull (¬¬ F) \ No newline at end of file diff --git a/master/Relation.Nullary.html b/master/Relation.Nullary.html index d596c53f80..3af45d9d30 100644 --- a/master/Relation.Nullary.html +++ b/master/Relation.Nullary.html @@ -24,27 +24,21 @@ ------------------------------------------------------------------------ -- Re-exports -open import Relation.Nullary.Negation.Core public -open import Relation.Nullary.Reflects public -open import Relation.Nullary.Decidable.Core public +open import Relation.Nullary.Recomputable public using (Recomputable) +open import Relation.Nullary.Negation.Core public +open import Relation.Nullary.Reflects public hiding (recompute; recompute-constant) +open import Relation.Nullary.Decidable.Core public ------------------------------------------------------------------------- --- Irrelevant types +------------------------------------------------------------------------ +-- Irrelevant types -Irrelevant : Set p Set p -Irrelevant P = (p₁ p₂ : P) p₁ p₂ +Irrelevant : Set p Set p +Irrelevant P = (p₁ p₂ : P) p₁ p₂ ------------------------------------------------------------------------- --- Recomputability - we can rebuild a relevant proof given an --- irrelevant one. +------------------------------------------------------------------------ +-- Weak decidability +-- `nothing` is 'don't know'/'give up'; `just` is `yes`/`definitely` -Recomputable : Set p Set p -Recomputable P = .P P - ------------------------------------------------------------------------- --- Weak decidability --- `nothing` is 'don't know'/'give up'; `just` is `yes`/`definitely` - -WeaklyDecidable : Set p Set p -WeaklyDecidable = Maybe +WeaklyDecidable : Set p Set p +WeaklyDecidable = Maybe \ No newline at end of file diff --git a/master/Relation.Unary.Algebra.html b/master/Relation.Unary.Algebra.html index 17904e7ba3..9153cb2f3d 100644 --- a/master/Relation.Unary.Algebra.html +++ b/master/Relation.Unary.Algebra.html @@ -20,161 +20,161 @@ open import Data.Unit.Polymorphic using (tt) open import Function.Base using (id; const; _∘_) open import Level -open import Relation.Unary hiding (; U) +open import Relation.Unary hiding (; U) open import Relation.Unary.Polymorphic using (; U) open import Relation.Unary.Relation.Binary.Equality using (≐-isEquivalence) module _ {a : Level} {A : Set a} where - open AlgebraicDefinitions {A = Pred A } _≐_ + open AlgebraicDefinitions {A = Pred A } _≐_ ------------------------------------------------------------------------ -- Properties of _∩_ - ∩-cong : Congruent₂ _∩_ + ∩-cong : Congruent₂ _∩_ ∩-cong (P⊆Q , Q⊆P) (R⊆S , S⊆R) = Product.map P⊆Q R⊆S , Product.map Q⊆P S⊆R - ∩-comm : Commutative _∩_ + ∩-comm : Commutative _∩_ ∩-comm _ _ = Product.swap , Product.swap - ∩-assoc : Associative _∩_ + ∩-assoc : Associative _∩_ ∩-assoc _ _ _ = Product.assocʳ′ , Product.assocˡ′ - ∩-idem : Idempotent _∩_ + ∩-idem : Idempotent _∩_ ∩-idem _ = proj₁ , < id , id > - ∩-identityˡ : LeftIdentity U _∩_ + ∩-identityˡ : LeftIdentity U _∩_ ∩-identityˡ _ = proj₂ , < const tt , id > - ∩-identityʳ : RightIdentity U _∩_ + ∩-identityʳ : RightIdentity U _∩_ ∩-identityʳ _ = proj₁ , < id , const tt > - ∩-identity : Identity U _∩_ + ∩-identity : Identity U _∩_ ∩-identity = ∩-identityˡ , ∩-identityʳ - ∩-zeroˡ : LeftZero _∩_ + ∩-zeroˡ : LeftZero _∩_ ∩-zeroˡ _ = proj₁ , ⊥-elim - ∩-zeroʳ : RightZero _∩_ + ∩-zeroʳ : RightZero _∩_ ∩-zeroʳ _ = proj₂ , ⊥-elim - ∩-zero : Zero _∩_ + ∩-zero : Zero _∩_ ∩-zero = ∩-zeroˡ , ∩-zeroʳ ------------------------------------------------------------------------ -- Properties of _∪_ - ∪-cong : Congruent₂ _∪_ + ∪-cong : Congruent₂ _∪_ ∪-cong (P⊆Q , Q⊆P) (R⊆S , S⊆R) = Sum.map P⊆Q R⊆S , Sum.map Q⊆P S⊆R - ∪-comm : Commutative _∪_ + ∪-comm : Commutative _∪_ ∪-comm _ _ = Sum.swap , Sum.swap - ∪-assoc : Associative _∪_ + ∪-assoc : Associative _∪_ ∪-assoc _ _ _ = Sum.assocʳ , Sum.assocˡ - ∪-idem : Idempotent _∪_ + ∪-idem : Idempotent _∪_ ∪-idem _ = [ id , id ] , inj₁ - ∪-identityˡ : LeftIdentity _∪_ + ∪-identityˡ : LeftIdentity _∪_ ∪-identityˡ _ = [ ⊥-elim , id ] , inj₂ - ∪-identityʳ : RightIdentity _∪_ + ∪-identityʳ : RightIdentity _∪_ ∪-identityʳ _ = [ id , ⊥-elim ] , inj₁ - ∪-identity : Identity _∪_ + ∪-identity : Identity _∪_ ∪-identity = ∪-identityˡ , ∪-identityʳ ------------------------------------------------------------------------ -- Properties of _∩_ and _∪_ - ∩-distribˡ-∪ : _∩_ DistributesOverˡ _∪_ + ∩-distribˡ-∪ : _∩_ DistributesOverˡ _∪_ ∩-distribˡ-∪ _ _ _ = ( uncurry x∈P [ inj₁ (x∈P ,_) , inj₂ (x∈P ,_) ]) , [ Product.map₂ inj₁ , Product.map₂ inj₂ ] ) - ∩-distribʳ-∪ : _∩_ DistributesOverʳ _∪_ + ∩-distribʳ-∪ : _∩_ DistributesOverʳ _∪_ ∩-distribʳ-∪ _ _ _ = ( uncurry [ curry inj₁ , curry inj₂ ] , [ Product.map₁ inj₁ , Product.map₁ inj₂ ] ) - ∩-distrib-∪ : _∩_ DistributesOver _∪_ + ∩-distrib-∪ : _∩_ DistributesOver _∪_ ∩-distrib-∪ = ∩-distribˡ-∪ , ∩-distribʳ-∪ - ∪-distribˡ-∩ : _∪_ DistributesOverˡ _∩_ + ∪-distribˡ-∩ : _∪_ DistributesOverˡ _∩_ ∪-distribˡ-∩ _ _ _ = ( [ < inj₁ , inj₁ > , Product.map inj₂ inj₂ ] , uncurry [ const inj₁ , x∈Q [ inj₁ , inj₂ (x∈Q ,_) ]) ] ) - ∪-distribʳ-∩ : _∪_ DistributesOverʳ _∩_ + ∪-distribʳ-∩ : _∪_ DistributesOverʳ _∩_ ∪-distribʳ-∩ _ _ _ = ( [ Product.map inj₁ inj₁ , < inj₂ , inj₂ > ] , uncurry [ x∈Q [ inj₁ (x∈Q ,_) , inj₂ ]) , const inj₂ ] ) - ∪-distrib-∩ : _∪_ DistributesOver _∩_ + ∪-distrib-∩ : _∪_ DistributesOver _∩_ ∪-distrib-∩ = ∪-distribˡ-∩ , ∪-distribʳ-∩ - ∩-abs-∪ : _∩_ Absorbs _∪_ + ∩-abs-∪ : _∩_ Absorbs _∪_ ∩-abs-∪ _ _ = proj₁ , < id , inj₁ > - ∪-abs-∩ : _∪_ Absorbs _∩_ + ∪-abs-∩ : _∪_ Absorbs _∩_ ∪-abs-∩ _ _ = [ id , proj₁ ] , inj₁ - ∪-∩-absorptive : Absorptive _∪_ _∩_ + ∪-∩-absorptive : Absorptive _∪_ _∩_ ∪-∩-absorptive = ∪-abs-∩ , ∩-abs-∪ - ∩-∪-absorptive : Absorptive _∩_ _∪_ + ∩-∪-absorptive : Absorptive _∩_ _∪_ ∩-∪-absorptive = ∩-abs-∪ , ∪-abs-∩ module _ {a : Level} (A : Set a) ( : Level) where - open AlgebraicStructures {A = Pred A } _≐_ - open AlgebraicLatticeStructures {A = Pred A } _≐_ + open AlgebraicStructures {A = Pred A } _≐_ + open AlgebraicLatticeStructures {A = Pred A } _≐_ ------------------------------------------------------------------------ -- Algebraic structures of _∩_ - ∩-isMagma : IsMagma _∩_ + ∩-isMagma : IsMagma _∩_ ∩-isMagma = record { isEquivalence = ≐-isEquivalence ; ∙-cong = ∩-cong } - ∩-isSemigroup : IsSemigroup _∩_ + ∩-isSemigroup : IsSemigroup _∩_ ∩-isSemigroup = record { isMagma = ∩-isMagma ; assoc = ∩-assoc } - ∩-isBand : IsBand _∩_ + ∩-isBand : IsBand _∩_ ∩-isBand = record { isSemigroup = ∩-isSemigroup ; idem = ∩-idem } - ∩-isSemilattice : IsSemilattice _∩_ + ∩-isSemilattice : IsSemilattice _∩_ ∩-isSemilattice = record { isBand = ∩-isBand ; comm = ∩-comm } - ∩-isMonoid : IsMonoid _∩_ U + ∩-isMonoid : IsMonoid _∩_ U ∩-isMonoid = record { isSemigroup = ∩-isSemigroup ; identity = ∩-identity } - ∩-isCommutativeMonoid : IsCommutativeMonoid _∩_ U + ∩-isCommutativeMonoid : IsCommutativeMonoid _∩_ U ∩-isCommutativeMonoid = record { isMonoid = ∩-isMonoid ; comm = ∩-comm } - ∩-isIdempotentCommutativeMonoid : IsIdempotentCommutativeMonoid _∩_ U + ∩-isIdempotentCommutativeMonoid : IsIdempotentCommutativeMonoid _∩_ U ∩-isIdempotentCommutativeMonoid = record { isCommutativeMonoid = ∩-isCommutativeMonoid ; idem = ∩-idem @@ -183,43 +183,43 @@ ------------------------------------------------------------------------ -- Algebraic structures of _∪_ - ∪-isMagma : IsMagma _∪_ + ∪-isMagma : IsMagma _∪_ ∪-isMagma = record { isEquivalence = ≐-isEquivalence ; ∙-cong = ∪-cong } - ∪-isSemigroup : IsSemigroup _∪_ + ∪-isSemigroup : IsSemigroup _∪_ ∪-isSemigroup = record { isMagma = ∪-isMagma ; assoc = ∪-assoc } - ∪-isBand : IsBand _∪_ + ∪-isBand : IsBand _∪_ ∪-isBand = record { isSemigroup = ∪-isSemigroup ; idem = ∪-idem } - ∪-isSemilattice : IsSemilattice _∪_ + ∪-isSemilattice : IsSemilattice _∪_ ∪-isSemilattice = record { isBand = ∪-isBand ; comm = ∪-comm } - ∪-isMonoid : IsMonoid _∪_ + ∪-isMonoid : IsMonoid _∪_ ∪-isMonoid = record { isSemigroup = ∪-isSemigroup ; identity = ∪-identity } - ∪-isCommutativeMonoid : IsCommutativeMonoid _∪_ + ∪-isCommutativeMonoid : IsCommutativeMonoid _∪_ ∪-isCommutativeMonoid = record { isMonoid = ∪-isMonoid ; comm = ∪-comm } - ∪-isIdempotentCommutativeMonoid : IsIdempotentCommutativeMonoid _∪_ + ∪-isIdempotentCommutativeMonoid : IsIdempotentCommutativeMonoid _∪_ ∪-isIdempotentCommutativeMonoid = record { isCommutativeMonoid = ∪-isCommutativeMonoid ; idem = ∪-idem @@ -228,7 +228,7 @@ ------------------------------------------------------------------------ -- Algebraic structures of _∩_ and _∪_ - ∪-∩-isSemiringWithoutAnnihilatingZero : IsSemiringWithoutAnnihilatingZero _∪_ _∩_ U + ∪-∩-isSemiringWithoutAnnihilatingZero : IsSemiringWithoutAnnihilatingZero _∪_ _∩_ U ∪-∩-isSemiringWithoutAnnihilatingZero = record { +-isCommutativeMonoid = ∪-isCommutativeMonoid ; *-cong = ∩-cong @@ -237,19 +237,19 @@ ; distrib = ∩-distrib-∪ } - ∪-∩-isSemiring : IsSemiring _∪_ _∩_ U + ∪-∩-isSemiring : IsSemiring _∪_ _∩_ U ∪-∩-isSemiring = record { isSemiringWithoutAnnihilatingZero = ∪-∩-isSemiringWithoutAnnihilatingZero ; zero = ∩-zero } - ∪-∩-isCommutativeSemiring : IsCommutativeSemiring _∪_ _∩_ U + ∪-∩-isCommutativeSemiring : IsCommutativeSemiring _∪_ _∩_ U ∪-∩-isCommutativeSemiring = record { isSemiring = ∪-∩-isSemiring ; *-comm = ∩-comm } - ∪-∩-isLattice : IsLattice _∪_ _∩_ + ∪-∩-isLattice : IsLattice _∪_ _∩_ ∪-∩-isLattice = record { isEquivalence = ≐-isEquivalence ; ∨-comm = ∪-comm @@ -261,14 +261,14 @@ ; absorptive = ∪-∩-absorptive } - ∪-∩-isDistributiveLattice : IsDistributiveLattice _∪_ _∩_ + ∪-∩-isDistributiveLattice : IsDistributiveLattice _∪_ _∩_ ∪-∩-isDistributiveLattice = record { isLattice = ∪-∩-isLattice ; ∨-distrib-∧ = ∪-distrib-∩ ; ∧-distrib-∨ = ∩-distrib-∪ } - ∩-∪-isSemiringWithoutAnnihilatingZero : IsSemiringWithoutAnnihilatingZero _∩_ _∪_ U + ∩-∪-isSemiringWithoutAnnihilatingZero : IsSemiringWithoutAnnihilatingZero _∩_ _∪_ U ∩-∪-isSemiringWithoutAnnihilatingZero = record { +-isCommutativeMonoid = ∩-isCommutativeMonoid ; *-cong = ∪-cong diff --git a/master/Relation.Unary.Closure.Base.html b/master/Relation.Unary.Closure.Base.html index a635ab0d04..a04683c44a 100644 --- a/master/Relation.Unary.Closure.Base.html +++ b/master/Relation.Unary.Closure.Base.html @@ -8,14 +8,14 @@ {-# OPTIONS --cubical-compatible --safe #-} open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Transitive; Reflexive) +open import Relation.Binary.Definitions using (Transitive; Reflexive) module Relation.Unary.Closure.Base {a b} {A : Set a} (R : Rel A b) where open import Level open import Data.Product.Base using (Σ-syntax; _×_; _,_; -,_) open import Function.Base using (flip) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) ------------------------------------------------------------------------ -- Definitions @@ -26,7 +26,7 @@ -- box modality in modal logic. `□ T x` states that all the elements one -- step away from `x` with respect to the relation R satisfy `T`. - : {t} Pred A t Pred A (a b t) + : {t} Pred A t Pred A (a b t) T x = {y} R x y T y -- Use cases of □ include: @@ -47,7 +47,7 @@ -- metaphor breaks down here: this only is a closure operator if the -- step we take is *backwards* with respect to R. - : {t} Pred A t Pred A (a b t) + : {t} Pred A t Pred A (a b t) T x = Σ[ support A ] (R support x × T support) -- Use cases of ◇ include: @@ -64,14 +64,14 @@ -- Whenever we have a value in one context, we can get one in any -- related context. -record Closed {t} (T : Pred A t) : Set (a b t) where +record Closed {t} (T : Pred A t) : Set (a b t) where field next : {x} T x T x ------------------------------------------------------------------------ -- Basic functions relating □ and ◇ -module _ {t p} {T : Pred A t} {P : Pred A p} where +module _ {t p} {T : Pred A t} {P : Pred A p} where curry : (∀ {x} T x P x) (∀ {x} T x P x) curry f tx x∼y = f (-, x∼y , tx) @@ -82,44 +82,44 @@ ------------------------------------------------------------------------ -- Properties -module {t} {T : Pred A t} where +module {t} {T : Pred A t} where - reindex : Transitive R {x y} R x y T x T y + reindex : Transitive R {x y} R x y T x T y reindex trans x∼y □Tx y∼z = □Tx (trans x∼y y∼z) -- Provided that R is reflexive and Transitive, □ is a comonad - map : {u} {U : Pred A u} {x} (∀ {x} T x U x) T x U x + map : {u} {U : Pred A u} {x} (∀ {x} T x U x) T x U x map f □Tx x~y = f (□Tx x~y) - extract : Reflexive R {x} T x T x + extract : Reflexive R {x} T x T x extract refl □Tx = □Tx refl - duplicate : Transitive R {x} T x ( T) x + duplicate : Transitive R {x} T x ( T) x duplicate trans □Tx x∼y y∼z = □Tx (trans x∼y y∼z) -- Provided that R is transitive, □ is a closure operator -- i.e. for any `T`, `□ T` is closed. - closed : Transitive R Closed ( T) + closed : Transitive R Closed ( T) closed trans = record { next = duplicate trans } -module {t} {T : Pred A t} where +module {t} {T : Pred A t} where - reindex : Transitive R {x y} R x y T x T y + reindex : Transitive R {x y} R x y T x T y reindex trans x∼y (z , z∼x , tz) = z , trans z∼x x∼y , tz -- Provided that R is reflexive and Transitive, ◇ is a monad - map : {u} {U : Pred A u} {x} (∀ {x} T x U x) T x U x + map : {u} {U : Pred A u} {x} (∀ {x} T x U x) T x U x map f (y , y∼x , ty) = y , y∼x , f ty - pure : Reflexive R {x} T x T x + pure : Reflexive R {x} T x T x pure refl tx = -, refl , tx - join : Transitive R {x} ( T) x T x + join : Transitive R {x} ( T) x T x join trans (_ , y∼x , _ , z∼y , tz) = _ , trans z∼y y∼x , tz -- Provided that R is transitive, ◇ is a closure operator -- i.e. for any `T`, `◇ T` is closed. - closed : Transitive R Closed ( T) + closed : Transitive R Closed ( T) closed trans = record { next = λ ◇Tx x∼y reindex trans x∼y ◇Tx } run : Closed T {x} T x T x diff --git a/master/Relation.Unary.Closure.Preorder.html b/master/Relation.Unary.Closure.Preorder.html index ddda46b504..52c9a01526 100644 --- a/master/Relation.Unary.Closure.Preorder.html +++ b/master/Relation.Unary.Closure.Preorder.html @@ -12,7 +12,7 @@ module Relation.Unary.Closure.Preorder {a r e} (P : Preorder a e r) where open Preorder P -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) -- Specialising the results proven generically in `Base`. import Relation.Unary.Closure.Base _∼_ as Base @@ -20,7 +20,7 @@ using (; ; Closed; curry; uncurry) hiding (module ; module ) -module {t} {T : Pred Carrier t} where +module {t} {T : Pred Carrier t} where reindex : {x y} x y T x T y reindex = Base.□.reindex trans @@ -31,12 +31,12 @@ duplicate : {x} T x ( T) x duplicate = Base.□.duplicate trans - closed : {t} {T : Pred Carrier t} Closed ( T) + closed : {t} {T : Pred Carrier t} Closed ( T) closed = Base.□.closed trans open Base.□ public using (map) -module {t} {T : Pred Carrier t} where +module {t} {T : Pred Carrier t} where reindex : {x y} x y T x T y reindex = Base.◇.reindex trans diff --git a/master/Relation.Unary.Closure.StrictPartialOrder.html b/master/Relation.Unary.Closure.StrictPartialOrder.html index d2dfdc235a..910ffb98d3 100644 --- a/master/Relation.Unary.Closure.StrictPartialOrder.html +++ b/master/Relation.Unary.Closure.StrictPartialOrder.html @@ -13,7 +13,7 @@ {a r e} (P : StrictPartialOrder a e r) where open StrictPartialOrder P renaming (_<_ to _∼_) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) -- Specialising the results proven generically in `Base`. import Relation.Unary.Closure.Base _∼_ as Base @@ -21,7 +21,7 @@ using (; ; Closed; curry; uncurry) hiding (module ; module ) -module {t} {T : Pred Carrier t} where +module {t} {T : Pred Carrier t} where reindex : {x y} x y T x T y reindex = Base.□.reindex trans @@ -29,12 +29,12 @@ duplicate : {x} T x ( T) x duplicate = Base.□.duplicate trans - closed : {t} {T : Pred Carrier t} Closed ( T) + closed : {t} {T : Pred Carrier t} Closed ( T) closed = Base.□.closed trans open Base.□ public using (map) -module {t} {T : Pred Carrier t} where +module {t} {T : Pred Carrier t} where reindex : {x y} x y T x T y reindex = Base.◇.reindex trans diff --git a/master/Relation.Unary.Consequences.html b/master/Relation.Unary.Consequences.html index 7101e116d1..2ce6ad5c8e 100644 --- a/master/Relation.Unary.Consequences.html +++ b/master/Relation.Unary.Consequences.html @@ -10,10 +10,10 @@ module Relation.Unary.Consequences where open import Relation.Unary -open import Relation.Nullary using (recompute) +open import Relation.Nullary using (recompute) -dec⇒recomputable : {a : _} {A : Set a} {P : Pred A } Decidable P Recomputable P -dec⇒recomputable P-dec = recompute (P-dec _) +dec⇒recomputable : {a : _} {A : Set a} {P : Pred A } Decidable P Recomputable P +dec⇒recomputable P-dec = recompute (P-dec _) ------------------------------------------------------------------------ -- DEPRECATED NAMES diff --git a/master/Relation.Unary.Indexed.html b/master/Relation.Unary.Indexed.html index 04f66349f4..8db9a660e4 100644 --- a/master/Relation.Unary.Indexed.html +++ b/master/Relation.Unary.Indexed.html @@ -11,7 +11,7 @@ open import Data.Product.Base using (; _×_) open import Level -open import Relation.Nullary.Negation using (¬_) +open import Relation.Nullary.Negation using (¬_) IPred : {i a} {I : Set i} (I Set a) ( : Level) Set _ IPred A = {i} A i Set @@ -24,5 +24,5 @@ x P = i P (x i) _∉_ : {} (∀ i A i) IPred A Set _ - t P = ¬ (t P) + t P = ¬ (t P) \ No newline at end of file diff --git a/master/Relation.Unary.Polymorphic.Properties.html b/master/Relation.Unary.Polymorphic.Properties.html index a97f525076..bd01837ffb 100644 --- a/master/Relation.Unary.Polymorphic.Properties.html +++ b/master/Relation.Unary.Polymorphic.Properties.html @@ -11,9 +11,9 @@ module Relation.Unary.Polymorphic.Properties where open import Level using (Level) -open import Relation.Binary.Definitions hiding (Decidable; Universal; Empty) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Unary hiding (; U) +open import Relation.Binary.Definitions hiding (Decidable; Universal; Empty) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Unary hiding (; U) open import Relation.Unary.Polymorphic open import Data.Unit.Polymorphic.Base using (tt) @@ -25,51 +25,51 @@ ------------------------------------------------------------------------ -- The empty set -∅? : Decidable {A = A} {} -∅? _ = no λ() +∅? : Decidable {A = A} {} +∅? _ = no λ() -∅-Empty : Empty {A = A} {} +∅-Empty : Empty {A = A} {} ∅-Empty _ () -∁∅-Universal : Universal {A = A} {} ( ) +∁∅-Universal : Universal {A = A} {} ( ) ∁∅-Universal _ () ------------------------------------------------------------------------ -- The universe -U? : Decidable {A = A} {} U -U? _ = yes tt +U? : Decidable {A = A} {} U +U? _ = yes tt -U-Universal : Universal {A = A} {} U +U-Universal : Universal {A = A} {} U U-Universal _ = _ -∁U-Empty : Empty {A = A} {} ( U) +∁U-Empty : Empty {A = A} {} ( U) ∁U-Empty _ x∈∁U = x∈∁U _ ------------------------------------------------------------------------ -- Subset properties -∅-⊆ : (P : Pred A ℓ₁) { = ℓ₂} P +∅-⊆ : (P : Pred A ℓ₁) { = ℓ₂} P ∅-⊆ _ () -⊆-U : (P : Pred A ℓ₁) P U { = ℓ₂} +⊆-U : (P : Pred A ℓ₁) P U { = ℓ₂} ⊆-U _ _ = _ -⊆-min : Min {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆_ +⊆-min : Min {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆_ ⊆-min = ∅-⊆ -⊆-max : Max {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆_ U +⊆-max : Max {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆_ U ⊆-max = ⊆-U -∅-⊆′ : (P : Pred A ℓ₁) { = ℓ₂} ⊆′ P +∅-⊆′ : (P : Pred A ℓ₁) { = ℓ₂} ⊆′ P ∅-⊆′ _ _ = λ () -⊆′-U : (P : Pred A ℓ₁) P ⊆′ U { = ℓ₂} +⊆′-U : (P : Pred A ℓ₁) P ⊆′ U { = ℓ₂} ⊆′-U _ _ _ = _ -⊆′-min : Min {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆′_ +⊆′-min : Min {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆′_ ⊆′-min = ∅-⊆′ -⊆′-max : Max {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆′_ U +⊆′-max : Max {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆′_ U ⊆′-max = ⊆′-U \ No newline at end of file diff --git a/master/Relation.Unary.Polymorphic.html b/master/Relation.Unary.Polymorphic.html index 36e39a2a40..c07c41e6e6 100644 --- a/master/Relation.Unary.Polymorphic.html +++ b/master/Relation.Unary.Polymorphic.html @@ -12,7 +12,7 @@ open import Data.Empty.Polymorphic using () open import Data.Unit.Polymorphic using () open import Level using (Level) -open import Relation.Unary using (Pred) +open import Relation.Unary using (Pred) private variable @@ -24,11 +24,11 @@ -- The empty set. - : Pred A + : Pred A = λ _ -- The universal set. -U : Pred A +U : Pred A U = λ _ \ No newline at end of file diff --git a/master/Relation.Unary.PredicateTransformer.html b/master/Relation.Unary.PredicateTransformer.html index e70a38dc79..eb89cd94e8 100644 --- a/master/Relation.Unary.PredicateTransformer.html +++ b/master/Relation.Unary.PredicateTransformer.html @@ -27,7 +27,7 @@ -- Heterogeneous and homogeneous predicate transformers PT : Set a Set b (ℓ₁ ℓ₂ : Level) Set _ -PT A B ℓ₁ ℓ₂ = Pred A ℓ₁ Pred B ℓ₂ +PT A B ℓ₁ ℓ₂ = Pred A ℓ₁ Pred B ℓ₂ Pt : Set a ( : Level) Set _ Pt A = PT A A @@ -49,27 +49,27 @@ -- The bottom and the top of the predicate transformer lattice. abort : PT A B 0ℓ 0ℓ -abort = λ _ +abort = λ _ magic : PT A B 0ℓ 0ℓ -magic = λ _ U +magic = λ _ U -- Negation. infix 8 ∼_ ∼_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ - T = T + T = T -- Refinement. infix 4 _⊑_ _⊒_ _⊑′_ _⊒′_ _⊑_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ Set _ -S T = {X} S X T X +S T = {X} S X T X _⊑′_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ Set _ -S ⊑′ T = X S X T X +S ⊑′ T = X S X T X _⊒_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ Set _ T S = T S @@ -82,48 +82,48 @@ infix 4 _⋢_ _⋢_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ Set _ -S T = λ X S X T X +S T = λ X S X T X -- Union. infixl 6 _⊓_ _⊓_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ -S T = λ X S X T X +S T = λ X S X T X -- Intersection. infixl 7 _⊔_ _⊔_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ -S T = λ X S X T X +S T = λ X S X T X -- Implication. infixl 8 _⇛_ _⇛_ : PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ PT A B ℓ₁ ℓ₂ -S T = λ X S X T X +S T = λ X S X T X -- Infinitary union and intersection. infix 9 : (I : Set i) (I PT A B ℓ₁ ℓ₂) PT A B ℓ₁ _ - I T = λ X ⋃[ i I ] T i X + I T = λ X ⋃[ i I ] T i X syntax I i T) = ⨆[ i I ] T : (I : Set i) (I PT A B ℓ₁ ℓ₂) PT A B ℓ₁ _ - I T = λ X ⋂[ i I ] T i X + I T = λ X ⋂[ i I ] T i X syntax I i T) = ⨅[ i I ] T -- Angelic and demonic update. ⟨_⟩ : REL A B PT B A _ - R P = λ x R x P + R P = λ x R x P [_] : REL A B PT B A _ -[ R ] P = λ x R x P +[ R ] P = λ x R x P \ No newline at end of file diff --git a/master/Relation.Unary.Properties.html b/master/Relation.Unary.Properties.html index 461d6db6f0..ef16bc9737 100644 --- a/master/Relation.Unary.Properties.html +++ b/master/Relation.Unary.Properties.html @@ -15,10 +15,10 @@ open import Level using (Level) open import Relation.Binary.Core as Binary open import Relation.Binary.Definitions - hiding (Decidable; Universal; Irrelevant; Empty) + hiding (Decidable; Universal; Irrelevant; Empty) open import Relation.Binary.PropositionalEquality.Core using (refl) open import Relation.Unary -open import Relation.Nullary.Decidable using (yes; no; _⊎-dec_; _×-dec_; ¬?) +open import Relation.Nullary.Decidable using (yes; no; _⊎-dec_; _×-dec_; ¬?) open import Function.Base using (id; _$_; _∘_) private @@ -30,179 +30,179 @@ ------------------------------------------------------------------------ -- The empty set -∅? : Decidable {A = A} -∅? _ = no λ() +∅? : Decidable {A = A} +∅? _ = no λ() -∅-Empty : Empty {A = A} +∅-Empty : Empty {A = A} ∅-Empty x () -∁∅-Universal : Universal {A = A} ( ) +∁∅-Universal : Universal {A = A} ( ) ∁∅-Universal = λ x x∈∅ x∈∅ ------------------------------------------------------------------------ -- The universe -U? : Decidable {A = A} U -U? _ = yes tt +U? : Decidable {A = A} U +U? _ = yes tt -U-Universal : Universal {A = A} U +U-Universal : Universal {A = A} U U-Universal = λ _ _ -∁U-Empty : Empty {A = A} ( U) +∁U-Empty : Empty {A = A} ( U) ∁U-Empty = λ x x∈∁U x∈∁U _ ------------------------------------------------------------------------ -- Subset properties -∅-⊆ : (P : Pred A ) P +∅-⊆ : (P : Pred A ) P ∅-⊆ P () -⊆-U : (P : Pred A ) P U +⊆-U : (P : Pred A ) P U ⊆-U P _ = _ -⊆-refl : Reflexive {A = Pred A } _⊆_ +⊆-refl : Reflexive {A = Pred A } _⊆_ ⊆-refl x∈P = x∈P -⊆-reflexive : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _⊆_ +⊆-reflexive : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _⊆_ ⊆-reflexive (P⊆Q , Q⊆P) = P⊆Q -⊆-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆_ _⊆_ _⊆_ +⊆-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆_ _⊆_ _⊆_ ⊆-trans P⊆Q Q⊆R x∈P = Q⊆R (P⊆Q x∈P) -⊆-antisym : Antisymmetric {A = Pred A } _≐_ _⊆_ +⊆-antisym : Antisymmetric {A = Pred A } _≐_ _⊆_ ⊆-antisym = _,_ -⊆-min : Min {B = Pred A } _⊆_ +⊆-min : Min {B = Pred A } _⊆_ ⊆-min = ∅-⊆ -⊆-max : Max {A = Pred A } _⊆_ U +⊆-max : Max {A = Pred A } _⊆_ U ⊆-max = ⊆-U -⊂⇒⊆ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _⊆_ +⊂⇒⊆ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _⊆_ ⊂⇒⊆ = proj₁ -⊂-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂_ _⊂_ _⊂_ +⊂-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂_ _⊂_ _⊂_ ⊂-trans (P⊆Q , Q⊈P) (Q⊆R , R⊈Q) = x∈P Q⊆R (P⊆Q x∈P)) , R⊆P R⊈Q x∈R P⊆Q (R⊆P x∈R))) -⊂-⊆-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂_ _⊆_ _⊂_ +⊂-⊆-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂_ _⊆_ _⊂_ ⊂-⊆-trans (P⊆Q , Q⊈P) Q⊆R = x∈P Q⊆R (P⊆Q x∈P)) , R⊆P Q⊈P x∈Q R⊆P (Q⊆R x∈Q))) -⊆-⊂-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆_ _⊂_ _⊂_ +⊆-⊂-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆_ _⊂_ _⊂_ ⊆-⊂-trans P⊆Q (Q⊆R , R⊈Q) = x∈P Q⊆R (P⊆Q x∈P)) , R⊆P R⊈Q R⊆Q P⊆Q (R⊆P R⊆Q))) -⊂-respʳ-≐ : _Respectsʳ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _≐_ +⊂-respʳ-≐ : _Respectsʳ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _≐_ ⊂-respʳ-≐ (Q⊆R , _) P⊂Q = ⊂-⊆-trans P⊂Q Q⊆R -⊂-respˡ-≐ : _Respectsˡ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _≐_ +⊂-respˡ-≐ : _Respectsˡ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _≐_ ⊂-respˡ-≐ (_ , R⊆Q) P⊂Q = ⊆-⊂-trans R⊆Q P⊂Q -⊂-resp-≐ : _Respects₂_ {A = Pred A } _⊂_ _≐_ +⊂-resp-≐ : _Respects₂_ {A = Pred A } _⊂_ _≐_ ⊂-resp-≐ = ⊂-respʳ-≐ , ⊂-respˡ-≐ -⊂-irrefl : Irreflexive {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _⊂_ +⊂-irrefl : Irreflexive {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _⊂_ ⊂-irrefl (_ , Q⊆P) (_ , Q⊈P) = Q⊈P Q⊆P -⊂-antisym : Antisymmetric {A = Pred A } _≐_ _⊂_ +⊂-antisym : Antisymmetric {A = Pred A } _≐_ _⊂_ ⊂-antisym (P⊆Q , _) (Q⊆P , _) = ⊆-antisym P⊆Q Q⊆P -⊂-asym : Asymmetric {A = Pred A } _⊂_ +⊂-asym : Asymmetric {A = Pred A } _⊂_ ⊂-asym (_ , Q⊈P) = Q⊈P proj₁ -∅-⊆′ : (P : Pred A ) ⊆′ P +∅-⊆′ : (P : Pred A ) ⊆′ P ∅-⊆′ _ _ = λ () -⊆′-U : (P : Pred A ) P ⊆′ U +⊆′-U : (P : Pred A ) P ⊆′ U ⊆′-U _ _ _ = _ -⊆′-refl : Reflexive {A = Pred A } _⊆′_ +⊆′-refl : Reflexive {A = Pred A } _⊆′_ ⊆′-refl x x∈P = x∈P -⊆′-reflexive : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _⊆′_ +⊆′-reflexive : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _⊆′_ ⊆′-reflexive (P⊆Q , Q⊆P) = P⊆Q -⊆′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆′_ _⊆′_ _⊆′_ +⊆′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆′_ _⊆′_ _⊆′_ ⊆′-trans P⊆Q Q⊆R x x∈P = Q⊆R x (P⊆Q x x∈P) -⊆′-antisym : Antisymmetric {A = Pred A } _≐′_ _⊆′_ +⊆′-antisym : Antisymmetric {A = Pred A } _≐′_ _⊆′_ ⊆′-antisym = _,_ -⊆′-min : Min {B = Pred A } _⊆′_ +⊆′-min : Min {B = Pred A } _⊆′_ ⊆′-min = ∅-⊆′ -⊆′-max : Max {A = Pred A } _⊆′_ U +⊆′-max : Max {A = Pred A } _⊆′_ U ⊆′-max = ⊆′-U -⊂′⇒⊆′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _⊆′_ +⊂′⇒⊆′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _⊆′_ ⊂′⇒⊆′ = proj₁ -⊂′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂′_ _⊂′_ _⊂′_ +⊂′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂′_ _⊂′_ _⊂′_ ⊂′-trans (P⊆Q , Q⊈P) (Q⊆R , R⊈Q) = ⊆′-trans P⊆Q Q⊆R , λ R⊆P R⊈Q (⊆′-trans R⊆P P⊆Q) -⊂′-⊆′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂′_ _⊆′_ _⊂′_ +⊂′-⊆′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊂′_ _⊆′_ _⊂′_ ⊂′-⊆′-trans (P⊆Q , Q⊈P) Q⊆R = ⊆′-trans P⊆Q Q⊆R , λ R⊆P Q⊈P (⊆′-trans Q⊆R R⊆P) -⊆′-⊂′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆′_ _⊂′_ _⊂′_ +⊆′-⊂′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _⊆′_ _⊂′_ _⊂′_ ⊆′-⊂′-trans P⊆Q (Q⊆R , R⊈Q) = ⊆′-trans P⊆Q Q⊆R , λ R⊆P R⊈Q (⊆′-trans R⊆P P⊆Q) -⊂′-respʳ-≐′ : _Respectsʳ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _≐′_ +⊂′-respʳ-≐′ : _Respectsʳ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _≐′_ ⊂′-respʳ-≐′ (Q⊆R , _) P⊂Q = ⊂′-⊆′-trans P⊂Q Q⊆R -⊂′-respˡ-≐′ : _Respectsˡ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _≐′_ +⊂′-respˡ-≐′ : _Respectsˡ_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _≐′_ ⊂′-respˡ-≐′ (_ , R⊆Q) P⊂Q = ⊆′-⊂′-trans R⊆Q P⊂Q -⊂′-resp-≐′ : _Respects₂_ {A = Pred A ℓ₁} _⊂′_ _≐′_ +⊂′-resp-≐′ : _Respects₂_ {A = Pred A ℓ₁} _⊂′_ _≐′_ ⊂′-resp-≐′ = ⊂′-respʳ-≐′ , ⊂′-respˡ-≐′ -⊂′-irrefl : Irreflexive {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _⊂′_ +⊂′-irrefl : Irreflexive {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _⊂′_ ⊂′-irrefl (_ , Q⊆P) (_ , Q⊈P) = Q⊈P Q⊆P -⊂′-antisym : Antisymmetric {A = Pred A } _≐′_ _⊂′_ +⊂′-antisym : Antisymmetric {A = Pred A } _≐′_ _⊂′_ ⊂′-antisym (P⊆Q , _) (Q⊆P , _) = ⊆′-antisym P⊆Q Q⊆P -⊆⇒⊆′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆_ _⊆′_ +⊆⇒⊆′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆_ _⊆′_ ⊆⇒⊆′ P⊆Q _ x∈P = P⊆Q x∈P -⊆′⇒⊆ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆′_ _⊆_ +⊆′⇒⊆ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊆′_ _⊆_ ⊆′⇒⊆ P⊆Q x∈P = P⊆Q _ x∈P -⊂⇒⊂′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _⊂′_ +⊂⇒⊂′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂_ _⊂′_ ⊂⇒⊂′ = Product.map ⊆⇒⊆′ (_∘ ⊆′⇒⊆) -⊂′⇒⊂ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _⊂_ +⊂′⇒⊂ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _⊂′_ _⊂_ ⊂′⇒⊂ = Product.map ⊆′⇒⊆ (_∘ ⊆⇒⊆′) ------------------------------------------------------------------------ -- Equality properties -≐-refl : Reflexive {A = Pred A } _≐_ +≐-refl : Reflexive {A = Pred A } _≐_ ≐-refl = id , id -≐-sym : Sym {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _≐_ +≐-sym : Sym {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _≐_ ≐-sym = swap -≐-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _≐_ _≐_ _≐_ +≐-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _≐_ _≐_ _≐_ ≐-trans = zip′ P⊆Q Q⊆R x∈P Q⊆R (P⊆Q x∈P)) Q⊆P R⊆Q x∈R Q⊆P (R⊆Q x∈R)) -≐′-refl : Reflexive {A = Pred A } _≐′_ +≐′-refl : Reflexive {A = Pred A } _≐′_ ≐′-refl = _ id) , _ id) -≐′-sym : Sym {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _≐′_ +≐′-sym : Sym {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _≐′_ ≐′-sym = swap -≐′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _≐′_ _≐′_ _≐′_ +≐′-trans : Trans {A = Pred A ℓ₁} {B = Pred A ℓ₂} {C = Pred A ℓ₃} _≐′_ _≐′_ _≐′_ ≐′-trans = zip′ P⊆Q Q⊆R x x∈P Q⊆R x (P⊆Q x x∈P)) λ Q⊆P R⊆Q x x∈R Q⊆P x (R⊆Q x x∈R) -≐⇒≐′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _≐′_ +≐⇒≐′ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐_ _≐′_ ≐⇒≐′ = Product.map ⊆⇒⊆′ ⊆⇒⊆′ -≐′⇒≐ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _≐_ +≐′⇒≐ : Binary._⇒_ {A = Pred A ℓ₁} {B = Pred A ℓ₂} _≐′_ _≐_ ≐′⇒≐ = Product.map ⊆′⇒⊆ ⊆′⇒⊆ ------------------------------------------------------------------------ -- Decidability properties -∁? : {P : Pred A } Decidable P Decidable ( P) -∁? P? x = ¬? (P? x) +∁? : {P : Pred A } Decidable P Decidable ( P) +∁? P? x = ¬? (P? x) infix 2 _×?_ _⊙?_ infix 10 _~? @@ -210,36 +210,36 @@ infixr 7 _∩?_ infixr 6 _∪?_ -_∪?_ : {P : Pred A ℓ₁} {Q : Pred A ℓ₂} - Decidable P Decidable Q Decidable (P Q) -_∪?_ P? Q? x = (P? x) ⊎-dec (Q? x) +_∪?_ : {P : Pred A ℓ₁} {Q : Pred A ℓ₂} + Decidable P Decidable Q Decidable (P Q) +_∪?_ P? Q? x = (P? x) ⊎-dec (Q? x) -_∩?_ : {P : Pred A ℓ₁} {Q : Pred A ℓ₂} - Decidable P Decidable Q Decidable (P Q) -_∩?_ P? Q? x = (P? x) ×-dec (Q? x) +_∩?_ : {P : Pred A ℓ₁} {Q : Pred A ℓ₂} + Decidable P Decidable Q Decidable (P Q) +_∩?_ P? Q? x = (P? x) ×-dec (Q? x) -_×?_ : {P : Pred A ℓ₁} {Q : Pred B ℓ₂} - Decidable P Decidable Q Decidable (P ⟨×⟩ Q) -_×?_ P? Q? (a , b) = (P? a) ×-dec (Q? b) +_×?_ : {P : Pred A ℓ₁} {Q : Pred B ℓ₂} + Decidable P Decidable Q Decidable (P ⟨×⟩ Q) +_×?_ P? Q? (a , b) = (P? a) ×-dec (Q? b) -_⊙?_ : {P : Pred A ℓ₁} {Q : Pred B ℓ₂} - Decidable P Decidable Q Decidable (P ⟨⊙⟩ Q) -_⊙?_ P? Q? (a , b) = (P? a) ⊎-dec (Q? b) +_⊙?_ : {P : Pred A ℓ₁} {Q : Pred B ℓ₂} + Decidable P Decidable Q Decidable (P ⟨⊙⟩ Q) +_⊙?_ P? Q? (a , b) = (P? a) ⊎-dec (Q? b) -_⊎?_ : {P : Pred A } {Q : Pred B } - Decidable P Decidable Q Decidable (P ⟨⊎⟩ Q) +_⊎?_ : {P : Pred A } {Q : Pred B } + Decidable P Decidable Q Decidable (P ⟨⊎⟩ Q) _⊎?_ P? Q? (inj₁ a) = P? a _⊎?_ P? Q? (inj₂ b) = Q? b -_~? : {P : Pred (A × B) } Decidable P Decidable (P ~) +_~? : {P : Pred (A × B) } Decidable P Decidable (P ~) _~? P? = P? swap ------------------------------------------------------------------------ -- Irrelevant properties -U-irrelevant : Irrelevant {A = A} U +U-irrelevant : Irrelevant {A = A} U U-irrelevant a b = refl -∁-irrelevant : (P : Pred A ) Irrelevant ( P) +∁-irrelevant : (P : Pred A ) Irrelevant ( P) ∁-irrelevant P a b = refl \ No newline at end of file diff --git a/master/Relation.Unary.Relation.Binary.Equality.html b/master/Relation.Unary.Relation.Binary.Equality.html index 7ae44e8aef..4c166e42a6 100644 --- a/master/Relation.Unary.Relation.Binary.Equality.html +++ b/master/Relation.Unary.Relation.Binary.Equality.html @@ -12,7 +12,7 @@ open import Level using (Level) open import Relation.Binary.Bundles using (Setoid) open import Relation.Binary.Structures using (IsEquivalence) -open import Relation.Unary using (Pred; _≐_; _≐′_) +open import Relation.Unary using (Pred; _≐_; _≐′_) open import Relation.Unary.Properties private @@ -20,14 +20,14 @@ a : Level A : Set a -≐-isEquivalence : IsEquivalence {A = Pred A } _≐_ +≐-isEquivalence : IsEquivalence {A = Pred A } _≐_ ≐-isEquivalence = record { refl = ≐-refl ; sym = ≐-sym ; trans = ≐-trans } -≐′-isEquivalence : IsEquivalence {A = Pred A } _≐′_ +≐′-isEquivalence : IsEquivalence {A = Pred A } _≐′_ ≐′-isEquivalence = record { refl = ≐′-refl ; sym = ≐′-sym diff --git a/master/Relation.Unary.Relation.Binary.Subset.html b/master/Relation.Unary.Relation.Binary.Subset.html index 79cc64db5f..134269d9a7 100644 --- a/master/Relation.Unary.Relation.Binary.Subset.html +++ b/master/Relation.Unary.Relation.Binary.Subset.html @@ -21,22 +21,22 @@ module _ {a : Level} {A : Set a} { : Level} where - open BinaryStructures {A = Pred A } _≐_ + open BinaryStructures {A = Pred A } _≐_ - ⊆-isPreorder : IsPreorder _⊆_ + ⊆-isPreorder : IsPreorder _⊆_ ⊆-isPreorder = record { isEquivalence = ≐-isEquivalence ; reflexive = ⊆-reflexive ; trans = ⊆-trans } - ⊆-isPartialOrder : IsPartialOrder _⊆_ + ⊆-isPartialOrder : IsPartialOrder _⊆_ ⊆-isPartialOrder = record { isPreorder = ⊆-isPreorder ; antisym = ⊆-antisym } - ⊂-isStrictPartialOrder : IsStrictPartialOrder _⊂_ + ⊂-isStrictPartialOrder : IsStrictPartialOrder _⊂_ ⊂-isStrictPartialOrder = record { isEquivalence = ≐-isEquivalence ; irrefl = ⊂-irrefl @@ -46,22 +46,22 @@ module _ {a : Level} {A : Set a} { : Level} where - open BinaryStructures {A = Pred A } _≐′_ + open BinaryStructures {A = Pred A } _≐′_ - ⊆′-isPreorder : IsPreorder _⊆′_ + ⊆′-isPreorder : IsPreorder _⊆′_ ⊆′-isPreorder = record { isEquivalence = ≐′-isEquivalence ; reflexive = ⊆′-reflexive ; trans = ⊆′-trans } - ⊆′-isPartialOrder : IsPartialOrder _⊆′_ + ⊆′-isPartialOrder : IsPartialOrder _⊆′_ ⊆′-isPartialOrder = record { isPreorder = ⊆′-isPreorder ; antisym = ⊆′-antisym } - ⊂′-isStrictPartialOrder : IsStrictPartialOrder _⊂′_ + ⊂′-isStrictPartialOrder : IsStrictPartialOrder _⊂′_ ⊂′-isStrictPartialOrder = record { isEquivalence = ≐′-isEquivalence ; irrefl = ⊂′-irrefl diff --git a/master/Relation.Unary.html b/master/Relation.Unary.html index c0f69fbbc7..f11613bef3 100644 --- a/master/Relation.Unary.html +++ b/master/Relation.Unary.html @@ -15,310 +15,309 @@ open import Data.Sum.Base using (_⊎_; [_,_]) open import Function.Base using (_∘_; _|>_) open import Level using (Level; _⊔_; 0ℓ; suc; Lift) -open import Relation.Nullary.Decidable.Core using (Dec; True) -open import Relation.Nullary as Nullary using (¬_) -open import Relation.Binary.PropositionalEquality.Core using (_≡_) +open import Relation.Binary.PropositionalEquality.Core using (_≡_) +open import Relation.Nullary as Nullary using (¬_; Dec; True) -private - variable - a b c ℓ₁ ℓ₂ : Level - A : Set a - B : Set b - C : Set c +private + variable + a b c ℓ₁ ℓ₂ : Level + A : Set a + B : Set b + C : Set c ------------------------------------------------------------------------- --- Definition +------------------------------------------------------------------------ +-- Definition --- Unary relations are known as predicates and `Pred A ℓ` can be viewed --- as some property that elements of type A might satisfy. +-- Unary relations are known as predicates and `Pred A ℓ` can be viewed +-- as some property that elements of type A might satisfy. --- Consequently `P : Pred A ℓ` can also be seen as a subset of A --- containing all the elements of A that satisfy property P. This view --- informs much of the notation used below. +-- Consequently `P : Pred A ℓ` can also be seen as a subset of A +-- containing all the elements of A that satisfy property P. This view +-- informs much of the notation used below. -Pred : {a} Set a ( : Level) Set (a suc ) -Pred A = A Set +Pred : {a} Set a ( : Level) Set (a suc ) +Pred A = A Set ------------------------------------------------------------------------- --- Special sets +------------------------------------------------------------------------ +-- Special sets --- The empty set. --- Explicitly not level polymorphic as this often causes unsolved metas; --- see `Relation.Unary.Polymorphic` for a level-polymorphic version. +-- The empty set. +-- Explicitly not level polymorphic as this often causes unsolved metas; +-- see `Relation.Unary.Polymorphic` for a level-polymorphic version. - : Pred A 0ℓ - = λ _ + : Pred A 0ℓ + = λ _ --- The singleton set. +-- The singleton set. -{_} : A Pred A _ - x = x ≡_ +{_} : A Pred A _ + x = x ≡_ --- The universal set. --- Explicitly not level polymorphic (see comments for `∅` for more details) +-- The universal set. +-- Explicitly not level polymorphic (see comments for `∅` for more details) -U : Pred A 0ℓ -U = λ _ +U : Pred A 0ℓ +U = λ _ ------------------------------------------------------------------------- --- Membership +------------------------------------------------------------------------ +-- Membership -infix 4 _∈_ _∉_ +infix 4 _∈_ _∉_ -_∈_ : A Pred A Set _ -x P = P x +_∈_ : A Pred A Set _ +x P = P x -_∉_ : A Pred A Set _ -x P = ¬ x P +_∉_ : A Pred A Set _ +x P = ¬ x P ------------------------------------------------------------------------- --- Subset relations +------------------------------------------------------------------------ +-- Subset relations -infix 4 _⊆_ _⊇_ _⊈_ _⊉_ _⊂_ _⊃_ _⊄_ _⊅_ _≐_ _≐′_ +infix 4 _⊆_ _⊇_ _⊈_ _⊉_ _⊂_ _⊃_ _⊄_ _⊅_ _≐_ _≐′_ -_⊆_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = {x} x P x Q +_⊆_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = {x} x P x Q -_⊇_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = Q P +_⊇_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = Q P -_⊈_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = ¬ (P Q) +_⊈_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = ¬ (P Q) -_⊉_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = ¬ (P Q) +_⊉_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = ¬ (P Q) -_⊂_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = P Q × Q P +_⊂_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = P Q × Q P -_⊃_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = Q P +_⊃_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = Q P -_⊄_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = ¬ (P Q) +_⊄_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = ¬ (P Q) -_⊅_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = ¬ (P Q) +_⊅_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = ¬ (P Q) -_≐_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = (P Q) × (Q P) +_≐_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = (P Q) × (Q P) --- The following primed variants of _⊆_ can be used when 'x' can't --- be inferred from 'x ∈ P'. +-- The following primed variants of _⊆_ can be used when 'x' can't +-- be inferred from 'x ∈ P'. -infix 4 _⊆′_ _⊇′_ _⊈′_ _⊉′_ _⊂′_ _⊃′_ _⊄′_ _⊅′_ +infix 4 _⊆′_ _⊇′_ _⊈′_ _⊉′_ _⊂′_ _⊃′_ _⊄′_ _⊅′_ -_⊆′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊆′ Q = x x P x Q +_⊆′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊆′ Q = x x P x Q -_⊇′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -Q ⊇′ P = P ⊆′ Q +_⊇′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +Q ⊇′ P = P ⊆′ Q -_⊈′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊈′ Q = ¬ (P ⊆′ Q) +_⊈′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊈′ Q = ¬ (P ⊆′ Q) -_⊉′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊉′ Q = ¬ (P ⊇′ Q) +_⊉′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊉′ Q = ¬ (P ⊇′ Q) -_⊂′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊂′ Q = P ⊆′ Q × Q ⊈′ P +_⊂′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊂′ Q = P ⊆′ Q × Q ⊈′ P -_⊃′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊃′ Q = Q ⊂′ P +_⊃′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊃′ Q = Q ⊂′ P -_⊄′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊄′ Q = ¬ (P ⊂′ Q) +_⊄′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊄′ Q = ¬ (P ⊂′ Q) -_⊅′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ⊅′ Q = ¬ (P ⊃′ Q) +_⊅′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ⊅′ Q = ¬ (P ⊃′ Q) -_≐′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P ≐′ Q = (P ⊆′ Q) × (Q ⊆′ P) +_≐′_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P ≐′ Q = (P ⊆′ Q) × (Q ⊆′ P) ------------------------------------------------------------------------- --- Properties of sets +------------------------------------------------------------------------ +-- Properties of sets -infix 10 Satisfiable Universal IUniversal +infix 10 Satisfiable Universal IUniversal --- Emptiness - no element satisfies P. +-- Emptiness - no element satisfies P. -Empty : Pred A Set _ -Empty P = x x P +Empty : Pred A Set _ +Empty P = x x P --- Satisfiable - at least one element satisfies P. +-- Satisfiable - at least one element satisfies P. -Satisfiable : Pred A Set _ -Satisfiable P = λ x x P +Satisfiable : Pred A Set _ +Satisfiable P = λ x x P -syntax Satisfiable P = ∃⟨ P +syntax Satisfiable P = ∃⟨ P --- Universality - all elements satisfy P. +-- Universality - all elements satisfy P. -Universal : Pred A Set _ -Universal P = x x P +Universal : Pred A Set _ +Universal P = x x P -syntax Universal P = Π[ P ] +syntax Universal P = Π[ P ] --- Implicit universality - all elements satisfy P. +-- Implicit universality - all elements satisfy P. -IUniversal : Pred A Set _ -IUniversal P = {x} x P +IUniversal : Pred A Set _ +IUniversal P = {x} x P -syntax IUniversal P = ∀[ P ] +syntax IUniversal P = ∀[ P ] --- Irrelevance - any two proofs that an element satifies P are --- indistinguishable. +-- Irrelevance - any two proofs that an element satifies P are +-- indistinguishable. -Irrelevant : Pred A Set _ -Irrelevant P = {x} Nullary.Irrelevant (P x) +Irrelevant : Pred A Set _ +Irrelevant P = {x} Nullary.Irrelevant (P x) --- Recomputability - we can rebuild a relevant proof given an --- irrelevant one. +-- Recomputability - we can rebuild a relevant proof given an +-- irrelevant one. -Recomputable : Pred A Set _ -Recomputable P = {x} Nullary.Recomputable (P x) +Recomputable : Pred A Set _ +Recomputable P = {x} Nullary.Recomputable (P x) --- Stability - instances of P are stable wrt double negation +-- Stability - instances of P are stable wrt double negation -Stable : Pred A Set _ -Stable P = x Nullary.Stable (P x) +Stable : Pred A Set _ +Stable P = x Nullary.Stable (P x) --- Weak Decidability +-- Weak Decidability -WeaklyDecidable : Pred A Set _ -WeaklyDecidable P = x Nullary.WeaklyDecidable (P x) +WeaklyDecidable : Pred A Set _ +WeaklyDecidable P = x Nullary.WeaklyDecidable (P x) --- Decidability - it is possible to determine if an arbitrary element --- satisfies P. +-- Decidability - it is possible to determine if an arbitrary element +-- satisfies P. -Decidable : Pred A Set _ -Decidable P = x Dec (P x) +Decidable : Pred A Set _ +Decidable P = x Dec (P x) --- Erasure: A decidable predicate gives rise to another one, more --- amenable to η-expansion +-- Erasure: A decidable predicate gives rise to another one, more +-- amenable to η-expansion -⌊_⌋ : {P : Pred A } Decidable P Pred A - P? a = Lift _ (True (P? a)) +⌊_⌋ : {P : Pred A } Decidable P Pred A + P? a = Lift _ (True (P? a)) ------------------------------------------------------------------------- --- Operations on sets +------------------------------------------------------------------------ +-- Operations on sets -infix 10 -infixr 9 _⊢_ -infixr 8 _⇒_ -infixr 7 _∩_ -infixr 6 _∪_ -infixr 6 _∖_ -infix 4 _≬_ +infix 10 +infixr 9 _⊢_ +infixr 8 _⇒_ +infixr 7 _∩_ +infixr 6 _∪_ +infixr 6 _∖_ +infix 4 _≬_ --- Complement. +-- Complement. - : Pred A Pred A - P = λ x x P + : Pred A Pred A + P = λ x x P --- Implication. +-- Implication. -_⇒_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ -P Q = λ x x P x Q +_⇒_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ +P Q = λ x x P x Q --- Union. +-- Union. -_∪_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ -P Q = λ x x P x Q +_∪_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ +P Q = λ x x P x Q --- Intersection. +-- Intersection. -_∩_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ -P Q = λ x x P × x Q +_∩_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ +P Q = λ x x P × x Q --- Difference. +-- Difference. -_∖_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ -P Q = λ x x P × x Q +_∖_ : Pred A ℓ₁ Pred A ℓ₂ Pred A _ +P Q = λ x x P × x Q --- Infinitary union. +-- Infinitary union. - : {i} (I : Set i) (I Pred A ) Pred A _ - I P = λ x Σ[ i I ] P i x + : {i} (I : Set i) (I Pred A ) Pred A _ + I P = λ x Σ[ i I ] P i x -syntax I i P) = ⋃[ i I ] P +syntax I i P) = ⋃[ i I ] P --- Infinitary intersection. +-- Infinitary intersection. - : {i} (I : Set i) (I Pred A ) Pred A _ - I P = λ x (i : I) P i x + : {i} (I : Set i) (I Pred A ) Pred A _ + I P = λ x (i : I) P i x -syntax I i P) = ⋂[ i I ] P +syntax I i P) = ⋂[ i I ] P --- Positive version of non-disjointness, dual to inclusion. +-- Positive version of non-disjointness, dual to inclusion. -_≬_ : Pred A ℓ₁ Pred A ℓ₂ Set _ -P Q = λ x x P × x Q +_≬_ : Pred A ℓ₁ Pred A ℓ₂ Set _ +P Q = λ x x P × x Q --- Update. +-- Update. -_⊢_ : (A B) Pred B Pred A -f P = λ x P (f x) +_⊢_ : (A B) Pred B Pred A +f P = λ x P (f x) ------------------------------------------------------------------------- --- Predicate combinators +------------------------------------------------------------------------ +-- Predicate combinators --- These differ from the set operations above, as the carrier set of the --- resulting predicates are not the same as the carrier set of the --- component predicates. +-- These differ from the set operations above, as the carrier set of the +-- resulting predicates are not the same as the carrier set of the +-- component predicates. -infixr 2 _⟨×⟩_ -infixr 2 _⟨⊙⟩_ -infixr 1 _⟨⊎⟩_ -infixr 0 _⟨→⟩_ -infixl 9 _⟨·⟩_ -infix 10 _~ -infixr 9 _⟨∘⟩_ -infixr 2 _//_ _\\_ +infixr 2 _⟨×⟩_ +infixr 2 _⟨⊙⟩_ +infixr 1 _⟨⊎⟩_ +infixr 0 _⟨→⟩_ +infixl 9 _⟨·⟩_ +infix 10 _~ +infixr 9 _⟨∘⟩_ +infixr 2 _//_ _\\_ --- Product. +-- Product. -_⟨×⟩_ : Pred A ℓ₁ Pred B ℓ₂ Pred (A × B) _ -(P ⟨×⟩ Q) (x , y) = x P × y Q +_⟨×⟩_ : Pred A ℓ₁ Pred B ℓ₂ Pred (A × B) _ +(P ⟨×⟩ Q) (x , y) = x P × y Q --- Sum over one element. +-- Sum over one element. -_⟨⊎⟩_ : Pred A Pred B Pred (A B) _ -P ⟨⊎⟩ Q = [ P , Q ] +_⟨⊎⟩_ : Pred A Pred B Pred (A B) _ +P ⟨⊎⟩ Q = [ P , Q ] --- Sum over two elements. +-- Sum over two elements. -_⟨⊙⟩_ : Pred A ℓ₁ Pred B ℓ₂ Pred (A × B) _ -(P ⟨⊙⟩ Q) (x , y) = x P y Q +_⟨⊙⟩_ : Pred A ℓ₁ Pred B ℓ₂ Pred (A × B) _ +(P ⟨⊙⟩ Q) (x , y) = x P y Q --- Implication. +-- Implication. -_⟨→⟩_ : Pred A ℓ₁ Pred B ℓ₂ Pred (A B) _ -(P ⟨→⟩ Q) f = P Q f +_⟨→⟩_ : Pred A ℓ₁ Pred B ℓ₂ Pred (A B) _ +(P ⟨→⟩ Q) f = P Q f --- Product. +-- Product. -_⟨·⟩_ : (P : Pred A ℓ₁) (Q : Pred B ℓ₂) - (P ⟨×⟩ (P ⟨→⟩ Q)) Q uncurry _|>_ -(P ⟨·⟩ Q) (p , f) = f p +_⟨·⟩_ : (P : Pred A ℓ₁) (Q : Pred B ℓ₂) + (P ⟨×⟩ (P ⟨→⟩ Q)) Q uncurry _|>_ +(P ⟨·⟩ Q) (p , f) = f p --- Converse. +-- Converse. -_~ : Pred (A × B) Pred (B × A) -P ~ = P swap +_~ : Pred (A × B) Pred (B × A) +P ~ = P swap --- Composition. +-- Composition. -_⟨∘⟩_ : Pred (A × B) ℓ₁ Pred (B × C) ℓ₂ Pred (A × C) _ -(P ⟨∘⟩ Q) (x , z) = λ y (x , y) P × (y , z) Q +_⟨∘⟩_ : Pred (A × B) ℓ₁ Pred (B × C) ℓ₂ Pred (A × C) _ +(P ⟨∘⟩ Q) (x , z) = λ y (x , y) P × (y , z) Q --- Post-division. +-- Post-division. -_//_ : Pred (A × C) ℓ₁ Pred (B × C) ℓ₂ Pred (A × B) _ -(P // Q) (x , y) = Q (y ,_) P (x ,_) +_//_ : Pred (A × C) ℓ₁ Pred (B × C) ℓ₂ Pred (A × B) _ +(P // Q) (x , y) = Q (y ,_) P (x ,_) --- Pre-division. +-- Pre-division. -_\\_ : Pred (A × C) ℓ₁ Pred (A × B) ℓ₂ Pred (B × C) _ -P \\ Q = (P ~ // Q ~) ~ +_\\_ : Pred (A × C) ℓ₁ Pred (A × B) ℓ₂ Pred (B × C) _ +P \\ Q = (P ~ // Q ~) ~ \ No newline at end of file diff --git a/master/System.Clock.html b/master/System.Clock.html index 4644a13459..4eb81dd0d4 100644 --- a/master/System.Clock.html +++ b/master/System.Clock.html @@ -22,7 +22,7 @@ open import Function.Base using (_$_; _∘′_) open import Foreign.Haskell using (_,_) -open import Relation.Nullary.Decidable using (False; fromWitnessFalse; toWitnessFalse) +open import Relation.Nullary.Decidable using (False; fromWitnessFalse; toWitnessFalse) private variable diff --git a/master/Tactic.Cong.html b/master/Tactic.Cong.html index 0cf59d03ca..58b1f507af 100644 --- a/master/Tactic.Cong.html +++ b/master/Tactic.Cong.html @@ -41,7 +41,7 @@ open import Function using (flip; case_of_) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) -open import Relation.Nullary.Decidable.Core using (yes; no) +open import Relation.Nullary.Decidable.Core using (yes; no) -- 'Data.String.Properties' defines this via 'Dec', so let's use the -- builtin for maximum speed. @@ -113,8 +113,8 @@ symTerm' symTerm -- Don't show the same term twice. let symErr = case term' Term.≟ symTerm' of λ where - (yes _) [] - (no _) strErr "\n" termErr symTerm' [] + (yes _) [] + (no _) strErr "\n" termErr symTerm' [] typeError (strErr "cong! failed, tried:\n" termErr term' symErr) record EqualityGoal : Set where diff --git a/master/Tactic.RingSolver.Core.Polynomial.Base.html b/master/Tactic.RingSolver.Core.Polynomial.Base.html index 93c0c26fe0..a3afd4996d 100644 --- a/master/Tactic.RingSolver.Core.Polynomial.Base.html +++ b/master/Tactic.RingSolver.Core.Polynomial.Base.html @@ -61,7 +61,7 @@ open import Data.Product.Base using (_×_; _,_; map₁; curry; uncurry) open import Data.Unit.Base using (; tt) open import Function.Base -open import Relation.Nullary using (¬_; Dec; yes; no) +open import Relation.Nullary using (¬_; Dec; yes; no) open import Algebra.Definitions.RawSemiring rawSemiring using (_^′_) @@ -153,7 +153,7 @@ constructor _≠0 field poly : Poly i - .{poly≠0} : ¬ Zero poly + .{poly≠0} : ¬ Zero poly -- This predicate is used (in its negation) to ensure that no -- coefficient is zero, preventing any trailing zeroes. @@ -173,11 +173,11 @@ -- Special operations -- Decision procedure for Zero -zero? : {n} (p : Poly n) Dec (Zero p) -zero? ( _ _) = no id +zero? : {n} (p : Poly n) Dec (Zero p) +zero? ( _ _) = no id zero? (Κ x _) with isZero x -... | true = yes tt -... | false = no id +... | true = yes tt +... | false = no id {-# INLINE zero? #-} -- Exponentiate the first variable of a polynomial @@ -195,8 +195,8 @@ infixr 5 _∷↓_ _∷↓_ : {n} PowInd (Poly n) Coeff n * Coeff n * x Δ i ∷↓ xs = case zero? x of - λ { (yes p) xs ⍓* suc i - ; (no ¬p) _≠0 x {¬p} Δ i & xs + λ { (yes p) xs ⍓* suc i + ; (no ¬p) _≠0 x {¬p} Δ i & xs } {-# INLINE _∷↓_ #-} diff --git a/master/Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas.html b/master/Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas.html index 88cdce3cbb..f107fdbe5a 100644 --- a/master/Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas.html +++ b/master/Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas.html @@ -26,7 +26,7 @@ open import Data.Maybe.Base using (nothing; just) open import Function.Base using (_⟨_⟩_) open import Level using (lift) -open import Relation.Nullary.Decidable.Core using (Dec; yes; no) +open import Relation.Nullary.Decidable.Core using (Dec; yes; no) open import Relation.Binary.PropositionalEquality.Core as using (_≡_) open Homomorphism homo hiding (_^_) @@ -122,9 +122,9 @@ -- especially when we're using the folds. ∷↓-hom-0 : {n} (x : Poly n) xs ρ ρs ⅀?⟦ x Δ 0 ∷↓ xs (ρ , ρs) (x , xs) ⟦∷⟧ (ρ , ρs) ∷↓-hom-0 x xs ρ ρs with zero? x -∷↓-hom-0 x xs ρ ρs | no ¬p = refl -∷↓-hom-0 x [] ρ ρs | yes p = zero-hom x p ρs -∷↓-hom-0 x ( xs ) ρ ρs | yes p = +∷↓-hom-0 x xs ρ ρs | no ¬p = refl +∷↓-hom-0 x [] ρ ρs | yes p = zero-hom x p ρs +∷↓-hom-0 x ( xs ) ρ ρs | yes p = begin ⅀⟦ xs ⍓+ 1 (ρ , ρs) ≈⟨ sym (pow-hom 1 xs ρ ρs) @@ -135,9 +135,9 @@ ∷↓-hom-s : {n} (x : Poly n) i xs ρ ρs ⅀?⟦ x Δ suc i ∷↓ xs (ρ , ρs) (ρ ^ suc i) * (x , xs) ⟦∷⟧ (ρ , ρs) ∷↓-hom-s x i xs ρ ρs with zero? x -∷↓-hom-s x i xs ρ ρs | no ¬p = refl -∷↓-hom-s x i [] ρ ρs | yes p = sym ((*≫ sym (zero-hom x p ρs)) trans zeroʳ _) -∷↓-hom-s x i ( xs ) ρ ρs | yes p = +∷↓-hom-s x i xs ρ ρs | no ¬p = refl +∷↓-hom-s x i [] ρ ρs | yes p = sym ((*≫ sym (zero-hom x p ρs)) trans zeroʳ _) +∷↓-hom-s x i ( xs ) ρ ρs | yes p = begin ⅀⟦ xs ⍓+ (suc (suc i)) (ρ , ρs) ≈⟨ sym (pow-hom (suc (suc i)) xs ρ ρs) diff --git a/master/Test.Golden.html b/master/Test.Golden.html index 4384e0f0d4..4b3a8a3503 100644 --- a/master/Test.Golden.html +++ b/master/Test.Golden.html @@ -98,7 +98,7 @@ open import Function.Base using (id; _$_; case_of_) -open import Relation.Nullary.Decidable.Core using (does) +open import Relation.Nullary.Decidable.Core using (does) open import Codata.Musical.Notation using (♯_) open import IO @@ -182,7 +182,7 @@ inj₂ (mfp , opts) pure $ go rest nothing (initOptions exe) where inj₁ arg pure (inj₁ (InvalidArgument arg)) term fromMaybe "" <$> lookupEnv "TERM" - let opts = if does (term "DUMB") + let opts = if does (term "DUMB") then record opts { colour = false } else opts just fp pure mfp @@ -219,7 +219,7 @@ else putStrLn (fileNotFound "expected") pure (inj₁ testPath) - let result = does (out String.≟ exp) + let result = does (out String.≟ exp) if result then printTiming (opts .timing) time diff --git a/master/Text.Pretty.Core.html b/master/Text.Pretty.Core.html index be6f806150..993a477e01 100644 --- a/master/Text.Pretty.Core.html +++ b/master/Text.Pretty.Core.html @@ -35,8 +35,8 @@ using (String; length; replicate; _++_; unlines) import Data.String.Unsafe as String open import Function.Base using (_∘_; flip; _on_; id; _∘′_; _$_) -open import Relation.Nullary.Decidable.Core using (Dec) -open import Relation.Unary using (IUniversal; _⇒_; U) +open import Relation.Nullary.Decidable.Core using (Dec) +open import Relation.Unary using (IUniversal; _⇒_; U) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; sym; cong; cong₂; subst) open import Relation.Binary.PropositionalEquality.Properties @@ -61,7 +61,7 @@ size = maybe′ (suc #nodes proj₂) 0 All : {p} (P : String Set p) (Content Set p) -All P = Allᴹ.All (Allᴾ.All P (Allᵀ.All P U)) +All P = Allᴹ.All (Allᴾ.All P (Allᵀ.All P U)) All≤ : Content Set All≤ n = All s length s n) @@ -115,7 +115,7 @@ step = flip ≤-trans m≤n All≤-node? : {l m r n} - All≤ n l length m n Allᵀ.All s length s n) U r + All≤ n l length m n Allᵀ.All s length s n) U r All≤ n (node? l m r) All≤-node? nothing py pys = just (py , pys) All≤-node? (just (px , pxs)) py pys = just (px , node pxs py pys) @@ -254,7 +254,7 @@ | just (hd , tl) = All≤-node? (≤-Content (m≤m⊔n _ _) ∣xs∣) middle - (subst (Allᵀ.All _ U) (sym $ unfold-indents pad tl) + (subst (Allᵀ.All _ U) (sym $ unfold-indents pad tl) $ Allᵀ.mapₙ⁺ (indent pad) (Allᵀ.mapₙ (indented _) ∣tl∣)) where @@ -350,6 +350,6 @@ $ maybe′ (uncurry hd tl hd Tree.Infix.toList tl)) [] $ node? (Block.block x .value) (Block.last x .value) (leaf tt) -valid : (width : ) (b : Block) Dec (Block.maxWidth b .value width) +valid : (width : ) (b : Block) Dec (Block.maxWidth b .value width) valid width b = Block.maxWidth b .value ≤? width \ No newline at end of file diff --git a/master/Text.Regex.Base.html b/master/Text.Regex.Base.html index 745f55394b..9b550a8bf3 100644 --- a/master/Text.Regex.Base.html +++ b/master/Text.Regex.Base.html @@ -19,7 +19,7 @@ open import Data.List.Relation.Unary.All using (All) open import Data.Sum.Base using (_⊎_) -open import Relation.Nullary.Negation.Core using (¬_) +open import Relation.Nullary.Negation.Core using (¬_) open Preorder P using (_≈_) renaming (Carrier to A; _∼_ to _≤_) open import Data.List.Relation.Ternary.Appending.Propositional {A = A} @@ -75,7 +75,7 @@ _─_ : {lb ub} lb c c ub c ∈ᴿ (lb ub) _∉ᴿ_ : A Range Set (a r e) -a ∉ᴿ r = ¬ (a ∈ᴿ r) +a ∉ᴿ r = ¬ (a ∈ᴿ r) infix 4 _∈_ _∉_ data _∈_ : List A Exp Set (a r e) where @@ -87,5 +87,5 @@ star : {v e} v (ε e (e )) v (e ) _∉_ : List A Exp Set (a r e) -w e = ¬ (w e) +w e = ¬ (w e) \ No newline at end of file diff --git a/master/Text.Regex.Derivative.Brzozowski.html b/master/Text.Regex.Derivative.Brzozowski.html index f7c6a42d72..7d4825d922 100644 --- a/master/Text.Regex.Derivative.Brzozowski.html +++ b/master/Text.Regex.Derivative.Brzozowski.html @@ -16,10 +16,10 @@ open import Data.Sum.Base as Sum using (inj₁; inj₂) open import Function.Base using (_$_; _∘′_; case_of_) -open import Relation.Nullary.Decidable using (Dec; yes; no) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Nullary.Decidable using (map′; ¬?) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Nullary.Decidable using (Dec; yes; no) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (map′; ¬?) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong) open DecPoset P? using (preorder) renaming (Carrier to A) @@ -34,9 +34,9 @@ -- Action of characters on regular expressions private - decToExp : {p} {P : Set p} Dec P Exp - decToExp (yes _) = ε - decToExp (no _) = + decToExp : {p} {P : Set p} Dec P Exp + decToExp (yes _) = ε + decToExp (no _) = eat : A Exp Exp eat a ε = @@ -44,29 +44,29 @@ eat a [^ rs ] = decToExp ((a []) ∈?[^ rs ]) eat a (e R.∣ f) = eat a e eat a f eat a (e R.∙ f) = case []∈? e of λ where - (yes _) (eat a e f) (eat a f) - (no ¬p) eat a e f + (yes _) (eat a e f) (eat a f) + (no ¬p) eat a e f eat a (e R.⋆) = eat a e (e ) ------------------------------------------------------------------------ -- This action is sound and complete with respect to matching eat-sound : x {xs} e xs eat x e (x xs) e -eat-sound x ε pr = contradiction pr ∉∅ +eat-sound x ε pr = contradiction pr ∉∅ eat-sound x [ rs ] pr with (x []) ∈?[ rs ] -... | yes p = case pr of λ where ε p -... | no _ = contradiction pr ∉∅ +... | yes p = case pr of λ where ε p +... | no _ = contradiction pr ∉∅ eat-sound x [^ rs ] pr with (x []) ∈?[^ rs ] -... | yes p = case pr of λ where ε p -... | no _ = contradiction pr ∉∅ +... | yes p = case pr of λ where ε p +... | no _ = contradiction pr ∉∅ eat-sound x (e R.∣ f) pr with ∣-sound (eat x e) (eat x f) pr ... | sum pr′ = sum $ Sum.map (eat-sound x e) (eat-sound x f) pr′ eat-sound x (e R.∙ f) pr with []∈? e -... | yes []∈e with ∣-sound (eat x e f) (eat x f) pr +... | yes []∈e with ∣-sound (eat x e f) (eat x f) pr ... | sum (inj₂ pr') = prod ([] ++ _) []∈e (eat-sound x f pr') ... | sum (inj₁ pr') with ∙-sound (eat x e) f pr' ... | prod eq p q = prod (refl eq) (eat-sound x e p) q -eat-sound x (e R.∙ f) pr | no ¬p with ∙-sound (eat x e) f pr +eat-sound x (e R.∙ f) pr | no ¬p with ∙-sound (eat x e) f pr ... | prod eq p q = prod (refl eq) (eat-sound x e p) q eat-sound x (e R.⋆) pr with ∙-sound (eat x e) (e ) pr ... | prod eq p q = @@ -79,24 +79,24 @@ eat-complete′ x [ rs ] (refl []) [ p ] with (x []) ∈?[ rs ] -... | yes _ = ε -... | no ¬p = contradiction [ p ] ¬p +... | yes _ = ε +... | no ¬p = contradiction [ p ] ¬p eat-complete′ x [^ rs ] (refl []) [^ p ] with (x []) ∈?[^ rs ] -... | yes _ = ε -... | no ¬p = contradiction [^ p ] ¬p +... | yes _ = ε +... | no ¬p = contradiction [^ p ] ¬p eat-complete′ x (e R.∣ f) eq (sum p) = ∣-complete (eat x e) (eat x f) $ sum $ Sum.map (eat-complete′ x e eq) (eat-complete′ x f eq) p eat-complete′ x (e R.∙ f) eq p with []∈? e -eat-complete′ x (e R.∙ f) (refl eq) (prod ([]++ _) p q) | no []∉e - = contradiction p []∉e -eat-complete′ x (e R.∙ f) (refl eq) (prod (refl app) p q) | no []∉e +eat-complete′ x (e R.∙ f) (refl eq) (prod ([]++ _) p q) | no []∉e + = contradiction p []∉e +eat-complete′ x (e R.∙ f) (refl eq) (prod (refl app) p q) | no []∉e = ∙-complete (eat x e) f (prod (respʳ-≋ app eq) (eat-complete x e p) q) -eat-complete′ x (e R.∙ f) eq (prod ([]++ eq′) p q) | yes []∈e +eat-complete′ x (e R.∙ f) eq (prod ([]++ eq′) p q) | yes []∈e = ∣-complete (eat x e f) (eat x f) $ sum $ inj₂ $ eat-complete′ x f (≋-trans eq′ eq) q -eat-complete′ x (e R.∙ f) (refl eq) (prod (refl app) p q) | yes []∈e +eat-complete′ x (e R.∙ f) (refl eq) (prod (refl app) p q) | yes []∈e = ∣-complete (eat x e f) (eat x f) $ sum $ inj₁ $ ∙-complete (eat x e) f (prod (respʳ-≋ app eq) (eat-complete x e p) q) eat-complete′ x (e R.⋆) eq (star (sum (inj₂ (prod ([]++ app) p q)))) @@ -110,10 +110,10 @@ infix 4 _∈?_ _∉?_ -_∈?_ : Decidable _∈_ +_∈?_ : Decidable _∈_ [] ∈? e = []∈? e -(x xs) ∈? e = map′ (eat-sound x e) (eat-complete x e) (xs ∈? eat x e) +(x xs) ∈? e = map′ (eat-sound x e) (eat-complete x e) (xs ∈? eat x e) -_∉?_ : Decidable _∉_ -xs ∉? e = ¬? (xs ∈? e) +_∉?_ : Decidable _∉_ +xs ∉? e = ¬? (xs ∈? e) \ No newline at end of file diff --git a/master/Text.Regex.Properties.Core.html b/master/Text.Regex.Properties.Core.html index 63681fe7de..e1044f59dc 100644 --- a/master/Text.Regex.Properties.Core.html +++ b/master/Text.Regex.Properties.Core.html @@ -21,9 +21,9 @@ open import Data.Product.Base using (_×_; _,_) open import Data.Sum.Base using (_⊎_; inj₁; inj₂) -open import Relation.Nullary using (¬_; Dec; yes; no) -open import Relation.Nullary.Negation using (contradiction) -open import Relation.Unary using (Pred) +open import Relation.Nullary using (¬_; Dec; yes; no) +open import Relation.Nullary.Negation using (contradiction) +open import Relation.Unary using (Pred) open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) open Preorder P using (_≈_) renaming (Carrier to A; _∼_ to _≤_) @@ -35,22 +35,22 @@ ------------------------------------------------------------------------ -- Views -is-∅ : (e : Exp) Dec (e ) -is-∅ ε = no ()) -is-∅ [ [] ] = yes refl -is-∅ [ r rs ] = no ()) -is-∅ [^ rs ] = no ()) -is-∅ (e f) = no ()) -is-∅ (e f) = no ()) -is-∅ (e ) = no ()) - -is-ε : (e : Exp) Dec (e ε) -is-ε ε = yes refl -is-ε [ rs ] = no ()) -is-ε [^ rs ] = no ()) -is-ε (e f) = no ()) -is-ε (e f) = no ()) -is-ε (e ) = no ()) +is-∅ : (e : Exp) Dec (e ) +is-∅ ε = no ()) +is-∅ [ [] ] = yes refl +is-∅ [ r rs ] = no ()) +is-∅ [^ rs ] = no ()) +is-∅ (e f) = no ()) +is-∅ (e f) = no ()) +is-∅ (e ) = no ()) + +is-ε : (e : Exp) Dec (e ε) +is-ε ε = yes refl +is-ε [ rs ] = no ()) +is-ε [^ rs ] = no ()) +is-ε (e f) = no ()) +is-ε (e f) = no ()) +is-ε (e ) = no ()) ------------------------------------------------------------------------ -- Inversion lemmas @@ -64,7 +64,7 @@ ∈∅⋆-inv : {w} w ( ) w ε ∈∅⋆-inv (star (sum (inj₁ ε))) = ε -∈∅⋆-inv (star (sum (inj₂ (prod eq p q)))) = contradiction p ∉∅ +∈∅⋆-inv (star (sum (inj₂ (prod eq p q)))) = contradiction p ∉∅ ∈ε∙e-inv : {w e} w (ε e) w e ∈ε∙e-inv (prod eq ε p) rewrite []++⁻¹ eq = p diff --git a/master/Text.Regex.Properties.html b/master/Text.Regex.Properties.html index 16db25a668..de6fe785c7 100644 --- a/master/Text.Regex.Properties.html +++ b/master/Text.Regex.Properties.html @@ -19,12 +19,12 @@ open import Function.Base using (_$_) open import Relation.Nullary.Decidable - using (Dec; yes; no; map′; ¬?; _×-dec_; _⊎-dec_) + using (Dec; yes; no; map′; ¬?; _×-dec_; _⊎-dec_) open import Relation.Nullary.Negation - using (¬_; contradiction) + using (¬_; contradiction) import Relation.Unary as U -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open DecPoset P? renaming (Carrier to A) open import Text.Regex.Base preorder @@ -40,38 +40,38 @@ ------------------------------------------------------------------------ -- Decidability results -[]∈?_ : U.Decidable ([] ∈_) -[]∈? ε = yes ε -[]∈? [ rs ] = no ()) -[]∈? [^ rs ] = no ()) -[]∈? (e f) = map′ sum where (sum pr) pr) - $ ([]∈? e) ⊎-dec ([]∈? f) -[]∈? (e f) = map′ (uncurry (prod ([]++ []))) []∈e∙f-inv - $ ([]∈? e) ×-dec ([]∈? f) -[]∈? (e ) = yes (star (sum (inj₁ ε))) +[]∈?_ : U.Decidable ([] ∈_) +[]∈? ε = yes ε +[]∈? [ rs ] = no ()) +[]∈? [^ rs ] = no ()) +[]∈? (e f) = map′ sum where (sum pr) pr) + $ ([]∈? e) ⊎-dec ([]∈? f) +[]∈? (e f) = map′ (uncurry (prod ([]++ []))) []∈e∙f-inv + $ ([]∈? e) ×-dec ([]∈? f) +[]∈? (e ) = yes (star (sum (inj₁ ε))) infix 4 _∈ᴿ?_ _∉ᴿ?_ _∈?ε _∈?[_] _∈?[^_] -_∈ᴿ?_ : Decidable _∈ᴿ_ -c ∈ᴿ? [ a ] = map′ [_] where [ eq ] eq) (c a) -c ∈ᴿ? (lb ub) = map′ (uncurry _─_) where (ge le) ge , le) - $ (lb ≤? c) ×-dec (c ≤? ub) +_∈ᴿ?_ : Decidable _∈ᴿ_ +c ∈ᴿ? [ a ] = map′ [_] where [ eq ] eq) (c a) +c ∈ᴿ? (lb ub) = map′ (uncurry _─_) where (ge le) ge , le) + $ (lb ≤? c) ×-dec (c ≤? ub) -_∉ᴿ?_ : Decidable _∉ᴿ_ -a ∉ᴿ? r = ¬? (a ∈ᴿ? r) +_∉ᴿ?_ : Decidable _∉ᴿ_ +a ∉ᴿ? r = ¬? (a ∈ᴿ? r) -_∈?ε : U.Decidable (_∈ ε) -[] ∈?ε = yes ε -(a _) ∈?ε = no ()) +_∈?ε : U.Decidable (_∈ ε) +[] ∈?ε = yes ε +(a _) ∈?ε = no ()) -_∈?[_] : w rs Dec (w [ rs ]) -[] ∈?[ rs ] = no ()) -(a b _) ∈?[ rs ] = no ()) -(a []) ∈?[ rs ] = map′ [_] where [ p ] p) +_∈?[_] : w rs Dec (w [ rs ]) +[] ∈?[ rs ] = no ()) +(a b _) ∈?[ rs ] = no ()) +(a []) ∈?[ rs ] = map′ [_] where [ p ] p) $ any? (a ∈ᴿ?_) rs -_∈?[^_] : w rs Dec (w [^ rs ]) -[] ∈?[^ rs ] = no ()) -(a []) ∈?[^ rs ] = map′ [^_] where [^ p ] p) $ all? (a ∉ᴿ?_) rs -(a b _) ∈?[^ rs ] = no ()) +_∈?[^_] : w rs Dec (w [^ rs ]) +[] ∈?[^ rs ] = no ()) +(a []) ∈?[^ rs ] = map′ [^_] where [^ p ] p) $ all? (a ∉ᴿ?_) rs +(a b _) ∈?[^ rs ] = no ()) \ No newline at end of file diff --git a/master/Text.Regex.Search.html b/master/Text.Regex.Search.html index 36382117df..92fd1de9fb 100644 --- a/master/Text.Regex.Search.html +++ b/master/Text.Regex.Search.html @@ -27,11 +27,11 @@ open import Data.List.Relation.Binary.Suffix.Heterogeneous using (Suffix; here; there) hiding (module Suffix) -open import Relation.Nullary using (Dec; ¬_; yes; no) -open import Relation.Nullary.Decidable using (map′) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary using (Dec; ¬_; yes; no) +open import Relation.Nullary.Decidable using (map′) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.Core using (Rel; _⇒_) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.PropositionalEquality.Core open DecPoset P? using (preorder) renaming (Carrier to A) @@ -96,26 +96,26 @@ _∷⁻¹ᴹ_ : {xs x e} [] e Match (Prefix _≡_) (x xs) e Match (Prefix _≡_) xs (eat x e) - []∉e ∷⁻¹ᴹ (mkMatch .[] []∈e []) = contradiction []∈e []∉e + []∉e ∷⁻¹ᴹ (mkMatch .[] []∈e []) = contradiction []∈e []∉e []∉e ∷⁻¹ᴹ (mkMatch (._ ys) ys∈e (refl ys≤xs)) = mkMatch ys (eat-complete _ _ ys∈e) ys≤xs - shortest : Decidable (Match (Prefix _≡_)) - shortest xs = no (∉∅ match) + shortest : Decidable (Match (Prefix _≡_)) + shortest xs = no (∉∅ match) shortest xs e with []∈? e - ... | yes []∈e = yes ([]ᴹ []∈e) - shortest [] e | no []∉e = no ([]∉e ∘′ []⁻¹ᴹ) - shortest (x xs) e | no []∉e with shortest xs (eat x e) - ... | yes p = yes (x ∷ᴹ p) - ... | no ¬p = no (¬p ([]∉e ∷⁻¹ᴹ_)) - - longest : Decidable (Match (Prefix _≡_)) - longest [] e = map′ []ᴹ []⁻¹ᴹ ([]∈? e) - longest xs = no (∉∅ match) + ... | yes []∈e = yes ([]ᴹ []∈e) + shortest [] e | no []∉e = no ([]∉e ∘′ []⁻¹ᴹ) + shortest (x xs) e | no []∉e with shortest xs (eat x e) + ... | yes p = yes (x ∷ᴹ p) + ... | no ¬p = no (¬p ([]∉e ∷⁻¹ᴹ_)) + + longest : Decidable (Match (Prefix _≡_)) + longest [] e = map′ []ᴹ []⁻¹ᴹ ([]∈? e) + longest xs = no (∉∅ match) longest (x xs) e with longest xs (eat x e) - ... | yes p = yes (x ∷ᴹ p) - ... | no ¬p with []∈? e - ... | yes []∈e = yes ([]ᴹ []∈e) - ... | no []∉e = no (¬p ([]∉e ∷⁻¹ᴹ_)) + ... | yes p = yes (x ∷ᴹ p) + ... | no ¬p with []∈? e + ... | yes []∈e = yes ([]ᴹ []∈e) + ... | no []∉e = no (¬p ([]∉e ∷⁻¹ᴹ_)) module Infix where @@ -135,8 +135,8 @@ Match (Infix _≡_) (x xs) e Match (Prefix _≡_) (x xs) acc Match (Infix _≡_) xs e Match (Prefix _≡_) xs (eat x (acc e)) -- can't possibly be the empty match - step⁻¹ x []∉e []∉acc (inj₁ (mkMatch .[] ys∈e (here []))) = contradiction ys∈e []∉e - step⁻¹ x []∉e []∉acc (inj₂ (mkMatch .[] ys∈e [])) = contradiction ys∈e []∉acc + step⁻¹ x []∉e []∉acc (inj₁ (mkMatch .[] ys∈e (here []))) = contradiction ys∈e []∉e + step⁻¹ x []∉e []∉acc (inj₂ (mkMatch .[] ys∈e [])) = contradiction ys∈e []∉acc -- if it starts 'there', it's an infix solution step⁻¹ x []∉e []∉acc (inj₁ (mkMatch ys ys∈e (there p))) = inj₁ (mkMatch ys ys∈e p) -- if it starts 'here' we're in prefix territory @@ -147,22 +147,22 @@ -- search non-deterministically: at each step, the `acc` regex is -- changed to accomodate the fact the match may be starting just now - searchND : xs e acc [] e Dec (Match (Infix _≡_) xs e Match (Prefix _≡_) xs acc) + searchND : xs e acc [] e Dec (Match (Infix _≡_) xs e Match (Prefix _≡_) xs acc) searchND xs e acc []∉e with []∈? acc - ... | yes []∈acc with Prefix.longest xs acc -- get the best match possible - ... | yes longer = yes (inj₂ longer) - ... | no noMatch = contradiction (mkMatch [] []∈acc []) noMatch - searchND [] e acc []∉e | no []∉acc = no ([ []∉e , []∉acc ]′ ∘′ []⁻¹ᴹ) - searchND (x xs) e acc []∉e | no []∉acc - = map′ (step x) (step⁻¹ x []∉e []∉acc) (searchND xs e (eat x (acc e)) []∉e) - - search : Decidable (Match (Infix _≡_)) + ... | yes []∈acc with Prefix.longest xs acc -- get the best match possible + ... | yes longer = yes (inj₂ longer) + ... | no noMatch = contradiction (mkMatch [] []∈acc []) noMatch + searchND [] e acc []∉e | no []∉acc = no ([ []∉e , []∉acc ]′ ∘′ []⁻¹ᴹ) + searchND (x xs) e acc []∉e | no []∉acc + = map′ (step x) (step⁻¹ x []∉e []∉acc) (searchND xs e (eat x (acc e)) []∉e) + + search : Decidable (Match (Infix _≡_)) search xs e with []∈? e - ... | yes []∈e = yes (mkMatch [] []∈e (here [])) - ... | no []∉e with searchND xs e []∉e - ... | no ¬p = no (¬p ∘′ inj₁) - ... | yes (inj₁ p) = yes p - ... | yes (inj₂ p) = contradiction (match p) ∉∅ + ... | yes []∈e = yes (mkMatch [] []∈e (here [])) + ... | no []∉e with searchND xs e []∉e + ... | no ¬p = no (¬p ∘′ inj₁) + ... | yes (inj₁ p) = yes p + ... | yes (inj₂ p) = contradiction (match p) ∉∅ module Whole where @@ -173,8 +173,8 @@ whole⁻¹ xs e (mkMatch ys ys∈e p) with Pointwise.Pointwise-≡⇒≡ p whole⁻¹ xs e (mkMatch .xs xs∈e p) | refl = xs∈e - search : Decidable (Match (Pointwise _≡_)) - search xs e = map′ (whole xs e) (whole⁻¹ xs e) (xs ∈? e) + search : Decidable (Match (Pointwise _≡_)) + search xs e = map′ (whole xs e) (whole⁻¹ xs e) (xs ∈? e) module Suffix where @@ -201,24 +201,24 @@ step⁻¹ {e} {acc} x (inj₂ (mkMatch (.x ys) ys∈e (refl p))) = inj₂ (mkMatch ys (eat-complete x (e acc) (sum (inj₂ ys∈e))) p) - searchND : xs e acc Dec (Match (Suffix _≡_) xs e Match (Pointwise _≡_) xs acc) + searchND : xs e acc Dec (Match (Suffix _≡_) xs e Match (Pointwise _≡_) xs acc) searchND [] e acc with []∈? e | []∈? acc - ... | yes []∈e | _ = yes (inj₁ (mkMatch [] []∈e (here []))) - ... | _ | yes []∈acc = yes (inj₂ (mkMatch [] []∈acc [])) - ... | no []∉e | no []∉acc = no ([ []∉e , []∉acc ]′ ∘′ []⁻¹ᴹ) + ... | yes []∈e | _ = yes (inj₁ (mkMatch [] []∈e (here []))) + ... | _ | yes []∈acc = yes (inj₂ (mkMatch [] []∈acc [])) + ... | no []∉e | no []∉acc = no ([ []∉e , []∉acc ]′ ∘′ []⁻¹ᴹ) searchND (x xs) e acc - = map′ (step x) (step⁻¹ x) (searchND xs e (eat x (e acc))) + = map′ (step x) (step⁻¹ x) (searchND xs e (eat x (e acc))) - search : Decidable (Match (Suffix _≡_)) + search : Decidable (Match (Suffix _≡_)) search xs e with searchND xs e - ... | no ¬p = no (¬p ∘′ inj₁) - ... | yes (inj₁ p) = yes p - ... | yes (inj₂ p) = contradiction (match p) ∉∅ + ... | no ¬p = no (¬p ∘′ inj₁) + ... | yes (inj₁ p) = yes p + ... | yes (inj₂ p) = contradiction (match p) ∉∅ ------------------------------------------------------------------------ -- Search for the user-specified span -search : xs e Dec (Match (Span e _≡_) xs (Regex.expression e)) +search : xs e Dec (Match (Span e _≡_) xs (Regex.expression e)) search xs e with Regex.fromStart e | Regex.tillEnd e ... | true | true = Whole.search xs (Regex.expression e) ... | true | false = Prefix.shortest xs (Regex.expression e) diff --git a/master/Text.Regex.SmartConstructors.html b/master/Text.Regex.SmartConstructors.html index 79d19db601..f392613f14 100644 --- a/master/Text.Regex.SmartConstructors.html +++ b/master/Text.Regex.SmartConstructors.html @@ -18,8 +18,8 @@ open import Data.List.Relation.Ternary.Appending.Propositional open import Data.Sum.Base using (inj₁; inj₂; fromInj₁; fromInj₂) -open import Relation.Nullary.Decidable using (yes; no) -open import Relation.Nullary.Negation using (contradiction) +open import Relation.Nullary.Decidable using (yes; no) +open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.PropositionalEquality.Core using (refl) open import Text.Regex.Base P as R hiding (_∣_; _∙_; _⋆) @@ -32,21 +32,21 @@ _∣_ : (e f : Exp) Exp e f with is-∅ e | is-∅ f -... | yes _ | _ = f -... | _ | yes _ = e +... | yes _ | _ = f +... | _ | yes _ = e ... | _ | _ = e R.∣ f ∣-sound : {w} e f w (e f) w (e R.∣ f) ∣-sound e f p with is-∅ e | is-∅ f -... | yes _ | _ = sum (inj₂ p) -... | no _ | yes _ = sum (inj₁ p) -... | no _ | no _ = p +... | yes _ | _ = sum (inj₂ p) +... | no _ | yes _ = sum (inj₁ p) +... | no _ | no _ = p ∣-complete : {w} e f w (e R.∣ f) w (e f) ∣-complete e f pr@(sum p) with is-∅ e | is-∅ f -... | yes refl | _ = fromInj₂ p contradiction p ∉∅) p -... | no _ | yes refl = fromInj₁ p contradiction p ∉∅) p -... | no _ | no _ = pr +... | yes refl | _ = fromInj₂ p contradiction p ∉∅) p +... | no _ | yes refl = fromInj₁ p contradiction p ∉∅) p +... | no _ | no _ = pr ------------------------------------------------------------------------ -- Product @@ -55,27 +55,27 @@ _∙_ : (e f : Exp) Exp e f with is-∅ e | is-ε e | is-∅ f | is-ε f -... | yes _ | _ | _ | _ = R.∅ -... | _ | yes _ | _ | _ = f -... | _ | _ | yes _ | _ = R.∅ -... | _ | _ | _ | yes _ = e +... | yes _ | _ | _ | _ = R.∅ +... | _ | yes _ | _ | _ = f +... | _ | _ | yes _ | _ = R.∅ +... | _ | _ | _ | yes _ = e ... | _ | _ | _ | _ = e R.∙ f ∙-sound : {w} e f w (e f) w (e R.∙ f) ∙-sound e f p with is-∅ e | is-ε e | is-∅ f | is-ε f -... | yes refl | _ | _ | _ = contradiction p ∉∅ -... | no _ | yes refl | _ | _ = prod ([] ++ _) ε p -... | no _ | no _ | yes refl | _ = contradiction p ∉∅ -... | no _ | no _ | no _ | yes refl = prod (_ ++[]) p ε -... | no _ | no _ | no _ | no _ = p +... | yes refl | _ | _ | _ = contradiction p ∉∅ +... | no _ | yes refl | _ | _ = prod ([] ++ _) ε p +... | no _ | no _ | yes refl | _ = contradiction p ∉∅ +... | no _ | no _ | no _ | yes refl = prod (_ ++[]) p ε +... | no _ | no _ | no _ | no _ = p ∙-complete : {w} e f w (e R.∙ f) w (e f) ∙-complete e f pr@(prod eq p q) with is-∅ e | is-ε e | is-∅ f | is-ε f -... | yes refl | _ | _ | _ = contradiction p ∉∅ -... | no _ | yes refl | _ | _ = ∈ε∙e-inv pr -... | no _ | no _ | yes refl | _ = contradiction q ∉∅ -... | no _ | no _ | no _ | yes refl = ∈e∙ε-inv pr -... | no _ | no _ | no _ | no _ = pr +... | yes refl | _ | _ | _ = contradiction p ∉∅ +... | no _ | yes refl | _ | _ = ∈ε∙e-inv pr +... | no _ | no _ | yes refl | _ = contradiction q ∉∅ +... | no _ | no _ | no _ | yes refl = ∈e∙ε-inv pr +... | no _ | no _ | no _ | no _ = pr ------------------------------------------------------------------------ -- Kleene star @@ -84,21 +84,21 @@ _⋆ : Exp Exp e with is-∅ e | is-ε e -... | yes _ | _ = R.ε -... | _ | yes _ = R.ε +... | yes _ | _ = R.ε +... | _ | yes _ = R.ε ... | _ | _ = e R.⋆ ⋆-sound : {w} e w (e ) w (e R.⋆) ⋆-sound e p with is-∅ e | is-ε e -... | yes refl | _ = star (sum (inj₁ p)) -... | no _ | yes refl = star (sum (inj₁ p)) -... | no _ | no _ = p +... | yes refl | _ = star (sum (inj₁ p)) +... | no _ | yes refl = star (sum (inj₁ p)) +... | no _ | no _ = p ⋆-complete : {w} e w (e R.⋆) w (e ) ⋆-complete e pr with is-∅ e | is-ε e -... | yes refl | no _ = ∈∅⋆-inv pr -... | no _ | yes refl = ∈ε⋆-inv pr -... | no _ | no _ = pr +... | yes refl | no _ = ∈∅⋆-inv pr +... | no _ | yes refl = ∈ε⋆-inv pr +... | no _ | no _ = pr ------------------------------------------------------------------------ -- Derived notions: at least one and maybe one diff --git a/master/Text.Regex.String.Unsafe.html b/master/Text.Regex.String.Unsafe.html index e1288a988b..a4856d48d4 100644 --- a/master/Text.Regex.String.Unsafe.html +++ b/master/Text.Regex.String.Unsafe.html @@ -14,9 +14,9 @@ open import Function.Base using (_on_; id) open import Level using (0ℓ) open import Relation.Binary.Core using (Rel) -open import Relation.Binary.Definitions using (Decidable) +open import Relation.Binary.Definitions using (Decidable) open import Relation.Binary.PropositionalEquality.Core using (_≡_; sym; subst) -open import Relation.Nullary.Decidable using (map′) +open import Relation.Nullary.Decidable using (map′) ------------------------------------------------------------------------ -- Re-exporting safe definitions @@ -35,10 +35,10 @@ _∉_ : String Exp Set str e = toList str Regex.∉ e -_∈?_ : Decidable _∈_ +_∈?_ : Decidable _∈_ str ∈? e = toList str Regex.∈? e -_∉?_ : Decidable _∉_ +_∉?_ : Decidable _∉_ str ∉? e = toList str Regex.∉? e Span : Regex Rel String 0ℓ @@ -54,8 +54,8 @@ related : Span e string str open Match public -search : Decidable Match -search str e = map′ from to (Regex.search input e) where +search : Decidable Match +search str e = map′ from to (Regex.search input e) where input = toList str exp = Regex.expression e diff --git a/master/index.html b/master/index.html index 4edca8e78c..e82a869c9a 100644 --- a/master/index.html +++ b/master/index.html @@ -942,74 +942,75 @@ import Relation.Nullary.Indexed.Negation import Relation.Nullary.Negation import Relation.Nullary.Negation.Core -import Relation.Nullary.Reflects -import Relation.Nullary.Universe -import Relation.Unary -import Relation.Unary.Algebra -import Relation.Unary.Closure.Base -import Relation.Unary.Closure.Preorder -import Relation.Unary.Closure.StrictPartialOrder -import Relation.Unary.Consequences -import Relation.Unary.Indexed -import Relation.Unary.Polymorphic -import Relation.Unary.Polymorphic.Properties -import Relation.Unary.PredicateTransformer -import Relation.Unary.Properties -import Relation.Unary.Relation.Binary.Equality -import Relation.Unary.Relation.Binary.Subset -import Relation.Unary.Sized -import Size -import System.Clock -import System.Clock.Primitive -import System.Console.ANSI -import System.Directory -import System.Directory.Primitive -import System.Environment -import System.Environment.Primitive -import System.Exit -import System.Exit.Primitive -import System.FilePath.Posix -import System.FilePath.Posix.Primitive -import System.Process -import System.Process.Primitive -import System.Random -import System.Random.Primitive -import Tactic.Cong -import Tactic.MonoidSolver -import Tactic.RingSolver -import Tactic.RingSolver.Core.AlmostCommutativeRing -import Tactic.RingSolver.Core.Expression -import Tactic.RingSolver.Core.NatSet -import Tactic.RingSolver.Core.Polynomial.Base -import Tactic.RingSolver.Core.Polynomial.Homomorphism -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Addition -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Constants -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Exponentiation -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Multiplication -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Negation -import Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables -import Tactic.RingSolver.Core.Polynomial.Parameters -import Tactic.RingSolver.Core.Polynomial.Reasoning -import Tactic.RingSolver.Core.Polynomial.Semantics -import Tactic.RingSolver.NonReflective -import Test.Golden -import Text.Format -import Text.Format.Generic -import Text.Pretty -import Text.Pretty.Core -import Text.Printf -import Text.Printf.Generic -import Text.Regex -import Text.Regex.Base -import Text.Regex.Derivative.Brzozowski -import Text.Regex.Properties -import Text.Regex.Properties.Core -import Text.Regex.Search -import Text.Regex.SmartConstructors -import Text.Regex.String -import Text.Regex.String.Unsafe -import Text.Tabular.Base -import Text.Tabular.List -import Text.Tabular.Vec +import Relation.Nullary.Recomputable +import Relation.Nullary.Reflects +import Relation.Nullary.Universe +import Relation.Unary +import Relation.Unary.Algebra +import Relation.Unary.Closure.Base +import Relation.Unary.Closure.Preorder +import Relation.Unary.Closure.StrictPartialOrder +import Relation.Unary.Consequences +import Relation.Unary.Indexed +import Relation.Unary.Polymorphic +import Relation.Unary.Polymorphic.Properties +import Relation.Unary.PredicateTransformer +import Relation.Unary.Properties +import Relation.Unary.Relation.Binary.Equality +import Relation.Unary.Relation.Binary.Subset +import Relation.Unary.Sized +import Size +import System.Clock +import System.Clock.Primitive +import System.Console.ANSI +import System.Directory +import System.Directory.Primitive +import System.Environment +import System.Environment.Primitive +import System.Exit +import System.Exit.Primitive +import System.FilePath.Posix +import System.FilePath.Posix.Primitive +import System.Process +import System.Process.Primitive +import System.Random +import System.Random.Primitive +import Tactic.Cong +import Tactic.MonoidSolver +import Tactic.RingSolver +import Tactic.RingSolver.Core.AlmostCommutativeRing +import Tactic.RingSolver.Core.Expression +import Tactic.RingSolver.Core.NatSet +import Tactic.RingSolver.Core.Polynomial.Base +import Tactic.RingSolver.Core.Polynomial.Homomorphism +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Addition +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Constants +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Exponentiation +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Lemmas +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Multiplication +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Negation +import Tactic.RingSolver.Core.Polynomial.Homomorphism.Variables +import Tactic.RingSolver.Core.Polynomial.Parameters +import Tactic.RingSolver.Core.Polynomial.Reasoning +import Tactic.RingSolver.Core.Polynomial.Semantics +import Tactic.RingSolver.NonReflective +import Test.Golden +import Text.Format +import Text.Format.Generic +import Text.Pretty +import Text.Pretty.Core +import Text.Printf +import Text.Printf.Generic +import Text.Regex +import Text.Regex.Base +import Text.Regex.Derivative.Brzozowski +import Text.Regex.Properties +import Text.Regex.Properties.Core +import Text.Regex.Search +import Text.Regex.SmartConstructors +import Text.Regex.String +import Text.Regex.String.Unsafe +import Text.Tabular.Base +import Text.Tabular.List +import Text.Tabular.Vec \ No newline at end of file