l3lab/ntp-mathlib huggingface dataset:
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    

Proof state:
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a b : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
⊢ ∀ (a b : (i : ι) × α i), Lex r s a b ∨ Lex r s b a

Next tactic:
rintro ⟨i, a⟩ ⟨j, b⟩
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    

Proof state:
case mk.mk
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
i : ι
a : α i
j : ι
b : α j
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b } ∨ Lex r s { fst := j, snd := b } { fst := i, snd := a }

Next tactic:
obtain hij | rfl | hji := trichotomous_of r i j
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · 

Proof state:
case mk.mk.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
i : ι
a : α i
j : ι
b : α j
hij : r i j
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b } ∨ Lex r s { fst := j, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inl (Lex.left _ _ hij)
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · 

Proof state:
case mk.mk.inr.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
i : ι
a b : α i
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b } ∨ Lex r s { fst := i, snd := b } { fst := i, snd := a }

Next tactic:
obtain hab | hba := total_of (s i) a b
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | hba := total_of (s i) a b
      · 

Proof state:
case mk.mk.inr.inl.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
i : ι
a b : α i
hab : s i a b
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b } ∨ Lex r s { fst := i, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inl (Lex.right _ _ hab)
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | hba := total_of (s i) a b
      · exact Or.inl (Lex.right _ _ hab)
      · 

Proof state:
case mk.mk.inr.inl.inr
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
i : ι
a b : α i
hba : s i b a
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b } ∨ Lex r s { fst := i, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inr (Lex.right _ _ hba)
instance [IsTrichotomous ι r] [∀ i, IsTotal (α i) (s i)] : IsTotal _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | hba := total_of (s i) a b
      · exact Or.inl (Lex.right _ _ hab)
      · exact Or.inr (Lex.right _ _ hba)
    · 

Proof state:
case mk.mk.inr.inr
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTotal (α i) (s i)
i : ι
a : α i
j : ι
b : α j
hji : r j i
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b } ∨ Lex r s { fst := j, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inr (Lex.left _ _ hji)
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    

Proof state:
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a b : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
⊢ ∀ (a b : (i : ι) × α i), Lex r s a b ∨ a = b ∨ Lex r s b a

Next tactic:
rintro ⟨i, a⟩ ⟨j, b⟩
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    

Proof state:
case mk.mk
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a : α i
j : ι
b : α j
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b } ∨
    { fst := i, snd := a } = { fst := j, snd := b } ∨ Lex r s { fst := j, snd := b } { fst := i, snd := a }

Next tactic:
obtain hij | rfl | hji := trichotomous_of r i j
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · 

Proof state:
case mk.mk.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a : α i
j : ι
b : α j
hij : r i j
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b } ∨
    { fst := i, snd := a } = { fst := j, snd := b } ∨ Lex r s { fst := j, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inl (Lex.left _ _ hij)
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · 

Proof state:
case mk.mk.inr.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a b : α i
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b } ∨
    { fst := i, snd := a } = { fst := i, snd := b } ∨ Lex r s { fst := i, snd := b } { fst := i, snd := a }

Next tactic:
obtain hab | rfl | hba := trichotomous_of (s i) a b
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | rfl | hba := trichotomous_of (s i) a b
      · 

Proof state:
case mk.mk.inr.inl.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a b : α i
hab : s i a b
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b } ∨
    { fst := i, snd := a } = { fst := i, snd := b } ∨ Lex r s { fst := i, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inl (Lex.right _ _ hab)
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | rfl | hba := trichotomous_of (s i) a b
      · exact Or.inl (Lex.right _ _ hab)
      · 

Proof state:
case mk.mk.inr.inl.inr.inl
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a : α i
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := a } ∨
    { fst := i, snd := a } = { fst := i, snd := a } ∨ Lex r s { fst := i, snd := a } { fst := i, snd := a }

Next tactic:
exact Or.inr (Or.inl rfl)
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | rfl | hba := trichotomous_of (s i) a b
      · exact Or.inl (Lex.right _ _ hab)
      · exact Or.inr (Or.inl rfl)
      · 

