l3lab/ntp-mathlib huggingface dataset:
theorem Subsingleton.induction_on {p : Set α → Prop} (hs : s.Subsingleton) (he : p ∅)
    (h₁ : ∀ x, p {x}) : p s := by
  rcases hs.eq_empty_or_singleton with (rfl | ⟨x, rfl⟩)
  

Proof state:
case inl
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s₁ s₂ t t₁ t₂ u : Set α
p : Set α → Prop
he : p ∅
h₁ : ∀ (x : α), p {x}
hs : Set.Subsingleton ∅
⊢ p ∅
case inr.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s₁ s₂ t t₁ t₂ u : Set α
p : Set α → Prop
he : p ∅
h₁ : ∀ (x : α), p {x}
x : α
hs : Set.Subsingleton {x}
⊢ p {x}

Next tactic:
exacts [he, h₁ _]
theorem exists_eq_singleton_iff_nonempty_subsingleton :
    (∃ a : α, s = {a}) ↔ s.Nonempty ∧ s.Subsingleton := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ (∃ a, s = {a}) ↔ Set.Nonempty s ∧ Set.Subsingleton s

Next tactic:
refine' ⟨_, fun h => _⟩
theorem exists_eq_singleton_iff_nonempty_subsingleton :
    (∃ a : α, s = {a}) ↔ s.Nonempty ∧ s.Subsingleton := by
  refine' ⟨_, fun h => _⟩
  · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ (∃ a, s = {a}) → Set.Nonempty s ∧ Set.Subsingleton s

Next tactic:
rintro ⟨a, rfl⟩
theorem exists_eq_singleton_iff_nonempty_subsingleton :
    (∃ a : α, s = {a}) ↔ s.Nonempty ∧ s.Subsingleton := by
  refine' ⟨_, fun h => _⟩
  · rintro ⟨a, rfl⟩
    

Proof state:
case refine'_1.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a✝ b : α
s₁ s₂ t t₁ t₂ u : Set α
a : α
⊢ Set.Nonempty {a} ∧ Set.Subsingleton {a}

Next tactic:
exact ⟨singleton_nonempty a, subsingleton_singleton⟩
theorem exists_eq_singleton_iff_nonempty_subsingleton :
    (∃ a : α, s = {a}) ↔ s.Nonempty ∧ s.Subsingleton := by
  refine' ⟨_, fun h => _⟩
  · rintro ⟨a, rfl⟩
    exact ⟨singleton_nonempty a, subsingleton_singleton⟩
  · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
h : Set.Nonempty s ∧ Set.Subsingleton s
⊢ ∃ a, s = {a}

Next tactic:
exact h.2.eq_empty_or_singleton.resolve_left h.1.ne_empty
/-- `s`, coerced to a type, is a subsingleton type if and only if `s` is a subsingleton set. -/
@[simp, norm_cast]
theorem subsingleton_coe (s : Set α) : Subsingleton s ↔ s.Subsingleton := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ Subsingleton ↑s ↔ Set.Subsingleton s

Next tactic:
constructor
/-- `s`, coerced to a type, is a subsingleton type if and only if `s` is a subsingleton set. -/
@[simp, norm_cast]
theorem subsingleton_coe (s : Set α) : Subsingleton s ↔ s.Subsingleton := by
  constructor
  · 

Proof state:
case mp
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ Subsingleton ↑s → Set.Subsingleton s

Next tactic:
refine' fun h => fun a ha b hb => _
/-- `s`, coerced to a type, is a subsingleton type if and only if `s` is a subsingleton set. -/
@[simp, norm_cast]
theorem subsingleton_coe (s : Set α) : Subsingleton s ↔ s.Subsingleton := by
  constructor
  · refine' fun h => fun a ha b hb => _
    

Proof state:
case mp
α : Type u
β : Type v
γ : Type w
ι : Sort x
a✝ b✝ : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
h : Subsingleton ↑s
a : α
ha : a ∈ s
b : α
hb : b ∈ s
⊢ a = b

