File: Mathlib/Data/Matroid/Basic.lean

full_name: Matroid.ExchangeProperty
code: /-- A predicate `P` on sets satisfies the **exchange property** if,
  for all `X` and `Y` satisfying `P` and all `a ∈ X \ Y`, there exists `b ∈ Y \ X` so that
  swapping `a` for `b` in `X` maintains `P`. -/
def Matroid.ExchangeProperty {α : Type _} (P : Set α → Prop) : Prop 
goal: Prop

full_name: Matroid.ExistsMaximalSubsetProperty
code: /-- A set `X` has the maximal subset property for a predicate `P` if every subset of `X` satisfying
  `P` is contained in a maximal subset of `X` satisfying `P`.  -/
def Matroid.ExistsMaximalSubsetProperty {α : Type _} (P : Set α → Prop) (X : Set α) : Prop 
goal: Prop

full_name: Matroid.Base
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: Set α → Prop

full_name: Matroid.indep_iff'
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: self.Indep I ↔ ∃ B, self.Base B ∧ I ⊆ B

full_name: Matroid.Indep
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: Set α → Prop

full_name: Matroid
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: Type u_1

full_name: Matroid.E
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: Set α

full_name: Matroid.base_exchange
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: Matroid.ExchangeProperty self.Base

full_name: Matroid.subset_ground
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: self.Base B → B ⊆ self.E

full_name: Matroid.maximality
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: X ⊆ self.E → Matroid.ExistsMaximalSubsetProperty self.Indep X

full_name: Matroid.exists_base
code: /-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)
goal: ∃ B, self.Base B

full_name: Matroid.Finite
code: /-- Typeclass for a matroid having finite ground set. Just a wrapper for `M.E.Finite`-/
protected class Finite (M : Matroid α) : Prop where
  /-- The ground set is finite -/
  (ground_finite : M.E.Finite)
goal: Prop

full_name: Matroid.Finite.ground_finite
code: /-- Typeclass for a matroid having finite ground set. Just a wrapper for `M.E.Finite`-/
protected class Finite (M : Matroid α) : Prop where
  /-- The ground set is finite -/
  (ground_finite : M.E.Finite)
goal: M.E.Finite

full_name: Matroid.Nonempty
code: /-- Typeclass for a matroid having nonempty ground set. Just a wrapper for `M.E.Nonempty`-/
protected class Nonempty (M : Matroid α) : Prop where
  /-- The ground set is nonempty -/
  (ground_nonempty : M.E.Nonempty)
goal: Prop

full_name: Matroid.Nonempty.ground_nonempty
code: /-- Typeclass for a matroid having nonempty ground set. Just a wrapper for `M.E.Nonempty`-/
protected class Nonempty (M : Matroid α) : Prop where
  /-- The ground set is nonempty -/
  (ground_nonempty : M.E.Nonempty)
goal: M.E.Nonempty

full_name: Matroid.ground_nonempty
code: theorem ground_nonempty (M : Matroid α) [M.Nonempty] : M.E.Nonempty 
goal: M.E.Nonempty

full_name: Matroid.ground_nonempty_iff
code: theorem ground_nonempty_iff (M : Matroid α) : M.E.Nonempty ↔ M.Nonempty 
goal: M.E.Nonempty ↔ M.Nonempty

full_name: Matroid.ground_finite
code: theorem ground_finite (M : Matroid α) [M.Finite] : M.E.Finite 
goal: M.E.Finite

full_name: Matroid.set_finite
code: theorem set_finite (M : Matroid α) [M.Finite] (X : Set α) (hX : X ⊆ M.E := by aesop) : X.Finite 
goal: X.Finite

full_name: Matroid.finite_of_finite
code: instance finite_of_finite [Finite α] {M : Matroid α} : M.Finite 
goal: M.Finite

full_name: Matroid.FiniteRk
code: /-- A `FiniteRk` matroid is one whose bases are finite -/
class FiniteRk (M : Matroid α) : Prop where
  /-- There is a finite base -/
  exists_finite_base : ∃ B, M.Base B ∧ B.Finite
goal: Prop

full_name: Matroid.FiniteRk.exists_finite_base
code: /-- A `FiniteRk` matroid is one whose bases are finite -/
class FiniteRk (M : Matroid α) : Prop where
  /-- There is a finite base -/
  exists_finite_base : ∃ B, M.Base B ∧ B.Finite
goal: ∃ B, M.Base B ∧ B.Finite

full_name: Matroid.finiteRk_of_finite
code: instance finiteRk_of_finite (M : Matroid α) [M.Finite] : FiniteRk M 
goal: M.FiniteRk

full_name: Matroid.InfiniteRk.exists_infinite_base
code: /-- An `InfiniteRk` matroid is one whose bases are infinite. -/
class InfiniteRk (M : Matroid α) : Prop where
  /-- There is an infinite base -/
  exists_infinite_base : ∃ B, M.Base B ∧ B.Infinite
goal: ∃ B, M.Base B ∧ B.Infinite

full_name: Matroid.InfiniteRk
code: /-- An `InfiniteRk` matroid is one whose bases are infinite. -/
class InfiniteRk (M : Matroid α) : Prop where
  /-- There is an infinite base -/
  exists_infinite_base : ∃ B, M.Base B ∧ B.Infinite
goal: Prop

full_name: Matroid.RkPos.empty_not_base
code: /-- A `RkPos` matroid is one whose bases are nonempty. -/
class RkPos (M : Matroid α) : Prop where
  /-- The empty set isn't a base -/
  empty_not_base : ¬M.Base ∅
goal: ¬M.Base ∅

full_name: Matroid.RkPos
code: /-- A `RkPos` matroid is one whose bases are nonempty. -/
class RkPos (M : Matroid α) : Prop where
  /-- The empty set isn't a base -/
  empty_not_base : ¬M.Base ∅
goal: Prop

full_name: Matroid.rkPos_iff_empty_not_base
code: theorem rkPos_iff_empty_not_base : M.RkPos ↔ ¬M.Base ∅ 
goal: M.RkPos ↔ ¬M.Base ∅