Proof state:
case mk.mk.inr.inl.inr.inr
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a b : α i
hba : s i b a
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b } ∨
    { fst := i, snd := a } = { fst := i, snd := b } ∨ Lex r s { fst := i, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inr (Or.inr $ Lex.right _ _ hba)
instance [IsTrichotomous ι r] [∀ i, IsTrichotomous (α i) (s i)] : IsTrichotomous _ (Lex r s) :=
  ⟨by
    rintro ⟨i, a⟩ ⟨j, b⟩
    obtain hij | rfl | hji := trichotomous_of r i j
    · exact Or.inl (Lex.left _ _ hij)
    · obtain hab | rfl | hba := trichotomous_of (s i) a b
      · exact Or.inl (Lex.right _ _ hab)
      · exact Or.inr (Or.inl rfl)
      · exact Or.inr (Or.inr $ Lex.right _ _ hba)
    · 

Proof state:
case mk.mk.inr.inr
ι : Type u_1
α : ι → Type u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a✝ b✝ : (i : ι) × α i
inst✝¹ : IsTrichotomous ι r
inst✝ : ∀ (i : ι), IsTrichotomous (α i) (s i)
i : ι
a : α i
j : ι
b : α j
hji : r j i
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b } ∨
    { fst := i, snd := a } = { fst := j, snd := b } ∨ Lex r s { fst := j, snd := b } { fst := i, snd := a }

Next tactic:
exact Or.inr (Or.inr $ Lex.left _ _ hji)
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  

Proof state:
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a b : (i : ι) ×' α i
⊢ Lex r s a b ↔ r a.fst b.fst ∨ ∃ h, s b.fst (h ▸ a.snd) b.snd

Next tactic:
constructor
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · 

Proof state:
case mp
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a b : (i : ι) ×' α i
⊢ Lex r s a b → r a.fst b.fst ∨ ∃ h, s b.fst (h ▸ a.snd) b.snd

Next tactic:
rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · 

Proof state:
case mp.left
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a₁✝ : ι
a : α a₁✝
a₂✝ : ι
b : α a₂✝
hij : r a₁✝ a₂✝
⊢ r { fst := a₁✝, snd := a }.fst { fst := a₂✝, snd := b }.fst ∨
    ∃ h, s { fst := a₂✝, snd := b }.fst (h ▸ { fst := a₁✝, snd := a }.snd) { fst := a₂✝, snd := b }.snd

Next tactic:
exact Or.inl hij
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · 

Proof state:
case mp.right
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
i : ι
b₁✝ b₂✝ : α i
hab : s i b₁✝ b₂✝
⊢ r { fst := i, snd := b₁✝ }.fst { fst := i, snd := b₂✝ }.fst ∨
    ∃ h, s { fst := i, snd := b₂✝ }.fst (h ▸ { fst := i, snd := b₁✝ }.snd) { fst := i, snd := b₂✝ }.snd

Next tactic:
exact Or.inr ⟨rfl, hab⟩
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · exact Or.inr ⟨rfl, hab⟩
  · 

Proof state:
case mpr
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
a b : (i : ι) ×' α i
⊢ (r a.fst b.fst ∨ ∃ h, s b.fst (h ▸ a.snd) b.snd) → Lex r s a b

Next tactic:
obtain ⟨i, a⟩ := a
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · exact Or.inr ⟨rfl, hab⟩
  · obtain ⟨i, a⟩ := a
    

Proof state:
case mpr.mk
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
b : (i : ι) ×' α i
i : ι
a : α i
⊢ (r { fst := i, snd := a }.fst b.fst ∨ ∃ h, s b.fst (h ▸ { fst := i, snd := a }.snd) b.snd) →
    Lex r s { fst := i, snd := a } b

Next tactic:
obtain ⟨j, b⟩ := b
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · exact Or.inr ⟨rfl, hab⟩
  · obtain ⟨i, a⟩ := a
    obtain ⟨j, b⟩ := b
    

Proof state:
case mpr.mk.mk
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
i : ι
a : α i
j : ι
b : α j
⊢ (r { fst := i, snd := a }.fst { fst := j, snd := b }.fst ∨
      ∃ h, s { fst := j, snd := b }.fst (h ▸ { fst := i, snd := a }.snd) { fst := j, snd := b }.snd) →
    Lex r s { fst := i, snd := a } { fst := j, snd := b }

