The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V30. Combinatorics

Mathlib.Combinatorics.Matroid.Minor.Restrict

89 declarations and 1 deprecated aliases. Mathlib docs · Source

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, written M ↾ R, is the restriction of M : Matroid α to R : Set α: i.e. the matroid with ground set R whose independent sets are the M-independent subsets of R.

  • Matroid.Restriction N M, written N ≤r M, means that N = M ↾ R for some R ⊆ M.E.

  • Matroid.IsStrictRestriction N M, written N <r M, means that N = M ↾ R for some R ⊂ M.E.

  • Matroidᵣ α is a type synonym for Matroid α, equipped with the PartialOrder ≤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.

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,

def Matroid.Matroidᵣ.ctorIdx E1 #

{α : Type u_2} → Matroid.Matroidᵣ α → ℕ

theorem Matroid.Matroidᵣ.ofMatroid.injEq E0 #

∀ {α : Type u_2} (toMatroid toMatroid_1 : Matroid α),
  ({ toMatroid := toMatroid } = { toMatroid := toMatroid_1 }) = (toMatroid = toMatroid_1)

theorem Matroid.Matroidᵣ.ofMatroid.inj E1 #

∀ {α : Type u_2} {toMatroid toMatroid_1 : Matroid α},
  { toMatroid := toMatroid } = { toMatroid := toMatroid_1 } → toMatroid = toMatroid_1

def Matroid.restrictIndepMatroid E1 #

{α : Type u_1} → Matroid α → Set α → IndepMatroid α

The IndepMatroid whose independent sets are the independent subsets of R.

theorem Matroid.restrictIndepMatroid_Indep E0 #

∀ {α : Type u_1} (M : Matroid α) (R I : Set α), (M.restrictIndepMatroid R).Indep I = (M.Indep I ∧ I ⊆ R)

theorem Matroid.restrictIndepMatroid_E E0 #

∀ {α : Type u_1} (M : Matroid α) (R : Set α), (M.restrictIndepMatroid R).E = R

def Matroid.restrict E1 #

{α : Type u_1} → Matroid α → Set α → Matroid α

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'.

def Matroid.«term_↾_» E1 #

Lean.TrailingParserDescr

M ↾ R means M.restrict R.

theorem Matroid.restrict_indep_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {R I : Set α}, (M.restrict R).Indep I ↔ M.Indep I ∧ I ⊆ R

theorem Matroid.Indep.indep_restrict_of_subset E1 #

∀ {α : Type u_1} {M : Matroid α} {R I : Set α}, M.Indep I → I ⊆ R → (M.restrict R).Indep I

theorem Matroid.Indep.of_restrict E1 #

∀ {α : Type u_1} {M : Matroid α} {R I : Set α}, (M.restrict R).Indep I → M.Indep I

theorem Matroid.restrict_ground_eq E0 #

∀ {α : Type u_1} {M : Matroid α} {R : Set α}, (M.restrict R).E = R

theorem Matroid.restrict_finite E1 #

∀ {α : Type u_1} {M : Matroid α} {R : Set α}, R.Finite → (M.restrict R).Finite

theorem Matroid.restrict_dep_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {R X : Set α}, (M.restrict R).Dep X ↔ ¬M.Indep X ∧ X ⊆ R

theorem Matroid.restrict_ground_eq_self E0 #

∀ {α : Type u_1} (M : Matroid α), M.restrict M.E = M

theorem Matroid.restrict_restrict_eq E0 #

∀ {α : Type u_1} {R₁ R₂ : Set α} (M : Matroid α), R₂ ⊆ R₁ → (M.restrict R₁).restrict R₂ = M.restrict R₂

theorem Matroid.restrict_idem E0 #

∀ {α : Type u_1} (M : Matroid α) (R : Set α), (M.restrict R).restrict R = M.restrict R

theorem Matroid.isBase_restrict_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α},
  autoParam (X ⊆ M.E) Matroid.isBase_restrict_iff._auto_1 → ((M.restrict X).IsBase I ↔ M.IsBasis I X)

theorem Matroid.isBase_restrict_iff' E1 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α}, (M.restrict X).IsBase I ↔ M.IsBasis' I X

theorem Matroid.IsBasis'.isBase_restrict E1 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α}, M.IsBasis' I X → (M.restrict X).IsBase I

theorem Matroid.IsBasis.restrict_isBase E1 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α}, M.IsBasis I X → (M.restrict X).IsBase I

instance Matroid.restrict_rankFinite E0 #

