l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
theorem preimage_div_preimage_subset {s t : Set β} : m ⁻¹' s / m ⁻¹' t ⊆ m ⁻¹' (s / t) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
s t : Set β
⊢ ⇑m ⁻¹' s / ⇑m ⁻¹' t ⊆ ⇑m ⁻¹' (s / t)

Next tactic:
rintro _ ⟨_, _, _, _, rfl⟩
@[to_additive]
theorem preimage_div_preimage_subset {s t : Set β} : m ⁻¹' s / m ⁻¹' t ⊆ m ⁻¹' (s / t) := by
  rintro _ ⟨_, _, _, _, rfl⟩
  

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
s t : Set β
w✝¹ w✝ : α
left✝¹ : w✝¹ ∈ ⇑m ⁻¹' s
left✝ : w✝ ∈ ⇑m ⁻¹' t
⊢ (fun x x_1 => x / x_1) w✝¹ w✝ ∈ ⇑m ⁻¹' (s / t)

Next tactic:
exact ⟨_, _, ‹_›, ‹_›, (map_div m _ _).symm⟩
@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
hm : Injective ⇑m
s t : Set β
hs : s ⊆ range ⇑m
ht : t ⊆ range ⇑m
⊢ ⇑m ⁻¹' (s / t) = ⇑m ⁻¹' s / ⇑m ⁻¹' t

Next tactic:
refine subset_antisymm ?_ (preimage_div_preimage_subset m)
@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t := by
  refine subset_antisymm ?_ (preimage_div_preimage_subset m)
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
hm : Injective ⇑m
s t : Set β
hs : s ⊆ range ⇑m
ht : t ⊆ range ⇑m
⊢ ⇑m ⁻¹' (s / t) ⊆ ⇑m ⁻¹' s / ⇑m ⁻¹' t

Next tactic:
rintro a ⟨b, c, hb, hc, ha⟩
@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t := by
  refine subset_antisymm ?_ (preimage_div_preimage_subset m)
  rintro a ⟨b, c, hb, hc, ha⟩
  

Proof state:
case intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
hm : Injective ⇑m
s t : Set β
hs : s ⊆ range ⇑m
ht : t ⊆ range ⇑m
a : α
b c : β
hb : b ∈ s
hc : c ∈ t
ha : (fun x x_1 => x / x_1) b c = m a
⊢ a ∈ ⇑m ⁻¹' s / ⇑m ⁻¹' t

Next tactic:
obtain ⟨b, rfl⟩ := hs hb
@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t := by
  refine subset_antisymm ?_ (preimage_div_preimage_subset m)
  rintro a ⟨b, c, hb, hc, ha⟩
  obtain ⟨b, rfl⟩ := hs hb
  

Proof state:
case intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
hm : Injective ⇑m
s t : Set β
hs : s ⊆ range ⇑m
ht : t ⊆ range ⇑m
a : α
c : β
hc : c ∈ t
b : α
hb : m b ∈ s
ha : (fun x x_1 => x / x_1) (m b) c = m a
⊢ a ∈ ⇑m ⁻¹' s / ⇑m ⁻¹' t

Next tactic:
obtain ⟨c, rfl⟩ := ht hc
@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t := by
  refine subset_antisymm ?_ (preimage_div_preimage_subset m)
  rintro a ⟨b, c, hb, hc, ha⟩
  obtain ⟨b, rfl⟩ := hs hb
  obtain ⟨c, rfl⟩ := ht hc
  

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
hm : Injective ⇑m
s t : Set β
hs : s ⊆ range ⇑m
ht : t ⊆ range ⇑m
a b : α
hb : m b ∈ s
c : α
hc : m c ∈ t
ha : (fun x x_1 => x / x_1) (m b) (m c) = m a
⊢ a ∈ ⇑m ⁻¹' s / ⇑m ⁻¹' t

Next tactic:
simp only [← map_div, hm.eq_iff] at ha
@[to_additive]
lemma preimage_div (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s / t) = m ⁻¹' s / m ⁻¹' t := by
  refine subset_antisymm ?_ (preimage_div_preimage_subset m)
  rintro a ⟨b, c, hb, hc, ha⟩
  obtain ⟨b, rfl⟩ := hs hb
  obtain ⟨c, rfl⟩ := ht hc
  simp only [← map_div, hm.eq_iff] at ha
  

