Order theory: why isless is strict / issubset is loose by default?

julia> @test issubset([1,2],[1,2])          # loose order
Test Passed

julia> @test isless((1,2), (1,2)) == false  # strict order
Test Passed

isless is defined in term of lexicographic order. scientific litterature (bender, williamson, arndt) is quite conservative about saying that implies the order is strict

issubset does not test for proper subsetting.

Any rational about this?

Currently working on poset / lattice in Julia.
sound foundation are appreciated.

If you have an a \preceq b relation, you can easily get a \prec b = (a \preceq b) \wedge \neg(b \preceq a) (and vice versa), so they are equivalent in functionality. Some texts prefers one, some the other, neither is superior to the other.

Cf Base.cmp if you want to economize on computation.

They are named consistently with the meanings of the words:

  • issubet(a, b) tests whether a is a subset of b
  • isless(a, b) tests whether a is less than b

The word subset does not entail strictness, the word less does entail strictness.

3 Likes

equivalent in functionality

Not true. you have two ops. you build a third.
first and third are equivalents. not the same of saying two first are.
With graph, lattice, structure can become heavy at some points.
Adding another indirection/level of storage can be tricky.
fine, if it can be avoided,

They are named consistently with the meanings of the words:

a bit tautological. so let’s say it’s some common way.

Without clear defs/perimeters/consensus, problems may appear when you have to deeply chain computing, for example when computing type lattice, even function type lattice and work to get precise result. example more precise than repr(typeof(isless)) == "typeof(isless)").

Anyway, definitively not a priority question at this point

I’m just basing this on standard dictionary definitions of these words:

The word “subset” is non-strict in its most common meaning while “less than” is strict in its most common meaning. If you want to have non-strict version of isless you can define one; if you want a strict version of issubset you can also define one.

4 Likes

Thanks for taking time to answer.