∀ {α : Type u_1} {M : Matroid α} [M.RankFinite] (R : Set α), (M.restrict R).RankFinite

instance Matroid.restrict_finitary E0 #

∀ {α : Type u_1} {M : Matroid α} [M.Finitary] (R : Set α), (M.restrict R).Finitary

theorem Matroid.IsBasis.isBase_restrict E0 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α}, M.IsBasis I X → (M.restrict X).IsBase I

theorem Matroid.IsBasis.isBasis_restrict_of_subset E1 #

∀ {α : Type u_1} {M : Matroid α} {I X Y : Set α}, M.IsBasis I X → X ⊆ Y → (M.restrict Y).IsBasis I X

theorem Matroid.isBasis'_restrict_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {R I X : Set α}, (M.restrict R).IsBasis' I X ↔ M.IsBasis' I (X ∩ R) ∧ I ⊆ R

theorem Matroid.isBasis_restrict_iff' E1 #

∀ {α : Type u_1} {M : Matroid α} {R I X : Set α}, (M.restrict R).IsBasis I X ↔ M.IsBasis I (X ∩ M.E) ∧ X ⊆ R

theorem Matroid.isBasis_restrict_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {R I X : Set α},
  autoParam (R ⊆ M.E) Matroid.isBasis_restrict_iff._auto_1 → ((M.restrict R).IsBasis I X ↔ M.IsBasis I X ∧ X ⊆ R)

theorem Matroid.isBasis'_iff_isBasis_restrict_univ E1 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α}, M.IsBasis' I X ↔ (M.restrict Set.univ).IsBasis I X

theorem Matroid.restrict_eq_restrict_iff E0 #

