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.IsBasis to Matroid.IsBase.
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 Matroid.IsBasis analogues of Matroid.IsBase 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 setRwhose independent sets are theM-independent subsets ofR.Matroid.Restriction N M, writtenN ≤r M, means thatN = M ↾ Rfor someR ⊆ M.E.Matroid.IsStrictRestriction N M, writtenN <r M, means thatN = M ↾ Rfor 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 the only independent set.
(In general, elements of R \ M.E are all 'loops' of the matroid M ↾ R;
see Matroid.loops and Matroid.restrict_loops_eq' for a precise version of this statement.)
This is mathematically strange, but is useful for API building.
The cost of allowing a restriction of M to be 'bigger' than 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; see Matroid.IsMinor.
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
Equations
- N.IsRestriction M = ∃ R ⊆ M.E, N = M.restrict R
Instances For
IsStrictRestriction N M means that N = M ↾ R for some strict subset R of M.E
Equations
- N.IsStrictRestriction M = (N.IsRestriction M ∧ ¬M.IsRestriction N)
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 IsStrictRestriction 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 isRestriction order.
(The PartialOrder on Matroid α is reserved for the minor order)
Instances For
Equations
Equations
- Matroid.instPartialOrderMatroidᵣ = { le := fun (x1 x2 : Matroid.Matroidᵣ α) => x1.toMatroid.IsRestriction x2.toMatroid, le_refl := ⋯, le_trans := ⋯, lt_iff_le_not_ge := ⋯, le_antisymm := ⋯ }
IsBasis and Base #
The lemmas below exploit the fact that (M ↾ X).Base I ↔ M.IsBasis I X to transfer facts about
Matroid.Base to facts about Matroid.IsBasis.
Their statements thematically belong in Data.Matroid.Basic, but they appear here because their
proofs depend on the API for Matroid.restrict,