full_name: Matroid.ExchangeProperty.antichain
code: /-- A family of sets with the exchange property is an antichain. -/
theorem antichain (hB : Base B) (hB' : Base B') (h : B ⊆ B') : B = B' 
goal: B = B'

full_name: Matroid.ExchangeProperty.encard_diff_le_aux
code: theorem encard_diff_le_aux {B₁ B₂ : Set α}
    (exch : ExchangeProperty Base) (hB₁ : Base B₁) (hB₂ : Base B₂) :
    (B₁ \ B₂).encard ≤ (B₂ \ B₁).encard 
goal: (B₁ \ B₂).encard ≤ (B₂ \ B₁).encard

full_name: Matroid.ExchangeProperty.encard_diff_eq
code: /-- For any two sets `B₁`, `B₂` in a family with the exchange property, the differences `B₁ \ B₂`
and `B₂ \ B₁` have the same `ℕ∞`-cardinality. -/
theorem encard_diff_eq (hB₁ : Base B₁) (hB₂ : Base B₂) : (B₁ \ B₂).encard = (B₂ \ B₁).encard 
goal: (B₁ \ B₂).encard = (B₂ \ B₁).encard

full_name: Matroid.ExchangeProperty.encard_base_eq
code: /-- Any two sets `B₁`, `B₂` in a family with the exchange property have the same
`ℕ∞`-cardinality. -/
theorem encard_base_eq (hB₁ : Base B₁) (hB₂ : Base B₂) : B₁.encard = B₂.encard 
goal: B₁.encard = B₂.encard

full_name: Matroid.aesop_mat
code: macro (name := aesop_mat) "aesop_mat" c:Aesop.tactic_clause* : tactic =>
`(tactic|
  aesop $c* (config := { terminal := true })
  (rule_sets := [$(Lean.mkIdent `Matroid):ident]))
goal: Lean.ParserDescr

full_name: Matroid._aux_Mathlib_Data_Matroid_Basic___macroRules_Matroid_aesop_mat_1
code: macro (name := aesop_mat) "aesop_mat" c:Aesop.tactic_clause* : tactic =>
`(tactic|
  aesop $c* (config := { terminal := true })
  (rule_sets := [$(Lean.mkIdent `Matroid):ident]))
