l3lab/ntp-mathlib huggingface dataset:
theorem mk_subset_ge_of_subset_image_lift {α : Type u} {β : Type v} (f : α → β) {s : Set α}
    {t : Set β} (h : t ⊆ f '' s) : lift.{u} #t ≤ lift.{v} #({ x ∈ s | f x ∈ t } : Set α) := by
  rw [image_eq_range] at h
  convert mk_preimage_of_subset_range_lift _ _ h using 1
  rw [mk_sep]
  

Proof state:
case h.e'_4
α✝ β✝ : Type u
c : Cardinal.{?u.842756}
α : Type u
β : Type v
f : α → β
s : Set α
t : Set β
h : t ⊆ range fun x => f ↑x
⊢ lift.{v, u} #↑{x | f ↑x ∈ t} = lift.{v, u} #↑((fun x => f ↑x) ⁻¹' t)

Next tactic:
rfl
theorem mk_subset_ge_of_subset_image (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) :
    #t ≤ #({ x ∈ s | f x ∈ t } : Set α) := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.843698}
f : α → β
s : Set α
t : Set β
h : t ⊆ f '' s
⊢ #↑t ≤ #↑{x | x ∈ s ∧ f x ∈ t}

Next tactic:
rw [image_eq_range] at h
theorem mk_subset_ge_of_subset_image (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) :
    #t ≤ #({ x ∈ s | f x ∈ t } : Set α) := by
  rw [image_eq_range] at h
  

Proof state:
α β : Type u
c : Cardinal.{?u.843698}
f : α → β
s : Set α
t : Set β
h : t ⊆ range fun x => f ↑x
⊢ #↑t ≤ #↑{x | x ∈ s ∧ f x ∈ t}

Next tactic:
convert mk_preimage_of_subset_range _ _ h using 1
theorem mk_subset_ge_of_subset_image (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) :
    #t ≤ #({ x ∈ s | f x ∈ t } : Set α) := by
  rw [image_eq_range] at h
  convert mk_preimage_of_subset_range _ _ h using 1
  

Proof state:
case h.e'_4
α β : Type u
c : Cardinal.{?u.843698}
f : α → β
s : Set α
t : Set β
h : t ⊆ range fun x => f ↑x
⊢ #↑{x | x ∈ s ∧ f x ∈ t} = #↑((fun x => f ↑x) ⁻¹' t)

Next tactic:
rw [mk_sep]
theorem mk_subset_ge_of_subset_image (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) :
    #t ≤ #({ x ∈ s | f x ∈ t } : Set α) := by
  rw [image_eq_range] at h
  convert mk_preimage_of_subset_range _ _ h using 1
  rw [mk_sep]
  

Proof state:
case h.e'_4
α β : Type u
c : Cardinal.{?u.843698}
f : α → β
s : Set α
t : Set β
h : t ⊆ range fun x => f ↑x
⊢ #↑{x | f ↑x ∈ t} = #↑((fun x => f ↑x) ⁻¹' t)

Next tactic:
rfl
theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
    c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c := by
  

Proof state:
α✝ β : Type u
c✝ : Cardinal.{?u.844569}
c : Cardinal.{u}
α : Type u
s : Set α
⊢ c ≤ #↑s ↔ ∃ p ⊆ s, #↑p = c

Next tactic:
rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
    c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c := by
  rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
  

