Theorem: Matroid.ofExistsMatroid_E
File: Mathlib/Data/Matroid/IndepAxioms.lean

Proof steps:
state_before: α : Type u_1
I B X E : Set α
Indep : Set α → Prop
hM : ∃ M, E = M.E ∧ ∀ (I : Set α), M.Indep I ↔ Indep I
⊢ ∃ M, E = M.E ∧ M.Indep = Indep
state_after: case intro.intro
α : Type u_1
I B X : Set α
Indep : Set α → Prop
M : Matroid α
h : ∀ (I : Set α), M.Indep I ↔ Indep I
⊢ ∃ M_1, M.E = M_1.E ∧ M_1.Indep = Indep
tactic: obtain ⟨M, rfl, h⟩ := hM
state_before: case intro.intro
α : Type u_1
I B X : Set α
Indep : Set α → Prop
M : Matroid α
h : ∀ (I : Set α), M.Indep I ↔ Indep I
⊢ ∃ M_1, M.E = M_1.E ∧ M_1.Indep = Indep
state_after: no goals
tactic: refine ⟨_, rfl, funext (by simp [h])⟩
state_before: α : Type u_1
I B X E : Set α
Indep : Set α → Prop
hM : ∃ M, E = M.E ∧ ∀ (I : Set α), M.Indep I ↔ Indep I
hex : ∃ M, E = M.E ∧ M.Indep = Indep
⊢ Indep ∅
state_after: case intro.intro
α : Type u_1
I B X E : Set α
M : Matroid α
hM : ∃ M_1, E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ M.Indep ∅
tactic: obtain ⟨M, -, rfl⟩ := hex
state_before: case intro.intro
α : Type u_1
I B X E : Set α
M : Matroid α
hM : ∃ M_1, E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ M.Indep ∅
state_after: no goals
tactic: exact M.empty_indep
state_before: α : Type u_1
I B X E : Set α
Indep : Set α → Prop
hM : ∃ M, E = M.E ∧ ∀ (I : Set α), M.Indep I ↔ Indep I
hex : ∃ M, E = M.E ∧ M.Indep = Indep
⊢ ∀ ⦃I J : Set α⦄, Indep J → I ⊆ J → Indep I
state_after: case intro.intro
α : Type u_1
I B X E : Set α
M : Matroid α
hM : ∃ M_1, E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ ⦃I J : Set α⦄, M.Indep J → I ⊆ J → M.Indep I
tactic: obtain ⟨M, -, rfl⟩ := hex
state_before: case intro.intro
α : Type u_1
I B X E : Set α
M : Matroid α
hM : ∃ M_1, E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ ⦃I J : Set α⦄, M.Indep J → I ⊆ J → M.Indep I
state_after: no goals
tactic: exact fun I J hJ hIJ ↦ hJ.subset hIJ
state_before: α : Type u_1
I B X E : Set α
Indep : Set α → Prop
hM : ∃ M, E = M.E ∧ ∀ (I : Set α), M.Indep I ↔ Indep I
hex : ∃ M, E = M.E ∧ M.Indep = Indep
⊢ ∀ ⦃I B : Set α⦄,
    Indep I →
      I ∉ maximals (fun x x_1 => x ⊆ x_1) {I | Indep I} →
        B ∈ maximals (fun x x_1 => x ⊆ x_1) {I | Indep I} → ∃ x ∈ B \ I, Indep (insert x I)
state_after: case intro.intro
α : Type u_1
I B X E : Set α
M : Matroid α
hM : ∃ M_1, E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ ⦃I B : Set α⦄,
    M.Indep I →
      I ∉ maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I} →
        B ∈ maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I} → ∃ x ∈ B \ I, M.Indep (insert x I)
tactic: obtain ⟨M, -, rfl⟩ := hex
state_before: case intro.intro
α : Type u_1
I B X E : Set α
M : Matroid α
hM : ∃ M_1, E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ ⦃I B : Set α⦄,
    M.Indep I →
      I ∉ maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I} →
        B ∈ maximals (fun x x_1 => x ⊆ x_1) {I | M.Indep I} → ∃ x ∈ B \ I, M.Indep (insert x I)
state_after: no goals
tactic: exact Indep.exists_insert_of_not_mem_maximals M
state_before: α : Type u_1
I B X E : Set α
Indep : Set α → Prop
hM : ∃ M, E = M.E ∧ ∀ (I : Set α), M.Indep I ↔ Indep I
hex : ∃ M, E = M.E ∧ M.Indep = Indep
⊢ ∀ X ⊆ E, ExistsMaximalSubsetProperty Indep X
state_after: case intro.intro
α : Type u_1
I B X : Set α
M : Matroid α
hM : ∃ M_1, M.E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ X ⊆ M.E, ExistsMaximalSubsetProperty M.Indep X
tactic: obtain ⟨M, rfl, rfl⟩ := hex
state_before: case intro.intro
α : Type u_1
I B X : Set α
M : Matroid α
hM : ∃ M_1, M.E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ X ⊆ M.E, ExistsMaximalSubsetProperty M.Indep X
state_after: no goals
tactic: exact M.existsMaximalSubsetProperty_indep
state_before: α : Type u_1
I B X E : Set α
Indep : Set α → Prop
hM : ∃ M, E = M.E ∧ ∀ (I : Set α), M.Indep I ↔ Indep I
hex : ∃ M, E = M.E ∧ M.Indep = Indep
⊢ ∀ (I : Set α), Indep I → I ⊆ E
state_after: case intro.intro
α : Type u_1
I B X : Set α
M : Matroid α
hM : ∃ M_1, M.E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ (I : Set α), M.Indep I → I ⊆ M.E
tactic: obtain ⟨M, rfl, rfl⟩ := hex
state_before: case intro.intro
α : Type u_1
I B X : Set α
M : Matroid α
hM : ∃ M_1, M.E = M_1.E ∧ ∀ (I : Set α), M_1.Indep I ↔ M.Indep I
⊢ ∀ (I : Set α), M.Indep I → I ⊆ M.E
state_after: no goals
tactic: exact fun I ↦ Indep.subset_ground