Proof state:
case intro.intro.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝² : Group α
inst✝¹ : DivisionMonoid β
inst✝ : MonoidHomClass F α β
m : F
s✝ t✝ : Set α
hm : Injective ⇑m
s t : Set β
hs : s ⊆ range ⇑m
ht : t ⊆ range ⇑m
a b : α
hb : m b ∈ s
c : α
hc : m c ∈ t
ha : b / c = a
⊢ a ∈ ⇑m ⁻¹' s / ⇑m ⁻¹' t

Next tactic:
exact ⟨b, c, hb, hc, ha⟩
@[to_additive]
theorem bddAbove_mul [OrderedCommMonoid α] {A B : Set α} :
    BddAbove A → BddAbove B → BddAbove (A * B) := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : OrderedCommMonoid α
A B : Set α
⊢ BddAbove A → BddAbove B → BddAbove (A * B)

Next tactic:
rintro ⟨bA, hbA⟩ ⟨bB, hbB⟩
@[to_additive]
theorem bddAbove_mul [OrderedCommMonoid α] {A B : Set α} :
    BddAbove A → BddAbove B → BddAbove (A * B) := by
  rintro ⟨bA, hbA⟩ ⟨bB, hbB⟩
  

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : OrderedCommMonoid α
A B : Set α
bA : α
hbA : bA ∈ upperBounds A
bB : α
hbB : bB ∈ upperBounds B
⊢ BddAbove (A * B)

Next tactic:
use bA * bB
@[to_additive]
theorem bddAbove_mul [OrderedCommMonoid α] {A B : Set α} :
    BddAbove A → BddAbove B → BddAbove (A * B) := by
  rintro ⟨bA, hbA⟩ ⟨bB, hbB⟩
  use bA * bB
  

Proof state:
case h
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : OrderedCommMonoid α
A B : Set α
bA : α
hbA : bA ∈ upperBounds A
bB : α
hbB : bB ∈ upperBounds B
⊢ bA * bB ∈ upperBounds (A * B)

Next tactic:
rintro x ⟨xa, xb, hxa, hxb, rfl⟩
@[to_additive]
theorem bddAbove_mul [OrderedCommMonoid α] {A B : Set α} :
    BddAbove A → BddAbove B → BddAbove (A * B) := by
  rintro ⟨bA, hbA⟩ ⟨bB, hbB⟩
  use bA * bB
  rintro x ⟨xa, xb, hxa, hxb, rfl⟩
  

Proof state:
case h.intro.intro.intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
inst✝ : OrderedCommMonoid α
A B : Set α
bA : α
hbA : bA ∈ upperBounds A
bB : α
hbB : bB ∈ upperBounds B
xa xb : α
hxa : xa ∈ A
hxb : xb ∈ B
⊢ (fun x x_1 => x * x_1) xa xb ≤ bA * bB

Next tactic:
exact mul_le_mul' (hbA hxa) (hbB hxb)
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h2 : ∀ (n : ℕ), f n ≤ B
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
⊢ ∀ (k : ℕ), B ≤ k → f k = f B

Next tactic:
have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
    exact fun n =>
      Nat.rec (fun _ => Nat.zero_le (f 0))
        (fun n ih h =>
          lt_of_le_of_lt (ih (n.le_succ.trans h))
            (lt_of_le_of_ne (h1 n.le_succ) (h2 n (Nat.succ_le_succ_iff.mp h))))
        n
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h2 : ∀ (n : ℕ), f n ≤ B
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
⊢ ∃ n ≤ B, f n = f (n + 1)

Next tactic:
contrapose! h2
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
h2 : ∀ n ≤ B, f n ≠ f (n + 1)
⊢ ∃ n, B < f n

Next tactic:
suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
h2 : ∀ n ≤ B, f n ≠ f (n + 1)
this : ∀ n ≤ B + 1, n ≤ f n
⊢ ∃ n, B < f n

Next tactic:
exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
    

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
h2 : ∀ n ≤ B, f n ≠ f (n + 1)
⊢ ∀ n ≤ B + 1, n ≤ f n