Proof state:
α✝ β : Type u
c✝ : Cardinal.{?u.844569}
c : Cardinal.{u}
α : Type u
s : Set α
⊢ (∃ p, #↑p = c) ↔ ∃ s_1, #↑(Subtype.val '' s_1) = c

Next tactic:
apply exists_congr
theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
    c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c := by
  rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
  apply exists_congr; 

Proof state:
case h
α✝ β : Type u
c✝ : Cardinal.{?u.844569}
c : Cardinal.{u}
α : Type u
s : Set α
⊢ ∀ (a : Set ↑s), #↑a = c ↔ #↑(Subtype.val '' a) = c

Next tactic:
intro t
theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
    c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c := by
  rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
  apply exists_congr; intro t; 

Proof state:
case h
α✝ β : Type u
c✝ : Cardinal.{?u.844569}
c : Cardinal.{u}
α : Type u
s : Set α
t : Set ↑s
⊢ #↑t = c ↔ #↑(Subtype.val '' t) = c

Next tactic:
rw [mk_image_eq]
theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
    c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c := by
  rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
  apply exists_congr; intro t; rw [mk_image_eq]; 

Proof state:
case h
α✝ β : Type u
c✝ : Cardinal.{?u.844569}
c : Cardinal.{u}
α : Type u
s : Set α
t : Set ↑s
⊢ Injective Subtype.val

Next tactic:
apply Subtype.val_injective
theorem two_le_iff : (2 : Cardinal) ≤ #α ↔ ∃ x y : α, x ≠ y := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.845043}
⊢ 2 ≤ #α ↔ ∃ x y, x ≠ y

Next tactic:
rw [← Nat.cast_two, nat_succ, succ_le_iff, Nat.cast_one, one_lt_iff_nontrivial, nontrivial_iff]
theorem two_le_iff' (x : α) : (2 : Cardinal) ≤ #α ↔ ∃ y : α, y ≠ x := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.845621}
x : α
⊢ 2 ≤ #α ↔ ∃ y, y ≠ x

Next tactic:
rw [two_le_iff, ← nontrivial_iff, nontrivial_iff_exists_ne x]
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.854734}
⊢ #α = 2 ↔ ∃ x y, x ≠ y ∧ {x, y} = univ

Next tactic:
simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  

Proof state:
α β : Type u
c : Cardinal.{?u.854734}
⊢ (∃ t, ↑t = univ ∧ ∃ x y, x ≠ y ∧ t = {x, y}) ↔ ∃ x y, x ≠ y ∧ {x, y} = univ

Next tactic:
constructor
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · 

Proof state:
case mp
α β : Type u
c : Cardinal.{?u.854734}
⊢ (∃ t, ↑t = univ ∧ ∃ x y, x ≠ y ∧ t = {x, y}) → ∃ x y, x ≠ y ∧ {x, y} = univ

Next tactic:
rintro ⟨t, ht, x, y, hne, rfl⟩
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · rintro ⟨t, ht, x, y, hne, rfl⟩
    

Proof state:
case mp.intro.intro.intro.intro.intro
α β : Type u
c : Cardinal.{?u.854734}
x y : α
hne : x ≠ y
ht : ↑{x, y} = univ
⊢ ∃ x y, x ≠ y ∧ {x, y} = univ

Next tactic:
exact ⟨x, y, hne, by simpa using ht⟩
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · rintro ⟨t, ht, x, y, hne, rfl⟩
    exact ⟨x, y, hne, by 

Proof state:
α β : Type u
c : Cardinal.{?u.854734}
x y : α
hne : x ≠ y
ht : ↑{x, y} = univ
⊢ {x, y} = univ

Next tactic:
simpa using ht
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · rintro ⟨t, ht, x, y, hne, rfl⟩
    exact ⟨x, y, hne, by simpa using ht⟩
  · 

Proof state:
case mpr
α β : Type u
c : Cardinal.{?u.854734}
⊢ (∃ x y, x ≠ y ∧ {x, y} = univ) → ∃ t, ↑t = univ ∧ ∃ x y, x ≠ y ∧ t = {x, y}

Next tactic:
rintro ⟨x, y, hne, h⟩
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · rintro ⟨t, ht, x, y, hne, rfl⟩
    exact ⟨x, y, hne, by simpa using ht⟩
  · rintro ⟨x, y, hne, h⟩
    

Proof state:
case mpr.intro.intro.intro
α β : Type u
c : Cardinal.{?u.854734}
x y : α
hne : x ≠ y
h : {x, y} = univ
⊢ ∃ t, ↑t = univ ∧ ∃ x y, x ≠ y ∧ t = {x, y}