Next tactic:
exact SetCoe.ext_iff.2 (@Subsingleton.elim s h ⟨a, ha⟩ ⟨b, hb⟩)
/-- `s`, coerced to a type, is a subsingleton type if and only if `s` is a subsingleton set. -/
@[simp, norm_cast]
theorem subsingleton_coe (s : Set α) : Subsingleton s ↔ s.Subsingleton := by
  constructor
  · refine' fun h => fun a ha b hb => _
    exact SetCoe.ext_iff.2 (@Subsingleton.elim s h ⟨a, ha⟩ ⟨b, hb⟩)
  · 

Proof state:
case mpr
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ Set.Subsingleton s → Subsingleton ↑s

Next tactic:
exact fun h => Subsingleton.intro fun a b => SetCoe.ext (h a.property b.property)
/-- The `coe_sort` of a set `s` in a subsingleton type is a subsingleton.
For the corresponding result for `Subtype`, see `subtype.subsingleton`. -/
instance subsingleton_coe_of_subsingleton [Subsingleton α] {s : Set α} : Subsingleton s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Subsingleton α
s : Set α
⊢ Subsingleton ↑s

Next tactic:
rw [s.subsingleton_coe]
/-- The `coe_sort` of a set `s` in a subsingleton type is a subsingleton.
For the corresponding result for `Subtype`, see `subtype.subsingleton`. -/
instance subsingleton_coe_of_subsingleton [Subsingleton α] {s : Set α} : Subsingleton s := by
  rw [s.subsingleton_coe]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u : Set α
inst✝ : Subsingleton α
s : Set α
⊢ Set.Subsingleton s

Next tactic:
exact subsingleton_of_subsingleton
theorem Nontrivial.exists_ne (hs : s.Nontrivial) (z) : ∃ x ∈ s, x ≠ z := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
hs : Set.Nontrivial s
z : α
⊢ ∃ x ∈ s, x ≠ z

Next tactic:
by_contra! H
theorem Nontrivial.exists_ne (hs : s.Nontrivial) (z) : ∃ x ∈ s, x ≠ z := by
  by_contra! H
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
hs : Set.Nontrivial s
z : α
H : ∀ x ∈ s, x = z
⊢ False

Next tactic:
rcases hs with ⟨x, hx, y, hy, hxy⟩
theorem Nontrivial.exists_ne (hs : s.Nontrivial) (z) : ∃ x ∈ s, x ≠ z := by
  by_contra! H
  rcases hs with ⟨x, hx, y, hy, hxy⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
z : α
H : ∀ x ∈ s, x = z
x : α
hx : x ∈ s
y : α
hy : y ∈ s
hxy : x ≠ y
⊢ False

Next tactic:
rw [H x hx, H y hy] at hxy
theorem Nontrivial.exists_ne (hs : s.Nontrivial) (z) : ∃ x ∈ s, x ≠ z := by
  by_contra! H
  rcases hs with ⟨x, hx, y, hy, hxy⟩
  rw [H x hx, H y hy] at hxy
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
z : α
H : ∀ x ∈ s, x = z
x : α
hx : x ∈ s
y : α
hy : y ∈ s
hxy : z ≠ z
⊢ False

Next tactic:
exact hxy rfl
@[simp]
theorem not_nontrivial_singleton {x} : ¬({x} : Set α).Nontrivial := fun H => by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
H : Set.Nontrivial {x}
⊢ False

Next tactic:
rw [nontrivial_iff_exists_ne (mem_singleton x)] at H
@[simp]
theorem not_nontrivial_singleton {x} : ¬({x} : Set α).Nontrivial := fun H => by
  rw [nontrivial_iff_exists_ne (mem_singleton x)] at H
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
H : ∃ y ∈ {x}, y ≠ x
⊢ False

Next tactic:
let ⟨y, hy, hya⟩ := H
@[simp]
theorem not_nontrivial_singleton {x} : ¬({x} : Set α).Nontrivial := fun H => by
  rw [nontrivial_iff_exists_ne (mem_singleton x)] at H
  let ⟨y, hy, hya⟩ := H
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
H : ∃ y ∈ {x}, y ≠ x
y : α
hy : y ∈ {x}
hya : y ≠ x
⊢ False