goal: Lean.Macro

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.inter_right_subset_ground
code: @[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem inter_right_subset_ground (hX : X ⊆ M.E) :
    X ∩ Y ⊆ M.E 
goal: X ∩ Y ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.inter_left_subset_ground
code: @[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem inter_left_subset_ground (hX : X ⊆ M.E) :
    Y ∩ X ⊆ M.E 
goal: Y ∩ X ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.diff_subset_ground
code: @[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem diff_subset_ground (hX : X ⊆ M.E) : X \ Y ⊆ M.E 
goal: X \ Y ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.ground_diff_subset_ground
code: @[aesop unsafe 10% (rule_sets := [Matroid])]
private theorem ground_diff_subset_ground : M.E \ X ⊆ M.E 
goal: M.E \ X ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.singleton_subset_ground
code: @[aesop unsafe 10% (rule_sets := [Matroid])]
private theorem singleton_subset_ground (he : e ∈ M.E) : {e} ⊆ M.E 
goal: {e} ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.subset_ground_of_subset
code: @[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem subset_ground_of_subset (hXY : X ⊆ Y) (hY : Y ⊆ M.E) : X ⊆ M.E 
goal: X ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.mem_ground_of_mem_of_subset
code: @[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem mem_ground_of_mem_of_subset (hX : X ⊆ M.E) (heX : e ∈ X) : e ∈ M.E 
goal: e ∈ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.insert_subset_ground
code: @[aesop safe (rule_sets := [Matroid])]
private theorem insert_subset_ground {e : α} {X : Set α} {M : Matroid α}
    (he : e ∈ M.E) (hX : X ⊆ M.E) : insert e X ⊆ M.E 
goal: insert e X ⊆ M.E

full_name: _private.Mathlib.Data.Matroid.Basic.0.Matroid.ground_subset_ground
code: @[aesop safe (rule_sets := [Matroid])]
private theorem ground_subset_ground {M : Matroid α} : M.E ⊆ M.E 
goal: M.E ⊆ M.E

full_name: Matroid.Base.subset_ground
code: @[aesop unsafe 10% (rule_sets := [Matroid])]
theorem Base.subset_ground (hB : M.Base B) : B ⊆ M.E 
goal: B ⊆ M.E

full_name: Matroid.Base.exchange
code: theorem Base.exchange {e : α} (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) (hx : e ∈ B₁ \ B₂) :
    ∃ y ∈ B₂ \ B₁, M.Base (insert y (B₁ \ {e}))  
goal: ∃ y ∈ B₂ \ B₁, M.Base (insert y (B₁ \ {e}))

full_name: Matroid.Base.exchange_mem
code: theorem Base.exchange_mem {e : α}
    (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) (hxB₁ : e ∈ B₁) (hxB₂ : e ∉ B₂) :
    ∃ y, (y ∈ B₂ ∧ y ∉ B₁) ∧ M.Base (insert y (B₁ \ {e})) 
goal: ∃ y, (y ∈ B₂ ∧ y ∉ B₁) ∧ M.Base (insert y (B₁ \ {e}))

full_name: Matroid.Base.eq_of_subset_base
code: theorem Base.eq_of_subset_base (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) (hB₁B₂ : B₁ ⊆ B₂) :
    B₁ = B₂ 
goal: B₁ = B₂

full_name: Matroid.Base.not_base_of_ssubset
code: theorem Base.not_base_of_ssubset {X : Set α} (hB : M.Base B) (hX : X ⊂ B) : ¬ M.Base X 
goal: ¬M.Base X

full_name: Matroid.Base.insert_not_base
code: theorem Base.insert_not_base {e : α} (hB : M.Base B) (heB : e ∉ B) : ¬ M.Base (insert e B) 
goal: ¬M.Base (insert e B)

full_name: Matroid.Base.encard_diff_comm
code: theorem Base.encard_diff_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).encard = (B₂ \ B₁).encard 
goal: (B₁ \ B₂).encard = (B₂ \ B₁).encard

full_name: Matroid.Base.ncard_diff_comm
code: theorem Base.ncard_diff_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).ncard = (B₂ \ B₁).ncard 
goal: (B₁ \ B₂).ncard = (B₂ \ B₁).ncard

full_name: Matroid.Base.card_eq_card_of_base
code: theorem Base.card_eq_card_of_base (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    B₁.encard = B₂.encard 
goal: B₁.encard = B₂.encard

full_name: Matroid.Base.ncard_eq_ncard_of_base
code: theorem Base.ncard_eq_ncard_of_base (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) : B₁.ncard = B₂.ncard 
goal: B₁.ncard = B₂.ncard

full_name: Matroid.Base.finite_of_finite
code: theorem Base.finite_of_finite {B' : Set α}
    (hB : M.Base B) (h : B.Finite) (hB' : M.Base B') : B'.Finite 
goal: B'.Finite

full_name: Matroid.Base.infinite_of_infinite
code: theorem Base.infinite_of_infinite (hB : M.Base B) (h : B.Infinite) (hB₁ : M.Base B₁) :
    B₁.Infinite 
goal: B₁.Infinite

full_name: Matroid.Base.finite
code: theorem Base.finite [FiniteRk M] (hB : M.Base B) : B.Finite 
goal: B.Finite

full_name: Matroid.Base.infinite
code: theorem Base.infinite [InfiniteRk M] (hB : M.Base B) : B.Infinite 
goal: B.Infinite

full_name: Matroid.empty_not_base
code: theorem empty_not_base [h : RkPos M] : ¬M.Base ∅ 
goal: ¬M.Base ∅

full_name: Matroid.Base.nonempty
code: theorem Base.nonempty [RkPos M] (hB : M.Base B) : B.Nonempty 
goal: B.Nonempty

full_name: Matroid.Base.rkPos_of_nonempty
code: theorem Base.rkPos_of_nonempty (hB : M.Base B) (h : B.Nonempty) : M.RkPos 
goal: M.RkPos

full_name: Matroid.Base.finiteRk_of_finite
code: theorem Base.finiteRk_of_finite (hB : M.Base B) (hfin : B.Finite) : FiniteRk M 
goal: M.FiniteRk

full_name: Matroid.Base.infiniteRk_of_infinite
code: theorem Base.infiniteRk_of_infinite (hB : M.Base B) (h : B.Infinite) : InfiniteRk M 
goal: M.InfiniteRk

full_name: Matroid.not_finiteRk
code: theorem not_finiteRk (M : Matroid α) [InfiniteRk M] : ¬ FiniteRk M 
goal: ¬M.FiniteRk

full_name: Matroid.not_infiniteRk
code: theorem not_infiniteRk (M : Matroid α) [FiniteRk M] : ¬ InfiniteRk M 
goal: ¬M.InfiniteRk

full_name: Matroid.finite_or_infiniteRk
code: theorem finite_or_infiniteRk (M : Matroid α) : FiniteRk M ∨ InfiniteRk M 
goal: M.FiniteRk ∨ M.InfiniteRk

full_name: Matroid.Base.diff_finite_comm
code: theorem Base.diff_finite_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).Finite ↔ (B₂ \ B₁).Finite 
goal: (B₁ \ B₂).Finite ↔ (B₂ \ B₁).Finite

full_name: Matroid.Base.diff_infinite_comm
code: theorem Base.diff_infinite_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
    (B₁ \ B₂).Infinite ↔ (B₂ \ B₁).Infinite 
goal: (B₁ \ B₂).Infinite ↔ (B₂ \ B₁).Infinite

full_name: Matroid.eq_of_base_iff_base_forall
code: theorem eq_of_base_iff_base_forall {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
    (h : ∀ ⦃B⦄, B ⊆ M₁.E → (M₁.Base B ↔ M₂.Base B)) : M₁ = M₂ 
goal: M₁ = M₂

full_name: Matroid.base_compl_iff_mem_maximals_disjoint_base
code: theorem base_compl_iff_mem_maximals_disjoint_base (hB : B ⊆ M.E := by aesop_mat) :
    M.Base (M.E \ B) ↔ B ∈ maximals (· ⊆ ·) {I | I ⊆ M.E ∧ ∃ B, M.Base B ∧ Disjoint I B} 
goal: M.Base (M.E \ B) ↔ B ∈ maximals (fun x x_1 => x ⊆ x_1) {I | I ⊆ M.E ∧ ∃ B, M.Base B ∧ Disjoint I B}

full_name: Matroid.Dep
code: /-- A subset of `M.E` is `Dep`endent if it is not `Indep`endent . -/
def Dep (M : Matroid α) (D : Set α) : Prop 
goal: Prop

full_name: Matroid.indep_iff
code: theorem indep_iff : M.Indep I ↔ ∃ B, M.Base B ∧ I ⊆ B 
goal: M.Indep I ↔ ∃ B, M.Base B ∧ I ⊆ B

full_name: Matroid.setOf_indep_eq
code: theorem setOf_indep_eq (M : Matroid α) : {I | M.Indep I} = lowerClosure ({B | M.Base B}) 
goal: {I | M.Indep I} = ↑(lowerClosure {B | M.Base B})

full_name: Matroid.Indep.exists_base_superset
code: theorem Indep.exists_base_superset (hI : M.Indep I) : ∃ B, M.Base B ∧ I ⊆ B 
goal: ∃ B, M.Base B ∧ I ⊆ B

full_name: Matroid.dep_iff
code: theorem dep_iff : M.Dep D ↔ ¬M.Indep D ∧ D ⊆ M.E 
goal: M.Dep D ↔ ¬M.Indep D ∧ D ⊆ M.E

full_name: Matroid.setOf_dep_eq
code: theorem setOf_dep_eq (M : Matroid α) : {D | M.Dep D} = {I | M.Indep I}ᶜ ∩ Iic M.E 
goal: {D | M.Dep D} = {I | M.Indep I}ᶜ ∩ Set.Iic M.E

full_name: Matroid.Indep.subset_ground
code: @[aesop unsafe 30% (rule_sets := [Matroid])]
theorem Indep.subset_ground (hI : M.Indep I) : I ⊆ M.E 
goal: I ⊆ M.E

full_name: Matroid.Dep.subset_ground
code: @[aesop unsafe 20% (rule_sets := [Matroid])]
theorem Dep.subset_ground (hD : M.Dep D) : D ⊆ M.E 
goal: D ⊆ M.E

full_name: Matroid.indep_or_dep
code: theorem indep_or_dep (hX : X ⊆ M.E := by aesop_mat) : M.Indep X ∨ M.Dep X 
goal: M.Indep X ∨ M.Dep X

full_name: Matroid.Indep.not_dep
code: theorem Indep.not_dep (hI : M.Indep I) : ¬ M.Dep I 
goal: ¬M.Dep I

full_name: Matroid.Dep.not_indep
code: theorem Dep.not_indep (hD : M.Dep D) : ¬ M.Indep D 
goal: ¬M.Indep D

full_name: Matroid.dep_of_not_indep
code: theorem dep_of_not_indep (hD : ¬ M.Indep D) (hDE : D ⊆ M.E := by aesop_mat) : M.Dep D 
goal: M.Dep D

full_name: Matroid.indep_of_not_dep
code: theorem indep_of_not_dep (hI : ¬ M.Dep I) (hIE : I ⊆ M.E := by aesop_mat) : M.Indep I 
goal: M.Indep I

full_name: Matroid.not_dep_iff
code: @[simp] theorem not_dep_iff (hX : X ⊆ M.E := by aesop_mat) : ¬ M.Dep X ↔ M.Indep X 
goal: ¬M.Dep X ↔ M.Indep X

full_name: Matroid.not_indep_iff
code: @[simp] theorem not_indep_iff (hX : X ⊆ M.E := by aesop_mat) : ¬ M.Indep X ↔ M.Dep X 
goal: ¬M.Indep X ↔ M.Dep X

full_name: Matroid.indep_iff_not_dep
code: theorem indep_iff_not_dep : M.Indep I ↔ ¬M.Dep I ∧ I ⊆ M.E 
goal: M.Indep I ↔ ¬M.Dep I ∧ I ⊆ M.E

full_name: Matroid.Indep.subset
code: theorem Indep.subset (hJ : M.Indep J) (hIJ : I ⊆ J) : M.Indep I 
goal: M.Indep I

full_name: Matroid.Dep.superset
code: theorem Dep.superset (hD : M.Dep D) (hDX : D ⊆ X) (hXE : X ⊆ M.E := by aesop_mat) : M.Dep X 
goal: M.Dep X

full_name: Matroid.Base.indep
code: theorem Base.indep (hB : M.Base B) : M.Indep B 
goal: M.Indep B

full_name: Matroid.empty_indep
code: @[simp] theorem empty_indep (M : Matroid α) : M.Indep ∅ 
goal: M.Indep ∅

full_name: Matroid.Dep.nonempty
code: theorem Dep.nonempty (hD : M.Dep D) : D.Nonempty 
goal: D.Nonempty

full_name: Matroid.Indep.finite
code: theorem Indep.finite [FiniteRk M] (hI : M.Indep I) : I.Finite 
goal: I.Finite

full_name: Matroid.Indep.rkPos_of_nonempty
code: theorem Indep.rkPos_of_nonempty (hI : M.Indep I) (hne : I.Nonempty) : M.RkPos 
goal: M.RkPos

full_name: Matroid.Indep.inter_right
code: theorem Indep.inter_right (hI : M.Indep I) (X : Set α) : M.Indep (I ∩ X) 
goal: M.Indep (I ∩ X)

full_name: Matroid.Indep.inter_left
code: theorem Indep.inter_left (hI : M.Indep I) (X : Set α) : M.Indep (X ∩ I) 
goal: M.Indep (X ∩ I)

full_name: Matroid.Indep.diff
code: theorem Indep.diff (hI : M.Indep I) (X : Set α) : M.Indep (I \ X) 
goal: M.Indep (I \ X)

full_name: Matroid.Base.eq_of_subset_indep
code: theorem Base.eq_of_subset_indep (hB : M.Base B) (hI : M.Indep I) (hBI : B ⊆ I) : B = I 
goal: B = I

full_name: Matroid.base_iff_maximal_indep
code: theorem base_iff_maximal_indep : M.Base B ↔ M.Indep B ∧ ∀ I, M.Indep I → B ⊆ I → B = I 
goal: M.Base B ↔ M.Indep B ∧ ∀ (I : Set α), M.Indep I → B ⊆ I → B = I

full_name: Matroid.setOf_base_eq_maximals_setOf_indep
code: theorem setOf_base_eq_maximals_setOf_indep : {B | M.Base B} = maximals (· ⊆ ·) {I | M.Indep I} 
goal: {B | M.Base B} = maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I}

full_name: Matroid.Indep.base_of_maximal
code: theorem Indep.base_of_maximal (hI : M.Indep I) (h : ∀ J, M.Indep J → I ⊆ J → I = J) : M.Base I 
goal: M.Base I

full_name: Matroid.Base.dep_of_ssubset
code: theorem Base.dep_of_ssubset (hB : M.Base B) (h : B ⊂ X) (hX : X ⊆ M.E := by aesop_mat) : M.Dep X 
goal: M.Dep X

full_name: Matroid.Base.dep_of_insert
code: theorem Base.dep_of_insert (hB : M.Base B) (heB : e ∉ B) (he : e ∈ M.E := by aesop_mat) :
    M.Dep (insert e B) 
goal: M.Dep (insert e B)

full_name: Matroid.Base.mem_of_insert_indep
code: theorem Base.mem_of_insert_indep (hB : M.Base B) (heB : M.Indep (insert e B)) : e ∈ B 
goal: e ∈ B

full_name: Matroid.Base.eq_exchange_of_diff_eq_singleton
code: /-- If the difference of two Bases is a singleton, then they differ by an insertion/removal -/
theorem Base.eq_exchange_of_diff_eq_singleton (hB : M.Base B) (hB' : M.Base B') (h : B \ B' = {e}) :
    ∃ f ∈ B' \ B, B' = (insert f B) \ {e} 
goal: ∃ f ∈ B' \ B, B' = insert f B \ {e}

full_name: Matroid.Base.exchange_base_of_indep
code: theorem Base.exchange_base_of_indep (hB : M.Base B) (hf : f ∉ B)
    (hI : M.Indep (insert f (B \ {e}))) : M.Base (insert f (B \ {e})) 
goal: M.Base (insert f (B \ {e}))

full_name: Matroid.Base.exchange_base_of_indep'
code: theorem Base.exchange_base_of_indep' (hB : M.Base B) (he : e ∈ B) (hf : f ∉ B)
    (hI : M.Indep (insert f B \ {e})) : M.Base (insert f B \ {e}) 
goal: M.Base (insert f B \ {e})

full_name: Matroid.Base.insert_dep
code: theorem Base.insert_dep (hB : M.Base B) (h : e ∈ M.E \ B) : M.Dep (insert e B) 
goal: M.Dep (insert e B)

full_name: Matroid.Indep.exists_insert_of_not_base
code: theorem Indep.exists_insert_of_not_base (hI : M.Indep I) (hI' : ¬M.Base I) (hB : M.Base B) :
    ∃ e ∈ B \ I, M.Indep (insert e I) 
goal: ∃ e ∈ B \ I, M.Indep (insert e I)

full_name: Matroid.Indep.exists_insert_of_not_mem_maximals
code: /-- This is the same as `Indep.exists_insert_of_not_base`, but phrased so that
  it is defeq to the augmentation axiom for independent sets. -/
theorem Indep.exists_insert_of_not_mem_maximals (M : Matroid α) ⦃I B : Set α⦄ (hI : M.Indep I)
    (hInotmax : I ∉ maximals (· ⊆ ·) {I | M.Indep I}) (hB : B ∈ maximals (· ⊆ ·) {I | M.Indep I}) :
    ∃ x ∈ B \ I, M.Indep (insert x I) 
goal: ∃ x ∈ B \ I, M.Indep (insert x I)

full_name: Matroid.Indep.base_of_forall_insert
code: theorem Indep.base_of_forall_insert (hB : M.Indep B)
    (hBmax : ∀ e ∈ M.E \ B, ¬ M.Indep (insert e B)) : M.Base B 
goal: M.Base B

full_name: Matroid.ground_indep_iff_base
code: theorem ground_indep_iff_base : M.Indep M.E ↔ M.Base M.E 
goal: M.Indep M.E ↔ M.Base M.E

full_name: Matroid.Base.exists_insert_of_ssubset
code: theorem Base.exists_insert_of_ssubset (hB : M.Base B) (hIB : I ⊂ B) (hB' : M.Base B') :
    ∃ e ∈ B' \ I, M.Indep (insert e I) 
goal: ∃ e ∈ B' \ I, M.Indep (insert e I)

full_name: Matroid.eq_of_indep_iff_indep_forall
code: theorem eq_of_indep_iff_indep_forall {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
    (h : ∀ I, I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I)) : M₁ = M₂ 
goal: M₁ = M₂

full_name: Matroid.eq_iff_indep_iff_indep_forall
code: theorem eq_iff_indep_iff_indep_forall {M₁ M₂ : Matroid α} :
    M₁ = M₂ ↔ (M₁.E = M₂.E) ∧ ∀ I, I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I) 
goal: M₁ = M₂ ↔ M₁.E = M₂.E ∧ ∀ I ⊆ M₁.E, M₁.Indep I ↔ M₂.Indep I

full_name: Matroid.Finitary.indep_of_forall_finite
code: /-- A `Finitary` matroid is one where a set is independent if and only if it all
  its finite subsets are independent, or equivalently a matroid whose circuits are finite. -/
class Finitary (M : Matroid α) : Prop where
  /-- `I` is independent if all its finite subsets are independent. -/
  indep_of_forall_finite : ∀ I, (∀ J, J ⊆ I → J.Finite → M.Indep J) → M.Indep I
goal: (∀ J ⊆ I, J.Finite → M.Indep J) → M.Indep I

full_name: Matroid.Finitary
code: /-- A `Finitary` matroid is one where a set is independent if and only if it all
  its finite subsets are independent, or equivalently a matroid whose circuits are finite. -/
class Finitary (M : Matroid α) : Prop where
  /-- `I` is independent if all its finite subsets are independent. -/
  indep_of_forall_finite : ∀ I, (∀ J, J ⊆ I → J.Finite → M.Indep J) → M.Indep I
goal: Prop

full_name: Matroid.indep_of_forall_finite_subset_indep
code: theorem indep_of_forall_finite_subset_indep {M : Matroid α} [Finitary M] (I : Set α)
    (h : ∀ J, J ⊆ I → J.Finite → M.Indep J) : M.Indep I 
goal: M.Indep I

full_name: Matroid.indep_iff_forall_finite_subset_indep
code: theorem indep_iff_forall_finite_subset_indep {M : Matroid α} [Finitary M] :
    M.Indep I ↔ ∀ J, J ⊆ I → J.Finite → M.Indep J 
goal: M.Indep I ↔ ∀ J ⊆ I, J.Finite → M.Indep J

full_name: Matroid.finitary_of_finiteRk
code: instance finitary_of_finiteRk {M : Matroid α} [FiniteRk M] : Finitary M 
goal: M.Finitary

full_name: Matroid.existsMaximalSubsetProperty_indep
code: /-- Matroids obey the maximality axiom -/
theorem existsMaximalSubsetProperty_indep (M : Matroid α) :
    ∀ X, X ⊆ M.E → ExistsMaximalSubsetProperty M.Indep X 
goal: X ⊆ M.E → Matroid.ExistsMaximalSubsetProperty M.Indep X

full_name: Matroid.Basis
code: /-- A Basis for a set `X ⊆ M.E` is a maximal independent subset of `X`
  (Often in the literature, the word 'Basis' is used to refer to what we call a 'Base'). -/
def Basis (M : Matroid α) (I X : Set α) : Prop 
goal: Prop

full_name: Matroid.Basis'
code: /-- A `Basis'` is a basis without the requirement that `X ⊆ M.E`. This is convenient for some
  API building, especially when working with rank and closure.  -/
def Basis' (M : Matroid α) (I X : Set α) : Prop 
goal: Prop

full_name: Matroid.Basis'.indep
code: theorem Basis'.indep (hI : M.Basis' I X) : M.Indep I 
goal: M.Indep I

full_name: Matroid.Basis.indep
code: theorem Basis.indep (hI : M.Basis I X) : M.Indep I 
goal: M.Indep I

full_name: Matroid.Basis.subset
code: theorem Basis.subset (hI : M.Basis I X) : I ⊆ X 
goal: I ⊆ X

full_name: Matroid.Basis.basis'
code: theorem Basis.basis' (hI : M.Basis I X) : M.Basis' I X 
goal: M.Basis' I X

full_name: Matroid.Basis'.basis
code: theorem Basis'.basis (hI : M.Basis' I X) (hX : X ⊆ M.E := by aesop_mat) : M.Basis I X 
goal: M.Basis I X

full_name: Matroid.Basis'.subset
code: theorem Basis'.subset (hI : M.Basis' I X) : I ⊆ X 
goal: I ⊆ X

full_name: Matroid.setOf_basis_eq
code: theorem setOf_basis_eq (M : Matroid α) (hX : X ⊆ M.E := by aesop_mat) :
    {I | M.Basis I X} = maximals (· ⊆ ·) ({I | M.Indep I} ∩ Iic X) 
goal: {I | M.Basis I X} = maximals (fun x x_1 => x ⊆ x_1) ({I | M.Indep I} ∩ Set.Iic X)

full_name: Matroid.Basis.subset_ground
code: @[aesop unsafe 15% (rule_sets := [Matroid])]
theorem Basis.subset_ground (hI : M.Basis I X) : X ⊆ M.E 
goal: X ⊆ M.E

full_name: Matroid.Basis.basis_inter_ground
code: theorem Basis.basis_inter_ground (hI : M.Basis I X) : M.Basis I (X ∩ M.E) 
goal: M.Basis I (X ∩ M.E)

full_name: Matroid.Basis.left_subset_ground
code: @[aesop unsafe 15% (rule_sets := [Matroid])]
theorem Basis.left_subset_ground (hI : M.Basis I X) : I ⊆ M.E 
goal: I ⊆ M.E

full_name: Matroid.Basis.eq_of_subset_indep
code: theorem Basis.eq_of_subset_indep (hI : M.Basis I X) (hJ : M.Indep J) (hIJ : I ⊆ J) (hJX : J ⊆ X) :
    I = J 
goal: I = J

full_name: Matroid.Basis.Finite
code: theorem Basis.Finite (hI : M.Basis I X) [FiniteRk M] : I.Finite 
goal: I.Finite

full_name: Matroid.basis_iff'
code: theorem basis_iff' :
    M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ J, M.Indep J → I ⊆ J → J ⊆ X → I = J) ∧ X ⊆ M.E 
goal: M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ (J : Set α), M.Indep J → I ⊆ J → J ⊆ X → I = J) ∧ X ⊆ M.E

