Theorem: Colex.lt_trichotomy
File: Mathlib/Combinatorics/Colex.lean

tactic: by_cases h₁ : A = B
state_before: α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
⊢ A < B ∨ A = B ∨ B < A

tactic: have h : Finset.Nonempty (A \ B ∪ B \ A) := by
  rw [nonempty_iff_ne_empty]
  intro a
  simp only [union_eq_empty_iff, sdiff_eq_empty_iff_subset] at a
  apply h₁ (Subset.antisymm a.1 a.2)
state_before: case neg
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
⊢ A < B ∨ A = B ∨ B < A

tactic: rcases exists_max_image (A \ B ∪ B \ A) id h with ⟨k, ⟨hk, z⟩⟩
state_before: case neg
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
⊢ A < B ∨ A = B ∨ B < A

tactic: tauto
state_before: case pos
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : A = B
⊢ A < B ∨ A = B ∨ B < A

tactic: rw [nonempty_iff_ne_empty]
state_before: α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
⊢ Finset.Nonempty (A \ B ∪ B \ A)

tactic: intro a
state_before: α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
⊢ A \ B ∪ B \ A ≠ ∅

tactic: simp only [union_eq_empty_iff, sdiff_eq_empty_iff_subset] at a
state_before: α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
a : A \ B ∪ B \ A = ∅
⊢ False

tactic: apply h₁ (Subset.antisymm a.1 a.2)
state_before: α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
a : A ⊆ B ∧ B ⊆ A
⊢ False

tactic: simp only [mem_union, mem_sdiff] at hk
state_before: case neg.intro.intro
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ A \ B ∪ B \ A
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
⊢ A < B ∨ A = B ∨ B < A

tactic: cases' hk with hk hk
state_before: case neg.intro.intro
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ A ∧ ¬k ∈ B ∨ k ∈ B ∧ ¬k ∈ A
⊢ A < B ∨ A = B ∨ B < A

tactic: right
state_before: case neg.intro.intro.inl
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ A ∧ ¬k ∈ B
⊢ A < B ∨ A = B ∨ B < A

tactic: right
state_before: case neg.intro.intro.inl.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ A ∧ ¬k ∈ B
⊢ A = B ∨ B < A

tactic: refine' ⟨k, @fun t th => _, hk.2, hk.1⟩
state_before: case neg.intro.intro.inl.h.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ A ∧ ¬k ∈ B
⊢ B < A

tactic: specialize z t
state_before: case neg.intro.intro.inl.h.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ A ∧ ¬k ∈ B
t : α
th : k < t
⊢ t ∈ B ↔ t ∈ A

tactic: by_contra h₂
state_before: case neg.intro.intro.inl.h.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ A ∧ ¬k ∈ B
t : α
th : k < t
z : t ∈ A \ B ∪ B \ A → id t ≤ id k
⊢ t ∈ B ↔ t ∈ A

tactic: simp only [mem_union, mem_sdiff, id.def] at z
state_before: case neg.intro.intro.inl.h.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ A ∧ ¬k ∈ B
t : α
th : k < t
z : t ∈ A \ B ∪ B \ A → id t ≤ id k
h₂ : ¬(t ∈ B ↔ t ∈ A)
⊢ False

tactic: rw [not_iff, iff_iff_and_or_not_and_not, not_not, and_comm] at h₂
state_before: case neg.intro.intro.inl.h.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ A ∧ ¬k ∈ B
t : α
th : k < t
h₂ : ¬(t ∈ B ↔ t ∈ A)
z : t ∈ A ∧ ¬t ∈ B ∨ t ∈ B ∧ ¬t ∈ A → t ≤ k
⊢ False

tactic: apply not_le_of_lt th (z h₂)
state_before: case neg.intro.intro.inl.h.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ A ∧ ¬k ∈ B
t : α
th : k < t
h₂ : t ∈ A ∧ ¬t ∈ B ∨ t ∈ B ∧ ¬t ∈ A
z : t ∈ A ∧ ¬t ∈ B ∨ t ∈ B ∧ ¬t ∈ A → t ≤ k
⊢ False

tactic: left
state_before: case neg.intro.intro.inr
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ B ∧ ¬k ∈ A
⊢ A < B ∨ A = B ∨ B < A

tactic: refine' ⟨k, @fun t th => _, hk.2, hk.1⟩
state_before: case neg.intro.intro.inr.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ B ∧ ¬k ∈ A
⊢ A < B

tactic: specialize z t
state_before: case neg.intro.intro.inr.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
z : ∀ (x' : α), x' ∈ A \ B ∪ B \ A → id x' ≤ id k
hk : k ∈ B ∧ ¬k ∈ A
t : α
th : k < t
⊢ t ∈ A ↔ t ∈ B

tactic: by_contra h₃
state_before: case neg.intro.intro.inr.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ B ∧ ¬k ∈ A
t : α
th : k < t
z : t ∈ A \ B ∪ B \ A → id t ≤ id k
⊢ t ∈ A ↔ t ∈ B

tactic: simp only [mem_union, mem_sdiff, id.def] at z
state_before: case neg.intro.intro.inr.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ B ∧ ¬k ∈ A
t : α
th : k < t
z : t ∈ A \ B ∪ B \ A → id t ≤ id k
h₃ : ¬(t ∈ A ↔ t ∈ B)
⊢ False

tactic: rw [not_iff, iff_iff_and_or_not_and_not, not_not, and_comm, or_comm] at h₃
state_before: case neg.intro.intro.inr.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ B ∧ ¬k ∈ A
t : α
th : k < t
h₃ : ¬(t ∈ A ↔ t ∈ B)
z : t ∈ A ∧ ¬t ∈ B ∨ t ∈ B ∧ ¬t ∈ A → t ≤ k
⊢ False

tactic: apply not_le_of_lt th (z h₃)
state_before: case neg.intro.intro.inr.h
α : Type u_1
inst✝ : LinearOrder α
A B : Colex α
h₁ : ¬A = B
h : Finset.Nonempty (A \ B ∪ B \ A)
k : α
hk : k ∈ B ∧ ¬k ∈ A
t : α
th : k < t
h₃ : t ∈ A ∧ ¬t ∈ B ∨ t ∈ B ∧ ¬t ∈ A
z : t ∈ A ∧ ¬t ∈ B ∨ t ∈ B ∧ ¬t ∈ A → t ≤ k
⊢ False