Next tactic:
exact hya (mem_singleton_iff.1 hy)
theorem Nontrivial.ne_singleton {x} (hs : s.Nontrivial) : s ≠ {x} := fun H => by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
hs : Set.Nontrivial s
H : s = {x}
⊢ False

Next tactic:
rw [H] at hs
theorem Nontrivial.ne_singleton {x} (hs : s.Nontrivial) : s ≠ {x} := fun H => by
  rw [H] at hs
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : α
hs : Set.Nontrivial {x}
H : s = {x}
⊢ False

Next tactic:
exact not_nontrivial_singleton hs
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
@[simp, norm_cast]
theorem nontrivial_coe_sort {s : Set α} : Nontrivial s ↔ s.Nontrivial := by
  -- simp_rw [← nontrivial_univ_iff, Set.Nontrivial, mem_univ, exists_true_left, SetCoe.exists,
  --   Subtype.mk_eq_mk]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ Nontrivial ↑s ↔ Set.Nontrivial s

Next tactic:
rw [← nontrivial_univ_iff, Set.Nontrivial, Set.Nontrivial]
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
@[simp, norm_cast]
theorem nontrivial_coe_sort {s : Set α} : Nontrivial s ↔ s.Nontrivial := by
  -- simp_rw [← nontrivial_univ_iff, Set.Nontrivial, mem_univ, exists_true_left, SetCoe.exists,
  --   Subtype.mk_eq_mk]
  rw [← nontrivial_univ_iff, Set.Nontrivial, Set.Nontrivial]
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ (∃ x ∈ univ, ∃ y ∈ univ, x ≠ y) ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y

Next tactic:
apply Iff.intro
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
@[simp, norm_cast]
theorem nontrivial_coe_sort {s : Set α} : Nontrivial s ↔ s.Nontrivial := by
  -- simp_rw [← nontrivial_univ_iff, Set.Nontrivial, mem_univ, exists_true_left, SetCoe.exists,
  --   Subtype.mk_eq_mk]
  rw [← nontrivial_univ_iff, Set.Nontrivial, Set.Nontrivial]
  apply Iff.intro
  · 

Proof state:
case mp
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ (∃ x ∈ univ, ∃ y ∈ univ, x ≠ y) → ∃ x ∈ s, ∃ y ∈ s, x ≠ y

Next tactic:
rintro ⟨x, _, y, _, hxy⟩
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
@[simp, norm_cast]
theorem nontrivial_coe_sort {s : Set α} : Nontrivial s ↔ s.Nontrivial := by
  -- simp_rw [← nontrivial_univ_iff, Set.Nontrivial, mem_univ, exists_true_left, SetCoe.exists,
  --   Subtype.mk_eq_mk]
  rw [← nontrivial_univ_iff, Set.Nontrivial, Set.Nontrivial]
  apply Iff.intro
  · rintro ⟨x, _, y, _, hxy⟩
    

Proof state:
case mp.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
x : ↑s
left✝¹ : x ∈ univ
y : ↑s
left✝ : y ∈ univ
hxy : x ≠ y
⊢ ∃ x ∈ s, ∃ y ∈ s, x ≠ y

Next tactic:
exact ⟨x, Subtype.prop x, y, Subtype.prop y, fun h => hxy (Subtype.coe_injective h)⟩
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
@[simp, norm_cast]
theorem nontrivial_coe_sort {s : Set α} : Nontrivial s ↔ s.Nontrivial := by
  -- simp_rw [← nontrivial_univ_iff, Set.Nontrivial, mem_univ, exists_true_left, SetCoe.exists,
  --   Subtype.mk_eq_mk]
  rw [← nontrivial_univ_iff, Set.Nontrivial, Set.Nontrivial]
  apply Iff.intro
  · rintro ⟨x, _, y, _, hxy⟩
    exact ⟨x, Subtype.prop x, y, Subtype.prop y, fun h => hxy (Subtype.coe_injective h)⟩
  · 

Proof state:
case mpr
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ (∃ x ∈ s, ∃ y ∈ s, x ≠ y) → ∃ x ∈ univ, ∃ y ∈ univ, x ≠ y