full_name: Matroid.basis_iff
code: theorem basis_iff (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ J, M.Indep J → I ⊆ J → J ⊆ X → I = J) 
goal: M.Basis I X ↔ M.Indep I ∧ I ⊆ X ∧ ∀ (J : Set α), M.Indep J → I ⊆ J → J ⊆ X → I = J

full_name: Matroid.basis'_iff_basis_inter_ground
code: theorem basis'_iff_basis_inter_ground : M.Basis' I X ↔ M.Basis I (X ∩ M.E) 
goal: M.Basis' I X ↔ M.Basis I (X ∩ M.E)

full_name: Matroid.basis'_iff_basis
code: theorem basis'_iff_basis (hX : X ⊆ M.E := by aesop_mat) : M.Basis' I X ↔ M.Basis I X 
goal: M.Basis' I X ↔ M.Basis I X

full_name: Matroid.basis_iff_basis'_subset_ground
code: theorem basis_iff_basis'_subset_ground : M.Basis I X ↔ M.Basis' I X ∧ X ⊆ M.E 
goal: M.Basis I X ↔ M.Basis' I X ∧ X ⊆ M.E

full_name: Matroid.Basis'.basis_inter_ground
code: theorem Basis'.basis_inter_ground (hIX : M.Basis' I X) : M.Basis I (X ∩ M.E) 
goal: M.Basis I (X ∩ M.E)

