Matroid Restriction #
Given M : Matroid α
and R : Set α
, the independent sets of M
that are contained in R
are the independent sets of another matroid M ↾ R
with ground set R
,
called the 'restriction' of M
to R
.
For I, R ⊆ M.E
, I
is a basis of R
in M
if and only if I
is a base
of the restriction M ↾ R
, so this construction relates Matroid.Basis
to Matroid.Base
.
If N M : Matroid α
satisfy N = M ↾ R
for some R ⊆ M.E
,
then we call N
a 'restriction of M
', and write N ≤r M
. This is a partial order.
This file proves that the restriction is a matroid and that the ≤r
order is a partial order,
and gives related API.
It also proves some Basis
analogues of Base
lemmas that, while they could be stated in
Data.Matroid.Basic
, are hard to prove without Matroid.restrict
API.
Main Definitions #
M.restrict R
, writtenM ↾ R
, is the restriction ofM : Matroid α
toR : Set α
: i.e. the matroid with ground setR
whose independent sets are theM
-independent subsets ofR
.Matroid.Restriction N M
, writtenN ≤r M
, means thatN = M ↾ R
for someR ⊆ M.E
.Matroid.StrictRestriction N M
, writtenN <r M
, means thatN = M ↾ R
for someR ⊂ M.E
.Matroidᵣ α
is a type synonym forMatroid α
, equipped with thePartialOrder
≤r
.
Implementation Notes #
Since R
and M.E
are both terms in Set α
, to define the restriction M ↾ R
,
we need to either insist that R ⊆ M.E
, or to say what happens when R
contains the junk
outside M.E
.
It turns out that R ⊆ M.E
is just an unnecessary hypothesis; if we say the restriction
M ↾ R
has ground set R
and its independent sets are the M
-independent subsets of R
,
we always get a matroid, in which the elements of R \ M.E
aren't in any independent sets.
We could instead define this matroid to always be 'smaller' than M
by setting
(M ↾ R).E := R ∩ M.E
, but this is worse definitionally, and more generally less convenient.
This makes it possible to actually restrict a matroid 'upwards'; for instance, if M : Matroid α
satisfies M.E = ∅
, then M ↾ Set.univ
is the matroid on α
whose ground set is all of α
,
where the empty set is only the independent set.
(Elements of R
outside the ground set are all 'loops' of the matroid.)
This is mathematically strange, but is useful for API building.
The cost of allowing a restriction of M
to be 'bigger' than the M
itself is that
the statement M ↾ R ≤r M
is only true with the hypothesis R ⊆ M.E
(at least, if we want ≤r
to be a partial order).
But this isn't too inconvenient in practice. Indeed (· ⊆ M.E)
proofs
can often be automatically provided by aesop_mat
.
We define the restriction order ≤r
to give a PartialOrder
instance on the type synonym
Matroidᵣ α
rather than Matroid α
itself, because the PartialOrder (Matroid α)
instance is
reserved for the more mathematically important 'minor' order.
Change the ground set of a matroid to some R : Set α
. The independent sets of the restriction
are the independent subsets of the new ground set. Most commonly used when R ⊆ M.E
,
but it is convenient not to require this. The elements of R \ M.E
become 'loops'.
Equations
- M.restrict R = (M.restrictIndepMatroid R).matroid
Instances For
M ↾ R
means M.restrict R
.
Equations
- Matroid.«term_↾_» = Lean.ParserDescr.trailingNode `Matroid.«term_↾_» 65 65 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ↾ ") (Lean.ParserDescr.cat `term 66))
Instances For
Restriction N M
means that N = M ↾ R
for some subset R
of M.E
Instances For
StrictRestriction N M
means that N = M ↾ R
for some strict subset R
of M.E
Instances For
N ≤r M
means that N
is a Restriction
of M
.
Equations
- Matroid.«term_≤r_» = Lean.ParserDescr.trailingNode `Matroid.«term_≤r_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≤r ") (Lean.ParserDescr.cat `term 51))
Instances For
N <r M
means that N
is a StrictRestriction
of M
.
Equations
- Matroid.«term_<r_» = Lean.ParserDescr.trailingNode `Matroid.«term_<r_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " <r ") (Lean.ParserDescr.cat `term 51))
Instances For
A type synonym for matroids with the restriction order.
(The PartialOrder
on Matroid α
is reserved for the minor order)
Instances For
Equations
- Matroid.instCoeOutMatroidᵣ = { coe := Matroid.Matroidᵣ.toMatroid }
Equations
- Matroid.instPartialOrderMatroidᵣ = PartialOrder.mk ⋯
Basis
and Base
#
The lemmas below exploit the fact that (M ↾ X).Base I ↔ M.Basis I X
to transfer facts about
Matroid.Base
to facts about Matroid.Basis
.
Their statements thematically belong in Data.Matroid.Basic
, but they appear here because their
proofs depend on the API for Matroid.restrict
,