Next tactic:
rintro ⟨x, hx, y, hy, hxy⟩
/-- `s`, coerced to a type, is a nontrivial type if and only if `s` is a nontrivial set. -/
@[simp, norm_cast]
theorem nontrivial_coe_sort {s : Set α} : Nontrivial s ↔ s.Nontrivial := by
  -- simp_rw [← nontrivial_univ_iff, Set.Nontrivial, mem_univ, exists_true_left, SetCoe.exists,
  --   Subtype.mk_eq_mk]
  rw [← nontrivial_univ_iff, Set.Nontrivial, Set.Nontrivial]
  apply Iff.intro
  · rintro ⟨x, _, y, _, hxy⟩
    exact ⟨x, Subtype.prop x, y, Subtype.prop y, fun h => hxy (Subtype.coe_injective h)⟩
  · rintro ⟨x, hx, y, hy, hxy⟩
    

Proof state:
case mpr.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
x : α
hx : x ∈ s
y : α
hy : y ∈ s
hxy : x ≠ y
⊢ ∃ x ∈ univ, ∃ y ∈ univ, x ≠ y

Next tactic:
exact ⟨⟨x, hx⟩, mem_univ _, ⟨y, hy⟩, mem_univ _, Subtype.mk_eq_mk.not.mpr hxy⟩
@[simp]
theorem not_subsingleton_iff : ¬s.Subsingleton ↔ s.Nontrivial := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
⊢ ¬Set.Subsingleton s ↔ Set.Nontrivial s

Next tactic:
simp_rw [Set.Subsingleton, Set.Nontrivial, not_forall, exists_prop]
protected lemma subsingleton_or_nontrivial (s : Set α) : s.Subsingleton ∨ s.Nontrivial := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s✝ s₁ s₂ t t₁ t₂ u s : Set α
⊢ Set.Subsingleton s ∨ Set.Nontrivial s

Next tactic:
simp [or_iff_not_imp_right]
lemma eq_singleton_or_nontrivial (ha : a ∈ s) : s = {a} ∨ s.Nontrivial := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
ha : a ∈ s
⊢ s = {a} ∨ Set.Nontrivial s

Next tactic:
rw [← subsingleton_iff_singleton ha]
lemma eq_singleton_or_nontrivial (ha : a ∈ s) : s = {a} ∨ s.Nontrivial := by
  rw [← subsingleton_iff_singleton ha]; 

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
ha : a ∈ s
⊢ Set.Subsingleton s ∨ Set.Nontrivial s

Next tactic:
exact s.subsingleton_or_nontrivial
theorem univ_eq_true_false : univ = ({True, False} : Set Prop) :=
  Eq.symm <| eq_univ_of_forall <| fun x => by
    

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : Prop
⊢ x ∈ {True, False}

Next tactic:
rw [mem_insert_iff, mem_singleton_iff]
theorem univ_eq_true_false : univ = ({True, False} : Set Prop) :=
  Eq.symm <| eq_univ_of_forall <| fun x => by
    rw [mem_insert_iff, mem_singleton_iff]
    

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
x : Prop
⊢ x = True ∨ x = False

Next tactic:
exact Classical.propComplete x
theorem monotoneOn_iff_monotone : MonotoneOn f s ↔
    Monotone fun a : s => f a := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝¹ : Preorder α
inst✝ : Preorder β
f : α → β
⊢ MonotoneOn f s ↔ Monotone fun a => f ↑a

Next tactic:
simp [Monotone, MonotoneOn]
theorem antitoneOn_iff_antitone : AntitoneOn f s ↔
    Antitone fun a : s => f a := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝¹ : Preorder α
inst✝ : Preorder β
f : α → β
⊢ AntitoneOn f s ↔ Antitone fun a => f ↑a

Next tactic:
simp [Antitone, AntitoneOn]
theorem strictMonoOn_iff_strictMono : StrictMonoOn f s ↔
    StrictMono fun a : s => f a := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝¹ : Preorder α
inst✝ : Preorder β
f : α → β
⊢ StrictMonoOn f s ↔ StrictMono fun a => f ↑a

