Theorem: Pi.isTrichotomous_lex
File: Mathlib/Data/Pi/Lex.lean

tactic: cases' eq_or_ne a b with hab hab
state_before: ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: exact Or.inr (Or.inl hab)
state_before: case inl
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : a = b
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: rw [Function.ne_iff] at hab
state_before: case inr
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : a ≠ b
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: let i := wf.min _ hab
state_before: case inr
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: have hri : ∀ j, r j i → a j = b j := by
  intro j
  rw [← not_imp_not]
  exact fun h' => wf.not_lt_min _ _ h'
state_before: case inr
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: have hne : a i ≠ b i := wf.min_mem _ hab
state_before: case inr
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: cases' trichotomous_of s (a i) (b i) with hi hi
state_before: case inr
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
hne : a i ≠ b i
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: exacts [Or.inl ⟨i, hri, hi⟩,
  Or.inr <| Or.inr <| ⟨i, fun j hj => (hri j hj).symm, hi.resolve_left hne⟩]
state_before: case inr.inl
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
hne : a i ≠ b i
hi : s (a i) (b i)
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

case inr.inr
ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
hne : a i ≠ b i
hi : a i = b i ∨ s (b i) (a i)
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a

tactic: intro j
state_before: ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
⊢ ∀ (j : ι), r j i → a j = b j

tactic: rw [← not_imp_not]
state_before: ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
j : ι
⊢ r j i → a j = b j

tactic: exact fun h' => wf.not_lt_min _ _ h'
state_before: ι : Type u_2
β : ι → Type u_1
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
j : ι
⊢ ¬a j = b j → ¬r j i