Theorem: Matroid.ModularPair.exists_common_basis (Matroid/Modular.lean)

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
h : M.ModularPair X Y
⊢ ∃ I, M.Basis I (X ∪ Y) ∧ M.Basis (I ∩ X) X ∧ M.Basis (I ∩ Y) Y ∧ M.Basis (I ∩ X ∩ Y) (X ∩ Y)
Tactic:
obtain ⟨B, hB⟩ := h
State after:
case intro
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ ∃ I, M.Basis I (X ∪ Y) ∧ M.Basis (I ∩ X) X ∧ M.Basis (I ∩ Y) Y ∧ M.Basis (I ∩ X ∩ Y) (X ∩ Y)

State before:
case intro
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ ∃ I, M.Basis I (X ∪ Y) ∧ M.Basis (I ∩ X) X ∧ M.Basis (I ∩ Y) Y ∧ M.Basis (I ∩ X ∩ Y) (X ∩ Y)
Tactic:
refine ⟨(X ∪ Y) ∩ B, ?_⟩
State after:
case intro
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y) ∧
    M.Basis ((X ∪ Y) ∩ B ∩ X) X ∧ M.Basis ((X ∪ Y) ∩ B ∩ Y) Y ∧ M.Basis ((X ∪ Y) ∩ B ∩ X ∩ Y) (X ∩ Y)

State before:
case intro
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y) ∧
    M.Basis ((X ∪ Y) ∩ B ∩ X) X ∧ M.Basis ((X ∪ Y) ∩ B ∩ Y) Y ∧ M.Basis ((X ∪ Y) ∩ B ∩ X ∩ Y) (X ∩ Y)
Tactic:
rw [inter_right_comm, inter_eq_self_of_subset_right subset_union_left,
  inter_right_comm, inter_eq_self_of_subset_right subset_union_right, inter_right_comm]
State after:
case intro
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y) ∧ M.Basis (X ∩ B) X ∧ M.Basis (Y ∩ B) Y ∧ M.Basis (X ∩ Y ∩ B) (X ∩ Y)

State before:
case intro
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y) ∧ M.Basis (X ∩ B) X ∧ M.Basis (Y ∩ B) Y ∧ M.Basis (X ∩ Y ∩ B) (X ∩ Y)
Tactic:
refine ⟨?_, by simpa using hB.basis_inter true, by simpa using hB.basis_inter false, ?_⟩
State after:
case intro.refine_1
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y)

case intro.refine_2
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis (X ∩ Y ∩ B) (X ∩ Y)

State before:
case intro.refine_2
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis (X ∩ Y ∩ B) (X ∩ Y)
Tactic:
have hi := hB.basis_iInter
State after:
case intro.refine_2
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
hi : M.Basis ((⋂ i, bif i then X else Y) ∩ B) (⋂ i, bif i then X else Y)
⊢ M.Basis (X ∩ Y ∩ B) (X ∩ Y)

State before:
case intro.refine_2
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
hi : M.Basis ((⋂ i, bif i then X else Y) ∩ B) (⋂ i, bif i then X else Y)
⊢ M.Basis (X ∩ Y ∩ B) (X ∩ Y)
Tactic:
rwa [← inter_eq_iInter] at hi
State after:
no goals

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis (X ∩ B) X
Tactic:
simpa using hB.basis_inter true
State after:
no goals

State before:
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis (Y ∩ B) Y
Tactic:
simpa using hB.basis_inter false
State after:
no goals

State before:
case intro.refine_1
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y)
Tactic:
have hu := hB.basis_iUnion
State after:
case intro.refine_1
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
hu : M.Basis ((⋃ i, bif i then X else Y) ∩ B) (⋃ i, bif i then X else Y)
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y)

State before:
case intro.refine_1
ι : Type u_1
α : Type u_2
M : Matroid α
B✝ I J X X' Y Y' F : Set α
Xs Ys Js Is : ι → Set α
i j : ι
e f : α
B : Set α
hB : M.ModularBase B fun i => bif i then X else Y
hu : M.Basis ((⋃ i, bif i then X else Y) ∩ B) (⋃ i, bif i then X else Y)
⊢ M.Basis ((X ∪ Y) ∩ B) (X ∪ Y)
Tactic:
rwa [← union_eq_iUnion] at hu
State after:
no goals