@@ -189,7 +189,7 @@ def Matroid.ExistsMaximalSubsetProperty {α : Type _} (P : Set α → Prop) (X :
189
189
use `Matroid.ofBase` or a variant. If just the independent sets are known,
190
190
define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
191
191
-/
192
- @[ext] structure Matroid (α : Type _) where
192
+ structure Matroid (α : Type _) where
193
193
/-- `M` has a ground set `E`. -/
194
194
(E : Set α)
195
195
/-- `M` has a predicate `Base` defining its bases. -/
@@ -209,6 +209,8 @@ def Matroid.ExistsMaximalSubsetProperty {α : Type _} (P : Set α → Prop) (X :
209
209
/-- Every base is contained in the ground set. -/
210
210
(subset_ground : ∀ B, Base B → B ⊆ E)
211
211
212
+ attribute [local ext] Matroid
213
+
212
214
namespace Matroid
213
215
214
216
variable {α : Type *} {M : Matroid α}
@@ -460,13 +462,19 @@ theorem Base.diff_infinite_comm (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) :
460
462
(B₁ \ B₂).Infinite ↔ (B₂ \ B₁).Infinite :=
461
463
infinite_iff_infinite_of_encard_eq_encard (hB₁.encard_diff_comm hB₂)
462
464
463
- theorem eq_of_base_iff_base_forall {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
465
+ theorem ext_base {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
464
466
(h : ∀ ⦃B⦄, B ⊆ M₁.E → (M₁.Base B ↔ M₂.Base B)) : M₁ = M₂ := by
465
467
have h' : ∀ B, M₁.Base B ↔ M₂.Base B :=
466
468
fun B ↦ ⟨fun hB ↦ (h hB.subset_ground).1 hB,
467
469
fun hB ↦ (h <| hB.subset_ground.trans_eq hE.symm).2 hB⟩
468
470
ext <;> simp [hE, M₁.indep_iff', M₂.indep_iff', h']
469
471
472
+ @[deprecated (since := "2024-12-25")] alias eq_of_base_iff_base_forall := ext_base
473
+
474
+ theorem ext_iff_base {M₁ M₂ : Matroid α} :
475
+ M₁ = M₂ ↔ M₁.E = M₂.E ∧ ∀ ⦃B⦄, B ⊆ M₁.E → (M₁.Base B ↔ M₂.Base B) :=
476
+ ⟨fun h ↦ by simp [h], fun ⟨hE, h⟩ ↦ ext_base hE h⟩
477
+
470
478
theorem base_compl_iff_maximal_disjoint_base (hB : B ⊆ M.E := by aesop_mat) :
471
479
M.Base (M.E \ B) ↔ Maximal (fun I ↦ I ⊆ M.E ∧ ∃ B, M.Base B ∧ Disjoint I B) B := by
472
480
simp_rw [maximal_iff, and_iff_right hB, and_imp, forall_exists_index]
@@ -663,22 +671,35 @@ theorem ground_indep_iff_base : M.Indep M.E ↔ M.Base M.E :=
663
671
664
672
theorem Base.exists_insert_of_ssubset (hB : M.Base B) (hIB : I ⊂ B) (hB' : M.Base B') :
665
673
∃ e ∈ B' \ I, M.Indep (insert e I) :=
666
- (hB.indep.subset hIB.subset).exists_insert_of_not_base
674
+ (hB.indep.subset hIB.subset).exists_insert_of_not_base
667
675
(fun hI ↦ hIB.ne (hI.eq_of_subset_base hB hIB.subset)) hB'
668
676
669
- theorem eq_of_indep_iff_indep_forall {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
670
- (h : ∀ I , I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I)) : M₁ = M₂ :=
677
+ @[ext] theorem ext_indep {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
678
+ (h : ∀ ⦃I⦄ , I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I)) : M₁ = M₂ :=
671
679
have h' : M₁.Indep = M₂.Indep := by
672
680
ext I
673
681
by_cases hI : I ⊆ M₁.E
674
682
· rwa [h]
675
683
exact iff_of_false (fun hi ↦ hI hi.subset_ground)
676
684
(fun hi ↦ hI (hi.subset_ground.trans_eq hE.symm))
677
- eq_of_base_iff_base_forall hE (fun B _ ↦ by simp_rw [base_iff_maximal_indep, h'])
685
+ ext_base hE (fun B _ ↦ by simp_rw [base_iff_maximal_indep, h'])
686
+
687
+ @[deprecated (since := "2024-12-25")] alias eq_of_indep_iff_indep_forall := ext_indep
678
688
679
- theorem eq_iff_indep_iff_indep_forall {M₁ M₂ : Matroid α} :
680
- M₁ = M₂ ↔ (M₁.E = M₂.E) ∧ ∀ I, I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I) :=
681
- ⟨fun h ↦ by (subst h; simp), fun h ↦ eq_of_indep_iff_indep_forall h.1 h.2 ⟩
689
+ theorem ext_iff_indep {M₁ M₂ : Matroid α} :
690
+ M₁ = M₂ ↔ (M₁.E = M₂.E) ∧ ∀ ⦃I⦄, I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I) :=
691
+ ⟨fun h ↦ by (subst h; simp), fun h ↦ ext_indep h.1 h.2 ⟩
692
+
693
+ @[deprecated (since := "2024-12-25")] alias eq_iff_indep_iff_indep_forall := ext_iff_indep
694
+
695
+ /-- If every base of `M₁` is independent in `M₂` and vice versa, then `M₁ = M₂`. -/
696
+ lemma ext_base_indep {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E) (hM₁ : ∀ ⦃B⦄, M₁.Base B → M₂.Indep B)
697
+ (hM₂ : ∀ ⦃B⦄, M₂.Base B → M₁.Indep B) : M₁ = M₂ := by
698
+ refine ext_indep hE fun I hIE ↦ ⟨fun hI ↦ ?_, fun hI ↦ ?_⟩
699
+ · obtain ⟨B, hB, hIB⟩ := hI.exists_base_superset
700
+ exact (hM₁ hB).subset hIB
701
+ obtain ⟨B, hB, hIB⟩ := hI.exists_base_superset
702
+ exact (hM₂ hB).subset hIB
682
703
683
704
/-- A `Finitary` matroid is one where a set is independent if and only if it all
684
705
its finite subsets are independent, or equivalently a matroid whose circuits are finite. -/
@@ -1003,7 +1024,7 @@ theorem finite_setOf_matroid {E : Set α} (hE : E.Finite) : {M : Matroid α | M.
1003
1024
have hf : f.Injective := by
1004
1025
refine fun M M' hMM' ↦ ?_
1005
1026
rw [Prod.mk.injEq, and_comm, Set.ext_iff, and_comm] at hMM'
1006
- exact eq_of_base_iff_base_forall hMM'.1 (fun B _ ↦ hMM'.2 B)
1027
+ exact ext_base hMM'.1 (fun B _ ↦ hMM'.2 B)
1007
1028
rw [← Set.finite_image_iff hf.injOn]
1008
1029
refine (hE.finite_subsets.prod hE.finite_subsets.finite_subsets).subset ?_
1009
1030
rintro _ ⟨M, hE : M.E ⊆ E, rfl⟩
0 commit comments