∀ {α : Type u_1} (M M' : Matroid α) (X : Set α), M.restrict X = M'.restrict X ↔ ∀ I ⊆ X, M.Indep I ↔ M'.Indep I

theorem Matroid.restrict_eq_self_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {R : Set α}, M.restrict R = M ↔ R = M.E

def Matroid.IsRestriction E1 #

{α : Type u_1} → Matroid α → Matroid α → Prop

Restriction N M means that N = M ↾ R for some subset R of M.E

def Matroid.IsStrictRestriction E1 #

{α : Type u_1} → Matroid α → Matroid α → Prop

IsStrictRestriction N M means that N = M ↾ R for some strict subset R of M.E

def Matroid.«term_≤r_» E1 #

Lean.TrailingParserDescr

N ≤r M means that N is a Restriction of M.

def Matroid.«term_<r_» E1 #

Lean.TrailingParserDescr

N <r M means that N is a IsStrictRestriction of M.

structure Matroid.Matroidᵣ E1 #

Type u_2 → Type u_2

A type synonym for matroids with the isRestriction order. (The PartialOrder on Matroid α is reserved for the minor order)

theorem Matroid.Matroidᵣ.ext E1 #

∀ {α : Type u_2} {x y : Matroid.Matroidᵣ α}, x.toMatroid = y.toMatroid → x = y

theorem Matroid.Matroidᵣ.ext_iff E0 #

∀ {α : Type u_2} {x y : Matroid.Matroidᵣ α}, x = y ↔ x.toMatroid = y.toMatroid

ctor Matroid.Matroidᵣ.ofMatroid E0 #

{α : Type u_2} → Matroid α → Matroid.Matroidᵣ α

abbrev Matroid.Matroidᵣ.toMatroid E1 #

{α : Type u_2} → Matroid.Matroidᵣ α → Matroid α

The underlying Matroid

instance Matroid.instCoeOutMatroidᵣ E0 #

{α : Type u_2} → CoeOut (Matroid.Matroidᵣ α) (Matroid α)

theorem Matroid.Matroidᵣ.coe_inj E0 #

∀ {α : Type u_1} {M₁ M₂ : Matroid.Matroidᵣ α}, M₁.toMatroid = M₂.toMatroid ↔ M₁ = M₂

instance Matroid.instPartialOrderMatroidᵣ E0 #

{α : Type u_2} → PartialOrder (Matroid.Matroidᵣ α)

theorem Matroid.Matroidᵣ.le_iff E0 #

∀ {α : Type u_1} {M M' : Matroid.Matroidᵣ α}, M ≤ M' ↔ M.toMatroid.IsRestriction M'.toMatroid

theorem Matroid.Matroidᵣ.lt_iff E0 #

∀ {α : Type u_1} {M M' : Matroid.Matroidᵣ α}, M < M' ↔ M.toMatroid.IsStrictRestriction M'.toMatroid

theorem Matroid.ofMatroid_le_iff E0 #

∀ {α : Type u_1} {M M' : Matroid α}, { toMatroid := M } ≤ { toMatroid := M' } ↔ M.IsRestriction M'

theorem Matroid.ofMatroid_lt_iff E0 #

∀ {α : Type u_1} {M M' : Matroid α}, { toMatroid := M } < { toMatroid := M' } ↔ M.IsStrictRestriction M'

theorem Matroid.IsRestriction.refl E1 #

∀ {α : Type u_1} {M : Matroid α}, M.IsRestriction M

theorem Matroid.IsRestriction.antisymm E1 #

∀ {α : Type u_1} {M M' : Matroid α}, M.IsRestriction M' → M'.IsRestriction M → M = M'

theorem Matroid.IsRestriction.trans E1 #

∀ {α : Type u_1} {M₁ M₂ M₃ : Matroid α}, M₁.IsRestriction M₂ → M₂.IsRestriction M₃ → M₁.IsRestriction M₃

theorem Matroid.restrict_isRestriction E1 #

∀ {α : Type u_1} (M : Matroid α) (R : Set α),
  autoParam (R ⊆ M.E) Matroid.restrict_isRestriction._auto_1 → (M.restrict R).IsRestriction M

theorem Matroid.IsRestriction.subset E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsRestriction M → N.E ⊆ M.E

theorem Matroid.IsRestriction.exists_eq_restrict E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsRestriction M → ∃ R ⊆ M.E, N = M.restrict R

theorem Matroid.IsRestriction.of_subset E1 #

∀ {α : Type u_1} {R R' : Set α} (M : Matroid α), R ⊆ R' → (M.restrict R).IsRestriction (M.restrict R')

theorem Matroid.isRestriction_iff_exists E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsRestriction M ↔ ∃ R ⊆ M.E, N = M.restrict R

theorem Matroid.IsStrictRestriction.isRestriction E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsStrictRestriction M → N.IsRestriction M

theorem Matroid.IsStrictRestriction.ne E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsStrictRestriction M → N ≠ M

theorem Matroid.IsStrictRestriction.irrefl E1 #

∀ {α : Type u_1} (M : Matroid α), ¬M.IsStrictRestriction M

theorem Matroid.IsStrictRestriction.ssubset E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsStrictRestriction M → N.E ⊂ M.E

theorem Matroid.IsStrictRestriction.exists_eq_restrict E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsStrictRestriction M → ∃ R ⊂ M.E, N = M.restrict R

theorem Matroid.IsRestriction.isStrictRestriction_of_ne E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsRestriction M → N ≠ M → N.IsStrictRestriction M

theorem Matroid.restrict_isStrictRestriction E1 #

∀ {α : Type u_1} {R : Set α} {M : Matroid α}, R ⊂ M.E → (M.restrict R).IsStrictRestriction M

theorem Matroid.IsRestriction.isStrictRestriction_of_ground_ne E1 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsRestriction M → N.E ≠ M.E → N.IsStrictRestriction M

theorem Matroid.IsStrictRestriction.of_ssubset E1 #

∀ {α : Type u_1} {R R' : Set α} (M : Matroid α), R ⊂ R' → (M.restrict R).IsStrictRestriction (M.restrict R')

theorem Matroid.IsRestriction.finite E1 #

∀ {α : Type u_1} {N M : Matroid α} [M.Finite], N.IsRestriction M → N.Finite

theorem Matroid.IsRestriction.rankFinite E1 #

∀ {α : Type u_1} {N M : Matroid α} [M.RankFinite], N.IsRestriction M → N.RankFinite

theorem Matroid.IsRestriction.finitary E1 #

∀ {α : Type u_1} {N M : Matroid α} [M.Finitary], N.IsRestriction M → N.Finitary

theorem Matroid.finite_setOfPred_isRestriction E1 #

∀ {α : Type u_1} (M : Matroid α) [M.Finite], {N | N.IsRestriction M}.Finite

theorem Matroid.Indep.of_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {I : Set α} {N : Matroid α}, N.Indep I → N.IsRestriction M → M.Indep I

theorem Matroid.Indep.indep_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {I : Set α} {N : Matroid α}, M.Indep I → N.IsRestriction M → I ⊆ N.E → N.Indep I

theorem Matroid.IsRestriction.indep_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {I : Set α} {N : Matroid α}, N.IsRestriction M → (N.Indep I ↔ M.Indep I ∧ I ⊆ N.E)

theorem Matroid.IsBasis.isBasis_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α} {N : Matroid α},
  M.IsBasis I X → N.IsRestriction M → X ⊆ N.E → N.IsBasis I X

theorem Matroid.IsBasis.of_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α} {N : Matroid α}, N.IsBasis I X → N.IsRestriction M → M.IsBasis I X

theorem Matroid.IsBase.isBasis_of_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {I : Set α} {N : Matroid α}, N.IsBase I → N.IsRestriction M → M.IsBasis I N.E

theorem Matroid.IsRestriction.base_iff E0 #

∀ {α : Type u_1} {M N : Matroid α}, N.IsRestriction M → ∀ {B : Set α}, N.IsBase B ↔ M.IsBasis B N.E

theorem Matroid.IsRestriction.isBasis_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {I X : Set α} {N : Matroid α},
  N.IsRestriction M → (N.IsBasis I X ↔ M.IsBasis I X ∧ X ⊆ N.E)

theorem Matroid.Dep.of_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {X : Set α} {N : Matroid α}, N.Dep X → N.IsRestriction M → M.Dep X

theorem Matroid.Dep.dep_isRestriction E1 #

∀ {α : Type u_1} {M : Matroid α} {X : Set α} {N : Matroid α},
  M.Dep X → N.IsRestriction M → autoParam (X ⊆ N.E) Matroid.Dep.dep_isRestriction._auto_1 → N.Dep X

theorem Matroid.IsRestriction.dep_iff E0 #

∀ {α : Type u_1} {M : Matroid α} {X : Set α} {N : Matroid α}, N.IsRestriction M → (N.Dep X ↔ M.Dep X ∧ X ⊆ N.E)

theorem Matroid.IsBasis.transfer E1 #

∀ {α : Type u_1} {M : Matroid α} {I X Y J : Set α},
  M.IsBasis I X → M.IsBasis J X → X ⊆ Y → M.IsBasis J Y → M.IsBasis I Y

theorem Matroid.IsBasis.isBasis_of_isBasis_of_subset_of_subset E1 #

∀ {α : Type u_1} {M : Matroid α} {I X Y J : Set α}, M.IsBasis I X → M.IsBasis J Y → J ⊆ X → I ⊆ Y → M.IsBasis I Y

theorem Matroid.Indep.exists_isBasis_subset_union_isBasis E1 #

∀ {α : Type u_1} {M : Matroid α} {I X J : Set α},
  M.Indep I → I ⊆ X → M.IsBasis J X → ∃ I', M.IsBasis I' X ∧ I ⊆ I' ∧ I' ⊆ I ∪ J

theorem Matroid.Indep.exists_insert_of_not_isBasis E1 #

∀ {α : Type u_1} {M : Matroid α} {I X J : Set α},
  M.Indep I → I ⊆ X → ¬M.IsBasis I X → M.IsBasis J X → ∃ e ∈ J \ I, M.Indep (insert e I)

theorem Matroid.IsBasis.isBase_of_isBase_subset E1 #

∀ {α : Type u_1} {M : Matroid α} {I X B : Set α}, M.IsBasis I X → M.IsBase B → B ⊆ X → M.IsBase I

theorem Matroid.IsBasis.exchange E1 #

∀ {α : Type u_1} {M : Matroid α} {I X J : Set α} {e : α},
  M.IsBasis I X → M.IsBasis J X → e ∈ I \ J → ∃ f ∈ J \ I, M.IsBasis (insert f (I \ {e})) X

theorem Matroid.IsBasis'.encard_eq_encard E1 #

∀ {α : Type u_1} {M : Matroid α} {I X J : Set α}, M.IsBasis' I X → M.IsBasis' J X → I.encard = J.encard

theorem Matroid.IsBasis.encard_eq_encard E1 #

∀ {α : Type u_1} {M : Matroid α} {I X J : Set α}, M.IsBasis I X → M.IsBasis J X → I.encard = J.encard

theorem Matroid.Indep.augment E1 #

∀ {α : Type u_1} {M : Matroid α} {I J : Set α},
  M.Indep I → M.Indep J → I.encard < J.encard → ∃ e ∈ J \ I, M.Indep (insert e I)

Any independent set can be extended into a larger independent set.

theorem Matroid.Indep.augment_finset E1 #

∀ {α : Type u_1} {M : Matroid α} {I J : Finset α},
  M.Indep ↑I → M.Indep ↑J → I.card < J.card → ∃ e ∈ J, e ∉ I ∧ M.Indep (insert e ↑I)

Deprecated aliases

NameNew nameSince
Matroid.finite_setOf_isRestrictionMatroid.finite_setOfPred_isRestriction2026-07-09