Skip to content

Commit

Permalink
chore: tidy various files (#12042)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben-VandeVelde committed Apr 11, 2024
1 parent 1e53d4f commit 8856dfd
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 120 deletions.
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Algebra/Quasispectrum.lean
Expand Up @@ -210,8 +210,8 @@ lemma IsQuasiregular.isUnit_one_add {R : Type*} [Semiring R] {x : R} (hx : IsQua
IsUnit (1 + x) := by
obtain ⟨y, hy₁, hy₂⟩ := isQuasiregular_iff.mp hx
refine ⟨⟨1 + x, 1 + y, ?_, ?_⟩, rfl⟩
· convert congr(1 + $(hy₁)) using 1 <;> first | noncomm_ring | simp
· convert congr(1 + $(hy₂)) using 1 <;> first | noncomm_ring | simp
· convert congr(1 + $(hy₁)) using 1 <;> [noncomm_ring; simp]
· convert congr(1 + $(hy₂)) using 1 <;> [noncomm_ring; simp]

lemma isQuasiregular_iff_isUnit {R : Type*} [Ring R] {x : R} :
IsQuasiregular x ↔ IsUnit (1 + x) := by
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Algebra/Associated.lean
Expand Up @@ -538,7 +538,7 @@ theorem Associated.mul_mul [CommMonoid α] {a₁ a₂ b₁ b₂ : α}

theorem Associated.pow_pow [CommMonoid α] {a b : α} {n : ℕ} (h : a ~ᵤ b) : a ^ n ~ᵤ b ^ n := by
induction' n with n ih
· simp only [Nat.zero_eq, pow_zero]; rfl
· simp [Associated.refl]
convert h.mul_mul ih <;> rw [pow_succ']
#align associated.pow_pow Associated.pow_pow

Expand Down Expand Up @@ -1001,7 +1001,7 @@ theorem dvd_of_mk_le_mk {a b : α} : Associates.mk a ≤ Associates.mk b → a
#align associates.dvd_of_mk_le_mk Associates.dvd_of_mk_le_mk

theorem mk_le_mk_of_dvd {a b : α} : a ∣ b → Associates.mk a ≤ Associates.mk b := fun ⟨c, hc⟩ =>
⟨Associates.mk c, by simp only [hc]; rfl
⟨Associates.mk c, by simp only [hc, mk_mul_mk]
#align associates.mk_le_mk_of_dvd Associates.mk_le_mk_of_dvd

theorem mk_le_mk_iff_dvd_iff {a b : α} : Associates.mk a ≤ Associates.mk b ↔ a ∣ b :=
Expand Down
5 changes: 3 additions & 2 deletions Mathlib/Algebra/BigOperators/List/Basic.lean
Expand Up @@ -357,9 +357,10 @@ lemma prod_range_succ' (f : ℕ → M) (n : ℕ) :
@[to_additive]
lemma prod_erase_of_comm [DecidableEq M] (ha : a ∈ l) (comm : ∀ x ∈ l, ∀ y ∈ l, x * y = y * x) :
a * (l.erase a).prod = l.prod := by
induction' l with b l ih; simp only [not_mem_nil] at ha
induction' l with b l ih
· simp only [not_mem_nil] at ha
obtain rfl | ⟨ne, h⟩ := Decidable.List.eq_or_ne_mem_of_mem ha
simp only [erase_cons_head, prod_cons]
· simp only [erase_cons_head, prod_cons]
rw [List.erase, beq_false_of_ne ne.symm, List.prod_cons, List.prod_cons, ← mul_assoc,
comm a ha b (l.mem_cons_self b), mul_assoc,
ih h fun x hx y hy ↦ comm _ (List.mem_cons_of_mem b hx) _ (List.mem_cons_of_mem b hy)]
Expand Down
51 changes: 24 additions & 27 deletions Mathlib/Analysis/SpecialFunctions/Stirling.lean
Expand Up @@ -74,15 +74,14 @@ theorem log_stirlingSeq_formula (n : ℕ) :
`∑ 1 / (2 * (k + 1) + 1) * (1 / 2 * (m + 1) + 1)^(2 * (k + 1))`
-/
theorem log_stirlingSeq_diff_hasSum (m : ℕ) :
HasSum (fun k : ℕ => 1 / (2 * ↑(k + 1) + 1) * (((1:ℝ)/(↑2 * ↑(m + 1) + 1)) ^ 2) ^ ↑(k + 1))
HasSum (fun k : ℕ => (1 : ℝ) / (2 * ↑(k + 1) + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ ↑(k + 1))
(log (stirlingSeq (m + 1)) - log (stirlingSeq (m + 2))) := by
change HasSum
((fun b : ℕ => (1:ℝ) / ((2:ℝ) * b + (1:ℝ)) * (((1:ℝ) / (2 * (m + 1 :) + 1)) ^ 2) ^ b) ∘ succ) _
refine' (hasSum_nat_add_iff (g := _ - _) -- Porting note: must give implicit arguments
(f := (fun b : ℕ => ↑1 / (↑2 * b + ↑1) * (((1:ℝ) / (2 * ↑(m + 1) + 1)) ^ 2) ^ b)) 1).mpr _
convert (hasSum_log_one_add_inv <|
cast_pos.mpr (succ_pos m)).mul_left ((↑(m + 1) : ℝ) + 1 / 2) using 1
let f (k : ℕ) := (1 : ℝ) / (2 * k + 1) * ((1 / (2 * ↑(m + 1) + 1)) ^ 2) ^ k
change HasSum (fun k => f (k + 1)) _
rw [hasSum_nat_add_iff]
convert (hasSum_log_one_add_inv m.cast_add_one_pos).mul_left ((↑(m + 1) : ℝ) + 1 / 2) using 1
· ext k
dsimp only [f]
rw [← pow_mul, pow_add]
push_cast
field_simp
Expand All @@ -103,18 +102,18 @@ theorem log_stirlingSeq'_antitone : Antitone (Real.log ∘ stirlingSeq ∘ succ)
-/
theorem log_stirlingSeq_diff_le_geo_sum (n : ℕ) :
log (stirlingSeq (n + 1)) - log (stirlingSeq (n + 2)) ≤
((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) := by
have h_nonneg : (0 : ℝ) ≤ ((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 := sq_nonneg _
have g : HasSum (fun k : ℕ => (((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1))
(((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2)) := by
have := (hasSum_geometric_of_lt_one h_nonneg ?_).mul_left (((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2)
((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) := by
have h_nonneg : (0 : ℝ) ≤ ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 := sq_nonneg _
have g : HasSum (fun k : ℕ => (((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1))
(((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2)) := by
have := (hasSum_geometric_of_lt_one h_nonneg ?_).mul_left (((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2)
· simp_rw [← _root_.pow_succ'] at this
exact this
rw [one_div, inv_pow]
exact inv_lt_one (one_lt_pow ((lt_add_iff_pos_left 1).mpr <| by positivity) two_ne_zero)
have hab : ∀ k : ℕ, (1:ℝ) / (2 * ↑(k + 1) + 1) * (((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1) ≤
(((1:ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1) := by
refine' fun k => mul_le_of_le_one_left (pow_nonneg h_nonneg ↑(k + 1)) _
have hab (k : ℕ) : (1 : ℝ) / (2 * ↑(k + 1) + 1) * ((1 / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1) ≤
(((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2) ^ ↑(k + 1) := by
refine' mul_le_of_le_one_left (pow_nonneg h_nonneg ↑(k + 1)) _
rw [one_div]
exact inv_le_one (le_add_of_nonneg_left <| by positivity)
exact hasSum_le hab (log_stirlingSeq_diff_hasSum n) g
Expand All @@ -128,11 +127,11 @@ set_option maxHeartbeats 400000 in
-/
theorem log_stirlingSeq_sub_log_stirlingSeq_succ (n : ℕ) :
log (stirlingSeq (n + 1)) - log (stirlingSeq (n + 2)) ≤ 1 / (4 * (↑(n + 1):ℝ) ^ 2) := by
have h₁ : (0 : ℝ) < 4 * ((n:ℝ) + 1) ^ 2 := by positivity
have h₃ : (0 : ℝ) < (2 * ((n:ℝ) + 1) + 1) ^ 2 := by positivity
have h₂ : (0 : ℝ) < 1 - (1 / (2 * ((n:ℝ) + 1) + 1)) ^ 2 := by
have h₁ : (0 : ℝ) < 4 * ((n : ℝ) + 1) ^ 2 := by positivity
have h₃ : (0 : ℝ) < (2 * ((n : ℝ) + 1) + 1) ^ 2 := by positivity
have h₂ : (0 : ℝ) < 1 - (1 / (2 * ((n : ℝ) + 1) + 1)) ^ 2 := by
rw [← mul_lt_mul_right h₃]
have H : 0 < (2 * ((n:ℝ) + 1) + 1) ^ 2 - 1 := by nlinarith [@cast_nonneg ℝ _ n]
have H : 0 < (2 * ((n : ℝ) + 1) + 1) ^ 2 - 1 := by nlinarith [@cast_nonneg ℝ _ n]
convert H using 1 <;> field_simp [h₃.ne']
refine' (log_stirlingSeq_diff_le_geo_sum n).trans _
push_cast
Expand All @@ -151,20 +150,18 @@ theorem log_stirlingSeq_bounded_aux :
use 1 / 4 * d
let log_stirlingSeq' : ℕ → ℝ := fun k => log (stirlingSeq (k + 1))
intro n
have h₁ : ∀ k, log_stirlingSeq' k - log_stirlingSeq' (k + 1) ≤
1 / ↑4 * (↑1 / (↑(k + 1):ℝ) ^ 2) := by
intro k; convert log_stirlingSeq_sub_log_stirlingSeq_succ k using 1; field_simp
have h₂ : (∑ k : ℕ in range n, ↑1 / (↑(k + 1):ℝ) ^ 2) ≤ d := by
have h₁ k : log_stirlingSeq' k - log_stirlingSeq' (k + 1) ≤ 1 / 4 * (1 / (↑(k + 1) : ℝ) ^ 2) := by
convert log_stirlingSeq_sub_log_stirlingSeq_succ k using 1; field_simp
have h₂ : (∑ k : ℕ in range n, 1 / (↑(k + 1) : ℝ) ^ 2) ≤ d := by
have := (summable_nat_add_iff 1).mpr <| Real.summable_one_div_nat_pow.mpr one_lt_two
simp only [rpow_nat_cast] at this
exact sum_le_tsum (range n) (fun k _ => by positivity) this
calc
log (stirlingSeq 1) - log (stirlingSeq (n + 1)) = log_stirlingSeq' 0 - log_stirlingSeq' n :=
rfl
_ = ∑ k in range n, (log_stirlingSeq' k - log_stirlingSeq' (k + 1)) := by
rw [← sum_range_sub' log_stirlingSeq' n]
_ ≤ ∑ k in range n, 1 / 4 * (1 / ↑((k + 1)) ^ 2) := (sum_le_sum fun k _ => h₁ k)
_ = 1 / 4 * ∑ k in range n, 1 / ↑((k + 1)) ^ 2 := by rw [mul_sum]
_ ≤ ∑ k in range n, 1 / 4 * (1 / ↑((k + 1)) ^ 2) := (sum_le_sum fun k _ => h₁ k)
_ = 1 / 4 * ∑ k in range n, 1 / ↑((k + 1)) ^ 2 := by rw [mul_sum]
_ ≤ 1 / 4 * d := by gcongr
#align stirling.log_stirling_seq_bounded_aux Stirling.log_stirlingSeq_bounded_aux

Expand Down Expand Up @@ -241,7 +238,7 @@ theorem second_wallis_limit (a : ℝ) (hane : a ≠ 0) (ha : Tendsto stirlingSeq
Tendsto Wallis.W atTop (𝓝 (a ^ 2 / 2)) := by
refine' Tendsto.congr' (eventually_atTop.mpr ⟨1, fun n hn =>
stirlingSeq_pow_four_div_stirlingSeq_pow_two_eq n (one_le_iff_ne_zero.mp hn)⟩) _
have h : a ^ 2 / 2 = a ^ 4 / a ^ 2 * (1 / 2) := by
have h : a ^ 2 / 2 = a ^ 4 / a ^ 2 * (1 / 2) := by
rw [mul_one_div, ← mul_one_div (a ^ 4) (a ^ 2), one_div, ← pow_sub_of_lt a]
norm_num
rw [h]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Combinatorics/SimpleGraph/Girth.lean
Expand Up @@ -29,7 +29,7 @@ noncomputable def girth (G : SimpleGraph α) : ℕ∞ :=
protected alias ⟨_, IsAcyclic.girth_eq_top⟩ := girth_eq_top

lemma girth_anti : Antitone (girth : SimpleGraph α → ℕ∞) :=
fun G H h ↦ iInf_mono fun a ↦ iInf₂_mono' fun w hw ↦ ⟨w.mapLe h, hw.mapLe _, by simp⟩
fun G H h ↦ iInf_mono fun a ↦ iInf₂_mono' fun w hw ↦ ⟨w.mapLe h, hw.mapLe _, by simp⟩

lemma exists_girth_eq_length :
(∃ (a : α) (w : G.Walk a a), w.IsCycle ∧ G.girth = w.length) ↔ ¬ G.IsAcyclic := by
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Data/Fin/Basic.lean
Expand Up @@ -1088,7 +1088,7 @@ theorem coe_eq_castSucc {a : Fin n} : (a : Fin (n + 1)) = castSucc a := by
#align fin.coe_eq_cast_succ Fin.coe_eq_castSucc

theorem coe_succ_lt_iff_lt {n : ℕ} {j k : Fin n} : (j : Fin <| n + 1) < k ↔ j < k := by
simp only [coe_eq_castSucc]; rfl
simp only [coe_eq_castSucc, castSucc_lt_castSucc_iff]

#align fin.coe_succ_eq_succ Fin.coeSucc_eq_succ

Expand Down
10 changes: 5 additions & 5 deletions Mathlib/Data/Int/Bitwise.lean
Expand Up @@ -513,18 +513,18 @@ theorem shiftLeft_add : ∀ (m : ℤ) (n : ℕ) (k : ℤ), m <<< (n + k) = (m <<
by dsimp; simp [← Nat.shiftLeft_sub _ , Nat.add_sub_cancel_left])
fun i n => by
dsimp
simp only [Nat.shiftLeft'_false, Nat.shiftRight_add, le_refl, ← Nat.shiftLeft_sub,
Nat.sub_eq_zero_of_le, Nat.shiftLeft_zero]
rfl
simp_rw [negSucc_eq, shiftLeft_neg, Nat.shiftLeft'_false, Nat.shiftRight_add,
Nat.shiftLeft_sub _ le_rfl, Nat.sub_self, Nat.shiftLeft_zero, ← shiftRight_coe_nat,
← shiftRight_add, Nat.cast_one]
| -[m+1], n, -[k+1] =>
subNatNat_elim n k.succ
(fun n k i => -[m+1] <<< i = -[(Nat.shiftLeft' true m n) >>> k+1])
(fun i n =>
congr_arg negSucc <| by
rw [← Nat.shiftLeft'_sub, Nat.add_sub_cancel_left]; apply Nat.le_add_right)
fun i n =>
congr_arg negSucc <| by rw [add_assoc, Nat.shiftRight_add, ← Nat.shiftLeft'_sub, Nat.sub_self]
<;> rfl
congr_arg negSucc <| by rw [add_assoc, Nat.shiftRight_add, ← Nat.shiftLeft'_sub _ _ le_rfl,
Nat.sub_self, Nat.shiftLeft']
#align int.shiftl_add Int.shiftLeft_add

theorem shiftLeft_sub (m : ℤ) (n : ℕ) (k : ℤ) : m <<< (n - k) = (m <<< (n : ℤ)) >>> k :=
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Data/Int/CardIntervalMod.lean
Expand Up @@ -12,8 +12,8 @@ import Mathlib.Data.Rat.Floor
/-!
# Counting elements in an interval with given residue
The theorems in this file generalise `Nat.card_multiples` in `Data.Nat.Factorization.Basic` to
all integer intervals and any fixed residue (not just zero, which reduces to the multiples).
The theorems in this file generalise `Nat.card_multiples` in `Mathlib.Data.Nat.Factorization.Basic`
to all integer intervals and any fixed residue (not just zero, which reduces to the multiples).
Theorems are given for `Ico` and `Ioc` intervals.
-/

Expand Down Expand Up @@ -79,15 +79,15 @@ namespace Nat
variable (a b : ℕ) {r : ℕ} (hr : 0 < r)

lemma Ico_filter_modEq_cast {v : ℕ} : ((Ico a b).filter (· ≡ v [MOD r])).map castEmbedding =
(Ico ↑a ↑b).filter (· ≡ v [ZMOD r]) := by
(Ico (a : ℤ) (b : ℤ)).filter (· ≡ v [ZMOD r]) := by
ext x
simp only [mem_map, mem_filter, mem_Ico, castEmbedding_apply]
constructor
· simp_rw [forall_exists_index, ← natCast_modEq_iff]; intro y ⟨h, c⟩; subst c; exact_mod_cast h
· intro h; lift x to ℕ using (by linarith); exact ⟨x, by simp_all [natCast_modEq_iff]⟩

lemma Ioc_filter_modEq_cast {v : ℕ} : ((Ioc a b).filter (· ≡ v [MOD r])).map castEmbedding =
(Ioc ↑a ↑b).filter (· ≡ v [ZMOD r]) := by
(Ioc (a : ℤ) (b : ℤ)).filter (· ≡ v [ZMOD r]) := by
ext x
simp only [mem_map, mem_filter, mem_Ioc, castEmbedding_apply]
constructor
Expand Down
5 changes: 2 additions & 3 deletions Mathlib/Data/Int/Cast/Prod.lean
Expand Up @@ -19,9 +19,8 @@ variable {α β : Type*} [AddGroupWithOne α] [AddGroupWithOne β]
instance : AddGroupWithOne (α × β) :=
{ Prod.instAddMonoidWithOne, Prod.instAddGroup with
intCast := fun n => (n, n)
intCast_ofNat := fun _ => by simp only [Int.cast_natCast]; rfl
intCast_negSucc := fun _ => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one,
neg_add_rev]; rfl }
intCast_ofNat := fun _ => by ext <;> simp
intCast_negSucc := fun _ => by ext <;> simp }

@[simp]
theorem fst_intCast (n : ℤ) : (n : α × β).fst = n :=
Expand Down
6 changes: 2 additions & 4 deletions Mathlib/Data/List/Permutation.lean
Expand Up @@ -133,8 +133,7 @@ theorem map_map_permutations'Aux (f : α → β) (t : α) (ts : List α) :
map (map f) (permutations'Aux t ts) = permutations'Aux (f t) (map f ts) := by
induction' ts with a ts ih
· rfl
· simp only [permutations'Aux, map_cons, map_map, ← ih, cons.injEq, true_and]
rfl
· simp only [permutations'Aux, map_cons, map_map, ← ih, cons.injEq, true_and, Function.comp_def]
#align list.map_map_permutations'_aux List.map_map_permutations'Aux

theorem permutations'Aux_eq_permutationsAux2 (t : α) (ts : List α) :
Expand Down Expand Up @@ -180,8 +179,7 @@ theorem foldr_permutationsAux2 (t : α) (ts : List α) (r L : List (List α)) :
(L.bind fun y => (permutationsAux2 t ts [] y id).2) ++ r := by
induction' L with l L ih
· rfl
· simp only [foldr_cons, ih, cons_bind, append_assoc]
rw [← permutationsAux2_append]
· simp_rw [foldr_cons, ih, cons_bind, append_assoc, permutationsAux2_append]
#align list.foldr_permutations_aux2 List.foldr_permutationsAux2

theorem mem_foldr_permutationsAux2 {t : α} {ts : List α} {r L : List (List α)} {l' : List α} :
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Data/List/Sublists.lean
Expand Up @@ -443,8 +443,8 @@ theorem revzip_sublists (l : List α) : ∀ l₁ l₂, (l₁, l₂) ∈ revzip l
mem_singleton, Prod.mk.injEq] at h
simp [h]
· intro l₁ l₂ h
rw [sublists_concat, reverse_append, zip_append, ← map_reverse, zip_map_right,
zip_map_left] at * <;> [skip; simp]
rw [sublists_concat, reverse_append, zip_append (by simp), ← map_reverse, zip_map_right,
zip_map_left] at *
simp only [Prod.mk.inj_iff, mem_map, mem_append, Prod.map_mk, Prod.exists] at h
rcases h with (⟨l₁, l₂', h, rfl, rfl⟩ | ⟨l₁', l₂, h, rfl, rfl⟩)
· rw [← append_assoc]
Expand Down
6 changes: 1 addition & 5 deletions Mathlib/Data/Seq/Parallel.lean
Expand Up @@ -131,11 +131,7 @@ theorem terminates_parallel {S : WSeq (Computation α)} {c} (h : c ∈ S) [T : T
intro n; induction' n with n IH <;> intro l S c o T
· cases' o with a a
· exact terminates_parallel.aux a T
have H : Seq.destruct S = some (some c, _) := by
dsimp [Seq.destruct, (· <$> ·)]
rw [← a]
simp only [Option.map_some', Option.some.injEq]
rfl
have H : Seq.destruct S = some (some c, Seq.tail S) := by simp [Seq.destruct, (· <$> ·), ← a]
induction' h : parallel.aux2 l with a l'
· have C : corec parallel.aux1 (l, S) = pure a := by
apply destruct_eq_pure
Expand Down
2 changes: 0 additions & 2 deletions Mathlib/Data/Seq/WSeq.lean
Expand Up @@ -1158,7 +1158,6 @@ theorem liftRel_flatten {R : α → β → Prop} {c1 : Computation (WSeq α)} {c
⟨S, ⟨c1, c2, rfl, rfl, h⟩, fun {s t} h =>
match s, t, h with
| _, _, ⟨c1, c2, rfl, rfl, h⟩ => by
-- Porting note: `exists_and_left` should be excluded.
simp only [destruct_flatten]; apply liftRel_bind _ _ h
intro a b ab; apply Computation.LiftRel.imp _ _ _ (liftRel_destruct ab)
intro a b; apply LiftRelO.imp_right
Expand All @@ -1176,7 +1175,6 @@ theorem tail_congr {s t : WSeq α} (h : s ~ʷ t) : tail s ~ʷ tail t := by
apply flatten_congr
dsimp only [(· <$> ·)]; rw [← Computation.bind_pure, ← Computation.bind_pure]
apply liftRel_bind _ _ (destruct_congr h)
-- Porting note: These 2 theorems should be excluded.
intro a b h; simp only [comp_apply, liftRel_pure]
cases' a with a <;> cases' b with b
· trivial
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/FieldTheory/SeparableDegree.lean
Expand Up @@ -342,8 +342,8 @@ theorem natSepDegree_eq_of_isAlgClosed [IsAlgClosed E] :

variable (E) in
theorem natSepDegree_map : (f.map (algebraMap F E)).natSepDegree = f.natSepDegree := by
simp_rw [natSepDegree_eq_of_isAlgClosed (AlgebraicClosure E), aroots_def, map_map]
rfl
simp_rw [natSepDegree_eq_of_isAlgClosed (AlgebraicClosure E), aroots_def, map_map,
← IsScalarTower.algebraMap_eq]

@[simp]
theorem natSepDegree_C_mul {x : F} (hx : x ≠ 0) :
Expand Down
5 changes: 2 additions & 3 deletions Mathlib/MeasureTheory/Decomposition/RadonNikodym.lean
Expand Up @@ -437,9 +437,8 @@ lemma set_lintegral_rnDeriv_mul [HaveLebesgueDecomposition μ ν] (hμν : μ
(hf : AEMeasurable f ν) {s : Set α} (hs : MeasurableSet s) :
∫⁻ x in s, μ.rnDeriv ν x * f x ∂ν = ∫⁻ x in s, f x ∂μ := by
nth_rw 2 [← Measure.withDensity_rnDeriv_eq μ ν hμν]
rw [set_lintegral_withDensity_eq_lintegral_mul₀ (Measure.measurable_rnDeriv μ ν).aemeasurable hf
hs]
rfl
rw [set_lintegral_withDensity_eq_lintegral_mul₀ (measurable_rnDeriv μ ν).aemeasurable hf hs]
simp only [Pi.mul_apply]

variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]

Expand Down
6 changes: 2 additions & 4 deletions Mathlib/MeasureTheory/MeasurableSpace/Basic.lean
Expand Up @@ -186,13 +186,11 @@ theorem le_map_comap : m ≤ (m.comap g).map g :=
end Functors

@[simp] theorem map_const {m} (b : β) : MeasurableSpace.map (fun _a : α ↦ b) m = ⊤ :=
eq_top_iff.2 <| fun s _ ↦ by
by_cases b ∈ s <;> simp [*, map_def] <;> rw [Set.preimage_id'] <;> simp
eq_top_iff.2 <| fun s _ ↦ by rw [map_def]; by_cases h : b ∈ s <;> simp [h]
#align measurable_space.map_const MeasurableSpace.map_const

set_option tactic.skipAssignedInstances false in
@[simp] theorem comap_const {m} (b : β) : MeasurableSpace.comap (fun _a : α => b) m = ⊥ :=
eq_bot_iff.2 <| by rintro _ ⟨s, -, rfl⟩; by_cases b ∈ s <;> simp [*]; exact measurableSet_empty _
eq_bot_iff.2 <| by rintro _ ⟨s, -, rfl⟩; by_cases b ∈ s <;> simp [*]
#align measurable_space.comap_const MeasurableSpace.comap_const

theorem comap_generateFrom {f : α → β} {s : Set (Set β)} :
Expand Down

0 comments on commit 8856dfd

Please sign in to comment.