Next tactic:
exact ⟨{x, y}, by simpa using h, x, y, hne, rfl⟩
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · rintro ⟨t, ht, x, y, hne, rfl⟩
    exact ⟨x, y, hne, by simpa using ht⟩
  · rintro ⟨x, y, hne, h⟩
    exact ⟨{x, y}, by 

Proof state:
α β : Type u
c : Cardinal.{?u.854734}
x y : α
hne : x ≠ y
h : {x, y} = univ
⊢ ↑{x, y} = univ

Next tactic:
simpa using h
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.857262}
x : α
⊢ #α = 2 ↔ ∃! y, y ≠ x

Next tactic:
rw [mk_eq_two_iff]
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; 

Proof state:
α β : Type u
c : Cardinal.{?u.857262}
x : α
⊢ (∃ x y, x ≠ y ∧ {x, y} = univ) ↔ ∃! y, y ≠ x

Next tactic:
constructor
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · 

Proof state:
case mp
α β : Type u
c : Cardinal.{?u.857262}
x : α
⊢ (∃ x y, x ≠ y ∧ {x, y} = univ) → ∃! y, y ≠ x

Next tactic:
rintro ⟨a, b, hne, h⟩
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · rintro ⟨a, b, hne, h⟩
    

Proof state:
case mp.intro.intro.intro
α β : Type u
c : Cardinal.{?u.857262}
x a b : α
hne : a ≠ b
h : {a, b} = univ
⊢ ∃! y, y ≠ x

Next tactic:
simp only [eq_univ_iff_forall, mem_insert_iff, mem_singleton_iff] at h
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · rintro ⟨a, b, hne, h⟩
    simp only [eq_univ_iff_forall, mem_insert_iff, mem_singleton_iff] at h
    

Proof state:
case mp.intro.intro.intro
α β : Type u
c : Cardinal.{?u.857262}
x a b : α
hne : a ≠ b
h : ∀ (x : α), x = a ∨ x = b
⊢ ∃! y, y ≠ x

Next tactic:
rcases h x with (rfl | rfl)
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · rintro ⟨a, b, hne, h⟩
    simp only [eq_univ_iff_forall, mem_insert_iff, mem_singleton_iff] at h
    rcases h x with (rfl | rfl)
    

Proof state:
case mp.intro.intro.intro.inl
α β : Type u
c : Cardinal.{?u.857262}
x b : α
hne : x ≠ b
h : ∀ (x_1 : α), x_1 = x ∨ x_1 = b
⊢ ∃! y, y ≠ x
case mp.intro.intro.intro.inr
α β : Type u
c : Cardinal.{?u.857262}
x a : α
hne : a ≠ x
h : ∀ (x_1 : α), x_1 = a ∨ x_1 = x
⊢ ∃! y, y ≠ x

Next tactic:
exacts [⟨b, hne.symm, fun z => (h z).resolve_left⟩, ⟨a, hne, fun z => (h z).resolve_right⟩]
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · rintro ⟨a, b, hne, h⟩
    simp only [eq_univ_iff_forall, mem_insert_iff, mem_singleton_iff] at h
    rcases h x with (rfl | rfl)
    exacts [⟨b, hne.symm, fun z => (h z).resolve_left⟩, ⟨a, hne, fun z => (h z).resolve_right⟩]
  · 

Proof state:
case mpr
α β : Type u
c : Cardinal.{?u.857262}
x : α
⊢ (∃! y, y ≠ x) → ∃ x y, x ≠ y ∧ {x, y} = univ

Next tactic:
rintro ⟨y, hne, hy⟩
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · rintro ⟨a, b, hne, h⟩
    simp only [eq_univ_iff_forall, mem_insert_iff, mem_singleton_iff] at h
    rcases h x with (rfl | rfl)
    exacts [⟨b, hne.symm, fun z => (h z).resolve_left⟩, ⟨a, hne, fun z => (h z).resolve_right⟩]
  · rintro ⟨y, hne, hy⟩
    