Next tactic:
exact fun n =>
      Nat.rec (fun _ => Nat.zero_le (f 0))
        (fun n ih h =>
          lt_of_le_of_lt (ih (n.le_succ.trans h))
            (lt_of_le_of_ne (h1 n.le_succ) (h2 n (Nat.succ_le_succ_iff.mp h))))
        n
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
    exact fun n =>
      Nat.rec (fun _ => Nat.zero_le (f 0))
        (fun n ih h =>
          lt_of_le_of_lt (ih (n.le_succ.trans h))
            (lt_of_le_of_ne (h1 n.le_succ) (h2 n (Nat.succ_le_succ_iff.mp h))))
        n
  · 

Proof state:
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h2 : ∀ (n : ℕ), f n ≤ B
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
key : ∃ n ≤ B, f n = f (n + 1)
⊢ ∀ (k : ℕ), B ≤ k → f k = f B

Next tactic:
obtain ⟨n, hn1, hn2⟩ := key
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
    exact fun n =>
      Nat.rec (fun _ => Nat.zero_le (f 0))
        (fun n ih h =>
          lt_of_le_of_lt (ih (n.le_succ.trans h))
            (lt_of_le_of_ne (h1 n.le_succ) (h2 n (Nat.succ_le_succ_iff.mp h))))
        n
  · obtain ⟨n, hn1, hn2⟩ := key
    

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h2 : ∀ (n : ℕ), f n ≤ B
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
n : ℕ
hn1 : n ≤ B
hn2 : f n = f (n + 1)
⊢ ∀ (k : ℕ), B ≤ k → f k = f B

Next tactic:
replace key : ∀ k : ℕ, f (n + k) = f (n + k + 1) ∧ f (n + k) = f n := fun k =>
      Nat.rec ⟨hn2, rfl⟩ (fun k ih => ⟨h3 _ ih.1, ih.1.symm.trans ih.2⟩) k
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
    exact fun n =>
      Nat.rec (fun _ => Nat.zero_le (f 0))
        (fun n ih h =>
          lt_of_le_of_lt (ih (n.le_succ.trans h))
            (lt_of_le_of_ne (h1 n.le_succ) (h2 n (Nat.succ_le_succ_iff.mp h))))
        n
  · obtain ⟨n, hn1, hn2⟩ := key
    replace key : ∀ k : ℕ, f (n + k) = f (n + k + 1) ∧ f (n + k) = f n := fun k =>
      Nat.rec ⟨hn2, rfl⟩ (fun k ih => ⟨h3 _ ih.1, ih.1.symm.trans ih.2⟩) k
    

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h2 : ∀ (n : ℕ), f n ≤ B
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
n : ℕ
hn1 : n ≤ B
hn2 : f n = f (n + 1)
key : ∀ (k : ℕ), f (n + k) = f (n + k + 1) ∧ f (n + k) = f n
⊢ ∀ (k : ℕ), B ≤ k → f k = f B

Next tactic:
replace key : ∀ k : ℕ, n ≤ k → f k = f n := fun k hk =>
      (congr_arg f (add_tsub_cancel_of_le hk)).symm.trans (key (k - n)).2
@[to_additive]
theorem card_pow_eq_card_pow_card_univ_aux {f : ℕ → ℕ} (h1 : Monotone f) {B : ℕ} (h2 : ∀ n, f n ≤ B)
    (h3 : ∀ n, f n = f (n + 1) → f (n + 1) = f (n + 2)) : ∀ k, B ≤ k → f k = f B := by
  have key : ∃ n : ℕ, n ≤ B ∧ f n = f (n + 1) := by
    contrapose! h2
    suffices ∀ n : ℕ, n ≤ B + 1 → n ≤ f n by exact ⟨B + 1, this (B + 1) (le_refl (B + 1))⟩
    exact fun n =>
      Nat.rec (fun _ => Nat.zero_le (f 0))
        (fun n ih h =>
          lt_of_le_of_lt (ih (n.le_succ.trans h))
            (lt_of_le_of_ne (h1 n.le_succ) (h2 n (Nat.succ_le_succ_iff.mp h))))
        n
  · obtain ⟨n, hn1, hn2⟩ := key
    replace key : ∀ k : ℕ, f (n + k) = f (n + k + 1) ∧ f (n + k) = f n := fun k =>
      Nat.rec ⟨hn2, rfl⟩ (fun k ih => ⟨h3 _ ih.1, ih.1.symm.trans ih.2⟩) k
    replace key : ∀ k : ℕ, n ≤ k → f k = f n := fun k hk =>
      (congr_arg f (add_tsub_cancel_of_le hk)).symm.trans (key (k - n)).2
    

