Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: quantales #17289

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
455a748
Basic definition of quantale.
PieterCuijpers Sep 24, 2024
a60b10f
Rephrased some text and todo's
PieterCuijpers Sep 30, 2024
c488a7d
Updated using lake exe mk_all
PieterCuijpers Sep 30, 2024
33a33c9
Linter corrections
PieterCuijpers Sep 30, 2024
7913f82
Linter corrections (docstrings)
PieterCuijpers Sep 30, 2024
0f08888
Update Mathlib/Order/Quantale.lean
PieterCuijpers Sep 30, 2024
1190a65
Update Mathlib/Order/Quantale.lean
PieterCuijpers Sep 30, 2024
b623b56
Style updates
PieterCuijpers Sep 30, 2024
15babb8
Made peace with using CompleteLattice as the basis of a quantale defi…
PieterCuijpers Sep 30, 2024
50a1500
scoping the residulation notation
PieterCuijpers Oct 1, 2024
1ec5d12
Implemented "to_additive" variants, and classes for all special quant…
PieterCuijpers Oct 2, 2024
2734c4a
Small textual changes in comments.
PieterCuijpers Oct 3, 2024
af98150
Extracted "IdemSemigroup" and updated IdemSemiring definition in Klee…
PieterCuijpers Oct 3, 2024
8bc9f44
Found a better way to derive IdemSemiring from IdemSemigroup
PieterCuijpers Oct 3, 2024
120eafe
Style updates to Idem.lean
PieterCuijpers Oct 3, 2024
03e05ad
Small edits
PieterCuijpers Oct 3, 2024
b8c27e8
Update
PieterCuijpers Oct 3, 2024
27a9144
Style. Added missing docstring
PieterCuijpers Oct 3, 2024
1551fe7
Residuation notation only on multiplicative quantale for the time being.
PieterCuijpers Oct 3, 2024
547941a
Added to_additive on left_residuation notation. (Test to see if there…
PieterCuijpers Oct 4, 2024
3e9b865
Separated additive and multiplicative notations for left- and right r…
PieterCuijpers Oct 4, 2024
47e3aa2
Made Quantale definition dependent on Semigroup - this seems to simpl…
PieterCuijpers Oct 4, 2024
0f080dc
Update
PieterCuijpers Oct 4, 2024
4a75852
Updated ToAdditive.Frontend to undo unnecessary changes.
PieterCuijpers Oct 4, 2024
206c5e4
IsIntegral into Quantale namespace
PieterCuijpers Sep 24, 2024
7723983
IsIdem in Semigroup namespace
PieterCuijpers Oct 22, 2024
a81f90e
Update Mathlib/Algebra/Group/IsIdem.lean
PieterCuijpers Oct 29, 2024
70d0f50
Update Mathlib/Algebra/Group/IsIdem.lean
PieterCuijpers Oct 29, 2024
c23bd96
Update Mathlib/Algebra/Group/IsIdem.lean
PieterCuijpers Oct 29, 2024
338f754
Update Mathlib/Algebra/Group/IsIdem.lean
PieterCuijpers Oct 29, 2024
8397c31
Update Mathlib/Algebra/Group/IsIdem.lean
PieterCuijpers Oct 29, 2024
8e4e77b
Update Mathlib/Algebra/Order/Kleene.lean
PieterCuijpers Oct 29, 2024
a673241
Update Mathlib/Order/Quantale.lean
PieterCuijpers Oct 29, 2024
3ccf5f3
Update Mathlib/Order/Quantale.lean
PieterCuijpers Oct 29, 2024
ca29e95
Update Mathlib/Order/Quantale.lean
PieterCuijpers Oct 29, 2024
8f2416b
Update Mathlib/Order/Quantale.lean
PieterCuijpers Oct 29, 2024
cb533ec
Moved Quantales to Algebra/Order and fixed the implementation of left…
PieterCuijpers Oct 29, 2024
1e1595d
Update library
PieterCuijpers Oct 29, 2024
9082b68
Struggles to resolve an not-understood error...
PieterCuijpers Oct 29, 2024
6d1141e
Correct Quantale.lean, but unresolved error in settings somewhere.
PieterCuijpers Oct 29, 2024
db7ada1
Merge conflicts resolved
PieterCuijpers Oct 29, 2024
80e96f3
Fixed left- rightResiduation notation, also for AddQuantale (workarou…
PieterCuijpers Oct 29, 2024
803078c
Merge branch 'PieterCuijpers_Quantales' of https://github.com/leanpro…
PieterCuijpers Oct 29, 2024
c602733
Lake-manifest was corrupted. Now fixed.
PieterCuijpers Oct 29, 2024
e7799fd
Moved Quantale.lean to Algebra/Order
PieterCuijpers Oct 29, 2024
96ed693
Update
PieterCuijpers Oct 29, 2024
dc50f88
Merge remote-tracking branch 'origin' into PieterCuijpers_Quantales
PieterCuijpers Oct 31, 2024
c72a23f
Corrected bibtex references
PieterCuijpers Oct 31, 2024
cf1b028
Update docs/references.bib
PieterCuijpers Oct 31, 2024
2f0ddb0
Typo in introduction text
PieterCuijpers Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3688,6 +3688,7 @@ import Mathlib.Order.PiLex
import Mathlib.Order.PrimeIdeal
import Mathlib.Order.PrimeSeparator
import Mathlib.Order.PropInstances
import Mathlib.Order.Quantale
import Mathlib.Order.Radical
import Mathlib.Order.Rel.GaloisConnection
import Mathlib.Order.RelClasses
Expand Down
128 changes: 128 additions & 0 deletions Mathlib/Order/Quantale.lean
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/-
Copyright (c) 2024 Pieter Cuijpers. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Pieter Cuijpers
-/
import Mathlib.Order.CompleteLattice
import Mathlib.Algebra.Group.Defs
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved

/-!
# Theory of quantales

Quantales are the non-commutative generalization of locales/frames and as such are linked
to point-free topology and order theory. Applications are found throughout logic,
quantum mechanics, and computer science. Intuitively, as described by [vickers1989],
open sets of a topology form a frame, and can be considered as modeling what is `observable`
in a system. Quantales come into play when making an observation may change the system itself.
Traditionally, one would write `x ⊓ y` to describe making observations `x` and `y` at the same
time, but when the order of observation becomes important due to changes in the system caused
by the observation, it makes more sense to write `x * y` or `x + y` and consider `*` or `+` as
a possibly non-commutative monoid.
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved

## Main definitions

* class `Quantale`: a monoid distributing over a complete sup-semilattice.
I.e satisfying `x * (sSup s) = ⨆ y ∈ s, x * y` and `(sSup s) * y = ⨆ x ∈ s, x * y`

Conceptually, every complete sup-semilattice is of course a complete lattice.
However, when considering morphisms between quantales, usually only the supremum
is required to be preserved. Hence, it is conseptually cleaner to define it as a
complete sup-semilattice. (In literature, both variants occur.)
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved

* `is_integral`: a quantale for which `1 = ⊤`
* `is_comm`: a commutative quantale, satisfying `x * y = y * x`
* `is_idem`: an idempotent quantale, satisfying `x * x = x`

## Naming conventions

## Notation

* `x ⇨ₗ y` : `sSup { z | z * x ≤ y }`, the left-residuation of `y` over `x`;
* `x ⇨ᵣ y` : `sSup { z | x * z ≤ y }`, the right-residuation of `y` over `x`;

## References

[Topology via Logic][vickers1989]
<https://en.wikipedia.org/wiki/Quantale>
<https://encyclopediaofmath.org/wiki/Quantale>
<https://ncatlab.org/nlab/show/quantale> (Categorical definition - not followed here)

## TODO

Additive quantales and multiplicative quantales both occur in literature.
For sequences of actions, usually a multiplicative quantale is used, but for
describing timing of actions (for example) the additive quantale of max-plus algebra
a.k.a. tropical algebra, can be used. Therefore, extending the definitions with
addition is - I think - relevant future work.

-/

/-- A quantale is a monoid distributing over a complete sup-semilattice.

Technically, I would prefer to define it as
`class Quantale (α : Type*) extends Monoid α, CompleteSemilatticeSup α where ...`
however, if I do that currently, the elements ⊤ and ⊥ are not automatically defined.
I could do that separately, but it seems more sensible to push the definition
of those to CompleteSemmilatticeSup in the library, as they are already making
sense there and having them should not break anything (in theory).

The reason not to consider a quantale as a complete lattice, is because the
morphisms between quantales usually only preserve the join and not the inf.
In fact, when seen as a generalization of locales, the monoid multiplication
usually takes the place of the inf.
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved
-/
class Quantale (α : Type*) extends Monoid α, CompleteLattice α where
/-- Multiplication is distributive over join in a quantale -/
protected mul_sSup_eq_iSup_mul (x : α) (s : Set α) : x * sSup s = ⨆ y ∈ s, x * y
/-- Multiplication is distributive over join in a quantale -/
protected sSup_mul_eq_iSup_mul (s : Set α) (y : α) : sSup s * y = ⨆ x ∈ s, x * y

section

variable (α : Type _)
variable [Quantale α]

theorem mul_sSup_eq_iSup_mul : ∀ x : α, ∀ s : Set α, x * sSup s = ⨆ y ∈ s, x * y :=
Quantale.mul_sSup_eq_iSup_mul
theorem sSup_mul_eq_iSup_mul : ∀ s : Set α, ∀ y : α, sSup s * y = ⨆ x ∈ s, x * y :=
Quantale.sSup_mul_eq_iSup_mul

namespace Quantale

/- Basic definitions on quantales -/

/-- A quantale is integral if its unit and top element coincide -/
def is_integral [Quantale α] := (⊤ : α) = 1

/-- A quantale is commutative if its monoid satisfies `x * y = y * x` -/
def is_comm [Quantale α] := ∀ x y : α , x * y = y * x

/-- A quantale is idempotent if its monoid satisfies `x * x = x` -/
def is_idem [Quantale α] := ∀ x : α, x * x = x
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved

variable {α : Type _}
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved
variable [Quantale α]

/-- Left- and right- residuation operators on a quantale are similar to the Heyting operator
on complete lattices, but for a non-commutative logic.
I.e. `x ⇨ₗ y = sSup { z | z * x ≤ y }`.
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved
-/
def l_residuation (x y : α) := sSup { z | z * x ≤ y }
/-- Notation for left-residuation in quantales.
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved
I.e. `x ⇨ₗ y = sSup { z | z * x ≤ y }`.
-/
infixr:60 " ⇨ₗ " => l_residuation
PieterCuijpers marked this conversation as resolved.
Show resolved Hide resolved

/-- Left- and right- residuation operators on a quantale are similar to the Heyting operator
on complete lattices, but for a non-commutative logic.
I.e. `x ⇨ᵣ y = sSup { z | x * z ≤ y }`.
-/
def r_residuation (x y : α) := sSup { z | x * z ≤ y }
/-- Notation for right-residuation in quantales.
I.e. `x ⇨ᵣ y = sSup { z | x * z ≤ y }`.
-/
infixr:60 " ⇨ᵣ " => r_residuation

end Quantale

end
9 changes: 9 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3245,6 +3245,15 @@ @Book{ verdier1996
mrnumber = {1453167}
}

@Book{ vickers1989,
author = {Vickers, Steven},
title = {Topology via Logic},
isbn = {0-521-57651-2},
year = {1989},
publisher = {University of Cambridge},
language = {English}
}

@Book{ wall2018analytic,
title = {Analytic Theory of Continued Fractions},
author = {Wall, H.S.},
Expand Down
Loading