Next tactic:
dsimp only
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · exact Or.inr ⟨rfl, hab⟩
  · obtain ⟨i, a⟩ := a
    obtain ⟨j, b⟩ := b
    dsimp only
    

Proof state:
case mpr.mk.mk
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
i : ι
a : α i
j : ι
b : α j
⊢ (r i j ∨ ∃ h, s j (h ▸ a) b) → Lex r s { fst := i, snd := a } { fst := j, snd := b }

Next tactic:
rintro (h | ⟨rfl, h⟩)
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · exact Or.inr ⟨rfl, hab⟩
  · obtain ⟨i, a⟩ := a
    obtain ⟨j, b⟩ := b
    dsimp only
    rintro (h | ⟨rfl, h⟩)
    · 

Proof state:
case mpr.mk.mk.inl
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
i : ι
a : α i
j : ι
b : α j
h : r i j
⊢ Lex r s { fst := i, snd := a } { fst := j, snd := b }

Next tactic:
exact Lex.left _ _ h
theorem lex_iff {a b : Σ' i, α i} :
    Lex r s a b ↔ r a.1 b.1 ∨ ∃ h : a.1 = b.1, s b.1 (h.rec a.2) b.2 := by
  constructor
  · rintro (⟨a, b, hij⟩ | ⟨i, hab⟩)
    · exact Or.inl hij
    · exact Or.inr ⟨rfl, hab⟩
  · obtain ⟨i, a⟩ := a
    obtain ⟨j, b⟩ := b
    dsimp only
    rintro (h | ⟨rfl, h⟩)
    · exact Lex.left _ _ h
    · 

Proof state:
case mpr.mk.mk.inr.intro
ι : Sort u_1
α : ι → Sort u_2
r r₁ r₂ : ι → ι → Prop
s s₁ s₂ : (i : ι) → α i → α i → Prop
i : ι
a b : α i
h : s i ((_ : i = i) ▸ a) b
⊢ Lex r s { fst := i, snd := a } { fst := i, snd := b }

Next tactic:
exact Lex.right _ h
theorem Lex.mono {r₁ r₂ : ι → ι → Prop} {s₁ s₂ : ∀ i, α i → α i → Prop}
    (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ i a b, s₁ i a b → s₂ i a b) {a b : Σ' i, α i}
    (h : Lex r₁ s₁ a b) : Lex r₂ s₂ a b := by
  

Proof state:
ι : Sort u_1
α : ι → Sort u_2
r r₁✝ r₂✝ : ι → ι → Prop
s s₁✝ s₂✝ : (i : ι) → α i → α i → Prop
r₁ r₂ : ι → ι → Prop
s₁ s₂ : (i : ι) → α i → α i → Prop
hr : ∀ (a b : ι), r₁ a b → r₂ a b
hs : ∀ (i : ι) (a b : α i), s₁ i a b → s₂ i a b
a b : (i : ι) ×' α i
h : Lex r₁ s₁ a b
⊢ Lex r₂ s₂ a b

Next tactic:
obtain ⟨a, b, hij⟩ | ⟨i, hab⟩ := h
theorem Lex.mono {r₁ r₂ : ι → ι → Prop} {s₁ s₂ : ∀ i, α i → α i → Prop}
    (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ i a b, s₁ i a b → s₂ i a b) {a b : Σ' i, α i}
    (h : Lex r₁ s₁ a b) : Lex r₂ s₂ a b := by
  obtain ⟨a, b, hij⟩ | ⟨i, hab⟩ := h
  · 

Proof state:
case left
ι : Sort u_1
α : ι → Sort u_2
r r₁✝ r₂✝ : ι → ι → Prop
s s₁✝ s₂✝ : (i : ι) → α i → α i → Prop
r₁ r₂ : ι → ι → Prop
s₁ s₂ : (i : ι) → α i → α i → Prop
hr : ∀ (a b : ι), r₁ a b → r₂ a b
hs : ∀ (i : ι) (a b : α i), s₁ i a b → s₂ i a b
a₁✝ : ι
a : α a₁✝
a₂✝ : ι
b : α a₂✝
hij : r₁ a₁✝ a₂✝
⊢ Lex r₂ s₂ { fst := a₁✝, snd := a } { fst := a₂✝, snd := b }

Next tactic:
exact Lex.left _ _ (hr _ _ hij)
theorem Lex.mono {r₁ r₂ : ι → ι → Prop} {s₁ s₂ : ∀ i, α i → α i → Prop}
    (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ i a b, s₁ i a b → s₂ i a b) {a b : Σ' i, α i}
    (h : Lex r₁ s₁ a b) : Lex r₂ s₂ a b := by
  obtain ⟨a, b, hij⟩ | ⟨i, hab⟩ := h
  · exact Lex.left _ _ (hr _ _ hij)
  · 

Proof state:
case right
ι : Sort u_1
α : ι → Sort u_2
r r₁✝ r₂✝ : ι → ι → Prop
s s₁✝ s₂✝ : (i : ι) → α i → α i → Prop
r₁ r₂ : ι → ι → Prop
s₁ s₂ : (i : ι) → α i → α i → Prop
hr : ∀ (a b : ι), r₁ a b → r₂ a b
hs : ∀ (i : ι) (a b : α i), s₁ i a b → s₂ i a b
i : ι
b₁✝ b₂✝ : α i
hab : s₁ i b₁✝ b₂✝
⊢ Lex r₂ s₂ { fst := i, snd := b₁✝ } { fst := i, snd := b₂✝ }

Next tactic:
exact Lex.right _ (hs _ _ _ hab)
lemma elim'_eq_elim {α β : Type*} (b : β) (f : α → β) (a : Option α) :
    Option.elim' b f a = Option.elim a b f := by
  

Proof state:
α✝ : Type u_1
β✝ : Type u_2
α : Type u_3
β : Type u_4
b : β
f : α → β
a : Option α
⊢ Option.elim' b f a = Option.elim a b f

Next tactic:
cases a
lemma elim'_eq_elim {α β : Type*} (b : β) (f : α → β) (a : Option α) :
    Option.elim' b f a = Option.elim a b f := by
  cases a <;> 

Proof state:
case none
α✝ : Type u_1
β✝ : Type u_2
α : Type u_3
β : Type u_4
b : β
f : α → β
⊢ Option.elim' b f none = Option.elim none b f

Next tactic:
rfl
lemma elim'_eq_elim {α β : Type*} (b : β) (f : α → β) (a : Option α) :
    Option.elim' b f a = Option.elim a b f := by
  cases a <;> 

Proof state:
case some
α✝ : Type u_1
β✝ : Type u_2
α : Type u_3
β : Type u_4
b : β
f : α → β
val✝ : α
⊢ Option.elim' b f (some val✝) = Option.elim (some val✝) b f

Next tactic:
rfl
theorem mem_some_iff {α : Type*} {a b : α} : a ∈ some b ↔ b = a := by 

Proof state:
α✝ : Type u_1
β : Type u_2
α : Type u_3
a b : α
⊢ a ∈ some b ↔ b = a

Next tactic:
simp
instance decidableForallMem {p : α → Prop} [DecidablePred p] :
    ∀ o : Option α, Decidable (∀ a ∈ o, p a)
  | none => isTrue (by 

Proof state:
α : Type u_1
β : Type u_2
p : α → Prop
inst✝ : DecidablePred p
⊢ ∀ (a : α), a ∈ none → p a

Next tactic:
simp [false_imp_iff]
instance decidableExistsMem {p : α → Prop} [DecidablePred p] :
    ∀ o : Option α, Decidable (∃ a ∈ o, p a)
  | none => isFalse fun ⟨a, ⟨h, _⟩⟩ ↦ by 

Proof state:
α : Type u_1
β : Type u_2
p : α → Prop
inst✝ : DecidablePred p
x✝ : ∃ a, a ∈ none ∧ p a
a : α
h : a ∈ none
right✝ : p a
⊢ False

Next tactic:
cases h
@[simp]
theorem mem_toList {a : α} {o : Option α} : a ∈ toList o ↔ a ∈ o := by
  

Proof state:
α : Type u_1
β : Type u_2
a : α
o : Option α
⊢ a ∈ toList o ↔ a ∈ o

Next tactic:
cases o
@[simp]
theorem mem_toList {a : α} {o : Option α} : a ∈ toList o ↔ a ∈ o := by
  cases o <;> 

Proof state:
case none
α : Type u_1
β : Type u_2
a : α
⊢ a ∈ toList none ↔ a ∈ none

Next tactic:
simp [toList, eq_comm]
@[simp]
theorem mem_toList {a : α} {o : Option α} : a ∈ toList o ↔ a ∈ o := by
  cases o <;> 

Proof state:
case some
α : Type u_1
β : Type u_2
a val✝ : α
⊢ a ∈ toList (some val✝) ↔ a ∈ some val✝

Next tactic:
simp [toList, eq_comm]
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by 

Proof state:
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
a b : Option α
⊢ liftOrGet f a b = liftOrGet f b a

Next tactic:
cases a
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by cases a <;> 

Proof state:
case none
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
b : Option α
⊢ liftOrGet f none b = liftOrGet f b none

Next tactic:
cases b
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by cases a <;> 

Proof state:
case some
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
b : Option α
val✝ : α
⊢ liftOrGet f (some val✝) b = liftOrGet f b (some val✝)

Next tactic:
cases b
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by cases a <;> cases b <;> 

Proof state:
case none.none
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
⊢ liftOrGet f none none = liftOrGet f none none

Next tactic:
simp [liftOrGet, IsCommutative.comm]
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by cases a <;> cases b <;> 

Proof state:
case none.some
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
val✝ : α
⊢ liftOrGet f none (some val✝) = liftOrGet f (some val✝) none

Next tactic:
simp [liftOrGet, IsCommutative.comm]
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by cases a <;> cases b <;> 

Proof state:
case some.none
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
val✝ : α
⊢ liftOrGet f (some val✝) none = liftOrGet f none (some val✝)

Next tactic:
simp [liftOrGet, IsCommutative.comm]
instance liftOrGet_isCommutative (f : α → α → α) [IsCommutative α f] :
    IsCommutative (Option α) (liftOrGet f) :=
  ⟨fun a b ↦ by cases a <;> cases b <;> 

Proof state:
case some.some
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsCommutative α f
val✝¹ val✝ : α
⊢ liftOrGet f (some val✝¹) (some val✝) = liftOrGet f (some val✝) (some val✝¹)

Next tactic:
simp [liftOrGet, IsCommutative.comm]
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by 

Proof state:
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
a b c : Option α
⊢ liftOrGet f (liftOrGet f a b) c = liftOrGet f a (liftOrGet f b c)

Next tactic:
cases a
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by cases a <;> 

Proof state:
case none
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
b c : Option α
⊢ liftOrGet f (liftOrGet f none b) c = liftOrGet f none (liftOrGet f b c)

Next tactic:
cases b
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by cases a <;> 

Proof state:
case some
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
b c : Option α
val✝ : α
⊢ liftOrGet f (liftOrGet f (some val✝) b) c = liftOrGet f (some val✝) (liftOrGet f b c)

Next tactic:
cases b
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by cases a <;> cases b <;> 

Proof state:
case none.none
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
c : Option α
⊢ liftOrGet f (liftOrGet f none none) c = liftOrGet f none (liftOrGet f none c)

Next tactic:
cases c
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by cases a <;> cases b <;> 

Proof state:
case none.some
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
c : Option α
val✝ : α
⊢ liftOrGet f (liftOrGet f none (some val✝)) c = liftOrGet f none (liftOrGet f (some val✝) c)

Next tactic:
cases c
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by cases a <;> cases b <;> 

Proof state:
case some.none
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
c : Option α
val✝ : α
⊢ liftOrGet f (liftOrGet f (some val✝) none) c = liftOrGet f (some val✝) (liftOrGet f none c)

Next tactic:
cases c
instance liftOrGet_isAssociative (f : α → α → α) [IsAssociative α f] :
    IsAssociative (Option α) (liftOrGet f) :=
  ⟨fun a b c ↦ by cases a <;> cases b <;> 

Proof state:
case some.some
α : Type u_1
β : Type u_2
f : α → α → α
inst✝ : IsAssociative α f
c : Option α
val✝¹ val✝ : α
⊢ liftOrGet f (liftOrGet f (some val✝¹) (some val✝)) c = liftOrGet f (some val✝¹) (liftOrGet f (some val✝) c)

Next tactic:
cases c