full_name: Matroid.Basis'.eq_of_subset_indep
code: theorem Basis'.eq_of_subset_indep (hI : M.Basis' I X) (hJ : M.Indep J) (hIJ : I ⊆ J)
    (hJX : J ⊆ X) : I = J 
goal: I = J

full_name: Matroid.Basis'.insert_not_indep
code: theorem Basis'.insert_not_indep (hI : M.Basis' I X) (he : e ∈ X \ I) : ¬ M.Indep (insert e I) 
goal: ¬M.Indep (insert e I)

full_name: Matroid.basis_iff_mem_maximals
code: theorem basis_iff_mem_maximals (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X ↔ I ∈ maximals (· ⊆ ·) {I | M.Indep I ∧ I ⊆ X} 
goal: M.Basis I X ↔ I ∈ maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I ∧ I ⊆ X}

full_name: Matroid.basis_iff_mem_maximals_Prop
code: theorem basis_iff_mem_maximals_Prop (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X ↔ I ∈ maximals (· ⊆ ·) (fun I ↦ M.Indep I ∧ I ⊆ X) 
goal: M.Basis I X ↔ I ∈ maximals (fun x x_1 => x ⊆ x_1) fun I => M.Indep I ∧ I ⊆ X

full_name: Matroid.Indep.basis_of_maximal_subset
code: theorem Indep.basis_of_maximal_subset (hI : M.Indep I) (hIX : I ⊆ X)
    (hmax : ∀ ⦃J⦄, M.Indep J → I ⊆ J → J ⊆ X → J ⊆ I) (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X 
goal: M.Basis I X

full_name: Matroid.Basis.basis_subset
code: theorem Basis.basis_subset (hI : M.Basis I X) (hIY : I ⊆ Y) (hYX : Y ⊆ X) : M.Basis I Y 
goal: M.Basis I Y

full_name: Matroid.basis_self_iff_indep
code: @[simp] theorem basis_self_iff_indep : M.Basis I I ↔ M.Indep I 
goal: M.Basis I I ↔ M.Indep I

full_name: Matroid.Indep.basis_self
code: theorem Indep.basis_self (h : M.Indep I) : M.Basis I I 
goal: M.Basis I I

full_name: Matroid.basis_empty_iff
code: @[simp] theorem basis_empty_iff (M : Matroid α) : M.Basis I ∅ ↔ I = ∅ 
goal: M.Basis I ∅ ↔ I = ∅

full_name: Matroid.Basis.dep_of_ssubset
code: theorem Basis.dep_of_ssubset (hI : M.Basis I X) (hIY : I ⊂ Y) (hYX : Y ⊆ X) : M.Dep Y 
goal: M.Dep Y

full_name: Matroid.Basis.insert_dep
code: theorem Basis.insert_dep (hI : M.Basis I X) (he : e ∈ X \ I) : M.Dep (insert e I) 
goal: M.Dep (insert e I)

full_name: Matroid.Basis.mem_of_insert_indep
code: theorem Basis.mem_of_insert_indep (hI : M.Basis I X) (he : e ∈ X) (hIe : M.Indep (insert e I)) :
    e ∈ I 
goal: e ∈ I

full_name: Matroid.Basis'.mem_of_insert_indep
code: theorem Basis'.mem_of_insert_indep (hI : M.Basis' I X) (he : e ∈ X) (hIe : M.Indep (insert e I)) :
    e ∈ I 
goal: e ∈ I

full_name: Matroid.Basis.not_basis_of_ssubset
code: theorem Basis.not_basis_of_ssubset (hI : M.Basis I X) (hJI : J ⊂ I) : ¬ M.Basis J X 
goal: ¬M.Basis J X

full_name: Matroid.Indep.subset_basis_of_subset
code: theorem Indep.subset_basis_of_subset (hI : M.Indep I) (hIX : I ⊆ X) (hX : X ⊆ M.E := by aesop_mat) :
    ∃ J, M.Basis J X ∧ I ⊆ J 
goal: ∃ J, M.Basis J X ∧ I ⊆ J

full_name: Matroid.Indep.subset_basis'_of_subset
code: theorem Indep.subset_basis'_of_subset (hI : M.Indep I) (hIX : I ⊆ X) :
    ∃ J, M.Basis' J X ∧ I ⊆ J 
goal: ∃ J, M.Basis' J X ∧ I ⊆ J

full_name: Matroid.exists_basis
code: theorem exists_basis (M : Matroid α) (X : Set α) (hX : X ⊆ M.E := by aesop_mat) :
    ∃ I, M.Basis I X 
goal: ∃ I, M.Basis I X

full_name: Matroid.exists_basis'
code: theorem exists_basis' (M : Matroid α) (X : Set α) : ∃ I, M.Basis' I X 
goal: ∃ I, M.Basis' I X

full_name: Matroid.exists_basis_subset_basis
code: theorem exists_basis_subset_basis (M : Matroid α) (hXY : X ⊆ Y) (hY : Y ⊆ M.E := by aesop_mat) :
    ∃ I J, M.Basis I X ∧ M.Basis J Y ∧ I ⊆ J 
goal: ∃ I J, M.Basis I X ∧ M.Basis J Y ∧ I ⊆ J

full_name: Matroid.Basis.exists_basis_inter_eq_of_superset
code: theorem Basis.exists_basis_inter_eq_of_superset (hI : M.Basis I X) (hXY : X ⊆ Y)
    (hY : Y ⊆ M.E := by aesop_mat) : ∃ J, M.Basis J Y ∧ J ∩ X = I 
goal: ∃ J, M.Basis J Y ∧ J ∩ X = I

full_name: Matroid.exists_basis_union_inter_basis
code: theorem exists_basis_union_inter_basis (M : Matroid α) (X Y : Set α) (hX : X ⊆ M.E := by aesop_mat)
    (hY : Y ⊆ M.E := by aesop_mat) : ∃ I, M.Basis I (X ∪ Y) ∧ M.Basis (I ∩ Y) Y 
goal: ∃ I, M.Basis I (X ∪ Y) ∧ M.Basis (I ∩ Y) Y

full_name: Matroid.Indep.eq_of_basis
code: theorem Indep.eq_of_basis (hI : M.Indep I) (hJ : M.Basis J I) : J = I 
goal: J = I

full_name: Matroid.Basis.exists_base
code: theorem Basis.exists_base (hI : M.Basis I X) : ∃ B, M.Base B ∧ I = B ∩ X 
goal: ∃ B, M.Base B ∧ I = B ∩ X

full_name: Matroid.basis_ground_iff
code: @[simp] theorem basis_ground_iff : M.Basis B M.E ↔ M.Base B 
goal: M.Basis B M.E ↔ M.Base B

full_name: Matroid.Base.basis_ground
code: theorem Base.basis_ground (hB : M.Base B) : M.Basis B M.E 
goal: M.Basis B M.E

full_name: Matroid.Indep.basis_iff_forall_insert_dep
code: theorem Indep.basis_iff_forall_insert_dep (hI : M.Indep I) (hIX : I ⊆ X) :
    M.Basis I X ↔ ∀ e ∈ X \ I, M.Dep (insert e I) 
goal: M.Basis I X ↔ ∀ e ∈ X \ I, M.Dep (insert e I)

full_name: Matroid.Indep.basis_of_forall_insert
code: theorem Indep.basis_of_forall_insert (hI : M.Indep I) (hIX : I ⊆ X)
    (he : ∀ e ∈ X \ I, M.Dep (insert e I)) : M.Basis I X 
goal: M.Basis I X

full_name: Matroid.Indep.basis_insert_iff
code: theorem Indep.basis_insert_iff (hI : M.Indep I) :
    M.Basis I (insert e I) ↔ M.Dep (insert e I) ∨ e ∈ I 
goal: M.Basis I (insert e I) ↔ M.Dep (insert e I) ∨ e ∈ I

full_name: Matroid.Basis.iUnion_basis_iUnion
code: theorem Basis.iUnion_basis_iUnion {ι : Type _} (X I : ι → Set α) (hI : ∀ i, M.Basis (I i) (X i))
    (h_ind : M.Indep (⋃ i, I i)) : M.Basis (⋃ i, I i) (⋃ i, X i) 
goal: M.Basis (⋃ i, I i) (⋃ i, X i)

full_name: Matroid.Basis.basis_iUnion
code: theorem Basis.basis_iUnion {ι : Type _} [Nonempty ι] (X : ι → Set α)
    (hI : ∀ i, M.Basis I (X i)) : M.Basis I (⋃ i, X i) 
goal: M.Basis I (⋃ i, X i)

full_name: Matroid.Basis.basis_sUnion
code: theorem Basis.basis_sUnion {Xs : Set (Set α)} (hne : Xs.Nonempty) (h : ∀ X ∈ Xs, M.Basis I X) :
    M.Basis I (⋃₀ Xs) 
goal: M.Basis I (⋃₀ Xs)

full_name: Matroid.Indep.basis_setOf_insert_basis
code: theorem Indep.basis_setOf_insert_basis (hI : M.Indep I) :
    M.Basis I {x | M.Basis I (insert x I)} 
goal: M.Basis I {x | M.Basis I (insert x I)}

full_name: Matroid.Basis.union_basis_union
code: theorem Basis.union_basis_union (hIX : M.Basis I X) (hJY : M.Basis J Y) (h : M.Indep (I ∪ J)) :
    M.Basis (I ∪ J) (X ∪ Y) 
goal: M.Basis (I ∪ J) (X ∪ Y)

full_name: Matroid.Basis.basis_union
code: theorem Basis.basis_union (hIX : M.Basis I X) (hIY : M.Basis I Y) : M.Basis I (X ∪ Y) 
goal: M.Basis I (X ∪ Y)

full_name: Matroid.Basis.basis_union_of_subset
code: theorem Basis.basis_union_of_subset (hI : M.Basis I X) (hJ : M.Indep J) (hIJ : I ⊆ J) :
    M.Basis J (J ∪ X) 
goal: M.Basis J (J ∪ X)

full_name: Matroid.Basis.insert_basis_insert
code: theorem Basis.insert_basis_insert (hI : M.Basis I X) (h : M.Indep (insert e I)) :
    M.Basis (insert e I) (insert e X) 
goal: M.Basis (insert e I) (insert e X)

full_name: Matroid.Base.base_of_basis_superset
code: theorem Base.base_of_basis_superset (hB : M.Base B) (hBX : B ⊆ X) (hIX : M.Basis I X) :
    M.Base I 
goal: M.Base I

full_name: Matroid.Indep.exists_base_subset_union_base
code: theorem Indep.exists_base_subset_union_base (hI : M.Indep I) (hB : M.Base B) :
    ∃ B', M.Base B' ∧ I ⊆ B' ∧ B' ⊆ I ∪ B 
goal: ∃ B', M.Base B' ∧ I ⊆ B' ∧ B' ⊆ I ∪ B

full_name: Matroid.Basis.inter_eq_of_subset_indep
code: theorem Basis.inter_eq_of_subset_indep (hIX : M.Basis I X) (hIJ : I ⊆ J) (hJ : M.Indep J) :
    J ∩ X = I 
goal: J ∩ X = I

full_name: Matroid.Basis'.inter_eq_of_subset_indep
code: theorem Basis'.inter_eq_of_subset_indep (hI : M.Basis' I X) (hIJ : I ⊆ J) (hJ : M.Indep J) :
    J ∩ X = I 