Next tactic:
simp [StrictMono, StrictMonoOn]
theorem strictAntiOn_iff_strictAnti : StrictAntiOn f s ↔
    StrictAnti fun a : s => f a := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝¹ : Preorder α
inst✝ : Preorder β
f : α → β
⊢ StrictAntiOn f s ↔ StrictAnti fun a => f ↑a

Next tactic:
simp [StrictAnti, StrictAntiOn]
/-- A function between linear orders which is neither monotone nor antitone makes a dent upright or
downright. -/
theorem not_monotoneOn_not_antitoneOn_iff_exists_le_le :
    ¬MonotoneOn f s ∧ ¬AntitoneOn f s ↔
      ∃ᵉ (a ∈ s) (b ∈ s) (c ∈ s), a ≤ b ∧ b ≤ c ∧
        (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
⊢ ¬MonotoneOn f s ∧ ¬AntitoneOn f s ↔
    ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a ≤ b ∧ b ≤ c ∧ (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)

Next tactic:
simp [monotoneOn_iff_monotone, antitoneOn_iff_antitone, and_assoc, exists_and_left,
    not_monotone_not_antitone_iff_exists_le_le, @and_left_comm (_ ∈ s)]
/-- A function between linear orders which is neither monotone nor antitone makes a dent upright or
downright. -/
theorem not_monotoneOn_not_antitoneOn_iff_exists_lt_lt :
    ¬MonotoneOn f s ∧ ¬AntitoneOn f s ↔
      ∃ᵉ (a ∈ s) (b ∈ s) (c ∈ s), a < b ∧ b < c ∧
        (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
ι : Sort x
a b : α
s s₁ s₂ t t₁ t₂ u : Set α
inst✝¹ : LinearOrder α
inst✝ : LinearOrder β
f : α → β
⊢ ¬MonotoneOn f s ∧ ¬AntitoneOn f s ↔
    ∃ a ∈ s, ∃ b ∈ s, ∃ c ∈ s, a < b ∧ b < c ∧ (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)

Next tactic:
simp [monotoneOn_iff_monotone, antitoneOn_iff_antitone, and_assoc, exists_and_left,
    not_monotone_not_antitone_iff_exists_lt_lt, @and_left_comm (_ ∈ s)]
theorem Injective.nonempty_apply_iff {f : Set α → Set β} (hf : Injective f) (h2 : f ∅ = ∅)
    {s : Set α} : (f s).Nonempty ↔ s.Nonempty := by
  

Proof state:
ι : Sort u_1
α : Type u_2
β : Type u_3
f✝ : α → β
f : Set α → Set β
hf : Injective f
h2 : f ∅ = ∅
s : Set α
⊢ Set.Nonempty (f s) ↔ Set.Nonempty s

Next tactic:
rw [nonempty_iff_ne_empty, ← h2, nonempty_iff_ne_empty, hf.ne_iff]
@[simp]
theorem inclusion_self (x : s) : inclusion Subset.rfl x = x := by
  

Proof state:
α : Type u_1
s t u : Set α
x : ↑s
⊢ inclusion (_ : s ⊆ s) x = x

Next tactic:
cases x
@[simp]
theorem inclusion_self (x : s) : inclusion Subset.rfl x = x := by
  cases x
  

Proof state:
case mk
α : Type u_1
s t u : Set α
val✝ : α
property✝ : val✝ ∈ s
⊢ inclusion (_ : s ⊆ s) { val := val✝, property := property✝ } = { val := val✝, property := property✝ }

Next tactic:
rfl
theorem inclusion_right (h : s ⊆ t) (x : t) (m : (x : α) ∈ s) : inclusion h ⟨x, m⟩ = x := by
  

Proof state:
α : Type u_1
s t u : Set α
h : s ⊆ t
x : ↑t
m : ↑x ∈ s
⊢ inclusion h { val := ↑x, property := m } = x

Next tactic:
cases x
theorem inclusion_right (h : s ⊆ t) (x : t) (m : (x : α) ∈ s) : inclusion h ⟨x, m⟩ = x := by
  cases x
  

Proof state:
case mk
α : Type u_1
s t u : Set α
h : s ⊆ t
val✝ : α
property✝ : val✝ ∈ t
m : ↑{ val := val✝, property := property✝ } ∈ s
⊢ inclusion h { val := ↑{ val := val✝, property := property✝ }, property := m } = { val := val✝, property := property✝ }

Next tactic:
rfl
@[simp]
theorem inclusion_inclusion (hst : s ⊆ t) (htu : t ⊆ u) (x : s) :
    inclusion htu (inclusion hst x) = inclusion (hst.trans htu) x := by
  

Proof state:
α : Type u_1
s t u : Set α
hst : s ⊆ t
htu : t ⊆ u
x : ↑s
⊢ inclusion htu (inclusion hst x) = inclusion (_ : s ⊆ u) x

Next tactic:
cases x
@[simp]
theorem inclusion_inclusion (hst : s ⊆ t) (htu : t ⊆ u) (x : s) :
    inclusion htu (inclusion hst x) = inclusion (hst.trans htu) x := by
  cases x
  

Proof state:
case mk
α : Type u_1
s t u : Set α
hst : s ⊆ t
htu : t ⊆ u
val✝ : α
property✝ : val✝ ∈ s
⊢ inclusion htu (inclusion hst { val := val✝, property := property✝ }) =
    inclusion (_ : s ⊆ u) { val := val✝, property := property✝ }

Next tactic:
rfl
theorem eq_of_inclusion_surjective {s t : Set α} {h : s ⊆ t}
    (h_surj : Function.Surjective (inclusion h)) : s = t := by
  

Proof state:
α : Type u_1
s✝ t✝ u s t : Set α
h : s ⊆ t
h_surj : Surjective (inclusion h)
⊢ s = t

Next tactic:
refine' Set.Subset.antisymm h (fun x hx => _)
theorem eq_of_inclusion_surjective {s t : Set α} {h : s ⊆ t}
    (h_surj : Function.Surjective (inclusion h)) : s = t := by
  refine' Set.Subset.antisymm h (fun x hx => _)
  

Proof state:
α : Type u_1
s✝ t✝ u s t : Set α
h : s ⊆ t
h_surj : Surjective (inclusion h)
x : α
hx : x ∈ t
⊢ x ∈ s

Next tactic:
obtain ⟨y, hy⟩ := h_surj ⟨x, hx⟩
theorem eq_of_inclusion_surjective {s t : Set α} {h : s ⊆ t}
    (h_surj : Function.Surjective (inclusion h)) : s = t := by
  refine' Set.Subset.antisymm h (fun x hx => _)
  obtain ⟨y, hy⟩ := h_surj ⟨x, hx⟩
  

Proof state:
case intro
α : Type u_1
s✝ t✝ u s t : Set α
h : s ⊆ t
h_surj : Surjective (inclusion h)
x : α
hx : x ∈ t
y : ↑s
hy : inclusion h y = { val := x, property := hx }
⊢ x ∈ s

Next tactic:
exact mem_of_eq_of_mem (congr_arg Subtype.val hy).symm y.prop
instance decidableSdiff [Decidable (a ∈ s)] [Decidable (a ∈ t)] : Decidable (a ∈ s \ t) :=
  (by 

Proof state:
α : Type u
s t : Set α
a : α
inst✝¹ : Decidable (a ∈ s)
inst✝ : Decidable (a ∈ t)
⊢ Decidable (a ∈ s ∧ a ∉ t)

Next tactic:
infer_instance
instance decidableInter [Decidable (a ∈ s)] [Decidable (a ∈ t)] : Decidable (a ∈ s ∩ t) :=
  (by 

Proof state:
α : Type u
s t : Set α
a : α
inst✝¹ : Decidable (a ∈ s)
inst✝ : Decidable (a ∈ t)
⊢ Decidable (a ∈ s ∧ a ∈ t)

Next tactic:
infer_instance
instance decidableUnion [Decidable (a ∈ s)] [Decidable (a ∈ t)] : Decidable (a ∈ s ∪ t) :=
  (by 

Proof state:
α : Type u
s t : Set α
a : α
inst✝¹ : Decidable (a ∈ s)
inst✝ : Decidable (a ∈ t)
⊢ Decidable (a ∈ s ∨ a ∈ t)

Next tactic:
infer_instance
instance decidableCompl [Decidable (a ∈ s)] : Decidable (a ∈ sᶜ) :=
  (by 

Proof state:
α : Type u
s t : Set α
a : α
inst✝ : Decidable (a ∈ s)
⊢ Decidable (a ∉ s)

Next tactic:
infer_instance
instance decidableEmptyset : DecidablePred (· ∈ (∅ : Set α)) := fun _ => Decidable.isFalse (by 

Proof state:
α : Type u
s t : Set α
a x✝ : α
⊢ ¬(fun x => x ∈ ∅) x✝

Next tactic:
simp
instance decidableUniv : DecidablePred (· ∈ (Set.univ : Set α)) := fun _ =>
  Decidable.isTrue (by 

Proof state:
α : Type u
s t : Set α
a x✝ : α
⊢ (fun x => x ∈ univ) x✝

Next tactic:
simp
instance decidableSetOf (p : α → Prop) [Decidable (p a)] : Decidable (a ∈ { a | p a }) := by
  

Proof state:
α : Type u
s t : Set α
a : α
p : α → Prop
inst✝ : Decidable (p a)
⊢ Decidable (a ∈ {a | p a})

Next tactic:
assumption
@[simp] theorem Prop.compl_singleton (p : Prop) : ({p}ᶜ : Set Prop) = {¬p} :=
  ext fun q ↦ by 

Proof state:
α : Type u_1
β : Type u_2
s t u : Set α
f : α → β
p q : Prop
⊢ q ∈ {p}ᶜ ↔ q ∈ {¬p}

Next tactic:
simpa [@Iff.comm q] using not_iff
theorem one_of_dist_le (hs : x ∈ (chartAt H c).source)
    (hd : dist (extChartAt I c x) (extChartAt I c c) ≤ f.rIn) : f x = 1 := by
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
hs : x ∈ (chartAt H c).toPartialEquiv.source
hd : dist (↑(extChartAt I c) x) (↑(extChartAt I c) c) ≤ f.rIn
⊢ ↑f x = 1

Next tactic:
simp only [f.eqOn_source hs, (· ∘ ·), f.one_of_mem_closedBall hd]
theorem support_eq_inter_preimage :
    support f = (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) f.rOut := by
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
⊢ support ↑f = (chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) f.rOut

Next tactic:
rw [coe_def, support_indicator, support_comp_eq_preimage, ← extChartAt_source I,
    ← (extChartAt I c).symm_image_target_inter_eq', ← (extChartAt I c).symm_image_target_inter_eq',
    f.support_eq]
theorem isOpen_support : IsOpen (support f) := by
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
⊢ IsOpen (support ↑f)

Next tactic:
rw [support_eq_inter_preimage]
theorem isOpen_support : IsOpen (support f) := by
  rw [support_eq_inter_preimage]
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
⊢ IsOpen ((chartAt H c).toPartialEquiv.source ∩ ↑(extChartAt I c) ⁻¹' ball (↑(extChartAt I c) c) f.rOut)

Next tactic:
exact isOpen_extChartAt_preimage I c isOpen_ball
theorem support_eq_symm_image :
    support f = (extChartAt I c).symm '' (ball (extChartAt I c c) f.rOut ∩ range I) := by
  

Proof state:
E : Type uE
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : NormedSpace ℝ E
inst✝⁴ : FiniteDimensional ℝ E
H : Type uH
inst✝³ : TopologicalSpace H
I : ModelWithCorners ℝ E H
M : Type uM
inst✝² : TopologicalSpace M
inst✝¹ : ChartedSpace H M
inst✝ : SmoothManifoldWithCorners I M
c : M
f : SmoothBumpFunction I c
x : M
⊢ support ↑f = ↑(PartialEquiv.symm (extChartAt I c)) '' (ball (↑(extChartAt I c) c) f.rOut ∩ range ↑I)

Next tactic:
rw [f.support_eq_inter_preimage, ← extChartAt_source I,
    ← (extChartAt I c).symm_image_target_inter_eq', inter_comm,
    ball_inter_range_eq_ball_inter_target]