Proof state:
case mpr.intro.intro
α β : Type u
c : Cardinal.{?u.857262}
x y : α
hne : y ≠ x
hy : ∀ (y_1 : α), (fun y => y ≠ x) y_1 → y_1 = y
⊢ ∃ x y, x ≠ y ∧ {x, y} = univ

Next tactic:
exact ⟨x, y, hne.symm, eq_univ_of_forall fun z => or_iff_not_imp_left.2 (hy z)⟩
theorem exists_not_mem_of_length_lt {α : Type*} (l : List α) (h : ↑l.length < #α) :
    ∃ z : α, z ∉ l := by
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.857890}
α : Type u_1
l : List α
h : ↑(List.length l) < #α
⊢ ∃ z, z ∉ l

Next tactic:
contrapose! h
theorem exists_not_mem_of_length_lt {α : Type*} (l : List α) (h : ↑l.length < #α) :
    ∃ z : α, z ∉ l := by
  contrapose! h
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.857890}
α : Type u_1
l : List α
h : ∀ (z : α), z ∈ l
⊢ #α ≤ ↑(List.length l)

Next tactic:
calc
    #α = #(Set.univ : Set α) := mk_univ.symm
    _ ≤ #l.toFinset := mk_le_mk_of_subset fun x _ => List.mem_toFinset.mpr (h x)
    _ = l.toFinset.card := Cardinal.mk_coe_finset
    _ ≤ l.length := Cardinal.natCast_le.mpr (List.toFinset_card_le l)
theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
⊢ ∃ z, z ≠ x ∧ z ≠ y

Next tactic:
have : ↑(3 : ℕ) ≤ #α
theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  have : ↑(3 : ℕ) ≤ #α; 

Proof state:
case this
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
⊢ ↑3 ≤ #α
α✝ β : Type u c : Cardinal.{?u.859111} α : Type u_1 h : 3 ≤ #α x y : α this : ↑3 ≤ #α ⊢ ∃ z, z ≠ x ∧ z ≠ y

Next tactic:
simpa using h
theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  have : ↑(3 : ℕ) ≤ #α; simpa using h
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
this : ↑3 ≤ #α
⊢ ∃ z, z ≠ x ∧ z ≠ y

Next tactic:
have : ↑(2 : ℕ) < #α
theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  have : ↑(3 : ℕ) ≤ #α; simpa using h
  have : ↑(2 : ℕ) < #α; 

Proof state:
case this
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
this : ↑3 ≤ #α
⊢ ↑2 < #α
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
this✝ : ↑3 ≤ #α
this : ↑2 < #α
⊢ ∃ z, z ≠ x ∧ z ≠ y

Next tactic:
rwa [← succ_le_iff, ← Cardinal.nat_succ]
theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  have : ↑(3 : ℕ) ≤ #α; simpa using h
  have : ↑(2 : ℕ) < #α; rwa [← succ_le_iff, ← Cardinal.nat_succ]
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
this✝ : ↑3 ≤ #α
this : ↑2 < #α
⊢ ∃ z, z ≠ x ∧ z ≠ y