goal: J ∩ X = I

full_name: Matroid.Base.basis_of_subset
code: theorem Base.basis_of_subset (hX : X ⊆ M.E := by aesop_mat) (hB : M.Base B) (hBX : B ⊆ X) :
    M.Basis B X 
goal: M.Basis B X

full_name: Matroid.exists_basis_disjoint_basis_of_subset
code: theorem exists_basis_disjoint_basis_of_subset (M : Matroid α) {X Y : Set α} (hXY : X ⊆ Y)
    (hY : Y ⊆ M.E := by aesop_mat) : ∃ I J, M.Basis I X ∧ M.Basis (I ∪ J) Y ∧ Disjoint X J 
goal: ∃ I J, M.Basis I X ∧ M.Basis (I ∪ J) Y ∧ Disjoint X J

full_name: Matroid.finite_setOf_matroid
code: /-- For finite `E`, finitely many matroids have ground set contained in `E`. -/
theorem finite_setOf_matroid {E : Set α} (hE : E.Finite) : {M : Matroid α | M.E ⊆ E}.Finite 
goal: {M | M.E ⊆ E}.Finite

full_name: Matroid.finite_setOf_matroid'
code: /-- For finite `E`, finitely many matroids have ground set `E`. -/
theorem finite_setOf_matroid' {E : Set α} (hE : E.Finite) : {M : Matroid α | M.E = E}.Finite 
goal: {M | M.E = E}.Finite