l3lab/ntp-mathlib huggingface dataset:
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      

Proof state:
case inr.intro.inl.intro
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a = b

Next tactic:
apply le_antisymm
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      

Proof state:
case inr.intro.inr.intro
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ a = b

Next tactic:
apply le_antisymm
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inl.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inl.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inl.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : b ≤ a
right✝ : b ≤ c
⊢ b ≤ a

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inl.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : b ≤ a
right✝ : b ≤ c
⊢ b ≤ a

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inl.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : c < b
right✝ : a < b
⊢ a ≤ b

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inl.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : c < b
right✝ : a < b
⊢ a ≤ b

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inl.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inl.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|

Proof state:
case inl.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
exact le_of_lt ‹_›
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|exact le_of_lt ‹_›|
    

Proof state:
case inl.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : a ≤ b
right✝¹ : a ≤ c
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
exact absurd hb (not_le_of_lt ‹c < b›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
exact le_of_lt ‹_›
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|exact le_of_lt ‹_›|
    

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
exact absurd hb (not_le_of_lt ‹c < b›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ a ≤ b

Next tactic:
exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ b ≤ a

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inr.intro.inl.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : b ≤ a
right✝ : b ≤ c
⊢ b ≤ a

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inr.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ a ≤ b

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inr.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ a ≤ b

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|

Proof state:
case inr.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ a ≤ b

Next tactic:
exact le_of_lt ‹_›
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    

Proof state:
case inr.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
first |assumption|exact le_of_lt ‹_›|
    exact absurd hb (not_le_of_lt ‹c < b›)|exact absurd ha (not_le_of_lt ‹c < a›)
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |

Proof state:
case inr.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
assumption
lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b := by
  simp_rw [not_mem_uIoc]
  rintro (⟨_, _⟩ | ⟨_, _⟩) (⟨_, _⟩ | ⟨_, _⟩) <;>
      apply le_antisymm <;>
    first |assumption|

Proof state:
case inr.intro.inr.intro.a
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a a₁ a₂ b b₁ b₂ c d x : α
ha : a ≤ c
hb : b ≤ c
left✝¹ : c < a
right✝¹ : b < a
left✝ : c < b
right✝ : a < b
⊢ b ≤ a

Next tactic:
exact le_of_lt ‹_›
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b b₁ b₂ c d x a : α
⊢ Injective fun b => Ι b a

Next tactic:
rintro b c h
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : (fun b => Ι b a) b = (fun b => Ι b a) c
⊢ b = c

Next tactic:
rw [ext_iff] at h
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
⊢ b = c

Next tactic:
obtain ha | ha := le_or_lt b a
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  obtain ha | ha := le_or_lt b a
  · 

Proof state:
case inl
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
ha : b ≤ a
⊢ b = c

Next tactic:
have hb := (h b).not
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  obtain ha | ha := le_or_lt b a
  · have hb := (h b).not
    

Proof state:
case inl
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
ha : b ≤ a
hb : b ∉ (fun b => Ι b a) b ↔ b ∉ (fun b => Ι b a) c
⊢ b = c

Next tactic:
simp only [ha, left_mem_uIoc, not_lt, true_iff_iff, not_mem_uIoc, ← not_le,
      and_true_iff, not_true, false_and_iff, not_false_iff, true_iff_iff, or_false_iff] at hb
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  obtain ha | ha := le_or_lt b a
  · have hb := (h b).not
    simp only [ha, left_mem_uIoc, not_lt, true_iff_iff, not_mem_uIoc, ← not_le,
      and_true_iff, not_true, false_and_iff, not_false_iff, true_iff_iff, or_false_iff] at hb
    

Proof state:
case inl
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
ha : b ≤ a
hb : b ≤ c
⊢ b = c

Next tactic:
refine' hb.eq_of_not_lt fun hc => _
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  obtain ha | ha := le_or_lt b a
  · have hb := (h b).not
    simp only [ha, left_mem_uIoc, not_lt, true_iff_iff, not_mem_uIoc, ← not_le,
      and_true_iff, not_true, false_and_iff, not_false_iff, true_iff_iff, or_false_iff] at hb
    refine' hb.eq_of_not_lt fun hc => _
    

Proof state:
case inl
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
ha : b ≤ a
hb : b ≤ c
hc : b < c
⊢ False

Next tactic:
simpa [ha, and_iff_right hc, ← @not_le _ _ _ a, iff_not_self, -not_le] using h c
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  obtain ha | ha := le_or_lt b a
  · have hb := (h b).not
    simp only [ha, left_mem_uIoc, not_lt, true_iff_iff, not_mem_uIoc, ← not_le,
      and_true_iff, not_true, false_and_iff, not_false_iff, true_iff_iff, or_false_iff] at hb
    refine' hb.eq_of_not_lt fun hc => _
    simpa [ha, and_iff_right hc, ← @not_le _ _ _ a, iff_not_self, -not_le] using h c
  · 

Proof state:
case inr
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
ha : a < b
⊢ b = c

Next tactic:
refine'
      eq_of_mem_uIoc_of_mem_uIoc ((h _).1 <| left_mem_uIoc.2 ha)
        ((h _).2 <| left_mem_uIoc.2 <| ha.trans_le _)
lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a := by
  rintro b c h
  rw [ext_iff] at h
  obtain ha | ha := le_or_lt b a
  · have hb := (h b).not
    simp only [ha, left_mem_uIoc, not_lt, true_iff_iff, not_mem_uIoc, ← not_le,
      and_true_iff, not_true, false_and_iff, not_false_iff, true_iff_iff, or_false_iff] at hb
    refine' hb.eq_of_not_lt fun hc => _
    simpa [ha, and_iff_right hc, ← @not_le _ _ _ a, iff_not_self, -not_le] using h c
  · refine'
      eq_of_mem_uIoc_of_mem_uIoc ((h _).1 <| left_mem_uIoc.2 ha)
        ((h _).2 <| left_mem_uIoc.2 <| ha.trans_le _)
    

Proof state:
case inr
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b✝ b₁ b₂ c✝ d x a b c : α
h : ∀ (x : α), x ∈ (fun b => Ι b a) b ↔ x ∈ (fun b => Ι b a) c
ha : a < b
⊢ b ≤ c

Next tactic:
simpa [ha, ha.not_le, mem_uIoc] using h b
lemma uIoc_injective_left (a : α) : Injective (Ι a) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
s : Set α
a✝ a₁ a₂ b b₁ b₂ c d x a : α
⊢ Injective (Ι a)

Next tactic:
simpa only [uIoc_comm] using uIoc_injective_right a
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
⊢ #((n : ℕ) × Functions (Language.sum L (skolem₁ L)) n) = #((n : ℕ) × BoundedFormula L Empty (n + 1))

Next tactic:
simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
⊢ ((sum fun i => lift.{max u v, u} #(Functions L i)) +
      sum fun i => lift.{u, max u v} #(BoundedFormula L Empty (i + 1))) =
    sum fun i => #(BoundedFormula L Empty (i + 1))

Next tactic:
conv_lhs => enter [2, 1, i]; rw [lift_id'.{u, v}]
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => 

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
| (sum fun i => lift.{max u v, u} #(Functions L i)) + sum fun i => lift.{u, max u v} #(BoundedFormula L Empty (i + 1))

Next tactic:
enter [2, 1, i]; rw [lift_id'.{u, v}]
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => 

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
| (sum fun i => lift.{max u v, u} #(Functions L i)) + sum fun i => lift.{u, max u v} #(BoundedFormula L Empty (i + 1))

Next tactic:
enter [2, 1, i]
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => enter [2, 1, i]; 

Proof state:
case h
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
i : ℕ
| lift.{u, max u v} #(BoundedFormula L Empty (i + 1))

Next tactic:
rw [lift_id'.{u, v}]
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => enter [2, 1, i]; rw [lift_id'.{u, v}]
  

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
⊢ ((sum fun i => lift.{max u v, u} #(Functions L i)) + sum fun i => #(BoundedFormula L Empty (i + 1))) =
    sum fun i => #(BoundedFormula L Empty (i + 1))

Next tactic:
rw [add_comm, add_eq_max, max_eq_left]
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => enter [2, 1, i]; rw [lift_id'.{u, v}]
  rw [add_comm, add_eq_max, max_eq_left]
  · 

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
⊢ (sum fun i => lift.{max u v, u} #(Functions L i)) ≤ sum fun i => #(BoundedFormula L Empty (i + 1))

Next tactic:
refine' sum_le_sum _ _ fun n => _
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => enter [2, 1, i]; rw [lift_id'.{u, v}]
  rw [add_comm, add_eq_max, max_eq_left]
  · refine' sum_le_sum _ _ fun n => _
    

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
n : ℕ
⊢ lift.{max u v, u} #(Functions L n) ≤ #(BoundedFormula L Empty (n + 1))

Next tactic:
rw [← lift_le.{_, max u v}, lift_lift, lift_mk_le.{v}]
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => enter [2, 1, i]; rw [lift_id'.{u, v}]
  rw [add_comm, add_eq_max, max_eq_left]
  · refine' sum_le_sum _ _ fun n => _
    rw [← lift_le.{_, max u v}, lift_lift, lift_mk_le.{v}]
    

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
n : ℕ
⊢ Nonempty (Functions L n ↪ BoundedFormula L Empty (n + 1))

Next tactic:
refine' ⟨⟨fun f => (func f default).bdEqual (func f default), fun f g h => _⟩⟩
theorem card_functions_sum_skolem₁ :
    #(Σ n, (L.sum L.skolem₁).Functions n) = #(Σ n, L.BoundedFormula Empty (n + 1)) := by
  simp only [card_functions_sum, skolem₁_Functions, mk_sigma, sum_add_distrib']
  conv_lhs => enter [2, 1, i]; rw [lift_id'.{u, v}]
  rw [add_comm, add_eq_max, max_eq_left]
  · refine' sum_le_sum _ _ fun n => _
    rw [← lift_le.{_, max u v}, lift_lift, lift_mk_le.{v}]
    refine' ⟨⟨fun f => (func f default).bdEqual (func f default), fun f g h => _⟩⟩
    

Proof state:
L : Language
M : Type w
inst✝¹ : Nonempty M
inst✝ : Structure L M
n : ℕ
f g : Functions L n
h : (fun f => func f default =' func f default) f = (fun f => func f default =' func f default) g
⊢ f = g

Next tactic:
rcases h with ⟨rfl, ⟨rfl⟩⟩