Next tactic:
have := exists_not_mem_of_length_lt [x, y] this
theorem three_le {α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  have : ↑(3 : ℕ) ≤ #α; simpa using h
  have : ↑(2 : ℕ) < #α; rwa [← succ_le_iff, ← Cardinal.nat_succ]
  have := exists_not_mem_of_length_lt [x, y] this
  

Proof state:
α✝ β : Type u
c : Cardinal.{?u.859111}
α : Type u_1
h : 3 ≤ #α
x y : α
this✝¹ : ↑3 ≤ #α
this✝ : ↑2 < #α
this : ∃ z, z ∉ [x, y]
⊢ ∃ z, z ≠ x ∧ z ≠ y

Next tactic:
simpa [not_or] using this
theorem le_powerlt {b c : Cardinal.{u}} (a) (h : c < b) : (a^c) ≤ a ^< b := by
  

Proof state:
α β : Type u
c✝ : Cardinal.{?u.876122}
b c a : Cardinal.{u}
h : c < b
⊢ a ^ c ≤ a ^< b

Next tactic:
refine le_ciSup (f := fun y : Iio b => a ^ (y : Cardinal)) ?_ ⟨c, h⟩
theorem le_powerlt {b c : Cardinal.{u}} (a) (h : c < b) : (a^c) ≤ a ^< b := by
  refine le_ciSup (f := fun y : Iio b => a ^ (y : Cardinal)) ?_ ⟨c, h⟩
  

Proof state:
α β : Type u
c✝ : Cardinal.{?u.876122}
b c a : Cardinal.{u}
h : c < b
⊢ BddAbove (range fun y => a ^ ↑y)

Next tactic:
rw [← image_eq_range]
theorem le_powerlt {b c : Cardinal.{u}} (a) (h : c < b) : (a^c) ≤ a ^< b := by
  refine le_ciSup (f := fun y : Iio b => a ^ (y : Cardinal)) ?_ ⟨c, h⟩
  rw [← image_eq_range]
  

Proof state:
α β : Type u
c✝ : Cardinal.{?u.876122}
b c a : Cardinal.{u}
h : c < b
⊢ BddAbove (HPow.hPow a '' Iio b)

Next tactic:
exact bddAbove_image.{u, u} _ bddAbove_Iio
theorem powerlt_le {a b c : Cardinal.{u}} : a ^< b ≤ c ↔ ∀ x < b, a ^ x ≤ c := by
  

Proof state:
α β : Type u
c✝ : Cardinal.{?u.876541}
a b c : Cardinal.{u}
⊢ a ^< b ≤ c ↔ ∀ x < b, a ^ x ≤ c

Next tactic:
rw [powerlt, ciSup_le_iff']
theorem powerlt_le {a b c : Cardinal.{u}} : a ^< b ≤ c ↔ ∀ x < b, a ^ x ≤ c := by
  rw [powerlt, ciSup_le_iff']
  · 

Proof state:
α β : Type u
c✝ : Cardinal.{?u.876541}
a b c : Cardinal.{u}
⊢ (∀ (i : ↑(Iio b)), a ^ ↑i ≤ c) ↔ ∀ x < b, a ^ x ≤ c

Next tactic:
simp
theorem powerlt_le {a b c : Cardinal.{u}} : a ^< b ≤ c ↔ ∀ x < b, a ^ x ≤ c := by
  rw [powerlt, ciSup_le_iff']
  · simp
  · 

Proof state:
case h
α β : Type u
c✝ : Cardinal.{?u.876541}
a b c : Cardinal.{u}
⊢ BddAbove (range fun c => a ^ ↑c)

Next tactic:
rw [← image_eq_range]
theorem powerlt_le {a b c : Cardinal.{u}} : a ^< b ≤ c ↔ ∀ x < b, a ^ x ≤ c := by
  rw [powerlt, ciSup_le_iff']
  · simp
  · rw [← image_eq_range]
    

Proof state:
case h
α β : Type u
c✝ : Cardinal.{?u.876541}
a b c : Cardinal.{u}
⊢ BddAbove (HPow.hPow a '' Iio b)

Next tactic:
exact bddAbove_image.{u, u} _ bddAbove_Iio
theorem zero_powerlt {a : Cardinal} (h : a ≠ 0) : 0 ^< a = 1 := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.880451}
a : Cardinal.{u_1}
h : a ≠ 0
⊢ 0 ^< a = 1

Next tactic:
apply (powerlt_le.2 fun c _ => zero_power_le _).antisymm
theorem zero_powerlt {a : Cardinal} (h : a ≠ 0) : 0 ^< a = 1 := by
  apply (powerlt_le.2 fun c _ => zero_power_le _).antisymm
  

Proof state:
α β : Type u
c : Cardinal.{?u.880451}
a : Cardinal.{u_1}
h : a ≠ 0
⊢ 1 ≤ 0 ^< a

Next tactic:
rw [← power_zero]
theorem zero_powerlt {a : Cardinal} (h : a ≠ 0) : 0 ^< a = 1 := by
  apply (powerlt_le.2 fun c _ => zero_power_le _).antisymm
  rw [← power_zero]
  

Proof state:
α β : Type u
c : Cardinal.{?u.880451}
a : Cardinal.{u_1}
h : a ≠ 0
⊢ ?m.880648 ^ 0 ≤ 0 ^< a
α β : Type u c : Cardinal.{?u.880451} a : Cardinal.{u_1} h : a ≠ 0 ⊢ Cardinal.{u_1}

Next tactic:
exact le_powerlt 0 (pos_iff_ne_zero.2 h)
@[simp]
theorem powerlt_zero {a : Cardinal} : a ^< 0 = 0 := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.880860}
a : Cardinal.{u_1}
⊢ a ^< 0 = 0

Next tactic:
convert Cardinal.iSup_of_empty _
@[simp]
theorem powerlt_zero {a : Cardinal} : a ^< 0 = 0 := by
  convert Cardinal.iSup_of_empty _
  

Proof state:
case convert_3
α β : Type u
c : Cardinal.{?u.880860}
a : Cardinal.{u_1}
⊢ IsEmpty ↑(Iio 0)

Next tactic:
exact Subtype.isEmpty_of_false fun x => mem_Iio.not.mpr (Cardinal.zero_le x).not_lt
/-- The cardinality of a nontrivial module over a ring is at least the cardinality of the ring if
there are no zero divisors (for instance if the ring is a field) -/
theorem mk_le_of_module (R : Type u) (E : Type v)
    [AddCommGroup E] [Ring R] [Module R E] [Nontrivial E] [NoZeroSMulDivisors R E] :
    Cardinal.lift.{v} (#R) ≤ Cardinal.lift.{u} (#E) := by
  

Proof state:
α β : Type u
c : Cardinal.{?u.883923}
R : Type u
E : Type v
inst✝⁴ : AddCommGroup E
inst✝³ : Ring R
inst✝² : Module R E
inst✝¹ : Nontrivial E
inst✝ : NoZeroSMulDivisors R E
⊢ lift.{v, u} #R ≤ lift.{u, v} #E

Next tactic:
obtain ⟨x, hx⟩ : ∃ (x : E), x ≠ 0 := exists_ne 0
/-- The cardinality of a nontrivial module over a ring is at least the cardinality of the ring if
there are no zero divisors (for instance if the ring is a field) -/
theorem mk_le_of_module (R : Type u) (E : Type v)
    [AddCommGroup E] [Ring R] [Module R E] [Nontrivial E] [NoZeroSMulDivisors R E] :
    Cardinal.lift.{v} (#R) ≤ Cardinal.lift.{u} (#E) := by
  obtain ⟨x, hx⟩ : ∃ (x : E), x ≠ 0 := exists_ne 0
  

Proof state:
case intro
α β : Type u
c : Cardinal.{?u.883923}
R : Type u
E : Type v
inst✝⁴ : AddCommGroup E
inst✝³ : Ring R
inst✝² : Module R E
inst✝¹ : Nontrivial E
inst✝ : NoZeroSMulDivisors R E
x : E
hx : x ≠ 0
⊢ lift.{v, u} #R ≤ lift.{u, v} #E

Next tactic:
have : Injective (fun k ↦ k • x) := smul_left_injective R hx
/-- The cardinality of a nontrivial module over a ring is at least the cardinality of the ring if
there are no zero divisors (for instance if the ring is a field) -/
theorem mk_le_of_module (R : Type u) (E : Type v)
    [AddCommGroup E] [Ring R] [Module R E] [Nontrivial E] [NoZeroSMulDivisors R E] :
    Cardinal.lift.{v} (#R) ≤ Cardinal.lift.{u} (#E) := by
  obtain ⟨x, hx⟩ : ∃ (x : E), x ≠ 0 := exists_ne 0
  have : Injective (fun k ↦ k • x) := smul_left_injective R hx
  

Proof state:
case intro
α β : Type u
c : Cardinal.{?u.883923}
R : Type u
E : Type v
inst✝⁴ : AddCommGroup E
inst✝³ : Ring R
inst✝² : Module R E
inst✝¹ : Nontrivial E
inst✝ : NoZeroSMulDivisors R E
x : E
hx : x ≠ 0
this : Injective fun k => k • x
⊢ lift.{v, u} #R ≤ lift.{u, v} #E

Next tactic:
exact lift_mk_le_lift_mk_of_injective this
@[to_additive (attr := simp)]
theorem inv_inv_symm_iff : SemiconjBy a⁻¹ x⁻¹ y⁻¹ ↔ SemiconjBy a y x :=
  inv_involutive.injective.eq_iff.symm.trans <| by
    

Proof state:
G : Type u_1
inst✝ : DivisionMonoid G
a x y : G
⊢ (a⁻¹ * x⁻¹)⁻¹ = (y⁻¹ * a⁻¹)⁻¹ ↔ SemiconjBy a y x

Next tactic:
rw [mul_inv_rev, mul_inv_rev, inv_inv, inv_inv, inv_inv, eq_comm, SemiconjBy]
/-- Restrict a measure `μ` to a set `s` as an `ℝ≥0∞`-linear map. -/
noncomputable def restrictₗ {m0 : MeasurableSpace α} (s : Set α) : Measure α →ₗ[ℝ≥0∞] Measure α :=
  liftLinear (OuterMeasure.restrict s) fun μ s' hs' t => by
    

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0✝ : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ✝ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s✝ s'✝ t✝ : Set α
m0 : MeasurableSpace α
s : Set α
μ : Measure α
s' : Set α
hs' : MeasurableSet s'
t : Set α
⊢ ↑((OuterMeasure.restrict s) ↑μ) t =
    ↑((OuterMeasure.restrict s) ↑μ) (t ∩ s') + ↑((OuterMeasure.restrict s) ↑μ) (t \ s')

Next tactic:
suffices μ (s ∩ t) = μ (s ∩ t ∩ s') + μ ((s ∩ t) \ s') by
      simpa [← Set.inter_assoc, Set.inter_comm _ s, ← inter_diff_assoc]
/-- Restrict a measure `μ` to a set `s` as an `ℝ≥0∞`-linear map. -/
noncomputable def restrictₗ {m0 : MeasurableSpace α} (s : Set α) : Measure α →ₗ[ℝ≥0∞] Measure α :=
  liftLinear (OuterMeasure.restrict s) fun μ s' hs' t => by
    suffices μ (s ∩ t) = μ (s ∩ t ∩ s') + μ ((s ∩ t) \ s') by
      

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0✝ : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ✝ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s✝ s'✝ t✝ : Set α
m0 : MeasurableSpace α
s : Set α
μ : Measure α
s' : Set α
hs' : MeasurableSet s'
t : Set α
this : ↑↑μ (s ∩ t) = ↑↑μ (s ∩ t ∩ s') + ↑↑μ ((s ∩ t) \ s')
⊢ ↑((OuterMeasure.restrict s) ↑μ) t =
    ↑((OuterMeasure.restrict s) ↑μ) (t ∩ s') + ↑((OuterMeasure.restrict s) ↑μ) (t \ s')

Next tactic:
simpa [← Set.inter_assoc, Set.inter_comm _ s, ← inter_diff_assoc]
/-- Restrict a measure `μ` to a set `s` as an `ℝ≥0∞`-linear map. -/
noncomputable def restrictₗ {m0 : MeasurableSpace α} (s : Set α) : Measure α →ₗ[ℝ≥0∞] Measure α :=
  liftLinear (OuterMeasure.restrict s) fun μ s' hs' t => by
    suffices μ (s ∩ t) = μ (s ∩ t ∩ s') + μ ((s ∩ t) \ s') by
      simpa [← Set.inter_assoc, Set.inter_comm _ s, ← inter_diff_assoc]
    

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0✝ : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ✝ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s✝ s'✝ t✝ : Set α
m0 : MeasurableSpace α
s : Set α
μ : Measure α
s' : Set α
hs' : MeasurableSet s'
t : Set α
⊢ ↑↑μ (s ∩ t) = ↑↑μ (s ∩ t ∩ s') + ↑↑μ ((s ∩ t) \ s')

Next tactic:
exact le_toOuterMeasure_caratheodory _ _ hs' _
/-- This lemma shows that `restrict` and `toOuterMeasure` commute. Note that the LHS has a
restrict on measures and the RHS has a restrict on outer measures. -/
theorem restrict_toOuterMeasure_eq_toOuterMeasure_restrict (h : MeasurableSet s) :
    (μ.restrict s).toOuterMeasure = OuterMeasure.restrict s μ.toOuterMeasure := by
  

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s s' t : Set α
h : MeasurableSet s
⊢ ↑(restrict μ s) = (OuterMeasure.restrict s) ↑μ

Next tactic:
simp_rw [restrict, restrictₗ, liftLinear, LinearMap.coe_mk, AddHom.coe_mk,
    toMeasure_toOuterMeasure, OuterMeasure.restrict_trim h, μ.trimmed]
theorem restrict_apply₀ (ht : NullMeasurableSet t (μ.restrict s)) : μ.restrict s t = μ (t ∩ s) :=
  (toMeasure_apply₀ _ (fun s' hs' t => by
    

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s s'✝ t✝ : Set α
ht : NullMeasurableSet t✝
s' : Set α
hs' : MeasurableSet s'
t : Set α
⊢ ↑((OuterMeasure.restrict s) ↑μ) t =
    ↑((OuterMeasure.restrict s) ↑μ) (t ∩ s') + ↑((OuterMeasure.restrict s) ↑μ) (t \ s')

Next tactic:
suffices μ (s ∩ t) = μ (s ∩ t ∩ s') + μ ((s ∩ t) \ s') by
      simpa [← Set.inter_assoc, Set.inter_comm _ s, ← inter_diff_assoc]
theorem restrict_apply₀ (ht : NullMeasurableSet t (μ.restrict s)) : μ.restrict s t = μ (t ∩ s) :=
  (toMeasure_apply₀ _ (fun s' hs' t => by
    suffices μ (s ∩ t) = μ (s ∩ t ∩ s') + μ ((s ∩ t) \ s') by
      

Proof state:
R : Type u_1
α : Type u_2
β : Type u_3
δ : Type u_4
γ : Type u_5
ι : Type u_6
m0 : MeasurableSpace α
inst✝¹ : MeasurableSpace β
inst✝ : MeasurableSpace γ
μ μ₁ μ₂ μ₃ ν ν' ν₁ ν₂ : Measure α
s s'✝ t✝ : Set α
ht : NullMeasurableSet t✝
s' : Set α
hs' : MeasurableSet s'
t : Set α
this : ↑↑μ (s ∩ t) = ↑↑μ (s ∩ t ∩ s') + ↑↑μ ((s ∩ t) \ s')
⊢ ↑((OuterMeasure.restrict s) ↑μ) t =
    ↑((OuterMeasure.restrict s) ↑μ) (t ∩ s') + ↑((OuterMeasure.restrict s) ↑μ) (t \ s')

Next tactic:
simpa [← Set.inter_assoc, Set.inter_comm _ s, ← inter_diff_assoc]