Proof state:
case intro.intro
F : Type u_1
α : Type u_2
β : Type u_3
γ : Type u_4
f : ℕ → ℕ
h1 : Monotone f
B : ℕ
h2 : ∀ (n : ℕ), f n ≤ B
h3 : ∀ (n : ℕ), f n = f (n + 1) → f (n + 1) = f (n + 2)
n : ℕ
hn1 : n ≤ B
hn2 : f n = f (n + 1)
key : ∀ (k : ℕ), n ≤ k → f k = f n
⊢ ∀ (k : ℕ), B ≤ k → f k = f B

Next tactic:
exact fun k hk => (key k (hn1.trans hk)).trans (key B hn1).symm
@[aesop safe 20 apply (rule_sets [Measurable])]
theorem AEMeasurable.inner {m : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {μ : MeasureTheory.Measure α} {f g : α → E}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : AEMeasurable (fun x => ⟪f x, g x⟫) μ := by
  

Proof state:
α : Type u_1
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
m : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace E
inst✝ : SecondCountableTopology E
μ : MeasureTheory.Measure α
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
⊢ AEMeasurable fun x => Inner.inner (f x) (g x)

Next tactic:
refine' ⟨fun x => ⟪hf.mk f x, hg.mk g x⟫, hf.measurable_mk.inner hg.measurable_mk, _⟩
@[aesop safe 20 apply (rule_sets [Measurable])]
theorem AEMeasurable.inner {m : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {μ : MeasureTheory.Measure α} {f g : α → E}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : AEMeasurable (fun x => ⟪f x, g x⟫) μ := by
  refine' ⟨fun x => ⟪hf.mk f x, hg.mk g x⟫, hf.measurable_mk.inner hg.measurable_mk, _⟩
  

Proof state:
α : Type u_1
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
m : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace E
inst✝ : SecondCountableTopology E
μ : MeasureTheory.Measure α
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
⊢ (fun x => Inner.inner (f x) (g x)) =ᶠ[MeasureTheory.Measure.ae μ] fun x => Inner.inner (mk f hf x) (mk g hg x)

Next tactic:
refine' hf.ae_eq_mk.mp (hg.ae_eq_mk.mono fun x hxg hxf => _)
@[aesop safe 20 apply (rule_sets [Measurable])]
theorem AEMeasurable.inner {m : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {μ : MeasureTheory.Measure α} {f g : α → E}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : AEMeasurable (fun x => ⟪f x, g x⟫) μ := by
  refine' ⟨fun x => ⟪hf.mk f x, hg.mk g x⟫, hf.measurable_mk.inner hg.measurable_mk, _⟩
  refine' hf.ae_eq_mk.mp (hg.ae_eq_mk.mono fun x hxg hxf => _)
  

Proof state:
α : Type u_1
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
m : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace E
inst✝ : SecondCountableTopology E
μ : MeasureTheory.Measure α
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
x : α
hxg : g x = mk g hg x
hxf : f x = mk f hf x
⊢ (fun x => Inner.inner (f x) (g x)) x = (fun x => Inner.inner (mk f hf x) (mk g hg x)) x

Next tactic:
dsimp only
@[aesop safe 20 apply (rule_sets [Measurable])]
theorem AEMeasurable.inner {m : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {μ : MeasureTheory.Measure α} {f g : α → E}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : AEMeasurable (fun x => ⟪f x, g x⟫) μ := by
  refine' ⟨fun x => ⟪hf.mk f x, hg.mk g x⟫, hf.measurable_mk.inner hg.measurable_mk, _⟩
  refine' hf.ae_eq_mk.mp (hg.ae_eq_mk.mono fun x hxg hxf => _)
  dsimp only
  

Proof state:
α : Type u_1
𝕜 : Type u_2
E : Type u_3
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : NormedAddCommGroup E
inst✝³ : InnerProductSpace 𝕜 E
m : MeasurableSpace α
inst✝² : MeasurableSpace E
inst✝¹ : OpensMeasurableSpace E
inst✝ : SecondCountableTopology E
μ : MeasureTheory.Measure α
f g : α → E
hf : AEMeasurable f
hg : AEMeasurable g
x : α
hxg : g x = mk g hg x
hxf : f x = mk f hf x
⊢ Inner.inner (f x) (g x) = Inner.inner (mk f hf x) (mk g hg x)

Next tactic:
congr
/-- Bounding the norm of the iterated derivative of `B (f x) (g x)` within a set in terms of the
iterated derivatives of `f` and `g` when `B` is bilinear. This lemma is an auxiliary version
assuming all spaces live in the same universe, to enable an induction. Use instead
`ContinuousLinearMap.norm_iteratedFDerivWithin_le_of_bilinear` that removes this assumption. -/
theorem ContinuousLinearMap.norm_iteratedFDerivWithin_le_of_bilinear_aux {Du Eu Fu Gu : Type u}
    [NormedAddCommGroup Du] [NormedSpace 𝕜 Du] [NormedAddCommGroup Eu] [NormedSpace 𝕜 Eu]
    [NormedAddCommGroup Fu] [NormedSpace 𝕜 Fu] [NormedAddCommGroup Gu] [NormedSpace 𝕜 Gu]
    (B : Eu →L[𝕜] Fu →L[𝕜] Gu) {f : Du → Eu} {g : Du → Fu} {n : ℕ} {s : Set Du} {x : Du}
    (hf : ContDiffOn 𝕜 n f s) (hg : ContDiffOn 𝕜 n g s) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    ‖iteratedFDerivWithin 𝕜 n (fun y => B (f y) (g y)) s x‖ ≤
      ‖B‖ * ∑ i in Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDerivWithin 𝕜 i f s x‖ *
        ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖ := by
  /- We argue by induction on `n`. The bound is trivial for `n = 0`. For `n + 1`, we write
    the `(n+1)`-th derivative as the `n`-th derivative of the derivative `B f g' + B f' g`,
    and apply the inductive assumption to each of those two terms. For this induction to make sense,
    the spaces of linear maps that appear in the induction should be in the same universe as the
    original spaces, which explains why we assume in the lemma that all spaces live in the same
    universe. -/
  

Proof state:
𝕜 : Type u_1
inst✝¹⁶ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹⁵ : NormedAddCommGroup D
inst✝¹⁴ : NormedSpace 𝕜 D
E : Type uE
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
F : Type uF
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
G : Type uG
inst✝⁹ : NormedAddCommGroup G
inst✝⁸ : NormedSpace 𝕜 G
s✝ s₁ t u : Set E
Du Eu Fu Gu : Type u
inst✝⁷ : NormedAddCommGroup Du
inst✝⁶ : NormedSpace 𝕜 Du
inst✝⁵ : NormedAddCommGroup Eu
inst✝⁴ : NormedSpace 𝕜 Eu
inst✝³ : NormedAddCommGroup Fu
inst✝² : NormedSpace 𝕜 Fu
inst✝¹ : NormedAddCommGroup Gu
inst✝ : NormedSpace 𝕜 Gu
B : Eu →L[𝕜] Fu →L[𝕜] Gu
f : Du → Eu
g : Du → Fu
n : ℕ
s : Set Du
x : Du
hf : ContDiffOn 𝕜 (↑n) f s
hg : ContDiffOn 𝕜 (↑n) g s
hs : UniqueDiffOn 𝕜 s
hx : x ∈ s
⊢ ‖iteratedFDerivWithin 𝕜 n (fun y => (B (f y)) (g y)) s x‖ ≤
    ‖B‖ *
      ∑ i in Finset.range (n + 1),
        ↑(Nat.choose n i) * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖

Next tactic:
induction' n with n IH generalizing Eu Fu Gu
/-- Bounding the norm of the iterated derivative of `B (f x) (g x)` within a set in terms of the
iterated derivatives of `f` and `g` when `B` is bilinear. This lemma is an auxiliary version
assuming all spaces live in the same universe, to enable an induction. Use instead
`ContinuousLinearMap.norm_iteratedFDerivWithin_le_of_bilinear` that removes this assumption. -/
theorem ContinuousLinearMap.norm_iteratedFDerivWithin_le_of_bilinear_aux {Du Eu Fu Gu : Type u}
    [NormedAddCommGroup Du] [NormedSpace 𝕜 Du] [NormedAddCommGroup Eu] [NormedSpace 𝕜 Eu]
    [NormedAddCommGroup Fu] [NormedSpace 𝕜 Fu] [NormedAddCommGroup Gu] [NormedSpace 𝕜 Gu]
    (B : Eu →L[𝕜] Fu →L[𝕜] Gu) {f : Du → Eu} {g : Du → Fu} {n : ℕ} {s : Set Du} {x : Du}
    (hf : ContDiffOn 𝕜 n f s) (hg : ContDiffOn 𝕜 n g s) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    ‖iteratedFDerivWithin 𝕜 n (fun y => B (f y) (g y)) s x‖ ≤
      ‖B‖ * ∑ i in Finset.range (n + 1), (n.choose i : ℝ) * ‖iteratedFDerivWithin 𝕜 i f s x‖ *
        ‖iteratedFDerivWithin 𝕜 (n - i) g s x‖ := by
  /- We argue by induction on `n`. The bound is trivial for `n = 0`. For `n + 1`, we write
    the `(n+1)`-th derivative as the `n`-th derivative of the derivative `B f g' + B f' g`,
    and apply the inductive assumption to each of those two terms. For this induction to make sense,
    the spaces of linear maps that appear in the induction should be in the same universe as the
    original spaces, which explains why we assume in the lemma that all spaces live in the same
    universe. -/
  induction' n with n IH generalizing Eu Fu Gu
  · 

Proof state:
case zero
𝕜 : Type u_1
inst✝¹⁶ : NontriviallyNormedField 𝕜
D : Type uD
inst✝¹⁵ : NormedAddCommGroup D
inst✝¹⁴ : NormedSpace 𝕜 D
E : Type uE
inst✝¹³ : NormedAddCommGroup E
inst✝¹² : NormedSpace 𝕜 E
F : Type uF
inst✝¹¹ : NormedAddCommGroup F
inst✝¹⁰ : NormedSpace 𝕜 F
G : Type uG
inst✝⁹ : NormedAddCommGroup G
inst✝⁸ : NormedSpace 𝕜 G
s✝ s₁ t u : Set E
Du : Type u
inst✝⁷ : NormedAddCommGroup Du
inst✝⁶ : NormedSpace 𝕜 Du
s : Set Du
x : Du
hs : UniqueDiffOn 𝕜 s
hx : x ∈ s
Eu Fu Gu : Type u
inst✝⁵ : NormedAddCommGroup Eu
inst✝⁴ : NormedSpace 𝕜 Eu
inst✝³ : NormedAddCommGroup Fu
inst✝² : NormedSpace 𝕜 Fu
inst✝¹ : NormedAddCommGroup Gu
inst✝ : NormedSpace 𝕜 Gu
B : Eu →L[𝕜] Fu →L[𝕜] Gu
f : Du → Eu
g : Du → Fu
hf : ContDiffOn 𝕜 (↑Nat.zero) f s
hg : ContDiffOn 𝕜 (↑Nat.zero) g s
⊢ ‖iteratedFDerivWithin 𝕜 Nat.zero (fun y => (B (f y)) (g y)) s x‖ ≤
    ‖B‖ *
      ∑ i in Finset.range (Nat.zero + 1),
        ↑(Nat.choose Nat.zero i) * ‖iteratedFDerivWithin 𝕜 i f s x‖ * ‖iteratedFDerivWithin 𝕜 (Nat.zero - i) g s x‖

Next tactic:
simp only [Nat.zero_eq, norm_iteratedFDerivWithin_zero, zero_add, Finset.range_one,
      Finset.sum_singleton, Nat.choose_self, Nat.cast_one, one_mul, Nat.sub_zero, ← mul_assoc]