Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
num_lines
int64
1
150
complexity_score
float64
2.72
139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B
diff_level
int64
0
2
file_diff_level
float64
0
2
theorem_same_file
int64
1
32
rank_file
int64
0
2.51k
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds #align_import data.real.pi.bounds from "leanprover-community/mathlib"@"402f8982dddc1864bd703da2d6e2ee304a866973" -- Porting note: needed to add a lot of type ascriptions for lean to interpret numbers as reals. open scoped Real namespace Real theorem pi_gt_sqrtTwoAddSeries (n : β„•) : (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) < Ο€ := by have : √(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) * (2 : ℝ) ^ (n + 2) < Ο€ := by rw [← lt_div_iff, ← sin_pi_over_two_pow_succ] focus apply sin_lt apply div_pos pi_pos all_goals apply pow_pos; norm_num apply lt_of_le_of_lt (le_of_eq _) this rw [pow_succ' _ (n + 1), ← mul_assoc, div_mul_cancelβ‚€, mul_comm]; norm_num #align real.pi_gt_sqrt_two_add_series Real.pi_gt_sqrtTwoAddSeries theorem pi_lt_sqrtTwoAddSeries (n : β„•) : Ο€ < (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) + 1 / (4 : ℝ) ^ n := by have : Ο€ < (√(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) + (1 : ℝ) / ((2 : ℝ) ^ n) ^ 3 / 4) * (2 : ℝ) ^ (n + 2) := by rw [← div_lt_iff (by norm_num), ← sin_pi_over_two_pow_succ] refine lt_of_lt_of_le (lt_add_of_sub_right_lt (sin_gt_sub_cube ?_ ?_)) ?_ Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· rw [div_le_iff'] Β· refine le_trans pi_le_four ?_ simp only [show (4 : ℝ) = (2 : ℝ) ^ 2 by norm_num, mul_one] apply pow_le_pow_right (by norm_num) apply le_add_of_nonneg_left; apply Nat.zero_le Β· apply pow_pos; norm_num apply add_le_add_left; rw [div_le_div_right (by norm_num)] rw [le_div_iff (by norm_num), ← mul_pow] refine le_trans ?_ (le_of_eq (one_pow 3)); apply pow_le_pow_left Β· apply le_of_lt; apply mul_pos Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· apply pow_pos; norm_num Β· rw [← le_div_iff (by norm_num)] refine le_trans ((div_le_div_right ?_).mpr pi_le_four) ?_ Β· apply pow_pos; norm_num Β· simp only [pow_succ', ← div_div, one_div] -- Porting note: removed `convert le_rfl` norm_num apply lt_of_lt_of_le this (le_of_eq _); rw [add_mul]; congr 1 Β· ring simp only [show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul, div_div, ← pow_add] rw [one_div, one_div, inv_mul_eq_iff_eq_mulβ‚€, eq_comm, mul_inv_eq_iff_eq_mulβ‚€, ← pow_add] Β· rw [add_assoc, Nat.mul_succ, add_comm, add_comm n, add_assoc, mul_comm n] all_goals norm_num #align real.pi_lt_sqrt_two_add_series Real.pi_lt_sqrtTwoAddSeries
Mathlib/Data/Real/Pi/Bounds.lean
77
82
theorem pi_lower_bound_start (n : β„•) {a} (h : sqrtTwoAddSeries ((0 : β„•) / (1 : β„•)) n ≀ (2 : ℝ) - (a / (2 : ℝ) ^ (n + 1)) ^ 2) : a < Ο€ := by
refine lt_of_le_of_lt ?_ (pi_gt_sqrtTwoAddSeries n); rw [mul_comm] refine (div_le_iff (pow_pos (by norm_num) _ : (0 : ℝ) < _)).mp (le_sqrt_of_sq_le ?_) rwa [le_sub_comm, show (0 : ℝ) = (0 : β„•) / (1 : β„•) by rw [Nat.cast_zero, zero_div]]
3
20.085537
1
1.833333
6
1,911
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds #align_import data.real.pi.bounds from "leanprover-community/mathlib"@"402f8982dddc1864bd703da2d6e2ee304a866973" -- Porting note: needed to add a lot of type ascriptions for lean to interpret numbers as reals. open scoped Real namespace Real theorem pi_gt_sqrtTwoAddSeries (n : β„•) : (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) < Ο€ := by have : √(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) * (2 : ℝ) ^ (n + 2) < Ο€ := by rw [← lt_div_iff, ← sin_pi_over_two_pow_succ] focus apply sin_lt apply div_pos pi_pos all_goals apply pow_pos; norm_num apply lt_of_le_of_lt (le_of_eq _) this rw [pow_succ' _ (n + 1), ← mul_assoc, div_mul_cancelβ‚€, mul_comm]; norm_num #align real.pi_gt_sqrt_two_add_series Real.pi_gt_sqrtTwoAddSeries theorem pi_lt_sqrtTwoAddSeries (n : β„•) : Ο€ < (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) + 1 / (4 : ℝ) ^ n := by have : Ο€ < (√(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) + (1 : ℝ) / ((2 : ℝ) ^ n) ^ 3 / 4) * (2 : ℝ) ^ (n + 2) := by rw [← div_lt_iff (by norm_num), ← sin_pi_over_two_pow_succ] refine lt_of_lt_of_le (lt_add_of_sub_right_lt (sin_gt_sub_cube ?_ ?_)) ?_ Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· rw [div_le_iff'] Β· refine le_trans pi_le_four ?_ simp only [show (4 : ℝ) = (2 : ℝ) ^ 2 by norm_num, mul_one] apply pow_le_pow_right (by norm_num) apply le_add_of_nonneg_left; apply Nat.zero_le Β· apply pow_pos; norm_num apply add_le_add_left; rw [div_le_div_right (by norm_num)] rw [le_div_iff (by norm_num), ← mul_pow] refine le_trans ?_ (le_of_eq (one_pow 3)); apply pow_le_pow_left Β· apply le_of_lt; apply mul_pos Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· apply pow_pos; norm_num Β· rw [← le_div_iff (by norm_num)] refine le_trans ((div_le_div_right ?_).mpr pi_le_four) ?_ Β· apply pow_pos; norm_num Β· simp only [pow_succ', ← div_div, one_div] -- Porting note: removed `convert le_rfl` norm_num apply lt_of_lt_of_le this (le_of_eq _); rw [add_mul]; congr 1 Β· ring simp only [show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul, div_div, ← pow_add] rw [one_div, one_div, inv_mul_eq_iff_eq_mulβ‚€, eq_comm, mul_inv_eq_iff_eq_mulβ‚€, ← pow_add] Β· rw [add_assoc, Nat.mul_succ, add_comm, add_comm n, add_assoc, mul_comm n] all_goals norm_num #align real.pi_lt_sqrt_two_add_series Real.pi_lt_sqrtTwoAddSeries theorem pi_lower_bound_start (n : β„•) {a} (h : sqrtTwoAddSeries ((0 : β„•) / (1 : β„•)) n ≀ (2 : ℝ) - (a / (2 : ℝ) ^ (n + 1)) ^ 2) : a < Ο€ := by refine lt_of_le_of_lt ?_ (pi_gt_sqrtTwoAddSeries n); rw [mul_comm] refine (div_le_iff (pow_pos (by norm_num) _ : (0 : ℝ) < _)).mp (le_sqrt_of_sq_le ?_) rwa [le_sub_comm, show (0 : ℝ) = (0 : β„•) / (1 : β„•) by rw [Nat.cast_zero, zero_div]] #align real.pi_lower_bound_start Real.pi_lower_bound_start
Mathlib/Data/Real/Pi/Bounds.lean
85
93
theorem sqrtTwoAddSeries_step_up (c d : β„•) {a b n : β„•} {z : ℝ} (hz : sqrtTwoAddSeries (c / d) n ≀ z) (hb : 0 < b) (hd : 0 < d) (h : (2 * b + a) * d ^ 2 ≀ c ^ 2 * b) : sqrtTwoAddSeries (a / b) (n + 1) ≀ z := by
refine le_trans ?_ hz; rw [sqrtTwoAddSeries_succ]; apply sqrtTwoAddSeries_monotone_left have hb' : 0 < (b : ℝ) := Nat.cast_pos.2 hb have hd' : 0 < (d : ℝ) := Nat.cast_pos.2 hd rw [sqrt_le_left (div_nonneg c.cast_nonneg d.cast_nonneg), div_pow, add_div_eq_mul_add_div _ _ (ne_of_gt hb'), div_le_div_iff hb' (pow_pos hd' _)] exact mod_cast h
6
403.428793
2
1.833333
6
1,911
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds #align_import data.real.pi.bounds from "leanprover-community/mathlib"@"402f8982dddc1864bd703da2d6e2ee304a866973" -- Porting note: needed to add a lot of type ascriptions for lean to interpret numbers as reals. open scoped Real namespace Real theorem pi_gt_sqrtTwoAddSeries (n : β„•) : (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) < Ο€ := by have : √(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) * (2 : ℝ) ^ (n + 2) < Ο€ := by rw [← lt_div_iff, ← sin_pi_over_two_pow_succ] focus apply sin_lt apply div_pos pi_pos all_goals apply pow_pos; norm_num apply lt_of_le_of_lt (le_of_eq _) this rw [pow_succ' _ (n + 1), ← mul_assoc, div_mul_cancelβ‚€, mul_comm]; norm_num #align real.pi_gt_sqrt_two_add_series Real.pi_gt_sqrtTwoAddSeries theorem pi_lt_sqrtTwoAddSeries (n : β„•) : Ο€ < (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) + 1 / (4 : ℝ) ^ n := by have : Ο€ < (√(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) + (1 : ℝ) / ((2 : ℝ) ^ n) ^ 3 / 4) * (2 : ℝ) ^ (n + 2) := by rw [← div_lt_iff (by norm_num), ← sin_pi_over_two_pow_succ] refine lt_of_lt_of_le (lt_add_of_sub_right_lt (sin_gt_sub_cube ?_ ?_)) ?_ Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· rw [div_le_iff'] Β· refine le_trans pi_le_four ?_ simp only [show (4 : ℝ) = (2 : ℝ) ^ 2 by norm_num, mul_one] apply pow_le_pow_right (by norm_num) apply le_add_of_nonneg_left; apply Nat.zero_le Β· apply pow_pos; norm_num apply add_le_add_left; rw [div_le_div_right (by norm_num)] rw [le_div_iff (by norm_num), ← mul_pow] refine le_trans ?_ (le_of_eq (one_pow 3)); apply pow_le_pow_left Β· apply le_of_lt; apply mul_pos Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· apply pow_pos; norm_num Β· rw [← le_div_iff (by norm_num)] refine le_trans ((div_le_div_right ?_).mpr pi_le_four) ?_ Β· apply pow_pos; norm_num Β· simp only [pow_succ', ← div_div, one_div] -- Porting note: removed `convert le_rfl` norm_num apply lt_of_lt_of_le this (le_of_eq _); rw [add_mul]; congr 1 Β· ring simp only [show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul, div_div, ← pow_add] rw [one_div, one_div, inv_mul_eq_iff_eq_mulβ‚€, eq_comm, mul_inv_eq_iff_eq_mulβ‚€, ← pow_add] Β· rw [add_assoc, Nat.mul_succ, add_comm, add_comm n, add_assoc, mul_comm n] all_goals norm_num #align real.pi_lt_sqrt_two_add_series Real.pi_lt_sqrtTwoAddSeries theorem pi_lower_bound_start (n : β„•) {a} (h : sqrtTwoAddSeries ((0 : β„•) / (1 : β„•)) n ≀ (2 : ℝ) - (a / (2 : ℝ) ^ (n + 1)) ^ 2) : a < Ο€ := by refine lt_of_le_of_lt ?_ (pi_gt_sqrtTwoAddSeries n); rw [mul_comm] refine (div_le_iff (pow_pos (by norm_num) _ : (0 : ℝ) < _)).mp (le_sqrt_of_sq_le ?_) rwa [le_sub_comm, show (0 : ℝ) = (0 : β„•) / (1 : β„•) by rw [Nat.cast_zero, zero_div]] #align real.pi_lower_bound_start Real.pi_lower_bound_start theorem sqrtTwoAddSeries_step_up (c d : β„•) {a b n : β„•} {z : ℝ} (hz : sqrtTwoAddSeries (c / d) n ≀ z) (hb : 0 < b) (hd : 0 < d) (h : (2 * b + a) * d ^ 2 ≀ c ^ 2 * b) : sqrtTwoAddSeries (a / b) (n + 1) ≀ z := by refine le_trans ?_ hz; rw [sqrtTwoAddSeries_succ]; apply sqrtTwoAddSeries_monotone_left have hb' : 0 < (b : ℝ) := Nat.cast_pos.2 hb have hd' : 0 < (d : ℝ) := Nat.cast_pos.2 hd rw [sqrt_le_left (div_nonneg c.cast_nonneg d.cast_nonneg), div_pow, add_div_eq_mul_add_div _ _ (ne_of_gt hb'), div_le_div_iff hb' (pow_pos hd' _)] exact mod_cast h #align real.sqrt_two_add_series_step_up Real.sqrtTwoAddSeries_step_up
Mathlib/Data/Real/Pi/Bounds.lean
128
136
theorem pi_upper_bound_start (n : β„•) {a} (h : (2 : ℝ) - ((a - 1 / (4 : ℝ) ^ n) / (2 : ℝ) ^ (n + 1)) ^ 2 ≀ sqrtTwoAddSeries ((0 : β„•) / (1 : β„•)) n) (hβ‚‚ : (1 : ℝ) / (4 : ℝ) ^ n ≀ a) : Ο€ < a := by
refine lt_of_lt_of_le (pi_lt_sqrtTwoAddSeries n) ?_ rw [← le_sub_iff_add_le, ← le_div_iff', sqrt_le_left, sub_le_comm] Β· rwa [Nat.cast_zero, zero_div] at h Β· exact div_nonneg (sub_nonneg.2 hβ‚‚) (pow_nonneg (le_of_lt zero_lt_two) _) Β· exact pow_pos zero_lt_two _
5
148.413159
2
1.833333
6
1,911
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds #align_import data.real.pi.bounds from "leanprover-community/mathlib"@"402f8982dddc1864bd703da2d6e2ee304a866973" -- Porting note: needed to add a lot of type ascriptions for lean to interpret numbers as reals. open scoped Real namespace Real theorem pi_gt_sqrtTwoAddSeries (n : β„•) : (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) < Ο€ := by have : √(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) * (2 : ℝ) ^ (n + 2) < Ο€ := by rw [← lt_div_iff, ← sin_pi_over_two_pow_succ] focus apply sin_lt apply div_pos pi_pos all_goals apply pow_pos; norm_num apply lt_of_le_of_lt (le_of_eq _) this rw [pow_succ' _ (n + 1), ← mul_assoc, div_mul_cancelβ‚€, mul_comm]; norm_num #align real.pi_gt_sqrt_two_add_series Real.pi_gt_sqrtTwoAddSeries theorem pi_lt_sqrtTwoAddSeries (n : β„•) : Ο€ < (2 : ℝ) ^ (n + 1) * √(2 - sqrtTwoAddSeries 0 n) + 1 / (4 : ℝ) ^ n := by have : Ο€ < (√(2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) + (1 : ℝ) / ((2 : ℝ) ^ n) ^ 3 / 4) * (2 : ℝ) ^ (n + 2) := by rw [← div_lt_iff (by norm_num), ← sin_pi_over_two_pow_succ] refine lt_of_lt_of_le (lt_add_of_sub_right_lt (sin_gt_sub_cube ?_ ?_)) ?_ Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· rw [div_le_iff'] Β· refine le_trans pi_le_four ?_ simp only [show (4 : ℝ) = (2 : ℝ) ^ 2 by norm_num, mul_one] apply pow_le_pow_right (by norm_num) apply le_add_of_nonneg_left; apply Nat.zero_le Β· apply pow_pos; norm_num apply add_le_add_left; rw [div_le_div_right (by norm_num)] rw [le_div_iff (by norm_num), ← mul_pow] refine le_trans ?_ (le_of_eq (one_pow 3)); apply pow_le_pow_left Β· apply le_of_lt; apply mul_pos Β· apply div_pos pi_pos; apply pow_pos; norm_num Β· apply pow_pos; norm_num Β· rw [← le_div_iff (by norm_num)] refine le_trans ((div_le_div_right ?_).mpr pi_le_four) ?_ Β· apply pow_pos; norm_num Β· simp only [pow_succ', ← div_div, one_div] -- Porting note: removed `convert le_rfl` norm_num apply lt_of_lt_of_le this (le_of_eq _); rw [add_mul]; congr 1 Β· ring simp only [show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul, div_div, ← pow_add] rw [one_div, one_div, inv_mul_eq_iff_eq_mulβ‚€, eq_comm, mul_inv_eq_iff_eq_mulβ‚€, ← pow_add] Β· rw [add_assoc, Nat.mul_succ, add_comm, add_comm n, add_assoc, mul_comm n] all_goals norm_num #align real.pi_lt_sqrt_two_add_series Real.pi_lt_sqrtTwoAddSeries theorem pi_lower_bound_start (n : β„•) {a} (h : sqrtTwoAddSeries ((0 : β„•) / (1 : β„•)) n ≀ (2 : ℝ) - (a / (2 : ℝ) ^ (n + 1)) ^ 2) : a < Ο€ := by refine lt_of_le_of_lt ?_ (pi_gt_sqrtTwoAddSeries n); rw [mul_comm] refine (div_le_iff (pow_pos (by norm_num) _ : (0 : ℝ) < _)).mp (le_sqrt_of_sq_le ?_) rwa [le_sub_comm, show (0 : ℝ) = (0 : β„•) / (1 : β„•) by rw [Nat.cast_zero, zero_div]] #align real.pi_lower_bound_start Real.pi_lower_bound_start theorem sqrtTwoAddSeries_step_up (c d : β„•) {a b n : β„•} {z : ℝ} (hz : sqrtTwoAddSeries (c / d) n ≀ z) (hb : 0 < b) (hd : 0 < d) (h : (2 * b + a) * d ^ 2 ≀ c ^ 2 * b) : sqrtTwoAddSeries (a / b) (n + 1) ≀ z := by refine le_trans ?_ hz; rw [sqrtTwoAddSeries_succ]; apply sqrtTwoAddSeries_monotone_left have hb' : 0 < (b : ℝ) := Nat.cast_pos.2 hb have hd' : 0 < (d : ℝ) := Nat.cast_pos.2 hd rw [sqrt_le_left (div_nonneg c.cast_nonneg d.cast_nonneg), div_pow, add_div_eq_mul_add_div _ _ (ne_of_gt hb'), div_le_div_iff hb' (pow_pos hd' _)] exact mod_cast h #align real.sqrt_two_add_series_step_up Real.sqrtTwoAddSeries_step_up theorem pi_upper_bound_start (n : β„•) {a} (h : (2 : ℝ) - ((a - 1 / (4 : ℝ) ^ n) / (2 : ℝ) ^ (n + 1)) ^ 2 ≀ sqrtTwoAddSeries ((0 : β„•) / (1 : β„•)) n) (hβ‚‚ : (1 : ℝ) / (4 : ℝ) ^ n ≀ a) : Ο€ < a := by refine lt_of_lt_of_le (pi_lt_sqrtTwoAddSeries n) ?_ rw [← le_sub_iff_add_le, ← le_div_iff', sqrt_le_left, sub_le_comm] Β· rwa [Nat.cast_zero, zero_div] at h Β· exact div_nonneg (sub_nonneg.2 hβ‚‚) (pow_nonneg (le_of_lt zero_lt_two) _) Β· exact pow_pos zero_lt_two _ #align real.pi_upper_bound_start Real.pi_upper_bound_start
Mathlib/Data/Real/Pi/Bounds.lean
139
147
theorem sqrtTwoAddSeries_step_down (a b : β„•) {c d n : β„•} {z : ℝ} (hz : z ≀ sqrtTwoAddSeries (a / b) n) (hb : 0 < b) (hd : 0 < d) (h : a ^ 2 * d ≀ (2 * d + c) * b ^ 2) : z ≀ sqrtTwoAddSeries (c / d) (n + 1) := by
apply le_trans hz; rw [sqrtTwoAddSeries_succ]; apply sqrtTwoAddSeries_monotone_left apply le_sqrt_of_sq_le have hb' : 0 < (b : ℝ) := Nat.cast_pos.2 hb have hd' : 0 < (d : ℝ) := Nat.cast_pos.2 hd rw [div_pow, add_div_eq_mul_add_div _ _ (ne_of_gt hd'), div_le_div_iff (pow_pos hb' _) hd'] exact mod_cast h
6
403.428793
2
1.833333
6
1,911
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd
Mathlib/RingTheory/WittVector/MulCoeff.lean
56
61
theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by
rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff]
5
148.413159
2
1.833333
6
1,912
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : β„•) : 𝕄 := βˆ‘ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder
Mathlib/RingTheory/WittVector/MulCoeff.lean
69
85
theorem wittPolyProdRemainder_vars (n : β„•) : (wittPolyProdRemainder p n).vars βŠ† univ Γ—Λ’ range n := by
rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ Β· apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : β„€) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset Β· apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊒ exact hx
15
3,269,017.372472
2
1.833333
6
1,912
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : β„•) : 𝕄 := βˆ‘ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : β„•) : (wittPolyProdRemainder p n).vars βŠ† univ Γ—Λ’ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ Β· apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : β„€) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset Β· apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊒ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : β„•) : 𝕄 := (βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x))) * βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x)) #align witt_vector.remainder WittVector.remainder
Mathlib/RingTheory/WittVector/MulCoeff.lean
99
110
theorem remainder_vars (n : β„•) : (remainder p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by
rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] Β· apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx Β· apply pow_ne_zero exact mod_cast hp.out.ne_zero
11
59,874.141715
2
1.833333
6
1,912
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : β„•) : 𝕄 := βˆ‘ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : β„•) : (wittPolyProdRemainder p n).vars βŠ† univ Γ—Λ’ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ Β· apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : β„€) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset Β· apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊒ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : β„•) : 𝕄 := (βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x))) * βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x)) #align witt_vector.remainder WittVector.remainder theorem remainder_vars (n : β„•) : (remainder p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] Β· apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx Β· apply pow_ne_zero exact mod_cast hp.out.ne_zero #align witt_vector.remainder_vars WittVector.remainder_vars def polyOfInterest (n : β„•) : 𝕄 := wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) - X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ (n + 1)) - X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ (n + 1)) #align witt_vector.poly_of_interest WittVector.polyOfInterest
Mathlib/RingTheory/WittVector/MulCoeff.lean
120
135
theorem mul_polyOfInterest_aux1 (n : β„•) : βˆ‘ i ∈ range (n + 1), (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by
simp only [wittPolyProd] convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1 Β· simp only [wittPolynomial, wittMul] rw [AlgHom.map_sum] congr 1 with i congr 1 have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by rw [Finsupp.support_eq_singleton] simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne] exact pow_ne_zero _ hp.out.ne_zero simp only [bind₁_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast, Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true, Int.cast_pow] Β· simp only [map_mul, bind₁_X_right]
14
1,202,604.284165
2
1.833333
6
1,912
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : β„•) : 𝕄 := βˆ‘ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : β„•) : (wittPolyProdRemainder p n).vars βŠ† univ Γ—Λ’ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ Β· apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : β„€) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset Β· apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊒ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : β„•) : 𝕄 := (βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x))) * βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x)) #align witt_vector.remainder WittVector.remainder theorem remainder_vars (n : β„•) : (remainder p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] Β· apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx Β· apply pow_ne_zero exact mod_cast hp.out.ne_zero #align witt_vector.remainder_vars WittVector.remainder_vars def polyOfInterest (n : β„•) : 𝕄 := wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) - X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ (n + 1)) - X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ (n + 1)) #align witt_vector.poly_of_interest WittVector.polyOfInterest theorem mul_polyOfInterest_aux1 (n : β„•) : βˆ‘ i ∈ range (n + 1), (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by simp only [wittPolyProd] convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1 Β· simp only [wittPolynomial, wittMul] rw [AlgHom.map_sum] congr 1 with i congr 1 have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by rw [Finsupp.support_eq_singleton] simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne] exact pow_ne_zero _ hp.out.ne_zero simp only [bind₁_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast, Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true, Int.cast_pow] Β· simp only [map_mul, bind₁_X_right] #align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1
Mathlib/RingTheory/WittVector/MulCoeff.lean
138
142
theorem mul_polyOfInterest_aux2 (n : β„•) : (p : 𝕄) ^ n * wittMul p n + wittPolyProdRemainder p n = wittPolyProd p n := by
convert mul_polyOfInterest_aux1 p n rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one] rfl
3
20.085537
1
1.833333
6
1,912
import Mathlib.Algebra.MvPolynomial.Supported import Mathlib.RingTheory.WittVector.Truncated #align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section namespace WittVector variable (p : β„•) [hp : Fact p.Prime] variable {k : Type*} [CommRing k] local notation "π•Ž" => WittVector p -- Porting note: new notation local notation "𝕄" => MvPolynomial (Fin 2 Γ— β„•) β„€ open Finset MvPolynomial def wittPolyProd (n : β„•) : 𝕄 := rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ n) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ n) #align witt_vector.witt_poly_prod WittVector.wittPolyProd theorem wittPolyProd_vars (n : β„•) : (wittPolyProd p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [wittPolyProd] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_rename _ _) ?_ simp [wittPolynomial_vars, image_subset_iff] #align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars def wittPolyProdRemainder (n : β„•) : 𝕄 := βˆ‘ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) #align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder theorem wittPolyProdRemainder_vars (n : β„•) : (wittPolyProdRemainder p n).vars βŠ† univ Γ—Λ’ range n := by rw [wittPolyProdRemainder] refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ Β· apply Subset.trans (vars_pow _ _) have : (p : 𝕄) = C (p : β„€) := by simp only [Int.cast_natCast, eq_intCast] rw [this, vars_C] apply empty_subset Β· apply Subset.trans (vars_pow _ _) apply Subset.trans (wittMul_vars _ _) apply product_subset_product (Subset.refl _) simp only [mem_range, range_subset] at hx ⊒ exact hx #align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars def remainder (n : β„•) : 𝕄 := (βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x))) * βˆ‘ x ∈ range (n + 1), (rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : β„€) ^ x)) #align witt_vector.remainder WittVector.remainder theorem remainder_vars (n : β„•) : (remainder p n).vars βŠ† univ Γ—Λ’ range (n + 1) := by rw [remainder] apply Subset.trans (vars_mul _ _) refine union_subset ?_ ?_ <;> Β· refine Subset.trans (vars_sum_subset _ _) ?_ rw [biUnion_subset] intro x hx rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single] Β· apply Subset.trans Finsupp.support_single_subset simpa using mem_range.mp hx Β· apply pow_ne_zero exact mod_cast hp.out.ne_zero #align witt_vector.remainder_vars WittVector.remainder_vars def polyOfInterest (n : β„•) : 𝕄 := wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) - X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ (n + 1)) - X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ (n + 1)) #align witt_vector.poly_of_interest WittVector.polyOfInterest theorem mul_polyOfInterest_aux1 (n : β„•) : βˆ‘ i ∈ range (n + 1), (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by simp only [wittPolyProd] convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1 Β· simp only [wittPolynomial, wittMul] rw [AlgHom.map_sum] congr 1 with i congr 1 have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by rw [Finsupp.support_eq_singleton] simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne] exact pow_ne_zero _ hp.out.ne_zero simp only [bind₁_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast, Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true, Int.cast_pow] Β· simp only [map_mul, bind₁_X_right] #align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1 theorem mul_polyOfInterest_aux2 (n : β„•) : (p : 𝕄) ^ n * wittMul p n + wittPolyProdRemainder p n = wittPolyProd p n := by convert mul_polyOfInterest_aux1 p n rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one] rfl #align witt_vector.mul_poly_of_interest_aux2 WittVector.mul_polyOfInterest_aux2
Mathlib/RingTheory/WittVector/MulCoeff.lean
145
176
theorem mul_polyOfInterest_aux3 (n : β„•) : wittPolyProd p (n + 1) = -((p : 𝕄) ^ (n + 1) * X (0, n + 1)) * ((p : 𝕄) ^ (n + 1) * X (1, n + 1)) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β„€ (n + 1)) + (p : 𝕄) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β„€ (n + 1)) + remainder p n := by
-- a useful auxiliary fact have mvpz : (p : 𝕄) ^ (n + 1) = MvPolynomial.C ((p : β„€) ^ (n + 1)) := by norm_cast -- Porting note: the original proof applies `sum_range_succ` through a non-`conv` rewrite, -- but this does not work in Lean 4; the whole proof also times out very badly. The proof has been -- nearly totally rewritten here and now finishes quite fast. rw [wittPolyProd, wittPolynomial, AlgHom.map_sum, AlgHom.map_sum] conv_lhs => arg 1 rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] conv_lhs => arg 2 rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] conv_rhs => enter [1, 1, 2, 2] rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] conv_rhs => enter [1, 2, 2] rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul, rename_C, rename_X, ← mvpz] simp only [add_mul, mul_add] rw [add_comm _ (remainder p n)] simp only [add_assoc] apply congrArg (Add.add _) ring
27
532,048,240,601.79865
2
1.833333
6
1,912
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Sieve def SecondObj : Type max v u := ∏ᢜ fun f : Ξ£(Y Z : _) (_ : Z ⟢ Y), { f' : Y ⟢ X // S f' } => P.obj (op f.2.1) #align category_theory.equalizer.sieve.second_obj CategoryTheory.Equalizer.Sieve.SecondObj variable {P S} -- Porting note (#10688): added to ease automation @[ext] lemma SecondObj.ext (z₁ zβ‚‚ : SecondObj P S) (h : βˆ€ (Y Z : C) (g : Z ⟢ Y) (f : Y ⟢ X) (hf : S.arrows f), (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, Z, g, f, hf⟩⟩ apply h variable (P S) def firstMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ (⟨_, _, S.downward_closed fg.2.2.2.2 fg.2.2.1⟩ : Ξ£Y, { f : Y ⟢ X // S f }) #align category_theory.equalizer.sieve.first_map CategoryTheory.Equalizer.Sieve.firstMap instance : Inhabited (SecondObj P (βŠ₯ : Sieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ ⟨_, fg.2.2.2⟩ ≫ P.map fg.2.2.1.op #align category_theory.equalizer.sieve.second_map CategoryTheory.Equalizer.Sieve.secondMap
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
133
135
theorem w : forkMap P (S : Presieve X) ≫ firstMap P S = forkMap P S ≫ secondMap P S := by
ext simp [firstMap, secondMap, forkMap]
2
7.389056
1
1.833333
6
1,913
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Sieve def SecondObj : Type max v u := ∏ᢜ fun f : Ξ£(Y Z : _) (_ : Z ⟢ Y), { f' : Y ⟢ X // S f' } => P.obj (op f.2.1) #align category_theory.equalizer.sieve.second_obj CategoryTheory.Equalizer.Sieve.SecondObj variable {P S} -- Porting note (#10688): added to ease automation @[ext] lemma SecondObj.ext (z₁ zβ‚‚ : SecondObj P S) (h : βˆ€ (Y Z : C) (g : Z ⟢ Y) (f : Y ⟢ X) (hf : S.arrows f), (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, Z, g, f, hf⟩⟩ apply h variable (P S) def firstMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ (⟨_, _, S.downward_closed fg.2.2.2.2 fg.2.2.1⟩ : Ξ£Y, { f : Y ⟢ X // S f }) #align category_theory.equalizer.sieve.first_map CategoryTheory.Equalizer.Sieve.firstMap instance : Inhabited (SecondObj P (βŠ₯ : Sieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ ⟨_, fg.2.2.2⟩ ≫ P.map fg.2.2.1.op #align category_theory.equalizer.sieve.second_map CategoryTheory.Equalizer.Sieve.secondMap theorem w : forkMap P (S : Presieve X) ≫ firstMap P S = forkMap P S ≫ secondMap P S := by ext simp [firstMap, secondMap, forkMap] #align category_theory.equalizer.sieve.w CategoryTheory.Equalizer.Sieve.w
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
142
152
theorem compatible_iff (x : FirstObj P S) : ((firstObjEqFamily P S).hom x).Compatible ↔ firstMap P S x = secondMap P S x := by
rw [Presieve.compatible_iff_sieveCompatible] constructor · intro t apply SecondObj.ext intros Y Z g f hf simpa [firstMap, secondMap] using t _ g hf · intro t Y Z f g hf rw [Types.limit_ext_iff'] at t simpa [firstMap, secondMap] using t ⟨⟨Y, Z, g, f, hf⟩⟩
9
8,103.083928
2
1.833333
6
1,913
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Sieve def SecondObj : Type max v u := ∏ᢜ fun f : Ξ£(Y Z : _) (_ : Z ⟢ Y), { f' : Y ⟢ X // S f' } => P.obj (op f.2.1) #align category_theory.equalizer.sieve.second_obj CategoryTheory.Equalizer.Sieve.SecondObj variable {P S} -- Porting note (#10688): added to ease automation @[ext] lemma SecondObj.ext (z₁ zβ‚‚ : SecondObj P S) (h : βˆ€ (Y Z : C) (g : Z ⟢ Y) (f : Y ⟢ X) (hf : S.arrows f), (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, Z, g, f, hf⟩⟩ apply h variable (P S) def firstMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ (⟨_, _, S.downward_closed fg.2.2.2.2 fg.2.2.1⟩ : Ξ£Y, { f : Y ⟢ X // S f }) #align category_theory.equalizer.sieve.first_map CategoryTheory.Equalizer.Sieve.firstMap instance : Inhabited (SecondObj P (βŠ₯ : Sieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P (S : Presieve X) ⟢ SecondObj P S := Pi.lift fun fg => Pi.Ο€ _ ⟨_, fg.2.2.2⟩ ≫ P.map fg.2.2.1.op #align category_theory.equalizer.sieve.second_map CategoryTheory.Equalizer.Sieve.secondMap theorem w : forkMap P (S : Presieve X) ≫ firstMap P S = forkMap P S ≫ secondMap P S := by ext simp [firstMap, secondMap, forkMap] #align category_theory.equalizer.sieve.w CategoryTheory.Equalizer.Sieve.w theorem compatible_iff (x : FirstObj P S) : ((firstObjEqFamily P S).hom x).Compatible ↔ firstMap P S x = secondMap P S x := by rw [Presieve.compatible_iff_sieveCompatible] constructor Β· intro t apply SecondObj.ext intros Y Z g f hf simpa [firstMap, secondMap] using t _ g hf Β· intro t Y Z f g hf rw [Types.limit_ext_iff'] at t simpa [firstMap, secondMap] using t ⟨⟨Y, Z, g, f, hf⟩⟩ #align category_theory.equalizer.sieve.compatible_iff CategoryTheory.Equalizer.Sieve.compatible_iff
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
156
174
theorem equalizer_sheaf_condition : Presieve.IsSheafFor P (S : Presieve X) ↔ Nonempty (IsLimit (Fork.ofΞΉ _ (w P S))) := by
rw [Types.type_equalizer_iff_unique, ← Equiv.forall_congr_left (firstObjEqFamily P (S : Presieve X)).toEquiv.symm] simp_rw [← compatible_iff] simp only [inv_hom_id_apply, Iso.toEquiv_symm_fun] apply forallβ‚‚_congr intro x _ apply exists_unique_congr intro t rw [← Iso.toEquiv_symm_fun] rw [Equiv.eq_symm_apply] constructor Β· intro q funext Y f hf simpa [firstObjEqFamily, forkMap] using q _ _ Β· intro q Y f hf rw [← q] simp [firstObjEqFamily, forkMap]
17
24,154,952.753575
2
1.833333
6
1,913
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Presieve variable [R.hasPullbacks] @[simp] def SecondObj : Type max v u := ∏ᢜ fun fg : (Ξ£Y, { f : Y ⟢ X // R f }) Γ— Ξ£Z, { g : Z ⟢ X // R g } => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 P.obj (op (pullback fg.1.2.1 fg.2.2.1)) #align category_theory.equalizer.presieve.second_obj CategoryTheory.Equalizer.Presieve.SecondObj def firstMap : FirstObj P R ⟢ SecondObj P R := Pi.lift fun fg => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 Pi.Ο€ _ _ ≫ P.map pullback.fst.op #align category_theory.equalizer.presieve.first_map CategoryTheory.Equalizer.Presieve.firstMap instance [HasPullbacks C] : Inhabited (SecondObj P (βŠ₯ : Presieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P R ⟢ SecondObj P R := Pi.lift fun fg => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 Pi.Ο€ _ _ ≫ P.map pullback.snd.op #align category_theory.equalizer.presieve.second_map CategoryTheory.Equalizer.Presieve.secondMap
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
216
223
theorem w : forkMap P R ≫ firstMap P R = forkMap P R ≫ secondMap P R := by
dsimp ext fg simp only [firstMap, secondMap, forkMap] simp only [limit.lift_Ο€, limit.lift_Ο€_assoc, assoc, Fan.mk_Ο€_app] haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 rw [← P.map_comp, ← op_comp, pullback.condition] simp
7
1,096.633158
2
1.833333
6
1,913
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Presieve variable [R.hasPullbacks] @[simp] def SecondObj : Type max v u := ∏ᢜ fun fg : (Ξ£Y, { f : Y ⟢ X // R f }) Γ— Ξ£Z, { g : Z ⟢ X // R g } => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 P.obj (op (pullback fg.1.2.1 fg.2.2.1)) #align category_theory.equalizer.presieve.second_obj CategoryTheory.Equalizer.Presieve.SecondObj def firstMap : FirstObj P R ⟢ SecondObj P R := Pi.lift fun fg => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 Pi.Ο€ _ _ ≫ P.map pullback.fst.op #align category_theory.equalizer.presieve.first_map CategoryTheory.Equalizer.Presieve.firstMap instance [HasPullbacks C] : Inhabited (SecondObj P (βŠ₯ : Presieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P R ⟢ SecondObj P R := Pi.lift fun fg => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 Pi.Ο€ _ _ ≫ P.map pullback.snd.op #align category_theory.equalizer.presieve.second_map CategoryTheory.Equalizer.Presieve.secondMap theorem w : forkMap P R ≫ firstMap P R = forkMap P R ≫ secondMap P R := by dsimp ext fg simp only [firstMap, secondMap, forkMap] simp only [limit.lift_Ο€, limit.lift_Ο€_assoc, assoc, Fan.mk_Ο€_app] haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 rw [← P.map_comp, ← op_comp, pullback.condition] simp #align category_theory.equalizer.presieve.w CategoryTheory.Equalizer.Presieve.w
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
230
240
theorem compatible_iff (x : FirstObj P R) : ((firstObjEqFamily P R).hom x).Compatible ↔ firstMap P R x = secondMap P R x := by
rw [Presieve.pullbackCompatible_iff] constructor · intro t apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩, Z, g, hg⟩ simpa [firstMap, secondMap] using t hf hg · intro t Y Z f g hf hg rw [Types.limit_ext_iff'] at t simpa [firstMap, secondMap] using t ⟨⟨⟨Y, f, hf⟩, Z, g, hg⟩⟩
9
8,103.083928
2
1.833333
6
1,913
import Mathlib.CategoryTheory.Sites.IsSheafFor import Mathlib.CategoryTheory.Limits.Shapes.Types import Mathlib.Tactic.ApplyFun #align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" universe w v u namespace CategoryTheory open Opposite CategoryTheory Category Limits Sieve namespace Equalizer variable {C : Type u} [Category.{v} C] (P : Cα΅’α΅– β₯€ Type max v u) {X : C} (R : Presieve X) (S : Sieve X) noncomputable section def FirstObj : Type max v u := ∏ᢜ fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1) #align category_theory.equalizer.first_obj CategoryTheory.Equalizer.FirstObj variable {P R} -- Porting note (#10688): added to ease automation @[ext] lemma FirstObj.ext (z₁ zβ‚‚ : FirstObj P R) (h : βˆ€ (Y : C) (f : Y ⟢ X) (hf : R f), (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) z₁ = (Pi.Ο€ _ ⟨Y, f, hf⟩ : FirstObj P R ⟢ _) zβ‚‚) : z₁ = zβ‚‚ := by apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩⟩ exact h Y f hf variable (P R) @[simps] def firstObjEqFamily : FirstObj P R β‰… R.FamilyOfElements P where hom t Y f hf := Pi.Ο€ (fun f : Ξ£Y, { f : Y ⟢ X // R f } => P.obj (op f.1)) ⟨_, _, hf⟩ t inv := Pi.lift fun f x => x _ f.2.2 #align category_theory.equalizer.first_obj_eq_family CategoryTheory.Equalizer.firstObjEqFamily instance : Inhabited (FirstObj P (βŠ₯ : Presieve X)) := (firstObjEqFamily P _).toEquiv.inhabited -- Porting note: was not needed in mathlib instance : Inhabited (FirstObj P ((βŠ₯ : Sieve X) : Presieve X)) := (inferInstance : Inhabited (FirstObj P (βŠ₯ : Presieve X))) def forkMap : P.obj (op X) ⟢ FirstObj P R := Pi.lift fun f => P.map f.2.1.op #align category_theory.equalizer.fork_map CategoryTheory.Equalizer.forkMap namespace Presieve variable [R.hasPullbacks] @[simp] def SecondObj : Type max v u := ∏ᢜ fun fg : (Ξ£Y, { f : Y ⟢ X // R f }) Γ— Ξ£Z, { g : Z ⟢ X // R g } => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 P.obj (op (pullback fg.1.2.1 fg.2.2.1)) #align category_theory.equalizer.presieve.second_obj CategoryTheory.Equalizer.Presieve.SecondObj def firstMap : FirstObj P R ⟢ SecondObj P R := Pi.lift fun fg => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 Pi.Ο€ _ _ ≫ P.map pullback.fst.op #align category_theory.equalizer.presieve.first_map CategoryTheory.Equalizer.Presieve.firstMap instance [HasPullbacks C] : Inhabited (SecondObj P (βŠ₯ : Presieve X)) := ⟨firstMap _ _ default⟩ def secondMap : FirstObj P R ⟢ SecondObj P R := Pi.lift fun fg => haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 Pi.Ο€ _ _ ≫ P.map pullback.snd.op #align category_theory.equalizer.presieve.second_map CategoryTheory.Equalizer.Presieve.secondMap theorem w : forkMap P R ≫ firstMap P R = forkMap P R ≫ secondMap P R := by dsimp ext fg simp only [firstMap, secondMap, forkMap] simp only [limit.lift_Ο€, limit.lift_Ο€_assoc, assoc, Fan.mk_Ο€_app] haveI := Presieve.hasPullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 rw [← P.map_comp, ← op_comp, pullback.condition] simp #align category_theory.equalizer.presieve.w CategoryTheory.Equalizer.Presieve.w theorem compatible_iff (x : FirstObj P R) : ((firstObjEqFamily P R).hom x).Compatible ↔ firstMap P R x = secondMap P R x := by rw [Presieve.pullbackCompatible_iff] constructor Β· intro t apply Limits.Types.limit_ext rintro ⟨⟨Y, f, hf⟩, Z, g, hg⟩ simpa [firstMap, secondMap] using t hf hg Β· intro t Y Z f g hf hg rw [Types.limit_ext_iff'] at t simpa [firstMap, secondMap] using t ⟨⟨⟨Y, f, hf⟩, Z, g, hg⟩⟩ #align category_theory.equalizer.presieve.compatible_iff CategoryTheory.Equalizer.Presieve.compatible_iff
Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean
246
261
theorem sheaf_condition : R.IsSheafFor P ↔ Nonempty (IsLimit (Fork.ofΞΉ _ (w P R))) := by
rw [Types.type_equalizer_iff_unique] erw [← Equiv.forall_congr_left (firstObjEqFamily P R).toEquiv.symm] simp_rw [← compatible_iff, ← Iso.toEquiv_fun, Equiv.apply_symm_apply] apply forallβ‚‚_congr intro x _ apply exists_unique_congr intro t rw [Equiv.eq_symm_apply] constructor Β· intro q funext Y f hf simpa [forkMap] using q _ _ Β· intro q Y f hf rw [← q] simp [forkMap]
15
3,269,017.372472
2
1.833333
6
1,913
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ΞΉ : Type*} {R : Type*} {M₁ Mβ‚‚ N₁ Nβ‚‚ : Type*} {Mα΅’ Nα΅’ : ΞΉ β†’ Type*} namespace QuadraticForm section Prod section Semiring variable [CommSemiring R] variable [AddCommMonoid M₁] [AddCommMonoid Mβ‚‚] [AddCommMonoid N₁] [AddCommMonoid Nβ‚‚] variable [Module R M₁] [Module R Mβ‚‚] [Module R N₁] [Module R Nβ‚‚] @[simps!] def prod (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : QuadraticForm R (M₁ Γ— Mβ‚‚) := Q₁.comp (LinearMap.fst _ _ _) + Qβ‚‚.comp (LinearMap.snd _ _ _) #align quadratic_form.prod QuadraticForm.prod @[simps toLinearEquiv] def IsometryEquiv.prod {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₁' : QuadraticForm R N₁} {Qβ‚‚' : QuadraticForm R Nβ‚‚} (e₁ : Q₁.IsometryEquiv Q₁') (eβ‚‚ : Qβ‚‚.IsometryEquiv Qβ‚‚') : (Q₁.prod Qβ‚‚).IsometryEquiv (Q₁'.prod Qβ‚‚') where map_app' x := congr_argβ‚‚ (Β· + Β·) (e₁.map_app x.1) (eβ‚‚.map_app x.2) toLinearEquiv := LinearEquiv.prod e₁.toLinearEquiv eβ‚‚.toLinearEquiv #align quadratic_form.isometry.prod QuadraticForm.IsometryEquiv.prod @[simps!] def Isometry.inl (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : Q₁ β†’qα΅’ (Q₁.prod Qβ‚‚) where toLinearMap := LinearMap.inl R _ _ map_app' m₁ := by simp @[simps!] def Isometry.inr (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : Qβ‚‚ β†’qα΅’ (Q₁.prod Qβ‚‚) where toLinearMap := LinearMap.inr R _ _ map_app' m₁ := by simp variable (Mβ‚‚) in @[simps!] def Isometry.fst (Q₁ : QuadraticForm R M₁) : (Q₁.prod (0 : QuadraticForm R Mβ‚‚)) β†’qα΅’ Q₁ where toLinearMap := LinearMap.fst R _ _ map_app' m₁ := by simp variable (M₁) in @[simps!] def Isometry.snd (Qβ‚‚ : QuadraticForm R Mβ‚‚) : ((0 : QuadraticForm R M₁).prod Qβ‚‚) β†’qα΅’ Qβ‚‚ where toLinearMap := LinearMap.snd R _ _ map_app' m₁ := by simp @[simp] lemma Isometry.fst_comp_inl (Q₁ : QuadraticForm R M₁) : (fst Mβ‚‚ Q₁).comp (inl Q₁ (0 : QuadraticForm R Mβ‚‚)) = .id _ := ext fun _ => rfl @[simp] lemma Isometry.snd_comp_inr (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (snd M₁ Qβ‚‚).comp (inr (0 : QuadraticForm R M₁) Qβ‚‚) = .id _ := ext fun _ => rfl @[simp] lemma Isometry.snd_comp_inl (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (snd M₁ Qβ‚‚).comp (inl (0 : QuadraticForm R M₁) Qβ‚‚) = 0 := ext fun _ => rfl @[simp] lemma Isometry.fst_comp_inr (Q₁ : QuadraticForm R M₁) : (fst Mβ‚‚ Q₁).comp (inr Q₁ (0 : QuadraticForm R Mβ‚‚)) = 0 := ext fun _ => rfl theorem Equivalent.prod {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₁' : QuadraticForm R N₁} {Qβ‚‚' : QuadraticForm R Nβ‚‚} (e₁ : Q₁.Equivalent Q₁') (eβ‚‚ : Qβ‚‚.Equivalent Qβ‚‚') : (Q₁.prod Qβ‚‚).Equivalent (Q₁'.prod Qβ‚‚') := Nonempty.map2 IsometryEquiv.prod e₁ eβ‚‚ #align quadratic_form.equivalent.prod QuadraticForm.Equivalent.prod @[simps!] def IsometryEquiv.prodComm (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (Q₁.prod Qβ‚‚).IsometryEquiv (Qβ‚‚.prod Q₁) where toLinearEquiv := LinearEquiv.prodComm _ _ _ map_app' _ := add_comm _ _ @[simps!] def IsometryEquiv.prodProdProdComm (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (Q₃ : QuadraticForm R N₁) (Qβ‚„ : QuadraticForm R Nβ‚‚) : ((Q₁.prod Qβ‚‚).prod (Q₃.prod Qβ‚„)).IsometryEquiv ((Q₁.prod Q₃).prod (Qβ‚‚.prod Qβ‚„)) where toLinearEquiv := LinearEquiv.prodProdProdComm _ _ _ _ _ map_app' _ := add_add_add_comm _ _ _ _
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
137
147
theorem anisotropic_of_prod {R} [OrderedCommRing R] [Module R M₁] [Module R Mβ‚‚] {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} (h : (Q₁.prod Qβ‚‚).Anisotropic) : Q₁.Anisotropic ∧ Qβ‚‚.Anisotropic := by
simp_rw [Anisotropic, prod_apply, Prod.forall, Prod.mk_eq_zero] at h constructor Β· intro x hx refine (h x 0 ?_).1 rw [hx, zero_add, map_zero] Β· intro x hx refine (h 0 x ?_).2 rw [hx, add_zero, map_zero]
8
2,980.957987
2
1.833333
6
1,914
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ΞΉ : Type*} {R : Type*} {M₁ Mβ‚‚ N₁ Nβ‚‚ : Type*} {Mα΅’ Nα΅’ : ΞΉ β†’ Type*} namespace QuadraticForm section Prod section Semiring variable [CommSemiring R] variable [AddCommMonoid M₁] [AddCommMonoid Mβ‚‚] [AddCommMonoid N₁] [AddCommMonoid Nβ‚‚] variable [Module R M₁] [Module R Mβ‚‚] [Module R N₁] [Module R Nβ‚‚] @[simps!] def prod (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : QuadraticForm R (M₁ Γ— Mβ‚‚) := Q₁.comp (LinearMap.fst _ _ _) + Qβ‚‚.comp (LinearMap.snd _ _ _) #align quadratic_form.prod QuadraticForm.prod @[simps toLinearEquiv] def IsometryEquiv.prod {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₁' : QuadraticForm R N₁} {Qβ‚‚' : QuadraticForm R Nβ‚‚} (e₁ : Q₁.IsometryEquiv Q₁') (eβ‚‚ : Qβ‚‚.IsometryEquiv Qβ‚‚') : (Q₁.prod Qβ‚‚).IsometryEquiv (Q₁'.prod Qβ‚‚') where map_app' x := congr_argβ‚‚ (Β· + Β·) (e₁.map_app x.1) (eβ‚‚.map_app x.2) toLinearEquiv := LinearEquiv.prod e₁.toLinearEquiv eβ‚‚.toLinearEquiv #align quadratic_form.isometry.prod QuadraticForm.IsometryEquiv.prod @[simps!] def Isometry.inl (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : Q₁ β†’qα΅’ (Q₁.prod Qβ‚‚) where toLinearMap := LinearMap.inl R _ _ map_app' m₁ := by simp @[simps!] def Isometry.inr (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : Qβ‚‚ β†’qα΅’ (Q₁.prod Qβ‚‚) where toLinearMap := LinearMap.inr R _ _ map_app' m₁ := by simp variable (Mβ‚‚) in @[simps!] def Isometry.fst (Q₁ : QuadraticForm R M₁) : (Q₁.prod (0 : QuadraticForm R Mβ‚‚)) β†’qα΅’ Q₁ where toLinearMap := LinearMap.fst R _ _ map_app' m₁ := by simp variable (M₁) in @[simps!] def Isometry.snd (Qβ‚‚ : QuadraticForm R Mβ‚‚) : ((0 : QuadraticForm R M₁).prod Qβ‚‚) β†’qα΅’ Qβ‚‚ where toLinearMap := LinearMap.snd R _ _ map_app' m₁ := by simp @[simp] lemma Isometry.fst_comp_inl (Q₁ : QuadraticForm R M₁) : (fst Mβ‚‚ Q₁).comp (inl Q₁ (0 : QuadraticForm R Mβ‚‚)) = .id _ := ext fun _ => rfl @[simp] lemma Isometry.snd_comp_inr (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (snd M₁ Qβ‚‚).comp (inr (0 : QuadraticForm R M₁) Qβ‚‚) = .id _ := ext fun _ => rfl @[simp] lemma Isometry.snd_comp_inl (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (snd M₁ Qβ‚‚).comp (inl (0 : QuadraticForm R M₁) Qβ‚‚) = 0 := ext fun _ => rfl @[simp] lemma Isometry.fst_comp_inr (Q₁ : QuadraticForm R M₁) : (fst Mβ‚‚ Q₁).comp (inr Q₁ (0 : QuadraticForm R Mβ‚‚)) = 0 := ext fun _ => rfl theorem Equivalent.prod {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} {Q₁' : QuadraticForm R N₁} {Qβ‚‚' : QuadraticForm R Nβ‚‚} (e₁ : Q₁.Equivalent Q₁') (eβ‚‚ : Qβ‚‚.Equivalent Qβ‚‚') : (Q₁.prod Qβ‚‚).Equivalent (Q₁'.prod Qβ‚‚') := Nonempty.map2 IsometryEquiv.prod e₁ eβ‚‚ #align quadratic_form.equivalent.prod QuadraticForm.Equivalent.prod @[simps!] def IsometryEquiv.prodComm (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) : (Q₁.prod Qβ‚‚).IsometryEquiv (Qβ‚‚.prod Q₁) where toLinearEquiv := LinearEquiv.prodComm _ _ _ map_app' _ := add_comm _ _ @[simps!] def IsometryEquiv.prodProdProdComm (Q₁ : QuadraticForm R M₁) (Qβ‚‚ : QuadraticForm R Mβ‚‚) (Q₃ : QuadraticForm R N₁) (Qβ‚„ : QuadraticForm R Nβ‚‚) : ((Q₁.prod Qβ‚‚).prod (Q₃.prod Qβ‚„)).IsometryEquiv ((Q₁.prod Q₃).prod (Qβ‚‚.prod Qβ‚„)) where toLinearEquiv := LinearEquiv.prodProdProdComm _ _ _ _ _ map_app' _ := add_add_add_comm _ _ _ _ theorem anisotropic_of_prod {R} [OrderedCommRing R] [Module R M₁] [Module R Mβ‚‚] {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} (h : (Q₁.prod Qβ‚‚).Anisotropic) : Q₁.Anisotropic ∧ Qβ‚‚.Anisotropic := by simp_rw [Anisotropic, prod_apply, Prod.forall, Prod.mk_eq_zero] at h constructor Β· intro x hx refine (h x 0 ?_).1 rw [hx, zero_add, map_zero] Β· intro x hx refine (h 0 x ?_).2 rw [hx, add_zero, map_zero] #align quadratic_form.anisotropic_of_prod QuadraticForm.anisotropic_of_prod
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
150
160
theorem nonneg_prod_iff {R} [OrderedCommRing R] [Module R M₁] [Module R Mβ‚‚] {Q₁ : QuadraticForm R M₁} {Qβ‚‚ : QuadraticForm R Mβ‚‚} : (βˆ€ x, 0 ≀ (Q₁.prod Qβ‚‚) x) ↔ (βˆ€ x, 0 ≀ Q₁ x) ∧ βˆ€ x, 0 ≀ Qβ‚‚ x := by
simp_rw [Prod.forall, prod_apply] constructor Β· intro h constructor Β· intro x; simpa only [add_zero, map_zero] using h x 0 Β· intro x; simpa only [zero_add, map_zero] using h 0 x Β· rintro ⟨h₁, hβ‚‚βŸ© x₁ xβ‚‚ exact add_nonneg (h₁ x₁) (hβ‚‚ xβ‚‚)
8
2,980.957987
2
1.833333
6
1,914
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ΞΉ : Type*} {R : Type*} {M₁ Mβ‚‚ N₁ Nβ‚‚ : Type*} {Mα΅’ Nα΅’ : ΞΉ β†’ Type*} namespace QuadraticForm section Prod section Pi section Semiring variable [CommSemiring R] variable [βˆ€ i, AddCommMonoid (Mα΅’ i)] [βˆ€ i, AddCommMonoid (Nα΅’ i)] variable [βˆ€ i, Module R (Mα΅’ i)] [βˆ€ i, Module R (Nα΅’ i)] def pi [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) : QuadraticForm R (βˆ€ i, Mα΅’ i) := βˆ‘ i, (Q i).comp (LinearMap.proj i : _ β†’β‚—[R] Mα΅’ i) #align quadratic_form.pi QuadraticForm.pi @[simp] theorem pi_apply [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (x : βˆ€ i, Mα΅’ i) : pi Q x = βˆ‘ i, Q i (x i) := sum_apply _ _ _ #align quadratic_form.pi_apply QuadraticForm.pi_apply
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
257
261
theorem pi_apply_single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) (m : Mα΅’ i) : pi Q (Pi.single i m) = Q i m := by
rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hj, map_zero]
2
7.389056
1
1.833333
6
1,914
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ΞΉ : Type*} {R : Type*} {M₁ Mβ‚‚ N₁ Nβ‚‚ : Type*} {Mα΅’ Nα΅’ : ΞΉ β†’ Type*} namespace QuadraticForm section Prod section Pi section Semiring variable [CommSemiring R] variable [βˆ€ i, AddCommMonoid (Mα΅’ i)] [βˆ€ i, AddCommMonoid (Nα΅’ i)] variable [βˆ€ i, Module R (Mα΅’ i)] [βˆ€ i, Module R (Nα΅’ i)] def pi [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) : QuadraticForm R (βˆ€ i, Mα΅’ i) := βˆ‘ i, (Q i).comp (LinearMap.proj i : _ β†’β‚—[R] Mα΅’ i) #align quadratic_form.pi QuadraticForm.pi @[simp] theorem pi_apply [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (x : βˆ€ i, Mα΅’ i) : pi Q x = βˆ‘ i, Q i (x i) := sum_apply _ _ _ #align quadratic_form.pi_apply QuadraticForm.pi_apply theorem pi_apply_single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) (m : Mα΅’ i) : pi Q (Pi.single i m) = Q i m := by rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hj, map_zero] @[simps toLinearEquiv] def IsometryEquiv.pi [Fintype ΞΉ] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} {Q' : βˆ€ i, QuadraticForm R (Nα΅’ i)} (e : βˆ€ i, (Q i).IsometryEquiv (Q' i)) : (pi Q).IsometryEquiv (pi Q') where map_app' x := by simp only [pi_apply, LinearEquiv.piCongrRight, LinearEquiv.toFun_eq_coe, IsometryEquiv.coe_toLinearEquiv, IsometryEquiv.map_app] toLinearEquiv := LinearEquiv.piCongrRight fun i => (e i : Mα΅’ i ≃ₗ[R] Nα΅’ i) #align quadratic_form.isometry.pi QuadraticForm.IsometryEquiv.pi @[simps!] def Isometry.single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) : Q i β†’qα΅’ pi Q where toLinearMap := LinearMap.single i map_app' := pi_apply_single _ _ @[simps!] def Isometry.proj [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (Q : QuadraticForm R (Mα΅’ i)) : pi (Pi.single i Q) β†’qα΅’ Q where toLinearMap := LinearMap.proj i map_app' m := by dsimp rw [pi_apply, Fintype.sum_eq_single i (fun j hij => ?_), Pi.single_eq_same] rw [Pi.single_eq_of_ne hij, zero_apply] @[simp, nolint simpNF] -- ignore the bogus "Left-hand side does not simplify" lint error theorem Isometry.proj_comp_single_of_same [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (Q : QuadraticForm R (Mα΅’ i)) : (proj i Q).comp (single _ i) = .ofEq (Pi.single_eq_same _ _) := ext fun _ => Pi.single_eq_same _ _ @[simp] theorem Isometry.proj_comp_single_of_ne [Fintype ΞΉ] [DecidableEq ΞΉ] {i j : ΞΉ} (h : i β‰  j) (Q : QuadraticForm R (Mα΅’ i)) : (proj i Q).comp (single _ j) = (0 : 0 β†’qα΅’ Q).comp (ofEq (Pi.single_eq_of_ne h.symm _)) := ext fun _ => Pi.single_eq_of_ne h _ theorem Equivalent.pi [Fintype ΞΉ] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} {Q' : βˆ€ i, QuadraticForm R (Nα΅’ i)} (e : βˆ€ i, (Q i).Equivalent (Q' i)) : (pi Q).Equivalent (pi Q') := ⟨IsometryEquiv.pi fun i => Classical.choice (e i)⟩ #align quadratic_form.equivalent.pi QuadraticForm.Equivalent.pi
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
313
325
theorem anisotropic_of_pi [Fintype ΞΉ] {R} [OrderedCommRing R] [βˆ€ i, Module R (Mα΅’ i)] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} (h : (pi Q).Anisotropic) : βˆ€ i, (Q i).Anisotropic := by
simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h intro i x hx classical have := h (Pi.single i x) ?_ i Β· rw [Pi.single_eq_same] at this exact this apply Finset.sum_eq_zero intro j _ by_cases hji : j = i Β· subst hji; rw [Pi.single_eq_same, hx] Β· rw [Pi.single_eq_of_ne hji, map_zero]
11
59,874.141715
2
1.833333
6
1,914
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ΞΉ : Type*} {R : Type*} {M₁ Mβ‚‚ N₁ Nβ‚‚ : Type*} {Mα΅’ Nα΅’ : ΞΉ β†’ Type*} namespace QuadraticForm section Prod section Pi section Semiring variable [CommSemiring R] variable [βˆ€ i, AddCommMonoid (Mα΅’ i)] [βˆ€ i, AddCommMonoid (Nα΅’ i)] variable [βˆ€ i, Module R (Mα΅’ i)] [βˆ€ i, Module R (Nα΅’ i)] def pi [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) : QuadraticForm R (βˆ€ i, Mα΅’ i) := βˆ‘ i, (Q i).comp (LinearMap.proj i : _ β†’β‚—[R] Mα΅’ i) #align quadratic_form.pi QuadraticForm.pi @[simp] theorem pi_apply [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (x : βˆ€ i, Mα΅’ i) : pi Q x = βˆ‘ i, Q i (x i) := sum_apply _ _ _ #align quadratic_form.pi_apply QuadraticForm.pi_apply theorem pi_apply_single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) (m : Mα΅’ i) : pi Q (Pi.single i m) = Q i m := by rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hj, map_zero] @[simps toLinearEquiv] def IsometryEquiv.pi [Fintype ΞΉ] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} {Q' : βˆ€ i, QuadraticForm R (Nα΅’ i)} (e : βˆ€ i, (Q i).IsometryEquiv (Q' i)) : (pi Q).IsometryEquiv (pi Q') where map_app' x := by simp only [pi_apply, LinearEquiv.piCongrRight, LinearEquiv.toFun_eq_coe, IsometryEquiv.coe_toLinearEquiv, IsometryEquiv.map_app] toLinearEquiv := LinearEquiv.piCongrRight fun i => (e i : Mα΅’ i ≃ₗ[R] Nα΅’ i) #align quadratic_form.isometry.pi QuadraticForm.IsometryEquiv.pi @[simps!] def Isometry.single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) : Q i β†’qα΅’ pi Q where toLinearMap := LinearMap.single i map_app' := pi_apply_single _ _ @[simps!] def Isometry.proj [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (Q : QuadraticForm R (Mα΅’ i)) : pi (Pi.single i Q) β†’qα΅’ Q where toLinearMap := LinearMap.proj i map_app' m := by dsimp rw [pi_apply, Fintype.sum_eq_single i (fun j hij => ?_), Pi.single_eq_same] rw [Pi.single_eq_of_ne hij, zero_apply] @[simp, nolint simpNF] -- ignore the bogus "Left-hand side does not simplify" lint error theorem Isometry.proj_comp_single_of_same [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (Q : QuadraticForm R (Mα΅’ i)) : (proj i Q).comp (single _ i) = .ofEq (Pi.single_eq_same _ _) := ext fun _ => Pi.single_eq_same _ _ @[simp] theorem Isometry.proj_comp_single_of_ne [Fintype ΞΉ] [DecidableEq ΞΉ] {i j : ΞΉ} (h : i β‰  j) (Q : QuadraticForm R (Mα΅’ i)) : (proj i Q).comp (single _ j) = (0 : 0 β†’qα΅’ Q).comp (ofEq (Pi.single_eq_of_ne h.symm _)) := ext fun _ => Pi.single_eq_of_ne h _ theorem Equivalent.pi [Fintype ΞΉ] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} {Q' : βˆ€ i, QuadraticForm R (Nα΅’ i)} (e : βˆ€ i, (Q i).Equivalent (Q' i)) : (pi Q).Equivalent (pi Q') := ⟨IsometryEquiv.pi fun i => Classical.choice (e i)⟩ #align quadratic_form.equivalent.pi QuadraticForm.Equivalent.pi theorem anisotropic_of_pi [Fintype ΞΉ] {R} [OrderedCommRing R] [βˆ€ i, Module R (Mα΅’ i)] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} (h : (pi Q).Anisotropic) : βˆ€ i, (Q i).Anisotropic := by simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h intro i x hx classical have := h (Pi.single i x) ?_ i Β· rw [Pi.single_eq_same] at this exact this apply Finset.sum_eq_zero intro j _ by_cases hji : j = i Β· subst hji; rw [Pi.single_eq_same, hx] Β· rw [Pi.single_eq_of_ne hji, map_zero] #align quadratic_form.anisotropic_of_pi QuadraticForm.anisotropic_of_pi
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
328
339
theorem nonneg_pi_iff [Fintype ΞΉ] {R} [OrderedCommRing R] [βˆ€ i, Module R (Mα΅’ i)] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} : (βˆ€ x, 0 ≀ pi Q x) ↔ βˆ€ i x, 0 ≀ Q i x := by
simp_rw [pi, sum_apply, comp_apply, LinearMap.proj_apply] constructor -- TODO: does this generalize to a useful lemma independent of `QuadraticForm`? Β· intro h i x classical convert h (Pi.single i x) using 1 rw [Finset.sum_eq_single_of_mem i (Finset.mem_univ _) fun j _ hji => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hji, map_zero] Β· rintro h x exact Finset.sum_nonneg fun i _ => h i (x i)
10
22,026.465795
2
1.833333
6
1,914
import Mathlib.LinearAlgebra.QuadraticForm.IsometryEquiv #align_import linear_algebra.quadratic_form.prod from "leanprover-community/mathlib"@"9b2755b951bc323c962bd072cd447b375cf58101" universe u v w variable {ΞΉ : Type*} {R : Type*} {M₁ Mβ‚‚ N₁ Nβ‚‚ : Type*} {Mα΅’ Nα΅’ : ΞΉ β†’ Type*} namespace QuadraticForm section Prod section Pi section Semiring variable [CommSemiring R] variable [βˆ€ i, AddCommMonoid (Mα΅’ i)] [βˆ€ i, AddCommMonoid (Nα΅’ i)] variable [βˆ€ i, Module R (Mα΅’ i)] [βˆ€ i, Module R (Nα΅’ i)] def pi [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) : QuadraticForm R (βˆ€ i, Mα΅’ i) := βˆ‘ i, (Q i).comp (LinearMap.proj i : _ β†’β‚—[R] Mα΅’ i) #align quadratic_form.pi QuadraticForm.pi @[simp] theorem pi_apply [Fintype ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (x : βˆ€ i, Mα΅’ i) : pi Q x = βˆ‘ i, Q i (x i) := sum_apply _ _ _ #align quadratic_form.pi_apply QuadraticForm.pi_apply theorem pi_apply_single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) (m : Mα΅’ i) : pi Q (Pi.single i m) = Q i m := by rw [pi_apply, Fintype.sum_eq_single i fun j hj => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hj, map_zero] @[simps toLinearEquiv] def IsometryEquiv.pi [Fintype ΞΉ] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} {Q' : βˆ€ i, QuadraticForm R (Nα΅’ i)} (e : βˆ€ i, (Q i).IsometryEquiv (Q' i)) : (pi Q).IsometryEquiv (pi Q') where map_app' x := by simp only [pi_apply, LinearEquiv.piCongrRight, LinearEquiv.toFun_eq_coe, IsometryEquiv.coe_toLinearEquiv, IsometryEquiv.map_app] toLinearEquiv := LinearEquiv.piCongrRight fun i => (e i : Mα΅’ i ≃ₗ[R] Nα΅’ i) #align quadratic_form.isometry.pi QuadraticForm.IsometryEquiv.pi @[simps!] def Isometry.single [Fintype ΞΉ] [DecidableEq ΞΉ] (Q : βˆ€ i, QuadraticForm R (Mα΅’ i)) (i : ΞΉ) : Q i β†’qα΅’ pi Q where toLinearMap := LinearMap.single i map_app' := pi_apply_single _ _ @[simps!] def Isometry.proj [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (Q : QuadraticForm R (Mα΅’ i)) : pi (Pi.single i Q) β†’qα΅’ Q where toLinearMap := LinearMap.proj i map_app' m := by dsimp rw [pi_apply, Fintype.sum_eq_single i (fun j hij => ?_), Pi.single_eq_same] rw [Pi.single_eq_of_ne hij, zero_apply] @[simp, nolint simpNF] -- ignore the bogus "Left-hand side does not simplify" lint error theorem Isometry.proj_comp_single_of_same [Fintype ΞΉ] [DecidableEq ΞΉ] (i : ΞΉ) (Q : QuadraticForm R (Mα΅’ i)) : (proj i Q).comp (single _ i) = .ofEq (Pi.single_eq_same _ _) := ext fun _ => Pi.single_eq_same _ _ @[simp] theorem Isometry.proj_comp_single_of_ne [Fintype ΞΉ] [DecidableEq ΞΉ] {i j : ΞΉ} (h : i β‰  j) (Q : QuadraticForm R (Mα΅’ i)) : (proj i Q).comp (single _ j) = (0 : 0 β†’qα΅’ Q).comp (ofEq (Pi.single_eq_of_ne h.symm _)) := ext fun _ => Pi.single_eq_of_ne h _ theorem Equivalent.pi [Fintype ΞΉ] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} {Q' : βˆ€ i, QuadraticForm R (Nα΅’ i)} (e : βˆ€ i, (Q i).Equivalent (Q' i)) : (pi Q).Equivalent (pi Q') := ⟨IsometryEquiv.pi fun i => Classical.choice (e i)⟩ #align quadratic_form.equivalent.pi QuadraticForm.Equivalent.pi theorem anisotropic_of_pi [Fintype ΞΉ] {R} [OrderedCommRing R] [βˆ€ i, Module R (Mα΅’ i)] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} (h : (pi Q).Anisotropic) : βˆ€ i, (Q i).Anisotropic := by simp_rw [Anisotropic, pi_apply, Function.funext_iff, Pi.zero_apply] at h intro i x hx classical have := h (Pi.single i x) ?_ i Β· rw [Pi.single_eq_same] at this exact this apply Finset.sum_eq_zero intro j _ by_cases hji : j = i Β· subst hji; rw [Pi.single_eq_same, hx] Β· rw [Pi.single_eq_of_ne hji, map_zero] #align quadratic_form.anisotropic_of_pi QuadraticForm.anisotropic_of_pi theorem nonneg_pi_iff [Fintype ΞΉ] {R} [OrderedCommRing R] [βˆ€ i, Module R (Mα΅’ i)] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} : (βˆ€ x, 0 ≀ pi Q x) ↔ βˆ€ i x, 0 ≀ Q i x := by simp_rw [pi, sum_apply, comp_apply, LinearMap.proj_apply] constructor -- TODO: does this generalize to a useful lemma independent of `QuadraticForm`? Β· intro h i x classical convert h (Pi.single i x) using 1 rw [Finset.sum_eq_single_of_mem i (Finset.mem_univ _) fun j _ hji => ?_, Pi.single_eq_same] rw [Pi.single_eq_of_ne hji, map_zero] Β· rintro h x exact Finset.sum_nonneg fun i _ => h i (x i) #align quadratic_form.nonneg_pi_iff QuadraticForm.nonneg_pi_iff
Mathlib/LinearAlgebra/QuadraticForm/Prod.lean
342
353
theorem posDef_pi_iff [Fintype ΞΉ] {R} [OrderedCommRing R] [βˆ€ i, Module R (Mα΅’ i)] {Q : βˆ€ i, QuadraticForm R (Mα΅’ i)} : (pi Q).PosDef ↔ βˆ€ i, (Q i).PosDef := by
simp_rw [posDef_iff_nonneg, nonneg_pi_iff] constructor · rintro ⟨hle, ha⟩ intro i exact ⟨hle i, anisotropic_of_pi ha i⟩ · intro h refine ⟨fun i => (h i).1, fun x hx => funext fun i => (h i).2 _ ?_⟩ rw [pi_apply, Finset.sum_eq_zero_iff_of_nonneg fun j _ => ?_] at hx · exact hx _ (Finset.mem_univ _) exact (h j).1 _
10
22,026.465795
2
1.833333
6
1,914
import Mathlib.Data.Finsupp.Lex import Mathlib.Data.Finsupp.Multiset import Mathlib.Order.GameAdd #align_import logic.hydra from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace Relation open Multiset Prod variable {Ξ± : Type*} def CutExpand (r : Ξ± β†’ Ξ± β†’ Prop) (s' s : Multiset Ξ±) : Prop := βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ s' + {a} = s + t #align relation.cut_expand Relation.CutExpand variable {r : Ξ± β†’ Ξ± β†’ Prop}
Mathlib/Logic/Hydra.lean
62
74
theorem cutExpand_le_invImage_lex [DecidableEq Ξ±] [IsIrrefl Ξ± r] : CutExpand r ≀ InvImage (Finsupp.Lex (rᢜ βŠ“ (Β· β‰  Β·)) (Β· < Β·)) toFinsupp := by
rintro s t ⟨u, a, hr, he⟩ replace hr := fun a' ↦ mt (hr a') classical refine ⟨a, fun b h ↦ ?_, ?_⟩ <;> simp_rw [toFinsupp_apply] Β· apply_fun count b at he simpa only [count_add, count_singleton, if_neg h.2, add_zero, count_eq_zero.2 (hr b h.1)] using he Β· apply_fun count a at he simp only [count_add, count_singleton_self, count_eq_zero.2 (hr _ (irrefl_of r a)), add_zero] at he exact he β–Έ Nat.lt_succ_self _
11
59,874.141715
2
1.833333
6
1,915
import Mathlib.Data.Finsupp.Lex import Mathlib.Data.Finsupp.Multiset import Mathlib.Order.GameAdd #align_import logic.hydra from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace Relation open Multiset Prod variable {Ξ± : Type*} def CutExpand (r : Ξ± β†’ Ξ± β†’ Prop) (s' s : Multiset Ξ±) : Prop := βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ s' + {a} = s + t #align relation.cut_expand Relation.CutExpand variable {r : Ξ± β†’ Ξ± β†’ Prop} theorem cutExpand_le_invImage_lex [DecidableEq Ξ±] [IsIrrefl Ξ± r] : CutExpand r ≀ InvImage (Finsupp.Lex (rᢜ βŠ“ (Β· β‰  Β·)) (Β· < Β·)) toFinsupp := by rintro s t ⟨u, a, hr, he⟩ replace hr := fun a' ↦ mt (hr a') classical refine ⟨a, fun b h ↦ ?_, ?_⟩ <;> simp_rw [toFinsupp_apply] Β· apply_fun count b at he simpa only [count_add, count_singleton, if_neg h.2, add_zero, count_eq_zero.2 (hr b h.1)] using he Β· apply_fun count a at he simp only [count_add, count_singleton_self, count_eq_zero.2 (hr _ (irrefl_of r a)), add_zero] at he exact he β–Έ Nat.lt_succ_self _ #align relation.cut_expand_le_inv_image_lex Relation.cutExpand_le_invImage_lex theorem cutExpand_singleton {s x} (h : βˆ€ x' ∈ s, r x' x) : CutExpand r s {x} := ⟨s, x, h, add_comm s _⟩ #align relation.cut_expand_singleton Relation.cutExpand_singleton theorem cutExpand_singleton_singleton {x' x} (h : r x' x) : CutExpand r {x'} {x} := cutExpand_singleton fun a h ↦ by rwa [mem_singleton.1 h] #align relation.cut_expand_singleton_singleton Relation.cutExpand_singleton_singleton theorem cutExpand_add_left {t u} (s) : CutExpand r (s + t) (s + u) ↔ CutExpand r t u := existsβ‚‚_congr fun _ _ ↦ and_congr Iff.rfl <| by rw [add_assoc, add_assoc, add_left_cancel_iff] #align relation.cut_expand_add_left Relation.cutExpand_add_left
Mathlib/Logic/Hydra.lean
89
98
theorem cutExpand_iff [DecidableEq Ξ±] [IsIrrefl Ξ± r] {s' s : Multiset Ξ±} : CutExpand r s' s ↔ βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t := by
simp_rw [CutExpand, add_singleton_eq_iff] refine existsβ‚‚_congr fun t a ↦ ⟨?_, ?_⟩ Β· rintro ⟨ht, ha, rfl⟩ obtain h | h := mem_add.1 ha exacts [⟨ht, h, erase_add_left_pos t h⟩, (@irrefl Ξ± r _ a (ht a h)).elim] Β· rintro ⟨ht, h, rfl⟩ exact ⟨ht, mem_add.2 (Or.inl h), (erase_add_left_pos t h).symm⟩
7
1,096.633158
2
1.833333
6
1,915
import Mathlib.Data.Finsupp.Lex import Mathlib.Data.Finsupp.Multiset import Mathlib.Order.GameAdd #align_import logic.hydra from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace Relation open Multiset Prod variable {Ξ± : Type*} def CutExpand (r : Ξ± β†’ Ξ± β†’ Prop) (s' s : Multiset Ξ±) : Prop := βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ s' + {a} = s + t #align relation.cut_expand Relation.CutExpand variable {r : Ξ± β†’ Ξ± β†’ Prop} theorem cutExpand_le_invImage_lex [DecidableEq Ξ±] [IsIrrefl Ξ± r] : CutExpand r ≀ InvImage (Finsupp.Lex (rᢜ βŠ“ (Β· β‰  Β·)) (Β· < Β·)) toFinsupp := by rintro s t ⟨u, a, hr, he⟩ replace hr := fun a' ↦ mt (hr a') classical refine ⟨a, fun b h ↦ ?_, ?_⟩ <;> simp_rw [toFinsupp_apply] Β· apply_fun count b at he simpa only [count_add, count_singleton, if_neg h.2, add_zero, count_eq_zero.2 (hr b h.1)] using he Β· apply_fun count a at he simp only [count_add, count_singleton_self, count_eq_zero.2 (hr _ (irrefl_of r a)), add_zero] at he exact he β–Έ Nat.lt_succ_self _ #align relation.cut_expand_le_inv_image_lex Relation.cutExpand_le_invImage_lex theorem cutExpand_singleton {s x} (h : βˆ€ x' ∈ s, r x' x) : CutExpand r s {x} := ⟨s, x, h, add_comm s _⟩ #align relation.cut_expand_singleton Relation.cutExpand_singleton theorem cutExpand_singleton_singleton {x' x} (h : r x' x) : CutExpand r {x'} {x} := cutExpand_singleton fun a h ↦ by rwa [mem_singleton.1 h] #align relation.cut_expand_singleton_singleton Relation.cutExpand_singleton_singleton theorem cutExpand_add_left {t u} (s) : CutExpand r (s + t) (s + u) ↔ CutExpand r t u := existsβ‚‚_congr fun _ _ ↦ and_congr Iff.rfl <| by rw [add_assoc, add_assoc, add_left_cancel_iff] #align relation.cut_expand_add_left Relation.cutExpand_add_left theorem cutExpand_iff [DecidableEq Ξ±] [IsIrrefl Ξ± r] {s' s : Multiset Ξ±} : CutExpand r s' s ↔ βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t := by simp_rw [CutExpand, add_singleton_eq_iff] refine existsβ‚‚_congr fun t a ↦ ⟨?_, ?_⟩ Β· rintro ⟨ht, ha, rfl⟩ obtain h | h := mem_add.1 ha exacts [⟨ht, h, erase_add_left_pos t h⟩, (@irrefl Ξ± r _ a (ht a h)).elim] Β· rintro ⟨ht, h, rfl⟩ exact ⟨ht, mem_add.2 (Or.inl h), (erase_add_left_pos t h).symm⟩ #align relation.cut_expand_iff Relation.cutExpand_iff
Mathlib/Logic/Hydra.lean
101
104
theorem not_cutExpand_zero [IsIrrefl Ξ± r] (s) : Β¬CutExpand r s 0 := by
classical rw [cutExpand_iff] rintro ⟨_, _, _, ⟨⟩, _⟩
3
20.085537
1
1.833333
6
1,915
import Mathlib.Data.Finsupp.Lex import Mathlib.Data.Finsupp.Multiset import Mathlib.Order.GameAdd #align_import logic.hydra from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace Relation open Multiset Prod variable {Ξ± : Type*} def CutExpand (r : Ξ± β†’ Ξ± β†’ Prop) (s' s : Multiset Ξ±) : Prop := βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ s' + {a} = s + t #align relation.cut_expand Relation.CutExpand variable {r : Ξ± β†’ Ξ± β†’ Prop} theorem cutExpand_le_invImage_lex [DecidableEq Ξ±] [IsIrrefl Ξ± r] : CutExpand r ≀ InvImage (Finsupp.Lex (rᢜ βŠ“ (Β· β‰  Β·)) (Β· < Β·)) toFinsupp := by rintro s t ⟨u, a, hr, he⟩ replace hr := fun a' ↦ mt (hr a') classical refine ⟨a, fun b h ↦ ?_, ?_⟩ <;> simp_rw [toFinsupp_apply] Β· apply_fun count b at he simpa only [count_add, count_singleton, if_neg h.2, add_zero, count_eq_zero.2 (hr b h.1)] using he Β· apply_fun count a at he simp only [count_add, count_singleton_self, count_eq_zero.2 (hr _ (irrefl_of r a)), add_zero] at he exact he β–Έ Nat.lt_succ_self _ #align relation.cut_expand_le_inv_image_lex Relation.cutExpand_le_invImage_lex theorem cutExpand_singleton {s x} (h : βˆ€ x' ∈ s, r x' x) : CutExpand r s {x} := ⟨s, x, h, add_comm s _⟩ #align relation.cut_expand_singleton Relation.cutExpand_singleton theorem cutExpand_singleton_singleton {x' x} (h : r x' x) : CutExpand r {x'} {x} := cutExpand_singleton fun a h ↦ by rwa [mem_singleton.1 h] #align relation.cut_expand_singleton_singleton Relation.cutExpand_singleton_singleton theorem cutExpand_add_left {t u} (s) : CutExpand r (s + t) (s + u) ↔ CutExpand r t u := existsβ‚‚_congr fun _ _ ↦ and_congr Iff.rfl <| by rw [add_assoc, add_assoc, add_left_cancel_iff] #align relation.cut_expand_add_left Relation.cutExpand_add_left theorem cutExpand_iff [DecidableEq Ξ±] [IsIrrefl Ξ± r] {s' s : Multiset Ξ±} : CutExpand r s' s ↔ βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t := by simp_rw [CutExpand, add_singleton_eq_iff] refine existsβ‚‚_congr fun t a ↦ ⟨?_, ?_⟩ Β· rintro ⟨ht, ha, rfl⟩ obtain h | h := mem_add.1 ha exacts [⟨ht, h, erase_add_left_pos t h⟩, (@irrefl Ξ± r _ a (ht a h)).elim] Β· rintro ⟨ht, h, rfl⟩ exact ⟨ht, mem_add.2 (Or.inl h), (erase_add_left_pos t h).symm⟩ #align relation.cut_expand_iff Relation.cutExpand_iff theorem not_cutExpand_zero [IsIrrefl Ξ± r] (s) : Β¬CutExpand r s 0 := by classical rw [cutExpand_iff] rintro ⟨_, _, _, ⟨⟩, _⟩ #align relation.not_cut_expand_zero Relation.not_cutExpand_zero
Mathlib/Logic/Hydra.lean
109
121
theorem cutExpand_fibration (r : Ξ± β†’ Ξ± β†’ Prop) : Fibration (GameAdd (CutExpand r) (CutExpand r)) (CutExpand r) fun s ↦ s.1 + s.2 := by
rintro ⟨s₁, sβ‚‚βŸ© s ⟨t, a, hr, he⟩; dsimp at he ⊒ classical obtain ⟨ha, rfl⟩ := add_singleton_eq_iff.1 he rw [add_assoc, mem_add] at ha obtain h | h := ha Β· refine ⟨(s₁.erase a + t, sβ‚‚), GameAdd.fst ⟨t, a, hr, ?_⟩, ?_⟩ Β· rw [add_comm, ← add_assoc, singleton_add, cons_erase h] Β· rw [add_assoc s₁, erase_add_left_pos _ h, add_right_comm, add_assoc] Β· refine ⟨(s₁, (sβ‚‚ + t).erase a), GameAdd.snd ⟨t, a, hr, ?_⟩, ?_⟩ Β· rw [add_comm, singleton_add, cons_erase h] Β· rw [add_assoc, erase_add_right_pos _ h]
11
59,874.141715
2
1.833333
6
1,915
import Mathlib.Data.Finsupp.Lex import Mathlib.Data.Finsupp.Multiset import Mathlib.Order.GameAdd #align_import logic.hydra from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace Relation open Multiset Prod variable {Ξ± : Type*} def CutExpand (r : Ξ± β†’ Ξ± β†’ Prop) (s' s : Multiset Ξ±) : Prop := βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ s' + {a} = s + t #align relation.cut_expand Relation.CutExpand variable {r : Ξ± β†’ Ξ± β†’ Prop} theorem cutExpand_le_invImage_lex [DecidableEq Ξ±] [IsIrrefl Ξ± r] : CutExpand r ≀ InvImage (Finsupp.Lex (rᢜ βŠ“ (Β· β‰  Β·)) (Β· < Β·)) toFinsupp := by rintro s t ⟨u, a, hr, he⟩ replace hr := fun a' ↦ mt (hr a') classical refine ⟨a, fun b h ↦ ?_, ?_⟩ <;> simp_rw [toFinsupp_apply] Β· apply_fun count b at he simpa only [count_add, count_singleton, if_neg h.2, add_zero, count_eq_zero.2 (hr b h.1)] using he Β· apply_fun count a at he simp only [count_add, count_singleton_self, count_eq_zero.2 (hr _ (irrefl_of r a)), add_zero] at he exact he β–Έ Nat.lt_succ_self _ #align relation.cut_expand_le_inv_image_lex Relation.cutExpand_le_invImage_lex theorem cutExpand_singleton {s x} (h : βˆ€ x' ∈ s, r x' x) : CutExpand r s {x} := ⟨s, x, h, add_comm s _⟩ #align relation.cut_expand_singleton Relation.cutExpand_singleton theorem cutExpand_singleton_singleton {x' x} (h : r x' x) : CutExpand r {x'} {x} := cutExpand_singleton fun a h ↦ by rwa [mem_singleton.1 h] #align relation.cut_expand_singleton_singleton Relation.cutExpand_singleton_singleton theorem cutExpand_add_left {t u} (s) : CutExpand r (s + t) (s + u) ↔ CutExpand r t u := existsβ‚‚_congr fun _ _ ↦ and_congr Iff.rfl <| by rw [add_assoc, add_assoc, add_left_cancel_iff] #align relation.cut_expand_add_left Relation.cutExpand_add_left theorem cutExpand_iff [DecidableEq Ξ±] [IsIrrefl Ξ± r] {s' s : Multiset Ξ±} : CutExpand r s' s ↔ βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t := by simp_rw [CutExpand, add_singleton_eq_iff] refine existsβ‚‚_congr fun t a ↦ ⟨?_, ?_⟩ Β· rintro ⟨ht, ha, rfl⟩ obtain h | h := mem_add.1 ha exacts [⟨ht, h, erase_add_left_pos t h⟩, (@irrefl Ξ± r _ a (ht a h)).elim] Β· rintro ⟨ht, h, rfl⟩ exact ⟨ht, mem_add.2 (Or.inl h), (erase_add_left_pos t h).symm⟩ #align relation.cut_expand_iff Relation.cutExpand_iff theorem not_cutExpand_zero [IsIrrefl Ξ± r] (s) : Β¬CutExpand r s 0 := by classical rw [cutExpand_iff] rintro ⟨_, _, _, ⟨⟩, _⟩ #align relation.not_cut_expand_zero Relation.not_cutExpand_zero theorem cutExpand_fibration (r : Ξ± β†’ Ξ± β†’ Prop) : Fibration (GameAdd (CutExpand r) (CutExpand r)) (CutExpand r) fun s ↦ s.1 + s.2 := by rintro ⟨s₁, sβ‚‚βŸ© s ⟨t, a, hr, he⟩; dsimp at he ⊒ classical obtain ⟨ha, rfl⟩ := add_singleton_eq_iff.1 he rw [add_assoc, mem_add] at ha obtain h | h := ha Β· refine ⟨(s₁.erase a + t, sβ‚‚), GameAdd.fst ⟨t, a, hr, ?_⟩, ?_⟩ Β· rw [add_comm, ← add_assoc, singleton_add, cons_erase h] Β· rw [add_assoc s₁, erase_add_left_pos _ h, add_right_comm, add_assoc] Β· refine ⟨(s₁, (sβ‚‚ + t).erase a), GameAdd.snd ⟨t, a, hr, ?_⟩, ?_⟩ Β· rw [add_comm, singleton_add, cons_erase h] Β· rw [add_assoc, erase_add_right_pos _ h] #align relation.cut_expand_fibration Relation.cutExpand_fibration
Mathlib/Logic/Hydra.lean
126
133
theorem acc_of_singleton [IsIrrefl Ξ± r] {s : Multiset Ξ±} (hs : βˆ€ a ∈ s, Acc (CutExpand r) {a}) : Acc (CutExpand r) s := by
induction s using Multiset.induction with | empty => exact Acc.intro 0 fun s h ↦ (not_cutExpand_zero s h).elim | cons a s ihs => rw [← s.singleton_add a] rw [forall_mem_cons] at hs exact (hs.1.prod_gameAdd <| ihs fun a ha ↦ hs.2 a ha).of_fibration _ (cutExpand_fibration r)
6
403.428793
2
1.833333
6
1,915
import Mathlib.Data.Finsupp.Lex import Mathlib.Data.Finsupp.Multiset import Mathlib.Order.GameAdd #align_import logic.hydra from "leanprover-community/mathlib"@"48085f140e684306f9e7da907cd5932056d1aded" namespace Relation open Multiset Prod variable {Ξ± : Type*} def CutExpand (r : Ξ± β†’ Ξ± β†’ Prop) (s' s : Multiset Ξ±) : Prop := βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ s' + {a} = s + t #align relation.cut_expand Relation.CutExpand variable {r : Ξ± β†’ Ξ± β†’ Prop} theorem cutExpand_le_invImage_lex [DecidableEq Ξ±] [IsIrrefl Ξ± r] : CutExpand r ≀ InvImage (Finsupp.Lex (rᢜ βŠ“ (Β· β‰  Β·)) (Β· < Β·)) toFinsupp := by rintro s t ⟨u, a, hr, he⟩ replace hr := fun a' ↦ mt (hr a') classical refine ⟨a, fun b h ↦ ?_, ?_⟩ <;> simp_rw [toFinsupp_apply] Β· apply_fun count b at he simpa only [count_add, count_singleton, if_neg h.2, add_zero, count_eq_zero.2 (hr b h.1)] using he Β· apply_fun count a at he simp only [count_add, count_singleton_self, count_eq_zero.2 (hr _ (irrefl_of r a)), add_zero] at he exact he β–Έ Nat.lt_succ_self _ #align relation.cut_expand_le_inv_image_lex Relation.cutExpand_le_invImage_lex theorem cutExpand_singleton {s x} (h : βˆ€ x' ∈ s, r x' x) : CutExpand r s {x} := ⟨s, x, h, add_comm s _⟩ #align relation.cut_expand_singleton Relation.cutExpand_singleton theorem cutExpand_singleton_singleton {x' x} (h : r x' x) : CutExpand r {x'} {x} := cutExpand_singleton fun a h ↦ by rwa [mem_singleton.1 h] #align relation.cut_expand_singleton_singleton Relation.cutExpand_singleton_singleton theorem cutExpand_add_left {t u} (s) : CutExpand r (s + t) (s + u) ↔ CutExpand r t u := existsβ‚‚_congr fun _ _ ↦ and_congr Iff.rfl <| by rw [add_assoc, add_assoc, add_left_cancel_iff] #align relation.cut_expand_add_left Relation.cutExpand_add_left theorem cutExpand_iff [DecidableEq Ξ±] [IsIrrefl Ξ± r] {s' s : Multiset Ξ±} : CutExpand r s' s ↔ βˆƒ (t : Multiset Ξ±) (a : Ξ±), (βˆ€ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t := by simp_rw [CutExpand, add_singleton_eq_iff] refine existsβ‚‚_congr fun t a ↦ ⟨?_, ?_⟩ Β· rintro ⟨ht, ha, rfl⟩ obtain h | h := mem_add.1 ha exacts [⟨ht, h, erase_add_left_pos t h⟩, (@irrefl Ξ± r _ a (ht a h)).elim] Β· rintro ⟨ht, h, rfl⟩ exact ⟨ht, mem_add.2 (Or.inl h), (erase_add_left_pos t h).symm⟩ #align relation.cut_expand_iff Relation.cutExpand_iff theorem not_cutExpand_zero [IsIrrefl Ξ± r] (s) : Β¬CutExpand r s 0 := by classical rw [cutExpand_iff] rintro ⟨_, _, _, ⟨⟩, _⟩ #align relation.not_cut_expand_zero Relation.not_cutExpand_zero theorem cutExpand_fibration (r : Ξ± β†’ Ξ± β†’ Prop) : Fibration (GameAdd (CutExpand r) (CutExpand r)) (CutExpand r) fun s ↦ s.1 + s.2 := by rintro ⟨s₁, sβ‚‚βŸ© s ⟨t, a, hr, he⟩; dsimp at he ⊒ classical obtain ⟨ha, rfl⟩ := add_singleton_eq_iff.1 he rw [add_assoc, mem_add] at ha obtain h | h := ha Β· refine ⟨(s₁.erase a + t, sβ‚‚), GameAdd.fst ⟨t, a, hr, ?_⟩, ?_⟩ Β· rw [add_comm, ← add_assoc, singleton_add, cons_erase h] Β· rw [add_assoc s₁, erase_add_left_pos _ h, add_right_comm, add_assoc] Β· refine ⟨(s₁, (sβ‚‚ + t).erase a), GameAdd.snd ⟨t, a, hr, ?_⟩, ?_⟩ Β· rw [add_comm, singleton_add, cons_erase h] Β· rw [add_assoc, erase_add_right_pos _ h] #align relation.cut_expand_fibration Relation.cutExpand_fibration theorem acc_of_singleton [IsIrrefl Ξ± r] {s : Multiset Ξ±} (hs : βˆ€ a ∈ s, Acc (CutExpand r) {a}) : Acc (CutExpand r) s := by induction s using Multiset.induction with | empty => exact Acc.intro 0 fun s h ↦ (not_cutExpand_zero s h).elim | cons a s ihs => rw [← s.singleton_add a] rw [forall_mem_cons] at hs exact (hs.1.prod_gameAdd <| ihs fun a ha ↦ hs.2 a ha).of_fibration _ (cutExpand_fibration r) #align relation.acc_of_singleton Relation.acc_of_singleton
Mathlib/Logic/Hydra.lean
138
146
theorem _root_.Acc.cutExpand [IsIrrefl Ξ± r] {a : Ξ±} (hacc : Acc r a) : Acc (CutExpand r) {a} := by
induction' hacc with a h ih refine Acc.intro _ fun s ↦ ?_ classical simp only [cutExpand_iff, mem_singleton] rintro ⟨t, a, hr, rfl, rfl⟩ refine acc_of_singleton fun a' ↦ ?_ rw [erase_singleton, zero_add] exact ih a' ∘ hr a'
8
2,980.957987
2
1.833333
6
1,915
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section RingHoms variable (p) (r : β„š) def modPart : β„€ := r.num * gcdA r.den p % p #align padic_int.mod_part PadicInt.modPart variable {p}
Mathlib/NumberTheory/Padics/RingHoms.lean
72
75
theorem modPart_lt_p : modPart p r < p := by
convert Int.emod_lt _ _ Β· simp Β· exact mod_cast hp_prime.1.ne_zero
3
20.085537
1
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section RingHoms variable (p) (r : β„š) def modPart : β„€ := r.num * gcdA r.den p % p #align padic_int.mod_part PadicInt.modPart variable {p} theorem modPart_lt_p : modPart p r < p := by convert Int.emod_lt _ _ Β· simp Β· exact mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_lt_p PadicInt.modPart_lt_p theorem modPart_nonneg : 0 ≀ modPart p r := Int.emod_nonneg _ <| mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_nonneg PadicInt.modPart_nonneg
Mathlib/NumberTheory/Padics/RingHoms.lean
82
101
theorem isUnit_den (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : IsUnit (r.den : β„€_[p]) := by
rw [isUnit_iff] apply le_antisymm (r.den : β„€_[p]).2 rw [← not_lt, coe_natCast] intro norm_denom_lt have hr : β€–(r * r.den : β„š_[p])β€– = β€–(r.num : β„š_[p])β€– := by congr rw_mod_cast [@Rat.mul_den_eq_num r] rw [padicNormE.mul] at hr have key : β€–(r.num : β„š_[p])β€– < 1 := by calc _ = _ := hr.symm _ < 1 * 1 := mul_lt_mul' h norm_denom_lt (norm_nonneg _) zero_lt_one _ = 1 := mul_one 1 have : ↑p ∣ r.num ∧ (p : β„€) ∣ r.den := by simp only [← norm_int_lt_one_iff_dvd, ← padic_norm_e_of_padicInt] exact ⟨key, norm_denom_lt⟩ apply hp_prime.1.not_dvd_one rwa [← r.reduced.gcd_eq_one, Nat.dvd_gcd_iff, ← Int.natCast_dvd, ← Int.natCast_dvd_natCast]
18
65,659,969.137331
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section RingHoms variable (p) (r : β„š) def modPart : β„€ := r.num * gcdA r.den p % p #align padic_int.mod_part PadicInt.modPart variable {p} theorem modPart_lt_p : modPart p r < p := by convert Int.emod_lt _ _ Β· simp Β· exact mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_lt_p PadicInt.modPart_lt_p theorem modPart_nonneg : 0 ≀ modPart p r := Int.emod_nonneg _ <| mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_nonneg PadicInt.modPart_nonneg theorem isUnit_den (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : IsUnit (r.den : β„€_[p]) := by rw [isUnit_iff] apply le_antisymm (r.den : β„€_[p]).2 rw [← not_lt, coe_natCast] intro norm_denom_lt have hr : β€–(r * r.den : β„š_[p])β€– = β€–(r.num : β„š_[p])β€– := by congr rw_mod_cast [@Rat.mul_den_eq_num r] rw [padicNormE.mul] at hr have key : β€–(r.num : β„š_[p])β€– < 1 := by calc _ = _ := hr.symm _ < 1 * 1 := mul_lt_mul' h norm_denom_lt (norm_nonneg _) zero_lt_one _ = 1 := mul_one 1 have : ↑p ∣ r.num ∧ (p : β„€) ∣ r.den := by simp only [← norm_int_lt_one_iff_dvd, ← padic_norm_e_of_padicInt] exact ⟨key, norm_denom_lt⟩ apply hp_prime.1.not_dvd_one rwa [← r.reduced.gcd_eq_one, Nat.dvd_gcd_iff, ← Int.natCast_dvd, ← Int.natCast_dvd_natCast] #align padic_int.is_unit_denom PadicInt.isUnit_den
Mathlib/NumberTheory/Padics/RingHoms.lean
104
121
theorem norm_sub_modPart_aux (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : ↑p ∣ r.num - r.num * r.den.gcdA p % p * ↑r.den := by
rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] simp only [Int.cast_natCast, ZMod.natCast_mod, Int.cast_mul, Int.cast_sub] have := congr_arg (fun x => x % p : β„€ β†’ ZMod p) (gcd_eq_gcd_ab r.den p) simp only [Int.cast_natCast, CharP.cast_eq_zero, EuclideanDomain.mod_zero, Int.cast_add, Int.cast_mul, zero_mul, add_zero] at this push_cast rw [mul_right_comm, mul_assoc, ← this] suffices rdcp : r.den.Coprime p by rw [rdcp.gcd_eq_one] simp only [mul_one, cast_one, sub_self] apply Coprime.symm apply (coprime_or_dvd_of_prime hp_prime.1 _).resolve_right rw [← Int.natCast_dvd_natCast, ← norm_int_lt_one_iff_dvd, not_lt] apply ge_of_eq rw [← isUnit_iff] exact isUnit_den r h
16
8,886,110.520508
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section RingHoms variable (p) (r : β„š) def modPart : β„€ := r.num * gcdA r.den p % p #align padic_int.mod_part PadicInt.modPart variable {p} theorem modPart_lt_p : modPart p r < p := by convert Int.emod_lt _ _ Β· simp Β· exact mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_lt_p PadicInt.modPart_lt_p theorem modPart_nonneg : 0 ≀ modPart p r := Int.emod_nonneg _ <| mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_nonneg PadicInt.modPart_nonneg theorem isUnit_den (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : IsUnit (r.den : β„€_[p]) := by rw [isUnit_iff] apply le_antisymm (r.den : β„€_[p]).2 rw [← not_lt, coe_natCast] intro norm_denom_lt have hr : β€–(r * r.den : β„š_[p])β€– = β€–(r.num : β„š_[p])β€– := by congr rw_mod_cast [@Rat.mul_den_eq_num r] rw [padicNormE.mul] at hr have key : β€–(r.num : β„š_[p])β€– < 1 := by calc _ = _ := hr.symm _ < 1 * 1 := mul_lt_mul' h norm_denom_lt (norm_nonneg _) zero_lt_one _ = 1 := mul_one 1 have : ↑p ∣ r.num ∧ (p : β„€) ∣ r.den := by simp only [← norm_int_lt_one_iff_dvd, ← padic_norm_e_of_padicInt] exact ⟨key, norm_denom_lt⟩ apply hp_prime.1.not_dvd_one rwa [← r.reduced.gcd_eq_one, Nat.dvd_gcd_iff, ← Int.natCast_dvd, ← Int.natCast_dvd_natCast] #align padic_int.is_unit_denom PadicInt.isUnit_den theorem norm_sub_modPart_aux (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : ↑p ∣ r.num - r.num * r.den.gcdA p % p * ↑r.den := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] simp only [Int.cast_natCast, ZMod.natCast_mod, Int.cast_mul, Int.cast_sub] have := congr_arg (fun x => x % p : β„€ β†’ ZMod p) (gcd_eq_gcd_ab r.den p) simp only [Int.cast_natCast, CharP.cast_eq_zero, EuclideanDomain.mod_zero, Int.cast_add, Int.cast_mul, zero_mul, add_zero] at this push_cast rw [mul_right_comm, mul_assoc, ← this] suffices rdcp : r.den.Coprime p by rw [rdcp.gcd_eq_one] simp only [mul_one, cast_one, sub_self] apply Coprime.symm apply (coprime_or_dvd_of_prime hp_prime.1 _).resolve_right rw [← Int.natCast_dvd_natCast, ← norm_int_lt_one_iff_dvd, not_lt] apply ge_of_eq rw [← isUnit_iff] exact isUnit_den r h #align padic_int.norm_sub_mod_part_aux PadicInt.norm_sub_modPart_aux
Mathlib/NumberTheory/Padics/RingHoms.lean
124
134
theorem norm_sub_modPart (h : β€–(r : β„š_[p])β€– ≀ 1) : β€–(⟨r, h⟩ - modPart p r : β„€_[p])β€– < 1 := by
let n := modPart p r rw [norm_lt_one_iff_dvd, ← (isUnit_den r h).dvd_mul_right] suffices ↑p ∣ r.num - n * r.den by convert (Int.castRingHom β„€_[p]).map_dvd this simp only [sub_mul, Int.cast_natCast, eq_intCast, Int.cast_mul, sub_left_inj, Int.cast_sub] apply Subtype.coe_injective simp only [coe_mul, Subtype.coe_mk, coe_natCast] rw_mod_cast [@Rat.mul_den_eq_num r] rfl exact norm_sub_modPart_aux r h
10
22,026.465795
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section RingHoms variable (p) (r : β„š) def modPart : β„€ := r.num * gcdA r.den p % p #align padic_int.mod_part PadicInt.modPart variable {p} theorem modPart_lt_p : modPart p r < p := by convert Int.emod_lt _ _ Β· simp Β· exact mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_lt_p PadicInt.modPart_lt_p theorem modPart_nonneg : 0 ≀ modPart p r := Int.emod_nonneg _ <| mod_cast hp_prime.1.ne_zero #align padic_int.mod_part_nonneg PadicInt.modPart_nonneg theorem isUnit_den (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : IsUnit (r.den : β„€_[p]) := by rw [isUnit_iff] apply le_antisymm (r.den : β„€_[p]).2 rw [← not_lt, coe_natCast] intro norm_denom_lt have hr : β€–(r * r.den : β„š_[p])β€– = β€–(r.num : β„š_[p])β€– := by congr rw_mod_cast [@Rat.mul_den_eq_num r] rw [padicNormE.mul] at hr have key : β€–(r.num : β„š_[p])β€– < 1 := by calc _ = _ := hr.symm _ < 1 * 1 := mul_lt_mul' h norm_denom_lt (norm_nonneg _) zero_lt_one _ = 1 := mul_one 1 have : ↑p ∣ r.num ∧ (p : β„€) ∣ r.den := by simp only [← norm_int_lt_one_iff_dvd, ← padic_norm_e_of_padicInt] exact ⟨key, norm_denom_lt⟩ apply hp_prime.1.not_dvd_one rwa [← r.reduced.gcd_eq_one, Nat.dvd_gcd_iff, ← Int.natCast_dvd, ← Int.natCast_dvd_natCast] #align padic_int.is_unit_denom PadicInt.isUnit_den theorem norm_sub_modPart_aux (r : β„š) (h : β€–(r : β„š_[p])β€– ≀ 1) : ↑p ∣ r.num - r.num * r.den.gcdA p % p * ↑r.den := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] simp only [Int.cast_natCast, ZMod.natCast_mod, Int.cast_mul, Int.cast_sub] have := congr_arg (fun x => x % p : β„€ β†’ ZMod p) (gcd_eq_gcd_ab r.den p) simp only [Int.cast_natCast, CharP.cast_eq_zero, EuclideanDomain.mod_zero, Int.cast_add, Int.cast_mul, zero_mul, add_zero] at this push_cast rw [mul_right_comm, mul_assoc, ← this] suffices rdcp : r.den.Coprime p by rw [rdcp.gcd_eq_one] simp only [mul_one, cast_one, sub_self] apply Coprime.symm apply (coprime_or_dvd_of_prime hp_prime.1 _).resolve_right rw [← Int.natCast_dvd_natCast, ← norm_int_lt_one_iff_dvd, not_lt] apply ge_of_eq rw [← isUnit_iff] exact isUnit_den r h #align padic_int.norm_sub_mod_part_aux PadicInt.norm_sub_modPart_aux theorem norm_sub_modPart (h : β€–(r : β„š_[p])β€– ≀ 1) : β€–(⟨r, h⟩ - modPart p r : β„€_[p])β€– < 1 := by let n := modPart p r rw [norm_lt_one_iff_dvd, ← (isUnit_den r h).dvd_mul_right] suffices ↑p ∣ r.num - n * r.den by convert (Int.castRingHom β„€_[p]).map_dvd this simp only [sub_mul, Int.cast_natCast, eq_intCast, Int.cast_mul, sub_left_inj, Int.cast_sub] apply Subtype.coe_injective simp only [coe_mul, Subtype.coe_mk, coe_natCast] rw_mod_cast [@Rat.mul_den_eq_num r] rfl exact norm_sub_modPart_aux r h #align padic_int.norm_sub_mod_part PadicInt.norm_sub_modPart theorem exists_mem_range_of_norm_rat_le_one (h : β€–(r : β„š_[p])β€– ≀ 1) : βˆƒ n : β„€, 0 ≀ n ∧ n < p ∧ β€–(⟨r, h⟩ - n : β„€_[p])β€– < 1 := ⟨modPart p r, modPart_nonneg _, modPart_lt_p _, norm_sub_modPart _ h⟩ #align padic_int.exists_mem_range_of_norm_rat_le_one PadicInt.exists_mem_range_of_norm_rat_le_one
Mathlib/NumberTheory/Padics/RingHoms.lean
142
150
theorem zmod_congr_of_sub_mem_span_aux (n : β„•) (x : β„€_[p]) (a b : β„€) (ha : x - a ∈ (Ideal.span {(p : β„€_[p]) ^ n})) (hb : x - b ∈ (Ideal.span {(p : β„€_[p]) ^ n})) : (a : ZMod (p ^ n)) = b := by
rw [Ideal.mem_span_singleton] at ha hb rw [← sub_eq_zero, ← Int.cast_sub, ZMod.intCast_zmod_eq_zero_iff_dvd, Int.natCast_pow] rw [← dvd_neg, neg_sub] at ha have := dvd_add ha hb rwa [sub_eq_add_neg, sub_eq_add_neg, add_assoc, neg_add_cancel_left, ← sub_eq_add_neg, ← Int.cast_sub, pow_p_dvd_int_iff] at this
6
403.428793
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp]
Mathlib/NumberTheory/Padics/RingHoms.lean
498
500
theorem nthHom_zero : nthHom f 0 = 0 := by
simp (config := { unfoldPartialApp := true }) [nthHom] rfl
2
7.389056
1
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp] theorem nthHom_zero : nthHom f 0 = 0 := by simp (config := { unfoldPartialApp := true }) [nthHom] rfl #align padic_int.nth_hom_zero PadicInt.nthHom_zero variable {f}
Mathlib/NumberTheory/Padics/RingHoms.lean
505
511
theorem pow_dvd_nthHom_sub (r : R) (i j : β„•) (h : i ≀ j) : (p : β„€) ^ i ∣ nthHom f r j - nthHom f r i := by
specialize f_compat i j h rw [← Int.natCast_pow, ← ZMod.intCast_zmod_eq_zero_iff_dvd, Int.cast_sub] dsimp [nthHom] rw [← f_compat, RingHom.comp_apply] simp only [ZMod.cast_id, ZMod.castHom_apply, sub_self, ZMod.natCast_val, ZMod.intCast_cast]
5
148.413159
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp] theorem nthHom_zero : nthHom f 0 = 0 := by simp (config := { unfoldPartialApp := true }) [nthHom] rfl #align padic_int.nth_hom_zero PadicInt.nthHom_zero variable {f} theorem pow_dvd_nthHom_sub (r : R) (i j : β„•) (h : i ≀ j) : (p : β„€) ^ i ∣ nthHom f r j - nthHom f r i := by specialize f_compat i j h rw [← Int.natCast_pow, ← ZMod.intCast_zmod_eq_zero_iff_dvd, Int.cast_sub] dsimp [nthHom] rw [← f_compat, RingHom.comp_apply] simp only [ZMod.cast_id, ZMod.castHom_apply, sub_self, ZMod.natCast_val, ZMod.intCast_cast] #align padic_int.pow_dvd_nth_hom_sub PadicInt.pow_dvd_nthHom_sub
Mathlib/NumberTheory/Padics/RingHoms.lean
514
525
theorem isCauSeq_nthHom (r : R) : IsCauSeq (padicNorm p) fun n => nthHom f r n := by
intro Ξ΅ hΞ΅ obtain ⟨k, hk⟩ : βˆƒ k : β„•, (p : β„š) ^ (-((k : β„•) : β„€)) < Ξ΅ := exists_pow_neg_lt_rat p hΞ΅ use k intro j hj refine lt_of_le_of_lt ?_ hk -- Need to do beta reduction first, as `norm_cast` doesn't. -- Added to adapt to leanprover/lean4#2734. beta_reduce norm_cast rw [← padicNorm.dvd_iff_norm_le] exact mod_cast pow_dvd_nthHom_sub f_compat r k j hj
11
59,874.141715
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp] theorem nthHom_zero : nthHom f 0 = 0 := by simp (config := { unfoldPartialApp := true }) [nthHom] rfl #align padic_int.nth_hom_zero PadicInt.nthHom_zero variable {f} theorem pow_dvd_nthHom_sub (r : R) (i j : β„•) (h : i ≀ j) : (p : β„€) ^ i ∣ nthHom f r j - nthHom f r i := by specialize f_compat i j h rw [← Int.natCast_pow, ← ZMod.intCast_zmod_eq_zero_iff_dvd, Int.cast_sub] dsimp [nthHom] rw [← f_compat, RingHom.comp_apply] simp only [ZMod.cast_id, ZMod.castHom_apply, sub_self, ZMod.natCast_val, ZMod.intCast_cast] #align padic_int.pow_dvd_nth_hom_sub PadicInt.pow_dvd_nthHom_sub theorem isCauSeq_nthHom (r : R) : IsCauSeq (padicNorm p) fun n => nthHom f r n := by intro Ξ΅ hΞ΅ obtain ⟨k, hk⟩ : βˆƒ k : β„•, (p : β„š) ^ (-((k : β„•) : β„€)) < Ξ΅ := exists_pow_neg_lt_rat p hΞ΅ use k intro j hj refine lt_of_le_of_lt ?_ hk -- Need to do beta reduction first, as `norm_cast` doesn't. -- Added to adapt to leanprover/lean4#2734. beta_reduce norm_cast rw [← padicNorm.dvd_iff_norm_le] exact mod_cast pow_dvd_nthHom_sub f_compat r k j hj #align padic_int.is_cau_seq_nth_hom PadicInt.isCauSeq_nthHom def nthHomSeq (r : R) : PadicSeq p := ⟨fun n => nthHom f r n, isCauSeq_nthHom f_compat r⟩ #align padic_int.nth_hom_seq PadicInt.nthHomSeq -- this lemma ran into issues after changing to `NeZero` and I'm not sure why.
Mathlib/NumberTheory/Padics/RingHoms.lean
537
544
theorem nthHomSeq_one : nthHomSeq f_compat 1 β‰ˆ 1 := by
intro Ξ΅ hΞ΅ change _ < _ at hΞ΅ use 1 intro j hj haveI : Fact (1 < p ^ j) := ⟨Nat.one_lt_pow (by omega) hp_prime.1.one_lt⟩ suffices (ZMod.cast (1 : ZMod (p ^ j)) : β„š) = 1 by simp [nthHomSeq, nthHom, this, hΞ΅] rw [ZMod.cast_eq_val, ZMod.val_one, Nat.cast_one]
7
1,096.633158
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp] theorem nthHom_zero : nthHom f 0 = 0 := by simp (config := { unfoldPartialApp := true }) [nthHom] rfl #align padic_int.nth_hom_zero PadicInt.nthHom_zero variable {f} theorem pow_dvd_nthHom_sub (r : R) (i j : β„•) (h : i ≀ j) : (p : β„€) ^ i ∣ nthHom f r j - nthHom f r i := by specialize f_compat i j h rw [← Int.natCast_pow, ← ZMod.intCast_zmod_eq_zero_iff_dvd, Int.cast_sub] dsimp [nthHom] rw [← f_compat, RingHom.comp_apply] simp only [ZMod.cast_id, ZMod.castHom_apply, sub_self, ZMod.natCast_val, ZMod.intCast_cast] #align padic_int.pow_dvd_nth_hom_sub PadicInt.pow_dvd_nthHom_sub theorem isCauSeq_nthHom (r : R) : IsCauSeq (padicNorm p) fun n => nthHom f r n := by intro Ξ΅ hΞ΅ obtain ⟨k, hk⟩ : βˆƒ k : β„•, (p : β„š) ^ (-((k : β„•) : β„€)) < Ξ΅ := exists_pow_neg_lt_rat p hΞ΅ use k intro j hj refine lt_of_le_of_lt ?_ hk -- Need to do beta reduction first, as `norm_cast` doesn't. -- Added to adapt to leanprover/lean4#2734. beta_reduce norm_cast rw [← padicNorm.dvd_iff_norm_le] exact mod_cast pow_dvd_nthHom_sub f_compat r k j hj #align padic_int.is_cau_seq_nth_hom PadicInt.isCauSeq_nthHom def nthHomSeq (r : R) : PadicSeq p := ⟨fun n => nthHom f r n, isCauSeq_nthHom f_compat r⟩ #align padic_int.nth_hom_seq PadicInt.nthHomSeq -- this lemma ran into issues after changing to `NeZero` and I'm not sure why. theorem nthHomSeq_one : nthHomSeq f_compat 1 β‰ˆ 1 := by intro Ξ΅ hΞ΅ change _ < _ at hΞ΅ use 1 intro j hj haveI : Fact (1 < p ^ j) := ⟨Nat.one_lt_pow (by omega) hp_prime.1.one_lt⟩ suffices (ZMod.cast (1 : ZMod (p ^ j)) : β„š) = 1 by simp [nthHomSeq, nthHom, this, hΞ΅] rw [ZMod.cast_eq_val, ZMod.val_one, Nat.cast_one] #align padic_int.nth_hom_seq_one PadicInt.nthHomSeq_one
Mathlib/NumberTheory/Padics/RingHoms.lean
547
560
theorem nthHomSeq_add (r s : R) : nthHomSeq f_compat (r + s) β‰ˆ nthHomSeq f_compat r + nthHomSeq f_compat s := by
intro Ξ΅ hΞ΅ obtain ⟨n, hn⟩ := exists_pow_neg_lt_rat p hΞ΅ use n intro j hj dsimp [nthHomSeq] apply lt_of_le_of_lt _ hn rw [← Int.cast_add, ← Int.cast_sub, ← padicNorm.dvd_iff_norm_le, ← ZMod.intCast_zmod_eq_zero_iff_dvd] dsimp [nthHom] simp only [ZMod.natCast_val, RingHom.map_add, Int.cast_sub, ZMod.intCast_cast, Int.cast_add] rw [ZMod.cast_add (show p ^ n ∣ p ^ j from pow_dvd_pow _ hj)] simp only [cast_add, ZMod.natCast_val, Int.cast_add, ZMod.intCast_cast, sub_self]
12
162,754.791419
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp] theorem nthHom_zero : nthHom f 0 = 0 := by simp (config := { unfoldPartialApp := true }) [nthHom] rfl #align padic_int.nth_hom_zero PadicInt.nthHom_zero variable {f} theorem pow_dvd_nthHom_sub (r : R) (i j : β„•) (h : i ≀ j) : (p : β„€) ^ i ∣ nthHom f r j - nthHom f r i := by specialize f_compat i j h rw [← Int.natCast_pow, ← ZMod.intCast_zmod_eq_zero_iff_dvd, Int.cast_sub] dsimp [nthHom] rw [← f_compat, RingHom.comp_apply] simp only [ZMod.cast_id, ZMod.castHom_apply, sub_self, ZMod.natCast_val, ZMod.intCast_cast] #align padic_int.pow_dvd_nth_hom_sub PadicInt.pow_dvd_nthHom_sub theorem isCauSeq_nthHom (r : R) : IsCauSeq (padicNorm p) fun n => nthHom f r n := by intro Ξ΅ hΞ΅ obtain ⟨k, hk⟩ : βˆƒ k : β„•, (p : β„š) ^ (-((k : β„•) : β„€)) < Ξ΅ := exists_pow_neg_lt_rat p hΞ΅ use k intro j hj refine lt_of_le_of_lt ?_ hk -- Need to do beta reduction first, as `norm_cast` doesn't. -- Added to adapt to leanprover/lean4#2734. beta_reduce norm_cast rw [← padicNorm.dvd_iff_norm_le] exact mod_cast pow_dvd_nthHom_sub f_compat r k j hj #align padic_int.is_cau_seq_nth_hom PadicInt.isCauSeq_nthHom def nthHomSeq (r : R) : PadicSeq p := ⟨fun n => nthHom f r n, isCauSeq_nthHom f_compat r⟩ #align padic_int.nth_hom_seq PadicInt.nthHomSeq -- this lemma ran into issues after changing to `NeZero` and I'm not sure why. theorem nthHomSeq_one : nthHomSeq f_compat 1 β‰ˆ 1 := by intro Ξ΅ hΞ΅ change _ < _ at hΞ΅ use 1 intro j hj haveI : Fact (1 < p ^ j) := ⟨Nat.one_lt_pow (by omega) hp_prime.1.one_lt⟩ suffices (ZMod.cast (1 : ZMod (p ^ j)) : β„š) = 1 by simp [nthHomSeq, nthHom, this, hΞ΅] rw [ZMod.cast_eq_val, ZMod.val_one, Nat.cast_one] #align padic_int.nth_hom_seq_one PadicInt.nthHomSeq_one theorem nthHomSeq_add (r s : R) : nthHomSeq f_compat (r + s) β‰ˆ nthHomSeq f_compat r + nthHomSeq f_compat s := by intro Ξ΅ hΞ΅ obtain ⟨n, hn⟩ := exists_pow_neg_lt_rat p hΞ΅ use n intro j hj dsimp [nthHomSeq] apply lt_of_le_of_lt _ hn rw [← Int.cast_add, ← Int.cast_sub, ← padicNorm.dvd_iff_norm_le, ← ZMod.intCast_zmod_eq_zero_iff_dvd] dsimp [nthHom] simp only [ZMod.natCast_val, RingHom.map_add, Int.cast_sub, ZMod.intCast_cast, Int.cast_add] rw [ZMod.cast_add (show p ^ n ∣ p ^ j from pow_dvd_pow _ hj)] simp only [cast_add, ZMod.natCast_val, Int.cast_add, ZMod.intCast_cast, sub_self] #align padic_int.nth_hom_seq_add PadicInt.nthHomSeq_add
Mathlib/NumberTheory/Padics/RingHoms.lean
563
575
theorem nthHomSeq_mul (r s : R) : nthHomSeq f_compat (r * s) β‰ˆ nthHomSeq f_compat r * nthHomSeq f_compat s := by
intro Ξ΅ hΞ΅ obtain ⟨n, hn⟩ := exists_pow_neg_lt_rat p hΞ΅ use n intro j hj dsimp [nthHomSeq] apply lt_of_le_of_lt _ hn rw [← Int.cast_mul, ← Int.cast_sub, ← padicNorm.dvd_iff_norm_le, ← ZMod.intCast_zmod_eq_zero_iff_dvd] dsimp [nthHom] simp only [ZMod.natCast_val, RingHom.map_mul, Int.cast_sub, ZMod.intCast_cast, Int.cast_mul] rw [ZMod.cast_mul (show p ^ n ∣ p ^ j from pow_dvd_pow _ hj), sub_self]
11
59,874.141715
2
1.833333
12
1,916
import Mathlib.NumberTheory.Padics.PadicIntegers import Mathlib.RingTheory.ZMod #align_import number_theory.padics.ring_homs from "leanprover-community/mathlib"@"565eb991e264d0db702722b4bde52ee5173c9950" noncomputable section open scoped Classical open Nat LocalRing Padic namespace PadicInt variable {p : β„•} [hp_prime : Fact p.Prime] section lift open CauSeq PadicSeq variable {R : Type*} [NonAssocSemiring R] (f : βˆ€ k : β„•, R β†’+* ZMod (p ^ k)) (f_compat : βˆ€ (k1 k2) (hk : k1 ≀ k2), (ZMod.castHom (pow_dvd_pow p hk) _).comp (f k2) = f k1) def nthHom (r : R) : β„• β†’ β„€ := fun n => (f n r : ZMod (p ^ n)).val #align padic_int.nth_hom PadicInt.nthHom @[simp] theorem nthHom_zero : nthHom f 0 = 0 := by simp (config := { unfoldPartialApp := true }) [nthHom] rfl #align padic_int.nth_hom_zero PadicInt.nthHom_zero variable {f} theorem pow_dvd_nthHom_sub (r : R) (i j : β„•) (h : i ≀ j) : (p : β„€) ^ i ∣ nthHom f r j - nthHom f r i := by specialize f_compat i j h rw [← Int.natCast_pow, ← ZMod.intCast_zmod_eq_zero_iff_dvd, Int.cast_sub] dsimp [nthHom] rw [← f_compat, RingHom.comp_apply] simp only [ZMod.cast_id, ZMod.castHom_apply, sub_self, ZMod.natCast_val, ZMod.intCast_cast] #align padic_int.pow_dvd_nth_hom_sub PadicInt.pow_dvd_nthHom_sub theorem isCauSeq_nthHom (r : R) : IsCauSeq (padicNorm p) fun n => nthHom f r n := by intro Ξ΅ hΞ΅ obtain ⟨k, hk⟩ : βˆƒ k : β„•, (p : β„š) ^ (-((k : β„•) : β„€)) < Ξ΅ := exists_pow_neg_lt_rat p hΞ΅ use k intro j hj refine lt_of_le_of_lt ?_ hk -- Need to do beta reduction first, as `norm_cast` doesn't. -- Added to adapt to leanprover/lean4#2734. beta_reduce norm_cast rw [← padicNorm.dvd_iff_norm_le] exact mod_cast pow_dvd_nthHom_sub f_compat r k j hj #align padic_int.is_cau_seq_nth_hom PadicInt.isCauSeq_nthHom def nthHomSeq (r : R) : PadicSeq p := ⟨fun n => nthHom f r n, isCauSeq_nthHom f_compat r⟩ #align padic_int.nth_hom_seq PadicInt.nthHomSeq -- this lemma ran into issues after changing to `NeZero` and I'm not sure why. theorem nthHomSeq_one : nthHomSeq f_compat 1 β‰ˆ 1 := by intro Ξ΅ hΞ΅ change _ < _ at hΞ΅ use 1 intro j hj haveI : Fact (1 < p ^ j) := ⟨Nat.one_lt_pow (by omega) hp_prime.1.one_lt⟩ suffices (ZMod.cast (1 : ZMod (p ^ j)) : β„š) = 1 by simp [nthHomSeq, nthHom, this, hΞ΅] rw [ZMod.cast_eq_val, ZMod.val_one, Nat.cast_one] #align padic_int.nth_hom_seq_one PadicInt.nthHomSeq_one theorem nthHomSeq_add (r s : R) : nthHomSeq f_compat (r + s) β‰ˆ nthHomSeq f_compat r + nthHomSeq f_compat s := by intro Ξ΅ hΞ΅ obtain ⟨n, hn⟩ := exists_pow_neg_lt_rat p hΞ΅ use n intro j hj dsimp [nthHomSeq] apply lt_of_le_of_lt _ hn rw [← Int.cast_add, ← Int.cast_sub, ← padicNorm.dvd_iff_norm_le, ← ZMod.intCast_zmod_eq_zero_iff_dvd] dsimp [nthHom] simp only [ZMod.natCast_val, RingHom.map_add, Int.cast_sub, ZMod.intCast_cast, Int.cast_add] rw [ZMod.cast_add (show p ^ n ∣ p ^ j from pow_dvd_pow _ hj)] simp only [cast_add, ZMod.natCast_val, Int.cast_add, ZMod.intCast_cast, sub_self] #align padic_int.nth_hom_seq_add PadicInt.nthHomSeq_add theorem nthHomSeq_mul (r s : R) : nthHomSeq f_compat (r * s) β‰ˆ nthHomSeq f_compat r * nthHomSeq f_compat s := by intro Ξ΅ hΞ΅ obtain ⟨n, hn⟩ := exists_pow_neg_lt_rat p hΞ΅ use n intro j hj dsimp [nthHomSeq] apply lt_of_le_of_lt _ hn rw [← Int.cast_mul, ← Int.cast_sub, ← padicNorm.dvd_iff_norm_le, ← ZMod.intCast_zmod_eq_zero_iff_dvd] dsimp [nthHom] simp only [ZMod.natCast_val, RingHom.map_mul, Int.cast_sub, ZMod.intCast_cast, Int.cast_mul] rw [ZMod.cast_mul (show p ^ n ∣ p ^ j from pow_dvd_pow _ hj), sub_self] #align padic_int.nth_hom_seq_mul PadicInt.nthHomSeq_mul def limNthHom (r : R) : β„€_[p] := ofIntSeq (nthHom f r) (isCauSeq_nthHom f_compat r) #align padic_int.lim_nth_hom PadicInt.limNthHom
Mathlib/NumberTheory/Padics/RingHoms.lean
586
597
theorem limNthHom_spec (r : R) : βˆ€ Ξ΅ : ℝ, 0 < Ξ΅ β†’ βˆƒ N : β„•, βˆ€ n β‰₯ N, β€–limNthHom f_compat r - nthHom f r nβ€– < Ξ΅ := by
intro Ξ΅ hΞ΅ obtain ⟨Ρ', hΞ΅'0, hΞ΅'⟩ : βˆƒ v : β„š, (0 : ℝ) < v ∧ ↑v < Ξ΅ := exists_rat_btwn hΞ΅ norm_cast at hΞ΅'0 obtain ⟨N, hN⟩ := padicNormE.defn (nthHomSeq f_compat r) hΞ΅'0 use N intro n hn apply _root_.lt_trans _ hΞ΅' change (padicNormE _ : ℝ) < _ norm_cast exact hN _ hn
10
22,026.465795
2
1.833333
12
1,916
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
42
61
theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by
classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
18
65,659,969.137331
2
1.833333
6
1,917
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_two_iff FiniteField.isSquare_two_iff
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
65
68
theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F (-2) = Ο‡β‚ˆ' (Fintype.card F) := by
rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Ο‡β‚ˆ'_eq_Ο‡β‚„_mul_Ο‡β‚ˆ, quadraticChar_neg_one hF, quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 ∣ 8)]
2
7.389056
1
1.833333
6
1,917
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_two_iff FiniteField.isSquare_two_iff theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F (-2) = Ο‡β‚ˆ' (Fintype.card F) := by rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Ο‡β‚ˆ'_eq_Ο‡β‚„_mul_Ο‡β‚ˆ, quadraticChar_neg_one hF, quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 ∣ 8)] #align quadratic_char_neg_two quadraticChar_neg_two
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
72
91
theorem FiniteField.isSquare_neg_two_iff : IsSquare (-2 : F) ↔ Fintype.card F % 8 β‰  5 ∧ Fintype.card F % 8 β‰  7 := by
classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)), quadraticChar_neg_two hF, Ο‡β‚ˆ'_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!`
18
65,659,969.137331
2
1.833333
6
1,917
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_two_iff FiniteField.isSquare_two_iff theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F (-2) = Ο‡β‚ˆ' (Fintype.card F) := by rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Ο‡β‚ˆ'_eq_Ο‡β‚„_mul_Ο‡β‚ˆ, quadraticChar_neg_one hF, quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 ∣ 8)] #align quadratic_char_neg_two quadraticChar_neg_two theorem FiniteField.isSquare_neg_two_iff : IsSquare (-2 : F) ↔ Fintype.card F % 8 β‰  5 ∧ Fintype.card F % 8 β‰  7 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)), quadraticChar_neg_two hF, Ο‡β‚ˆ'_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_neg_two_iff FiniteField.isSquare_neg_two_iff
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
97
115
theorem quadraticChar_card_card [DecidableEq F] (hF : ringChar F β‰  2) {F' : Type*} [Field F'] [Fintype F'] [DecidableEq F'] (hF' : ringChar F' β‰  2) (h : ringChar F' β‰  ringChar F) : quadraticChar F (Fintype.card F') = quadraticChar F' (quadraticChar F (-1) * Fintype.card F) := by
let Ο‡ := (quadraticChar F).ringHomComp (algebraMap β„€ F') have hχ₁ : Ο‡.IsNontrivial := by obtain ⟨a, ha⟩ := quadraticChar_exists_neg_one hF have hu : IsUnit a := by contrapose ha exact ne_of_eq_of_ne (map_nonunit (quadraticChar F) ha) (mt zero_eq_neg.mp one_ne_zero) use hu.unit simp only [Ο‡, IsUnit.unit_spec, ringHomComp_apply, eq_intCast, Ne, ha] rw [Int.cast_neg, Int.cast_one] exact Ring.neg_one_ne_one_of_char_ne_two hF' have hΟ‡β‚‚ : Ο‡.IsQuadratic := IsQuadratic.comp (quadraticChar_isQuadratic F) _ have h := Char.card_pow_card hχ₁ hΟ‡β‚‚ h hF' rw [← quadraticChar_eq_pow_of_char_ne_two' hF'] at h exact (IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F') (quadraticChar_isQuadratic F) hF' h).symm
15
3,269,017.372472
2
1.833333
6
1,917
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_two_iff FiniteField.isSquare_two_iff theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F (-2) = Ο‡β‚ˆ' (Fintype.card F) := by rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Ο‡β‚ˆ'_eq_Ο‡β‚„_mul_Ο‡β‚ˆ, quadraticChar_neg_one hF, quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 ∣ 8)] #align quadratic_char_neg_two quadraticChar_neg_two theorem FiniteField.isSquare_neg_two_iff : IsSquare (-2 : F) ↔ Fintype.card F % 8 β‰  5 ∧ Fintype.card F % 8 β‰  7 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)), quadraticChar_neg_two hF, Ο‡β‚ˆ'_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_neg_two_iff FiniteField.isSquare_neg_two_iff theorem quadraticChar_card_card [DecidableEq F] (hF : ringChar F β‰  2) {F' : Type*} [Field F'] [Fintype F'] [DecidableEq F'] (hF' : ringChar F' β‰  2) (h : ringChar F' β‰  ringChar F) : quadraticChar F (Fintype.card F') = quadraticChar F' (quadraticChar F (-1) * Fintype.card F) := by let Ο‡ := (quadraticChar F).ringHomComp (algebraMap β„€ F') have hχ₁ : Ο‡.IsNontrivial := by obtain ⟨a, ha⟩ := quadraticChar_exists_neg_one hF have hu : IsUnit a := by contrapose ha exact ne_of_eq_of_ne (map_nonunit (quadraticChar F) ha) (mt zero_eq_neg.mp one_ne_zero) use hu.unit simp only [Ο‡, IsUnit.unit_spec, ringHomComp_apply, eq_intCast, Ne, ha] rw [Int.cast_neg, Int.cast_one] exact Ring.neg_one_ne_one_of_char_ne_two hF' have hΟ‡β‚‚ : Ο‡.IsQuadratic := IsQuadratic.comp (quadraticChar_isQuadratic F) _ have h := Char.card_pow_card hχ₁ hΟ‡β‚‚ h hF' rw [← quadraticChar_eq_pow_of_char_ne_two' hF'] at h exact (IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F') (quadraticChar_isQuadratic F) hF' h).symm #align quadratic_char_card_card quadraticChar_card_card
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
119
125
theorem quadraticChar_odd_prime [DecidableEq F] (hF : ringChar F β‰  2) {p : β„•} [Fact p.Prime] (hp₁ : p β‰  2) (hpβ‚‚ : ringChar F β‰  p) : quadraticChar F p = quadraticChar (ZMod p) (Ο‡β‚„ (Fintype.card F) * Fintype.card F) := by
rw [← quadraticChar_neg_one hF] have h := quadraticChar_card_card hF (ne_of_eq_of_ne (ringChar_zmod_n p) hp₁) (ne_of_eq_of_ne (ringChar_zmod_n p) hpβ‚‚.symm) rwa [card p] at h
4
54.59815
2
1.833333
6
1,917
import Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic import Mathlib.NumberTheory.GaussSum #align_import number_theory.legendre_symbol.quadratic_char.gauss_sum from "leanprover-community/mathlib"@"5b2fe80501ff327b9109fb09b7cc8c325cd0d7d9" section SpecialValues open ZMod MulChar variable {F : Type*} [Field F] [Fintype F] theorem quadraticChar_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F 2 = Ο‡β‚ˆ (Fintype.card F) := IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F) isQuadratic_Ο‡β‚ˆ hF ((quadraticChar_eq_pow_of_char_ne_two' hF 2).trans (FiniteField.two_pow_card hF)) #align quadratic_char_two quadraticChar_two theorem FiniteField.isSquare_two_iff : IsSquare (2 : F) ↔ Fintype.card F % 8 β‰  3 ∧ Fintype.card F % 8 β‰  5 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (Ring.two_ne_zero hF), quadraticChar_two hF, Ο‡β‚ˆ_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_two_iff FiniteField.isSquare_two_iff theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F β‰  2) : quadraticChar F (-2) = Ο‡β‚ˆ' (Fintype.card F) := by rw [(by norm_num : (-2 : F) = -1 * 2), map_mul, Ο‡β‚ˆ'_eq_Ο‡β‚„_mul_Ο‡β‚ˆ, quadraticChar_neg_one hF, quadraticChar_two hF, @cast_natCast _ (ZMod 4) _ _ _ (by decide : 4 ∣ 8)] #align quadratic_char_neg_two quadraticChar_neg_two theorem FiniteField.isSquare_neg_two_iff : IsSquare (-2 : F) ↔ Fintype.card F % 8 β‰  5 ∧ Fintype.card F % 8 β‰  7 := by classical by_cases hF : ringChar F = 2 focus have h := FiniteField.even_card_of_char_two hF simp only [FiniteField.isSquare_of_char_two hF, true_iff_iff] rotate_left focus have h := FiniteField.odd_card_of_char_ne_two hF rw [← quadraticChar_one_iff_isSquare (neg_ne_zero.mpr (Ring.two_ne_zero hF)), quadraticChar_neg_two hF, Ο‡β‚ˆ'_nat_eq_if_mod_eight] simp only [h, Nat.one_ne_zero, if_false, ite_eq_left_iff, Ne, (by decide : (-1 : β„€) β‰  1), imp_false, Classical.not_not] all_goals rw [← Nat.mod_mod_of_dvd _ (by decide : 2 ∣ 8)] at h have h₁ := Nat.mod_lt (Fintype.card F) (by decide : 0 < 8) revert h₁ h generalize Fintype.card F % 8 = n intros; interval_cases n <;> simp_all -- Porting note (#11043): was `decide!` #align finite_field.is_square_neg_two_iff FiniteField.isSquare_neg_two_iff theorem quadraticChar_card_card [DecidableEq F] (hF : ringChar F β‰  2) {F' : Type*} [Field F'] [Fintype F'] [DecidableEq F'] (hF' : ringChar F' β‰  2) (h : ringChar F' β‰  ringChar F) : quadraticChar F (Fintype.card F') = quadraticChar F' (quadraticChar F (-1) * Fintype.card F) := by let Ο‡ := (quadraticChar F).ringHomComp (algebraMap β„€ F') have hχ₁ : Ο‡.IsNontrivial := by obtain ⟨a, ha⟩ := quadraticChar_exists_neg_one hF have hu : IsUnit a := by contrapose ha exact ne_of_eq_of_ne (map_nonunit (quadraticChar F) ha) (mt zero_eq_neg.mp one_ne_zero) use hu.unit simp only [Ο‡, IsUnit.unit_spec, ringHomComp_apply, eq_intCast, Ne, ha] rw [Int.cast_neg, Int.cast_one] exact Ring.neg_one_ne_one_of_char_ne_two hF' have hΟ‡β‚‚ : Ο‡.IsQuadratic := IsQuadratic.comp (quadraticChar_isQuadratic F) _ have h := Char.card_pow_card hχ₁ hΟ‡β‚‚ h hF' rw [← quadraticChar_eq_pow_of_char_ne_two' hF'] at h exact (IsQuadratic.eq_of_eq_coe (quadraticChar_isQuadratic F') (quadraticChar_isQuadratic F) hF' h).symm #align quadratic_char_card_card quadraticChar_card_card theorem quadraticChar_odd_prime [DecidableEq F] (hF : ringChar F β‰  2) {p : β„•} [Fact p.Prime] (hp₁ : p β‰  2) (hpβ‚‚ : ringChar F β‰  p) : quadraticChar F p = quadraticChar (ZMod p) (Ο‡β‚„ (Fintype.card F) * Fintype.card F) := by rw [← quadraticChar_neg_one hF] have h := quadraticChar_card_card hF (ne_of_eq_of_ne (ringChar_zmod_n p) hp₁) (ne_of_eq_of_ne (ringChar_zmod_n p) hpβ‚‚.symm) rwa [card p] at h #align quadratic_char_odd_prime quadraticChar_odd_prime
Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/GaussSum.lean
130
143
theorem FiniteField.isSquare_odd_prime_iff (hF : ringChar F β‰  2) {p : β„•} [Fact p.Prime] (hp : p β‰  2) : IsSquare (p : F) ↔ quadraticChar (ZMod p) (Ο‡β‚„ (Fintype.card F) * Fintype.card F) β‰  -1 := by
classical by_cases hFp : ringChar F = p Β· rw [show (p : F) = 0 by rw [← hFp]; exact ringChar.Nat.cast_ringChar] simp only [isSquare_zero, Ne, true_iff_iff, map_mul] obtain ⟨n, _, hc⟩ := FiniteField.card F (ringChar F) have hchar : ringChar F = ringChar (ZMod p) := by rw [hFp]; exact (ringChar_zmod_n p).symm conv => enter [1, 1, 2]; rw [hc, Nat.cast_pow, map_pow, hchar, map_ringChar] simp only [zero_pow n.ne_zero, mul_zero, zero_eq_neg, one_ne_zero, not_false_iff] Β· rw [← Iff.not_left (@quadraticChar_neg_one_iff_not_isSquare F _ _ _ _), quadraticChar_odd_prime hF hp] exact hFp
11
59,874.141715
2
1.833333
6
1,917
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory section SameSpace variable {Ξ± E : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E] {ΞΌ : Measure Ξ±} {f : Ξ± β†’ E}
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
26
45
theorem snorm'_le_snorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≀ q) (hf : AEStronglyMeasurable f ΞΌ) : snorm' f p ΞΌ ≀ snorm' f q ΞΌ * ΞΌ Set.univ ^ (1 / p - 1 / q) := by
have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hpq_eq : p = q Β· rw [hpq_eq, sub_self, ENNReal.rpow_zero, mul_one] have hpq : p < q := lt_of_le_of_ne hpq hpq_eq let g := fun _ : Ξ± => (1 : ℝβ‰₯0∞) have h_rw : (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ p βˆ‚ΞΌ) = ∫⁻ a, ((β€–f aβ€–β‚Š : ℝβ‰₯0∞) * g a) ^ p βˆ‚ΞΌ := lintegral_congr fun a => by simp [g] repeat' rw [snorm'] rw [h_rw] let r := p * q / (q - p) have hpqr : 1 / p = 1 / q + 1 / r := by field_simp [r, hp0_lt.ne', hq0_lt.ne'] calc (∫⁻ a : Ξ±, (↑‖f aβ€–β‚Š * g a) ^ p βˆ‚ΞΌ) ^ (1 / p) ≀ (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * (∫⁻ a : Ξ±, g a ^ r βˆ‚ΞΌ) ^ (1 / r) := ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr ΞΌ hf.ennnorm aemeasurable_const _ = (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * ΞΌ Set.univ ^ (1 / p - 1 / q) := by rw [hpqr]; simp [r, g]
17
24,154,952.753575
2
1.833333
6
1,918
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory section SameSpace variable {Ξ± E : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E] {ΞΌ : Measure Ξ±} {f : Ξ± β†’ E} theorem snorm'_le_snorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≀ q) (hf : AEStronglyMeasurable f ΞΌ) : snorm' f p ΞΌ ≀ snorm' f q ΞΌ * ΞΌ Set.univ ^ (1 / p - 1 / q) := by have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hpq_eq : p = q Β· rw [hpq_eq, sub_self, ENNReal.rpow_zero, mul_one] have hpq : p < q := lt_of_le_of_ne hpq hpq_eq let g := fun _ : Ξ± => (1 : ℝβ‰₯0∞) have h_rw : (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ p βˆ‚ΞΌ) = ∫⁻ a, ((β€–f aβ€–β‚Š : ℝβ‰₯0∞) * g a) ^ p βˆ‚ΞΌ := lintegral_congr fun a => by simp [g] repeat' rw [snorm'] rw [h_rw] let r := p * q / (q - p) have hpqr : 1 / p = 1 / q + 1 / r := by field_simp [r, hp0_lt.ne', hq0_lt.ne'] calc (∫⁻ a : Ξ±, (↑‖f aβ€–β‚Š * g a) ^ p βˆ‚ΞΌ) ^ (1 / p) ≀ (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * (∫⁻ a : Ξ±, g a ^ r βˆ‚ΞΌ) ^ (1 / r) := ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr ΞΌ hf.ennnorm aemeasurable_const _ = (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * ΞΌ Set.univ ^ (1 / p - 1 / q) := by rw [hpqr]; simp [r, g] #align measure_theory.snorm'_le_snorm'_mul_rpow_measure_univ MeasureTheory.snorm'_le_snorm'_mul_rpow_measure_univ
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
48
58
theorem snorm'_le_snormEssSup_mul_rpow_measure_univ {q : ℝ} (hq_pos : 0 < q) : snorm' f q ΞΌ ≀ snormEssSup f ΞΌ * ΞΌ Set.univ ^ (1 / q) := by
have h_le : (∫⁻ a : Ξ±, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ q βˆ‚ΞΌ) ≀ ∫⁻ _ : Ξ±, snormEssSup f ΞΌ ^ q βˆ‚ΞΌ := by refine lintegral_mono_ae ?_ have h_nnnorm_le_snorm_ess_sup := coe_nnnorm_ae_le_snormEssSup f ΞΌ exact h_nnnorm_le_snorm_ess_sup.mono fun x hx => by gcongr rw [snorm', ← ENNReal.rpow_one (snormEssSup f ΞΌ)] nth_rw 2 [← mul_inv_cancel (ne_of_lt hq_pos).symm] rw [ENNReal.rpow_mul, one_div, ← ENNReal.mul_rpow_of_nonneg _ _ (by simp [hq_pos.le] : 0 ≀ q⁻¹)] gcongr rwa [lintegral_const] at h_le
9
8,103.083928
2
1.833333
6
1,918
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory section SameSpace variable {Ξ± E : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E] {ΞΌ : Measure Ξ±} {f : Ξ± β†’ E} theorem snorm'_le_snorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≀ q) (hf : AEStronglyMeasurable f ΞΌ) : snorm' f p ΞΌ ≀ snorm' f q ΞΌ * ΞΌ Set.univ ^ (1 / p - 1 / q) := by have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hpq_eq : p = q Β· rw [hpq_eq, sub_self, ENNReal.rpow_zero, mul_one] have hpq : p < q := lt_of_le_of_ne hpq hpq_eq let g := fun _ : Ξ± => (1 : ℝβ‰₯0∞) have h_rw : (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ p βˆ‚ΞΌ) = ∫⁻ a, ((β€–f aβ€–β‚Š : ℝβ‰₯0∞) * g a) ^ p βˆ‚ΞΌ := lintegral_congr fun a => by simp [g] repeat' rw [snorm'] rw [h_rw] let r := p * q / (q - p) have hpqr : 1 / p = 1 / q + 1 / r := by field_simp [r, hp0_lt.ne', hq0_lt.ne'] calc (∫⁻ a : Ξ±, (↑‖f aβ€–β‚Š * g a) ^ p βˆ‚ΞΌ) ^ (1 / p) ≀ (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * (∫⁻ a : Ξ±, g a ^ r βˆ‚ΞΌ) ^ (1 / r) := ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr ΞΌ hf.ennnorm aemeasurable_const _ = (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * ΞΌ Set.univ ^ (1 / p - 1 / q) := by rw [hpqr]; simp [r, g] #align measure_theory.snorm'_le_snorm'_mul_rpow_measure_univ MeasureTheory.snorm'_le_snorm'_mul_rpow_measure_univ theorem snorm'_le_snormEssSup_mul_rpow_measure_univ {q : ℝ} (hq_pos : 0 < q) : snorm' f q ΞΌ ≀ snormEssSup f ΞΌ * ΞΌ Set.univ ^ (1 / q) := by have h_le : (∫⁻ a : Ξ±, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ q βˆ‚ΞΌ) ≀ ∫⁻ _ : Ξ±, snormEssSup f ΞΌ ^ q βˆ‚ΞΌ := by refine lintegral_mono_ae ?_ have h_nnnorm_le_snorm_ess_sup := coe_nnnorm_ae_le_snormEssSup f ΞΌ exact h_nnnorm_le_snorm_ess_sup.mono fun x hx => by gcongr rw [snorm', ← ENNReal.rpow_one (snormEssSup f ΞΌ)] nth_rw 2 [← mul_inv_cancel (ne_of_lt hq_pos).symm] rw [ENNReal.rpow_mul, one_div, ← ENNReal.mul_rpow_of_nonneg _ _ (by simp [hq_pos.le] : 0 ≀ q⁻¹)] gcongr rwa [lintegral_const] at h_le #align measure_theory.snorm'_le_snorm_ess_sup_mul_rpow_measure_univ MeasureTheory.snorm'_le_snormEssSup_mul_rpow_measure_univ
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
61
85
theorem snorm_le_snorm_mul_rpow_measure_univ {p q : ℝβ‰₯0∞} (hpq : p ≀ q) (hf : AEStronglyMeasurable f ΞΌ) : snorm f p ΞΌ ≀ snorm f q ΞΌ * ΞΌ Set.univ ^ (1 / p.toReal - 1 / q.toReal) := by
by_cases hp0 : p = 0 Β· simp [hp0, zero_le] rw [← Ne] at hp0 have hp0_lt : 0 < p := lt_of_le_of_ne (zero_le _) hp0.symm have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hq_top : q = ∞ Β· simp only [hq_top, _root_.div_zero, one_div, ENNReal.top_toReal, sub_zero, snorm_exponent_top, GroupWithZero.inv_zero] by_cases hp_top : p = ∞ Β· simp only [hp_top, ENNReal.rpow_zero, mul_one, ENNReal.top_toReal, sub_zero, GroupWithZero.inv_zero, snorm_exponent_top] exact le_rfl rw [snorm_eq_snorm' hp0 hp_top] have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0_lt.ne' hp_top refine (snorm'_le_snormEssSup_mul_rpow_measure_univ hp_pos).trans (le_of_eq ?_) congr exact one_div _ have hp_lt_top : p < ∞ := hpq.trans_lt (lt_top_iff_ne_top.mpr hq_top) have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0_lt.ne' hp_lt_top.ne rw [snorm_eq_snorm' hp0_lt.ne.symm hp_lt_top.ne, snorm_eq_snorm' hq0_lt.ne.symm hq_top] have hpq_real : p.toReal ≀ q.toReal := by rwa [ENNReal.toReal_le_toReal hp_lt_top.ne hq_top] exact snorm'_le_snorm'_mul_rpow_measure_univ hp_pos hpq_real hf
22
3,584,912,846.131591
2
1.833333
6
1,918
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory section SameSpace variable {Ξ± E : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E] {ΞΌ : Measure Ξ±} {f : Ξ± β†’ E} theorem snorm'_le_snorm'_mul_rpow_measure_univ {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≀ q) (hf : AEStronglyMeasurable f ΞΌ) : snorm' f p ΞΌ ≀ snorm' f q ΞΌ * ΞΌ Set.univ ^ (1 / p - 1 / q) := by have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hpq_eq : p = q Β· rw [hpq_eq, sub_self, ENNReal.rpow_zero, mul_one] have hpq : p < q := lt_of_le_of_ne hpq hpq_eq let g := fun _ : Ξ± => (1 : ℝβ‰₯0∞) have h_rw : (∫⁻ a, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ p βˆ‚ΞΌ) = ∫⁻ a, ((β€–f aβ€–β‚Š : ℝβ‰₯0∞) * g a) ^ p βˆ‚ΞΌ := lintegral_congr fun a => by simp [g] repeat' rw [snorm'] rw [h_rw] let r := p * q / (q - p) have hpqr : 1 / p = 1 / q + 1 / r := by field_simp [r, hp0_lt.ne', hq0_lt.ne'] calc (∫⁻ a : Ξ±, (↑‖f aβ€–β‚Š * g a) ^ p βˆ‚ΞΌ) ^ (1 / p) ≀ (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * (∫⁻ a : Ξ±, g a ^ r βˆ‚ΞΌ) ^ (1 / r) := ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr ΞΌ hf.ennnorm aemeasurable_const _ = (∫⁻ a : Ξ±, ↑‖f aβ€–β‚Š ^ q βˆ‚ΞΌ) ^ (1 / q) * ΞΌ Set.univ ^ (1 / p - 1 / q) := by rw [hpqr]; simp [r, g] #align measure_theory.snorm'_le_snorm'_mul_rpow_measure_univ MeasureTheory.snorm'_le_snorm'_mul_rpow_measure_univ theorem snorm'_le_snormEssSup_mul_rpow_measure_univ {q : ℝ} (hq_pos : 0 < q) : snorm' f q ΞΌ ≀ snormEssSup f ΞΌ * ΞΌ Set.univ ^ (1 / q) := by have h_le : (∫⁻ a : Ξ±, (β€–f aβ€–β‚Š : ℝβ‰₯0∞) ^ q βˆ‚ΞΌ) ≀ ∫⁻ _ : Ξ±, snormEssSup f ΞΌ ^ q βˆ‚ΞΌ := by refine lintegral_mono_ae ?_ have h_nnnorm_le_snorm_ess_sup := coe_nnnorm_ae_le_snormEssSup f ΞΌ exact h_nnnorm_le_snorm_ess_sup.mono fun x hx => by gcongr rw [snorm', ← ENNReal.rpow_one (snormEssSup f ΞΌ)] nth_rw 2 [← mul_inv_cancel (ne_of_lt hq_pos).symm] rw [ENNReal.rpow_mul, one_div, ← ENNReal.mul_rpow_of_nonneg _ _ (by simp [hq_pos.le] : 0 ≀ q⁻¹)] gcongr rwa [lintegral_const] at h_le #align measure_theory.snorm'_le_snorm_ess_sup_mul_rpow_measure_univ MeasureTheory.snorm'_le_snormEssSup_mul_rpow_measure_univ theorem snorm_le_snorm_mul_rpow_measure_univ {p q : ℝβ‰₯0∞} (hpq : p ≀ q) (hf : AEStronglyMeasurable f ΞΌ) : snorm f p ΞΌ ≀ snorm f q ΞΌ * ΞΌ Set.univ ^ (1 / p.toReal - 1 / q.toReal) := by by_cases hp0 : p = 0 Β· simp [hp0, zero_le] rw [← Ne] at hp0 have hp0_lt : 0 < p := lt_of_le_of_ne (zero_le _) hp0.symm have hq0_lt : 0 < q := lt_of_lt_of_le hp0_lt hpq by_cases hq_top : q = ∞ Β· simp only [hq_top, _root_.div_zero, one_div, ENNReal.top_toReal, sub_zero, snorm_exponent_top, GroupWithZero.inv_zero] by_cases hp_top : p = ∞ Β· simp only [hp_top, ENNReal.rpow_zero, mul_one, ENNReal.top_toReal, sub_zero, GroupWithZero.inv_zero, snorm_exponent_top] exact le_rfl rw [snorm_eq_snorm' hp0 hp_top] have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0_lt.ne' hp_top refine (snorm'_le_snormEssSup_mul_rpow_measure_univ hp_pos).trans (le_of_eq ?_) congr exact one_div _ have hp_lt_top : p < ∞ := hpq.trans_lt (lt_top_iff_ne_top.mpr hq_top) have hp_pos : 0 < p.toReal := ENNReal.toReal_pos hp0_lt.ne' hp_lt_top.ne rw [snorm_eq_snorm' hp0_lt.ne.symm hp_lt_top.ne, snorm_eq_snorm' hq0_lt.ne.symm hq_top] have hpq_real : p.toReal ≀ q.toReal := by rwa [ENNReal.toReal_le_toReal hp_lt_top.ne hq_top] exact snorm'_le_snorm'_mul_rpow_measure_univ hp_pos hpq_real hf #align measure_theory.snorm_le_snorm_mul_rpow_measure_univ MeasureTheory.snorm_le_snorm_mul_rpow_measure_univ
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
88
92
theorem snorm'_le_snorm'_of_exponent_le {p q : ℝ} (hp0_lt : 0 < p) (hpq : p ≀ q) (ΞΌ : Measure Ξ±) [IsProbabilityMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) : snorm' f p ΞΌ ≀ snorm' f q ΞΌ := by
have h_le_ΞΌ := snorm'_le_snorm'_mul_rpow_measure_univ hp0_lt hpq hf rwa [measure_univ, ENNReal.one_rpow, mul_one] at h_le_ΞΌ
2
7.389056
1
1.833333
6
1,918
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory section Bilinear variable {Ξ± E F G : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] {ΞΌ : Measure Ξ±} {f : Ξ± β†’ E} {g : Ξ± β†’ F}
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
158
196
theorem snorm_le_snorm_top_mul_snorm (p : ℝβ‰₯0∞) (f : Ξ± β†’ E) {g : Ξ± β†’ F} (hg : AEStronglyMeasurable g ΞΌ) (b : E β†’ F β†’ G) (h : βˆ€α΅ x βˆ‚ΞΌ, β€–b (f x) (g x)β€–β‚Š ≀ β€–f xβ€–β‚Š * β€–g xβ€–β‚Š) : snorm (fun x => b (f x) (g x)) p ΞΌ ≀ snorm f ∞ ΞΌ * snorm g p ΞΌ := by
by_cases hp_top : p = ∞ Β· simp_rw [hp_top, snorm_exponent_top] refine le_trans (essSup_mono_ae <| h.mono fun a ha => ?_) (ENNReal.essSup_mul_le _ _) simp_rw [Pi.mul_apply, ← ENNReal.coe_mul, ENNReal.coe_le_coe] exact ha by_cases hp_zero : p = 0 Β· simp only [hp_zero, snorm_exponent_zero, mul_zero, le_zero_iff] simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top, snorm_exponent_top, snormEssSup] calc (∫⁻ x, (β€–b (f x) (g x)β€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) ≀ (∫⁻ x, (β€–f xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal * (β€–g xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by gcongr ?_ ^ _ refine lintegral_mono_ae (h.mono fun a ha => ?_) rw [← ENNReal.mul_rpow_of_nonneg _ _ ENNReal.toReal_nonneg] refine ENNReal.rpow_le_rpow ?_ ENNReal.toReal_nonneg rw [← ENNReal.coe_mul, ENNReal.coe_le_coe] exact ha _ ≀ (∫⁻ x, essSup (fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)) ΞΌ ^ p.toReal * (β€–g xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by gcongr ?_ ^ _ refine lintegral_mono_ae ?_ filter_upwards [@ENNReal.ae_le_essSup _ _ ΞΌ fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)] with x hx gcongr _ = essSup (fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)) ΞΌ * (∫⁻ x, (β€–g xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by rw [lintegral_const_mul''] swap; Β· exact hg.nnnorm.aemeasurable.coe_nnreal_ennreal.pow aemeasurable_const rw [ENNReal.mul_rpow_of_nonneg] swap; Β· rw [one_div_nonneg] exact ENNReal.toReal_nonneg rw [← ENNReal.rpow_mul, one_div, mul_inv_cancel, ENNReal.rpow_one] rw [Ne, ENNReal.toReal_eq_zero_iff, not_or] exact ⟨hp_zero, hp_top⟩
35
1,586,013,452,313,430.8
2
1.833333
6
1,918
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.MeanInequalities #align_import measure_theory.function.lp_seminorm from "leanprover-community/mathlib"@"c4015acc0a223449d44061e27ddac1835a3852b9" open Filter open scoped ENNReal Topology namespace MeasureTheory section Bilinear variable {Ξ± E F G : Type*} {m : MeasurableSpace Ξ±} [NormedAddCommGroup E] [NormedAddCommGroup F] [NormedAddCommGroup G] {ΞΌ : Measure Ξ±} {f : Ξ± β†’ E} {g : Ξ± β†’ F} theorem snorm_le_snorm_top_mul_snorm (p : ℝβ‰₯0∞) (f : Ξ± β†’ E) {g : Ξ± β†’ F} (hg : AEStronglyMeasurable g ΞΌ) (b : E β†’ F β†’ G) (h : βˆ€α΅ x βˆ‚ΞΌ, β€–b (f x) (g x)β€–β‚Š ≀ β€–f xβ€–β‚Š * β€–g xβ€–β‚Š) : snorm (fun x => b (f x) (g x)) p ΞΌ ≀ snorm f ∞ ΞΌ * snorm g p ΞΌ := by by_cases hp_top : p = ∞ Β· simp_rw [hp_top, snorm_exponent_top] refine le_trans (essSup_mono_ae <| h.mono fun a ha => ?_) (ENNReal.essSup_mul_le _ _) simp_rw [Pi.mul_apply, ← ENNReal.coe_mul, ENNReal.coe_le_coe] exact ha by_cases hp_zero : p = 0 Β· simp only [hp_zero, snorm_exponent_zero, mul_zero, le_zero_iff] simp_rw [snorm_eq_lintegral_rpow_nnnorm hp_zero hp_top, snorm_exponent_top, snormEssSup] calc (∫⁻ x, (β€–b (f x) (g x)β€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) ≀ (∫⁻ x, (β€–f xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal * (β€–g xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by gcongr ?_ ^ _ refine lintegral_mono_ae (h.mono fun a ha => ?_) rw [← ENNReal.mul_rpow_of_nonneg _ _ ENNReal.toReal_nonneg] refine ENNReal.rpow_le_rpow ?_ ENNReal.toReal_nonneg rw [← ENNReal.coe_mul, ENNReal.coe_le_coe] exact ha _ ≀ (∫⁻ x, essSup (fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)) ΞΌ ^ p.toReal * (β€–g xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by gcongr ?_ ^ _ refine lintegral_mono_ae ?_ filter_upwards [@ENNReal.ae_le_essSup _ _ ΞΌ fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)] with x hx gcongr _ = essSup (fun x => (β€–f xβ€–β‚Š : ℝβ‰₯0∞)) ΞΌ * (∫⁻ x, (β€–g xβ€–β‚Š : ℝβ‰₯0∞) ^ p.toReal βˆ‚ΞΌ) ^ (1 / p.toReal) := by rw [lintegral_const_mul''] swap; Β· exact hg.nnnorm.aemeasurable.coe_nnreal_ennreal.pow aemeasurable_const rw [ENNReal.mul_rpow_of_nonneg] swap; Β· rw [one_div_nonneg] exact ENNReal.toReal_nonneg rw [← ENNReal.rpow_mul, one_div, mul_inv_cancel, ENNReal.rpow_one] rw [Ne, ENNReal.toReal_eq_zero_iff, not_or] exact ⟨hp_zero, hp_top⟩ #align measure_theory.snorm_le_snorm_top_mul_snorm MeasureTheory.snorm_le_snorm_top_mul_snorm theorem snorm_le_snorm_mul_snorm_top (p : ℝβ‰₯0∞) {f : Ξ± β†’ E} (hf : AEStronglyMeasurable f ΞΌ) (g : Ξ± β†’ F) (b : E β†’ F β†’ G) (h : βˆ€α΅ x βˆ‚ΞΌ, β€–b (f x) (g x)β€–β‚Š ≀ β€–f xβ€–β‚Š * β€–g xβ€–β‚Š) : snorm (fun x => b (f x) (g x)) p ΞΌ ≀ snorm f p ΞΌ * snorm g ∞ ΞΌ := calc snorm (fun x ↦ b (f x) (g x)) p ΞΌ ≀ snorm g ∞ ΞΌ * snorm f p ΞΌ := snorm_le_snorm_top_mul_snorm p g hf (flip b) <| by simpa only [mul_comm] using h _ = snorm f p ΞΌ * snorm g ∞ ΞΌ := mul_comm _ _ #align measure_theory.snorm_le_snorm_mul_snorm_top MeasureTheory.snorm_le_snorm_mul_snorm_top
Mathlib/MeasureTheory/Function/LpSeminorm/CompareExp.lean
208
222
theorem snorm'_le_snorm'_mul_snorm' {p q r : ℝ} (hf : AEStronglyMeasurable f ΞΌ) (hg : AEStronglyMeasurable g ΞΌ) (b : E β†’ F β†’ G) (h : βˆ€α΅ x βˆ‚ΞΌ, β€–b (f x) (g x)β€–β‚Š ≀ β€–f xβ€–β‚Š * β€–g xβ€–β‚Š) (hp0_lt : 0 < p) (hpq : p < q) (hpqr : 1 / p = 1 / q + 1 / r) : snorm' (fun x => b (f x) (g x)) p ΞΌ ≀ snorm' f q ΞΌ * snorm' g r ΞΌ := by
rw [snorm'] calc (∫⁻ a : Ξ±, ↑‖b (f a) (g a)β€–β‚Š ^ p βˆ‚ΞΌ) ^ (1 / p) ≀ (∫⁻ a : Ξ±, ↑(β€–f aβ€–β‚Š * β€–g aβ€–β‚Š) ^ p βˆ‚ΞΌ) ^ (1 / p) := (ENNReal.rpow_le_rpow_iff <| one_div_pos.mpr hp0_lt).mpr <| lintegral_mono_ae <| h.mono fun a ha => (ENNReal.rpow_le_rpow_iff hp0_lt).mpr <| ENNReal.coe_le_coe.mpr <| ha _ ≀ _ := ?_ simp_rw [snorm', ENNReal.coe_mul] exact ENNReal.lintegral_Lp_mul_le_Lq_mul_Lr hp0_lt hpq hpqr ΞΌ hf.ennnorm hg.ennnorm
10
22,026.465795
2
1.833333
6
1,918
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E]
Mathlib/Analysis/Convex/StrictConvexSpace.lean
76
81
theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by
rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _
4
54.59815
2
1.833333
6
1,919
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _ #align strict_convex_closed_ball strictConvex_closedBall variable [NormedSpace ℝ E] theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π•œ ℝ] (h : StrictConvex π•œ (closedBall (0 : E) 1)) : StrictConvexSpace π•œ E := ⟨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul r⟩ #align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball
Mathlib/Analysis/Convex/StrictConvexSpace.lean
95
106
theorem StrictConvexSpace.of_norm_combo_lt_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– < 1) : StrictConvexSpace ℝ E := by
refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex' fun x hx y hy hne => ?_) rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball, mem_sphere_zero_iff_norm] at hx hy rcases h x y hx hy hne with ⟨a, b, hab, hlt⟩ use b rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff, sub_eq_iff_eq_add.2 hab.symm]
9
8,103.083928
2
1.833333
6
1,919
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _ #align strict_convex_closed_ball strictConvex_closedBall variable [NormedSpace ℝ E] theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π•œ ℝ] (h : StrictConvex π•œ (closedBall (0 : E) 1)) : StrictConvexSpace π•œ E := ⟨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul r⟩ #align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball theorem StrictConvexSpace.of_norm_combo_lt_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– < 1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex' fun x hx y hy hne => ?_) rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball, mem_sphere_zero_iff_norm] at hx hy rcases h x y hx hy hne with ⟨a, b, hab, hlt⟩ use b rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff, sub_eq_iff_eq_add.2 hab.symm] #align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one
Mathlib/Analysis/Convex/StrictConvexSpace.lean
109
120
theorem StrictConvexSpace.of_norm_combo_ne_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, 0 ≀ a ∧ 0 ≀ b ∧ a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– β‰  1) : StrictConvexSpace ℝ E := by
refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex ?_) simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise, frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm] intro x hx y hy hne rcases h x y hx hy hne with ⟨a, b, ha, hb, hab, hne'⟩ exact ⟨_, ⟨a, b, ha, hb, hab, rfl⟩, mt mem_sphere_zero_iff_norm.1 hne'⟩
7
1,096.633158
2
1.833333
6
1,919
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _ #align strict_convex_closed_ball strictConvex_closedBall variable [NormedSpace ℝ E] theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π•œ ℝ] (h : StrictConvex π•œ (closedBall (0 : E) 1)) : StrictConvexSpace π•œ E := ⟨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul r⟩ #align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball theorem StrictConvexSpace.of_norm_combo_lt_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– < 1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex' fun x hx y hy hne => ?_) rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball, mem_sphere_zero_iff_norm] at hx hy rcases h x y hx hy hne with ⟨a, b, hab, hlt⟩ use b rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff, sub_eq_iff_eq_add.2 hab.symm] #align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one theorem StrictConvexSpace.of_norm_combo_ne_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, 0 ≀ a ∧ 0 ≀ b ∧ a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– β‰  1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex ?_) simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise, frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm] intro x hx y hy hne rcases h x y hx hy hne with ⟨a, b, ha, hb, hab, hne'⟩ exact ⟨_, ⟨a, b, ha, hb, hab, rfl⟩, mt mem_sphere_zero_iff_norm.1 hne'⟩ #align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one
Mathlib/Analysis/Convex/StrictConvexSpace.lean
123
130
theorem StrictConvexSpace.of_norm_add_ne_two (h : βˆ€ ⦃x y : E⦄, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ β€–x + yβ€– β‰  2) : StrictConvexSpace ℝ E := by
refine StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne => ⟨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, ?_⟩ rw [← smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, ← div_eq_inv_mul, Ne, div_eq_one_iff_eq (two_ne_zero' ℝ)] exact h hx hy hne
6
403.428793
2
1.833333
6
1,919
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _ #align strict_convex_closed_ball strictConvex_closedBall variable [NormedSpace ℝ E] theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π•œ ℝ] (h : StrictConvex π•œ (closedBall (0 : E) 1)) : StrictConvexSpace π•œ E := ⟨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul r⟩ #align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball theorem StrictConvexSpace.of_norm_combo_lt_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– < 1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex' fun x hx y hy hne => ?_) rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball, mem_sphere_zero_iff_norm] at hx hy rcases h x y hx hy hne with ⟨a, b, hab, hlt⟩ use b rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff, sub_eq_iff_eq_add.2 hab.symm] #align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one theorem StrictConvexSpace.of_norm_combo_ne_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, 0 ≀ a ∧ 0 ≀ b ∧ a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– β‰  1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex ?_) simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise, frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm] intro x hx y hy hne rcases h x y hx hy hne with ⟨a, b, ha, hb, hab, hne'⟩ exact ⟨_, ⟨a, b, ha, hb, hab, rfl⟩, mt mem_sphere_zero_iff_norm.1 hne'⟩ #align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one theorem StrictConvexSpace.of_norm_add_ne_two (h : βˆ€ ⦃x y : E⦄, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ β€–x + yβ€– β‰  2) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne => ⟨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, ?_⟩ rw [← smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, ← div_eq_inv_mul, Ne, div_eq_one_iff_eq (two_ne_zero' ℝ)] exact h hx hy hne #align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two (h : (sphere (0 : E) 1).Pairwise fun x y => β€–x + yβ€– β‰  2) : StrictConvexSpace ℝ E := StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy => h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy) #align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two
Mathlib/Analysis/Convex/StrictConvexSpace.lean
141
145
theorem StrictConvexSpace.of_norm_add (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ β€–x + yβ€– = 2 β†’ SameRay ℝ x y) : StrictConvexSpace ℝ E := by
refine StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ‚‚ => ?_ rw [mem_sphere_zero_iff_norm] at hx hy exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ‚‚)
3
20.085537
1
1.833333
6
1,919
import Mathlib.Analysis.Convex.Normed import Mathlib.Analysis.Convex.Strict import Mathlib.Analysis.Normed.Order.Basic import Mathlib.Analysis.NormedSpace.AddTorsor import Mathlib.Analysis.NormedSpace.Pointwise import Mathlib.Analysis.NormedSpace.Ray #align_import analysis.convex.strict_convex_space from "leanprover-community/mathlib"@"a63928c34ec358b5edcda2bf7513c50052a5230f" open Convex Pointwise Set Metric class StrictConvexSpace (π•œ E : Type*) [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] : Prop where strictConvex_closedBall : βˆ€ r : ℝ, 0 < r β†’ StrictConvex π•œ (closedBall (0 : E) r) #align strict_convex_space StrictConvexSpace variable (π•œ : Type*) {E : Type*} [NormedLinearOrderedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] theorem strictConvex_closedBall [StrictConvexSpace π•œ E] (x : E) (r : ℝ) : StrictConvex π•œ (closedBall x r) := by rcases le_or_lt r 0 with hr | hr Β· exact (subsingleton_closedBall x hr).strictConvex rw [← vadd_closedBall_zero] exact (StrictConvexSpace.strictConvex_closedBall r hr).vadd _ #align strict_convex_closed_ball strictConvex_closedBall variable [NormedSpace ℝ E] theorem StrictConvexSpace.of_strictConvex_closed_unit_ball [LinearMap.CompatibleSMul E E π•œ ℝ] (h : StrictConvex π•œ (closedBall (0 : E) 1)) : StrictConvexSpace π•œ E := ⟨fun r hr => by simpa only [smul_closedUnitBall_of_nonneg hr.le] using h.smul r⟩ #align strict_convex_space.of_strict_convex_closed_unit_ball StrictConvexSpace.of_strictConvex_closed_unit_ball theorem StrictConvexSpace.of_norm_combo_lt_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– < 1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex' fun x hx y hy hne => ?_) rw [interior_closedBall (0 : E) one_ne_zero, closedBall_diff_ball, mem_sphere_zero_iff_norm] at hx hy rcases h x y hx hy hne with ⟨a, b, hab, hlt⟩ use b rwa [AffineMap.lineMap_apply_module, interior_closedBall (0 : E) one_ne_zero, mem_ball_zero_iff, sub_eq_iff_eq_add.2 hab.symm] #align strict_convex_space.of_norm_combo_lt_one StrictConvexSpace.of_norm_combo_lt_one theorem StrictConvexSpace.of_norm_combo_ne_one (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ βˆƒ a b : ℝ, 0 ≀ a ∧ 0 ≀ b ∧ a + b = 1 ∧ β€–a β€’ x + b β€’ yβ€– β‰  1) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_strictConvex_closed_unit_ball ℝ ((convex_closedBall _ _).strictConvex ?_) simp only [interior_closedBall _ one_ne_zero, closedBall_diff_ball, Set.Pairwise, frontier_closedBall _ one_ne_zero, mem_sphere_zero_iff_norm] intro x hx y hy hne rcases h x y hx hy hne with ⟨a, b, ha, hb, hab, hne'⟩ exact ⟨_, ⟨a, b, ha, hb, hab, rfl⟩, mt mem_sphere_zero_iff_norm.1 hne'⟩ #align strict_convex_space.of_norm_combo_ne_one StrictConvexSpace.of_norm_combo_ne_one theorem StrictConvexSpace.of_norm_add_ne_two (h : βˆ€ ⦃x y : E⦄, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ x β‰  y β†’ β€–x + yβ€– β‰  2) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_norm_combo_ne_one fun x y hx hy hne => ⟨1 / 2, 1 / 2, one_half_pos.le, one_half_pos.le, add_halves _, ?_⟩ rw [← smul_add, norm_smul, Real.norm_of_nonneg one_half_pos.le, one_div, ← div_eq_inv_mul, Ne, div_eq_one_iff_eq (two_ne_zero' ℝ)] exact h hx hy hne #align strict_convex_space.of_norm_add_ne_two StrictConvexSpace.of_norm_add_ne_two theorem StrictConvexSpace.of_pairwise_sphere_norm_ne_two (h : (sphere (0 : E) 1).Pairwise fun x y => β€–x + yβ€– β‰  2) : StrictConvexSpace ℝ E := StrictConvexSpace.of_norm_add_ne_two fun _ _ hx hy => h (mem_sphere_zero_iff_norm.2 hx) (mem_sphere_zero_iff_norm.2 hy) #align strict_convex_space.of_pairwise_sphere_norm_ne_two StrictConvexSpace.of_pairwise_sphere_norm_ne_two theorem StrictConvexSpace.of_norm_add (h : βˆ€ x y : E, β€–xβ€– = 1 β†’ β€–yβ€– = 1 β†’ β€–x + yβ€– = 2 β†’ SameRay ℝ x y) : StrictConvexSpace ℝ E := by refine StrictConvexSpace.of_pairwise_sphere_norm_ne_two fun x hx y hy => mt fun hβ‚‚ => ?_ rw [mem_sphere_zero_iff_norm] at hx hy exact (sameRay_iff_of_norm_eq (hx.trans hy.symm)).1 (h x y hx hy hβ‚‚) #align strict_convex_space.of_norm_add StrictConvexSpace.of_norm_add variable [StrictConvexSpace ℝ E] {x y z : E} {a b r : ℝ}
Mathlib/Analysis/Convex/StrictConvexSpace.lean
152
158
theorem combo_mem_ball_of_ne (hx : x ∈ closedBall z r) (hy : y ∈ closedBall z r) (hne : x β‰  y) (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) : a β€’ x + b β€’ y ∈ ball z r := by
rcases eq_or_ne r 0 with (rfl | hr) Β· rw [closedBall_zero, mem_singleton_iff] at hx hy exact (hne (hx.trans hy.symm)).elim Β· simp only [← interior_closedBall _ hr] at hx hy ⊒ exact strictConvex_closedBall ℝ z r hx hy hne ha hb hab
5
148.413159
2
1.833333
6
1,919
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section RingHom variable (P : βˆ€ {R S : Type u} [CommRing R] [CommRing S] (_ : R β†’+* S), Prop) def RingHom.LocalizationPreserves := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (M : Submonoid R) (R' S' : Type u) [CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R'] [IsLocalization (M.map f) S'], P f β†’ P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' β†’+* S') #align ring_hom.localization_preserves RingHom.LocalizationPreserves def RingHom.OfLocalizationFiniteSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset R) (_ : Ideal.span (s : Set R) = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan def RingHom.OfLocalizationSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set R) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_span RingHom.OfLocalizationSpan def RingHom.HoldsForLocalizationAway : Prop := βˆ€ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R) [IsLocalization.Away r S], P (algebraMap R S) #align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway def RingHom.OfLocalizationFiniteSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset S) (_ : Ideal.span (s : Set S) = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget def RingHom.OfLocalizationSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set S) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget def RingHom.OfLocalizationPrime : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S), (βˆ€ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) β†’ P f #align ring_hom.of_localization_prime RingHom.OfLocalizationPrime structure RingHom.PropertyIsLocal : Prop where LocalizationPreserves : RingHom.LocalizationPreserves @P OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P StableUnderComposition : RingHom.StableUnderComposition @P HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P #align ring_hom.property_is_local RingHom.PropertyIsLocal
Mathlib/RingTheory/LocalProperties.lean
153
163
theorem RingHom.ofLocalizationSpan_iff_finite : RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by
delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩
9
8,103.083928
2
1.833333
6
1,920
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section RingHom variable (P : βˆ€ {R S : Type u} [CommRing R] [CommRing S] (_ : R β†’+* S), Prop) def RingHom.LocalizationPreserves := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (M : Submonoid R) (R' S' : Type u) [CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R'] [IsLocalization (M.map f) S'], P f β†’ P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' β†’+* S') #align ring_hom.localization_preserves RingHom.LocalizationPreserves def RingHom.OfLocalizationFiniteSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset R) (_ : Ideal.span (s : Set R) = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan def RingHom.OfLocalizationSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set R) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_span RingHom.OfLocalizationSpan def RingHom.HoldsForLocalizationAway : Prop := βˆ€ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R) [IsLocalization.Away r S], P (algebraMap R S) #align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway def RingHom.OfLocalizationFiniteSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset S) (_ : Ideal.span (s : Set S) = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget def RingHom.OfLocalizationSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set S) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget def RingHom.OfLocalizationPrime : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S), (βˆ€ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) β†’ P f #align ring_hom.of_localization_prime RingHom.OfLocalizationPrime structure RingHom.PropertyIsLocal : Prop where LocalizationPreserves : RingHom.LocalizationPreserves @P OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P StableUnderComposition : RingHom.StableUnderComposition @P HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P #align ring_hom.property_is_local RingHom.PropertyIsLocal theorem RingHom.ofLocalizationSpan_iff_finite : RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite
Mathlib/RingTheory/LocalProperties.lean
166
176
theorem RingHom.ofLocalizationSpanTarget_iff_finite : RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by
delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩
9
8,103.083928
2
1.833333
6
1,920
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section RingHom variable (P : βˆ€ {R S : Type u} [CommRing R] [CommRing S] (_ : R β†’+* S), Prop) def RingHom.LocalizationPreserves := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (M : Submonoid R) (R' S' : Type u) [CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R'] [IsLocalization (M.map f) S'], P f β†’ P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' β†’+* S') #align ring_hom.localization_preserves RingHom.LocalizationPreserves def RingHom.OfLocalizationFiniteSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset R) (_ : Ideal.span (s : Set R) = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan def RingHom.OfLocalizationSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set R) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_span RingHom.OfLocalizationSpan def RingHom.HoldsForLocalizationAway : Prop := βˆ€ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R) [IsLocalization.Away r S], P (algebraMap R S) #align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway def RingHom.OfLocalizationFiniteSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset S) (_ : Ideal.span (s : Set S) = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget def RingHom.OfLocalizationSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set S) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget def RingHom.OfLocalizationPrime : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S), (βˆ€ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) β†’ P f #align ring_hom.of_localization_prime RingHom.OfLocalizationPrime structure RingHom.PropertyIsLocal : Prop where LocalizationPreserves : RingHom.LocalizationPreserves @P OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P StableUnderComposition : RingHom.StableUnderComposition @P HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P #align ring_hom.property_is_local RingHom.PropertyIsLocal theorem RingHom.ofLocalizationSpan_iff_finite : RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite theorem RingHom.ofLocalizationSpanTarget_iff_finite : RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_target_iff_finite RingHom.ofLocalizationSpanTarget_iff_finite variable {P f R' S'}
Mathlib/RingTheory/LocalProperties.lean
181
189
theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) : RingHom.RespectsIso @P := by
apply hP.StableUnderComposition.respectsIso introv letI := e.toRingHom.toAlgebra -- Porting note: was `apply_with hP.holds_for_localization_away { instances := ff }` have : IsLocalization.Away (1 : R) S := by apply IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective exact RingHom.PropertyIsLocal.HoldsForLocalizationAway hP S (1 : R)
7
1,096.633158
2
1.833333
6
1,920
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section RingHom variable (P : βˆ€ {R S : Type u} [CommRing R] [CommRing S] (_ : R β†’+* S), Prop) def RingHom.LocalizationPreserves := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (M : Submonoid R) (R' S' : Type u) [CommRing R'] [CommRing S'] [Algebra R R'] [Algebra S S'] [IsLocalization M R'] [IsLocalization (M.map f) S'], P f β†’ P (IsLocalization.map S' f (Submonoid.le_comap_map M) : R' β†’+* S') #align ring_hom.localization_preserves RingHom.LocalizationPreserves def RingHom.OfLocalizationFiniteSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset R) (_ : Ideal.span (s : Set R) = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_finite_span RingHom.OfLocalizationFiniteSpan def RingHom.OfLocalizationSpan := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set R) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P (Localization.awayMap f r)), P f #align ring_hom.of_localization_span RingHom.OfLocalizationSpan def RingHom.HoldsForLocalizationAway : Prop := βˆ€ ⦃R : Type u⦄ (S : Type u) [CommRing R] [CommRing S] [Algebra R S] (r : R) [IsLocalization.Away r S], P (algebraMap R S) #align ring_hom.holds_for_localization_away RingHom.HoldsForLocalizationAway def RingHom.OfLocalizationFiniteSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Finset S) (_ : Ideal.span (s : Set S) = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_finite_span_target RingHom.OfLocalizationFiniteSpanTarget def RingHom.OfLocalizationSpanTarget : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S) (s : Set S) (_ : Ideal.span s = ⊀) (_ : βˆ€ r : s, P ((algebraMap S (Localization.Away (r : S))).comp f)), P f #align ring_hom.of_localization_span_target RingHom.OfLocalizationSpanTarget def RingHom.OfLocalizationPrime : Prop := βˆ€ ⦃R S : Type u⦄ [CommRing R] [CommRing S] (f : R β†’+* S), (βˆ€ (J : Ideal S) (_ : J.IsPrime), P (Localization.localRingHom _ J f rfl)) β†’ P f #align ring_hom.of_localization_prime RingHom.OfLocalizationPrime structure RingHom.PropertyIsLocal : Prop where LocalizationPreserves : RingHom.LocalizationPreserves @P OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P StableUnderComposition : RingHom.StableUnderComposition @P HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P #align ring_hom.property_is_local RingHom.PropertyIsLocal theorem RingHom.ofLocalizationSpan_iff_finite : RingHom.OfLocalizationSpan @P ↔ RingHom.OfLocalizationFiniteSpan @P := by delta RingHom.OfLocalizationSpan RingHom.OfLocalizationFiniteSpan apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_iff_finite RingHom.ofLocalizationSpan_iff_finite theorem RingHom.ofLocalizationSpanTarget_iff_finite : RingHom.OfLocalizationSpanTarget @P ↔ RingHom.OfLocalizationFiniteSpanTarget @P := by delta RingHom.OfLocalizationSpanTarget RingHom.OfLocalizationFiniteSpanTarget apply forallβ‚…_congr -- TODO: Using `refine` here breaks `resetI`. intros constructor Β· intro h s; exact h s Β· intro h s hs hs' obtain ⟨s', h₁, hβ‚‚βŸ© := (Ideal.span_eq_top_iff_finite s).mp hs exact h s' hβ‚‚ fun x => hs' ⟨_, h₁ x.prop⟩ #align ring_hom.of_localization_span_target_iff_finite RingHom.ofLocalizationSpanTarget_iff_finite variable {P f R' S'} theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) : RingHom.RespectsIso @P := by apply hP.StableUnderComposition.respectsIso introv letI := e.toRingHom.toAlgebra -- Porting note: was `apply_with hP.holds_for_localization_away { instances := ff }` have : IsLocalization.Away (1 : R) S := by apply IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective exact RingHom.PropertyIsLocal.HoldsForLocalizationAway hP S (1 : R) #align ring_hom.property_is_local.respects_iso RingHom.PropertyIsLocal.respectsIso -- Almost all arguments are implicit since this is not intended to use mid-proof.
Mathlib/RingTheory/LocalProperties.lean
193
197
theorem RingHom.LocalizationPreserves.away (H : RingHom.LocalizationPreserves @P) (r : R) [IsLocalization.Away r R'] [IsLocalization.Away (f r) S'] (hf : P f) : P (IsLocalization.Away.map R' S' f r) := by
have : IsLocalization ((Submonoid.powers r).map f) S' := by rw [Submonoid.map_powers]; assumption exact H f (Submonoid.powers r) R' S' hf
2
7.389056
1
1.833333
6
1,920
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section Ideal open scoped nonZeroDivisors
Mathlib/RingTheory/LocalProperties.lean
236
255
theorem Ideal.le_of_localization_maximal {I J : Ideal R} (h : βˆ€ (P : Ideal R) (hP : P.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime P)) I ≀ Ideal.map (algebraMap R (Localization.AtPrime P)) J) : I ≀ J := by
intro x hx suffices J.colon (Ideal.span {x}) = ⊀ by simpa using Submodule.mem_colon.mp (show (1 : R) ∈ J.colon (Ideal.span {x}) from this.symm β–Έ Submodule.mem_top) x (Ideal.mem_span_singleton_self x) refine Not.imp_symm (J.colon (Ideal.span {x})).exists_le_maximal ?_ push_neg intro P hP le obtain ⟨⟨⟨a, ha⟩, ⟨s, hs⟩⟩, eq⟩ := (IsLocalization.mem_map_algebraMap_iff P.primeCompl _).mp (h P hP (Ideal.mem_map_of_mem _ hx)) rw [← _root_.map_mul, ← sub_eq_zero, ← map_sub] at eq obtain ⟨⟨m, hm⟩, eq⟩ := (IsLocalization.map_eq_zero_iff P.primeCompl _ _).mp eq refine hs ((hP.isPrime.mem_or_mem (le (Ideal.mem_colon_singleton.mpr ?_))).resolve_right hm) simp only [Subtype.coe_mk, mul_sub, sub_eq_zero, mul_comm x s, mul_left_comm] at eq simpa only [mul_assoc, eq] using J.mul_mem_left m ha
15
3,269,017.372472
2
1.833333
6
1,920
import Mathlib.RingTheory.FiniteType import Mathlib.RingTheory.Localization.AtPrime import Mathlib.RingTheory.Localization.Away.Basic import Mathlib.RingTheory.Localization.Integer import Mathlib.RingTheory.Localization.Submodule import Mathlib.RingTheory.Nilpotent.Lemmas import Mathlib.RingTheory.RingHomProperties import Mathlib.Data.Set.Subsingleton #align_import ring_theory.local_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0" open scoped Pointwise Classical universe u variable {R S : Type u} [CommRing R] [CommRing S] (M : Submonoid R) variable (N : Submonoid S) (R' S' : Type u) [CommRing R'] [CommRing S'] (f : R β†’+* S) variable [Algebra R R'] [Algebra S S'] section Properties section Ideal open scoped nonZeroDivisors theorem Ideal.le_of_localization_maximal {I J : Ideal R} (h : βˆ€ (P : Ideal R) (hP : P.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime P)) I ≀ Ideal.map (algebraMap R (Localization.AtPrime P)) J) : I ≀ J := by intro x hx suffices J.colon (Ideal.span {x}) = ⊀ by simpa using Submodule.mem_colon.mp (show (1 : R) ∈ J.colon (Ideal.span {x}) from this.symm β–Έ Submodule.mem_top) x (Ideal.mem_span_singleton_self x) refine Not.imp_symm (J.colon (Ideal.span {x})).exists_le_maximal ?_ push_neg intro P hP le obtain ⟨⟨⟨a, ha⟩, ⟨s, hs⟩⟩, eq⟩ := (IsLocalization.mem_map_algebraMap_iff P.primeCompl _).mp (h P hP (Ideal.mem_map_of_mem _ hx)) rw [← _root_.map_mul, ← sub_eq_zero, ← map_sub] at eq obtain ⟨⟨m, hm⟩, eq⟩ := (IsLocalization.map_eq_zero_iff P.primeCompl _ _).mp eq refine hs ((hP.isPrime.mem_or_mem (le (Ideal.mem_colon_singleton.mpr ?_))).resolve_right hm) simp only [Subtype.coe_mk, mul_sub, sub_eq_zero, mul_comm x s, mul_left_comm] at eq simpa only [mul_assoc, eq] using J.mul_mem_left m ha #align ideal.le_of_localization_maximal Ideal.le_of_localization_maximal theorem Ideal.eq_of_localization_maximal {I J : Ideal R} (h : βˆ€ (P : Ideal R) (_ : P.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime P)) I = Ideal.map (algebraMap R (Localization.AtPrime P)) J) : I = J := le_antisymm (Ideal.le_of_localization_maximal fun P hP => (h P hP).le) (Ideal.le_of_localization_maximal fun P hP => (h P hP).ge) #align ideal.eq_of_localization_maximal Ideal.eq_of_localization_maximal theorem ideal_eq_bot_of_localization' (I : Ideal R) (h : βˆ€ (J : Ideal R) (hJ : J.IsMaximal), Ideal.map (algebraMap R (Localization.AtPrime J)) I = βŠ₯) : I = βŠ₯ := Ideal.eq_of_localization_maximal fun P hP => by simpa using h P hP #align ideal_eq_bot_of_localization' ideal_eq_bot_of_localization' -- TODO: This proof should work for all modules, once we have enough material on submodules of -- localized modules. theorem ideal_eq_bot_of_localization (I : Ideal R) (h : βˆ€ (J : Ideal R) (hJ : J.IsMaximal), IsLocalization.coeSubmodule (Localization.AtPrime J) I = βŠ₯) : I = βŠ₯ := ideal_eq_bot_of_localization' _ fun P hP => (Ideal.map_eq_bot_iff_le_ker _).mpr fun x hx => by rw [RingHom.mem_ker, ← Submodule.mem_bot R, ← h P hP, IsLocalization.mem_coeSubmodule] exact ⟨x, hx, rfl⟩ #align ideal_eq_bot_of_localization ideal_eq_bot_of_localization
Mathlib/RingTheory/LocalProperties.lean
290
300
theorem eq_zero_of_localization (r : R) (h : βˆ€ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) : r = 0 := by
rw [← Ideal.span_singleton_eq_bot] apply ideal_eq_bot_of_localization intro J hJ delta IsLocalization.coeSubmodule erw [Submodule.map_span, Submodule.span_eq_bot] rintro _ ⟨_, h', rfl⟩ cases Set.mem_singleton_iff.mpr h' exact h J hJ
8
2,980.957987
2
1.833333
6
1,920
import Mathlib.FieldTheory.Separable import Mathlib.RingTheory.IntegralDomain import Mathlib.Algebra.CharP.Reduced import Mathlib.Tactic.ApplyFun #align_import field_theory.finite.basic from "leanprover-community/mathlib"@"12a85fac627bea918960da036049d611b1a3ee43" variable {K : Type*} {R : Type*} local notation "q" => Fintype.card K open Finset open scoped Polynomial namespace FiniteField section Polynomial variable [CommRing R] [IsDomain R] open Polynomial theorem card_image_polynomial_eval [DecidableEq R] [Fintype R] {p : R[X]} (hp : 0 < p.degree) : Fintype.card R ≀ natDegree p * (univ.image fun x => eval x p).card := Finset.card_le_mul_card_image _ _ (fun a _ => calc _ = (p - C a).roots.toFinset.card := congr_arg card (by simp [Finset.ext_iff, ← mem_roots_sub_C hp]) _ ≀ Multiset.card (p - C a).roots := Multiset.toFinset_card_le _ _ ≀ _ := card_roots_sub_C' hp) #align finite_field.card_image_polynomial_eval FiniteField.card_image_polynomial_eval
Mathlib/FieldTheory/Finite/Basic.lean
76
98
theorem exists_root_sum_quadratic [Fintype R] {f g : R[X]} (hf2 : degree f = 2) (hg2 : degree g = 2) (hR : Fintype.card R % 2 = 1) : βˆƒ a b, f.eval a + g.eval b = 0 := letI := Classical.decEq R suffices Β¬Disjoint (univ.image fun x : R => eval x f) (univ.image fun x : R => eval x (-g)) by simp only [disjoint_left, mem_image] at this push_neg at this rcases this with ⟨x, ⟨a, _, ha⟩, ⟨b, _, hb⟩⟩ exact ⟨a, b, by rw [ha, ← hb, eval_neg, neg_add_self]⟩ fun hd : Disjoint _ _ => lt_irrefl (2 * ((univ.image fun x : R => eval x f) βˆͺ univ.image fun x : R => eval x (-g)).card) <| calc 2 * ((univ.image fun x : R => eval x f) βˆͺ univ.image fun x : R => eval x (-g)).card ≀ 2 * Fintype.card R := Nat.mul_le_mul_left _ (Finset.card_le_univ _) _ = Fintype.card R + Fintype.card R := two_mul _ _ < natDegree f * (univ.image fun x : R => eval x f).card + natDegree (-g) * (univ.image fun x : R => eval x (-g)).card := (add_lt_add_of_lt_of_le (lt_of_le_of_ne (card_image_polynomial_eval (by rw [hf2]; decide)) (mt (congr_arg (Β· % 2)) (by simp [natDegree_eq_of_degree_eq_some hf2, hR]))) (card_image_polynomial_eval (by rw [degree_neg, hg2]; decide))) _ = 2 * ((univ.image fun x : R => eval x f) βˆͺ univ.image fun x : R => eval x (-g)).card := by
rw [card_union_of_disjoint hd]; simp [natDegree_eq_of_degree_eq_some hf2, natDegree_eq_of_degree_eq_some hg2, mul_add]
2
7.389056
1
1.833333
6
1,921
import Mathlib.FieldTheory.Separable import Mathlib.RingTheory.IntegralDomain import Mathlib.Algebra.CharP.Reduced import Mathlib.Tactic.ApplyFun #align_import field_theory.finite.basic from "leanprover-community/mathlib"@"12a85fac627bea918960da036049d611b1a3ee43" variable {K : Type*} {R : Type*} local notation "q" => Fintype.card K open Finset open scoped Polynomial namespace FiniteField
Mathlib/FieldTheory/Finite/Basic.lean
104
111
theorem prod_univ_units_id_eq_neg_one [CommRing K] [IsDomain K] [Fintype Kˣ] : ∏ x : Kˣ, x = (-1 : Kˣ) := by
classical have : (∏ x ∈ (@univ KΛ£ _).erase (-1), x) = 1 := prod_involution (fun x _ => x⁻¹) (by simp) (fun a => by simp (config := { contextual := true }) [Units.inv_eq_self_iff]) (fun a => by simp [@inv_eq_iff_eq_inv _ _ a]) (by simp) rw [← insert_erase (mem_univ (-1 : KΛ£)), prod_insert (not_mem_erase _ _), this, mul_one]
6
403.428793
2
1.833333
6
1,921
import Mathlib.FieldTheory.Separable import Mathlib.RingTheory.IntegralDomain import Mathlib.Algebra.CharP.Reduced import Mathlib.Tactic.ApplyFun #align_import field_theory.finite.basic from "leanprover-community/mathlib"@"12a85fac627bea918960da036049d611b1a3ee43" variable {K : Type*} {R : Type*} local notation "q" => Fintype.card K open Finset open scoped Polynomial namespace FiniteField theorem prod_univ_units_id_eq_neg_one [CommRing K] [IsDomain K] [Fintype KΛ£] : ∏ x : KΛ£, x = (-1 : KΛ£) := by classical have : (∏ x ∈ (@univ KΛ£ _).erase (-1), x) = 1 := prod_involution (fun x _ => x⁻¹) (by simp) (fun a => by simp (config := { contextual := true }) [Units.inv_eq_self_iff]) (fun a => by simp [@inv_eq_iff_eq_inv _ _ a]) (by simp) rw [← insert_erase (mem_univ (-1 : KΛ£)), prod_insert (not_mem_erase _ _), this, mul_one] #align finite_field.prod_univ_units_id_eq_neg_one FiniteField.prod_univ_units_id_eq_neg_one set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532
Mathlib/FieldTheory/Finite/Basic.lean
115
139
theorem card_cast_subgroup_card_ne_zero [Ring K] [NoZeroDivisors K] [Nontrivial K] (G : Subgroup KΛ£) [Fintype G] : (Fintype.card G : K) β‰  0 := by
let n := Fintype.card G intro nzero have ⟨p, char_p⟩ := CharP.exists K have hd : p ∣ n := (CharP.cast_eq_zero_iff K p n).mp nzero cases CharP.char_is_prime_or_zero K p with | inr pzero => exact (Fintype.card_pos).ne' <| Nat.eq_zero_of_zero_dvd <| pzero β–Έ hd | inl pprime => have fact_pprime := Fact.mk pprime -- G has an element x of order p by Cauchy's theorem have ⟨x, hx⟩ := exists_prime_orderOf_dvd_card p hd -- F has an element u (= ↑↑x) of order p let u := ((x : KΛ£) : K) have hu : orderOf u = p := by rwa [orderOf_units, Subgroup.orderOf_coe] -- u ^ p = 1 implies (u - 1) ^ p = 0 and hence u = 1 ... have h : u = 1 := by rw [← sub_left_inj, sub_self 1] apply pow_eq_zero (n := p) rw [sub_pow_char_of_commute, one_pow, ← hu, pow_orderOf_eq_one, sub_self] exact Commute.one_right u -- ... meaning x didn't have order p after all, contradiction apply pprime.one_lt.ne rw [← hu, h, orderOf_one]
23
9,744,803,446.248903
2
1.833333
6
1,921
import Mathlib.FieldTheory.Separable import Mathlib.RingTheory.IntegralDomain import Mathlib.Algebra.CharP.Reduced import Mathlib.Tactic.ApplyFun #align_import field_theory.finite.basic from "leanprover-community/mathlib"@"12a85fac627bea918960da036049d611b1a3ee43" variable {K : Type*} {R : Type*} local notation "q" => Fintype.card K open Finset open scoped Polynomial namespace FiniteField theorem prod_univ_units_id_eq_neg_one [CommRing K] [IsDomain K] [Fintype KΛ£] : ∏ x : KΛ£, x = (-1 : KΛ£) := by classical have : (∏ x ∈ (@univ KΛ£ _).erase (-1), x) = 1 := prod_involution (fun x _ => x⁻¹) (by simp) (fun a => by simp (config := { contextual := true }) [Units.inv_eq_self_iff]) (fun a => by simp [@inv_eq_iff_eq_inv _ _ a]) (by simp) rw [← insert_erase (mem_univ (-1 : KΛ£)), prod_insert (not_mem_erase _ _), this, mul_one] #align finite_field.prod_univ_units_id_eq_neg_one FiniteField.prod_univ_units_id_eq_neg_one set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532 theorem card_cast_subgroup_card_ne_zero [Ring K] [NoZeroDivisors K] [Nontrivial K] (G : Subgroup KΛ£) [Fintype G] : (Fintype.card G : K) β‰  0 := by let n := Fintype.card G intro nzero have ⟨p, char_p⟩ := CharP.exists K have hd : p ∣ n := (CharP.cast_eq_zero_iff K p n).mp nzero cases CharP.char_is_prime_or_zero K p with | inr pzero => exact (Fintype.card_pos).ne' <| Nat.eq_zero_of_zero_dvd <| pzero β–Έ hd | inl pprime => have fact_pprime := Fact.mk pprime -- G has an element x of order p by Cauchy's theorem have ⟨x, hx⟩ := exists_prime_orderOf_dvd_card p hd -- F has an element u (= ↑↑x) of order p let u := ((x : KΛ£) : K) have hu : orderOf u = p := by rwa [orderOf_units, Subgroup.orderOf_coe] -- u ^ p = 1 implies (u - 1) ^ p = 0 and hence u = 1 ... have h : u = 1 := by rw [← sub_left_inj, sub_self 1] apply pow_eq_zero (n := p) rw [sub_pow_char_of_commute, one_pow, ← hu, pow_orderOf_eq_one, sub_self] exact Commute.one_right u -- ... meaning x didn't have order p after all, contradiction apply pprime.one_lt.ne rw [← hu, h, orderOf_one]
Mathlib/FieldTheory/Finite/Basic.lean
142
164
theorem sum_subgroup_units_eq_zero [Ring K] [NoZeroDivisors K] {G : Subgroup KΛ£} [Fintype G] (hg : G β‰  βŠ₯) : βˆ‘ x : G, (x.val : K) = 0 := by
rw [Subgroup.ne_bot_iff_exists_ne_one] at hg rcases hg with ⟨a, ha⟩ -- The action of a on G as an embedding let a_mul_emb : G β†ͺ G := mulLeftEmbedding a -- ... and leaves G unchanged have h_unchanged : Finset.univ.map a_mul_emb = Finset.univ := by simp -- Therefore the sum of x over a G is the sum of a x over G have h_sum_map := Finset.univ.sum_map a_mul_emb fun x => ((x : KΛ£) : K) -- ... and the former is the sum of x over G. -- By algebraic manipulation, we have Ξ£ G, x = βˆ‘ G, a x = a βˆ‘ G, x simp only [a_mul_emb, h_unchanged, Function.Embedding.coeFn_mk, Function.Embedding.toFun_eq_coe, mulLeftEmbedding_apply, Submonoid.coe_mul, Subgroup.coe_toSubmonoid, Units.val_mul, ← Finset.mul_sum] at h_sum_map -- thus one of (a - 1) or βˆ‘ G, x is zero have hzero : (((a : KΛ£) : K) - 1) = 0 ∨ βˆ‘ x : β†₯G, ((x : KΛ£) : K) = 0 := by rw [← mul_eq_zero, sub_mul, ← h_sum_map, one_mul, sub_self] apply Or.resolve_left hzero contrapose! ha ext rwa [← sub_eq_zero]
20
485,165,195.40979
2
1.833333
6
1,921
import Mathlib.FieldTheory.Separable import Mathlib.RingTheory.IntegralDomain import Mathlib.Algebra.CharP.Reduced import Mathlib.Tactic.ApplyFun #align_import field_theory.finite.basic from "leanprover-community/mathlib"@"12a85fac627bea918960da036049d611b1a3ee43" variable {K : Type*} {R : Type*} local notation "q" => Fintype.card K open Finset open scoped Polynomial namespace FiniteField theorem prod_univ_units_id_eq_neg_one [CommRing K] [IsDomain K] [Fintype KΛ£] : ∏ x : KΛ£, x = (-1 : KΛ£) := by classical have : (∏ x ∈ (@univ KΛ£ _).erase (-1), x) = 1 := prod_involution (fun x _ => x⁻¹) (by simp) (fun a => by simp (config := { contextual := true }) [Units.inv_eq_self_iff]) (fun a => by simp [@inv_eq_iff_eq_inv _ _ a]) (by simp) rw [← insert_erase (mem_univ (-1 : KΛ£)), prod_insert (not_mem_erase _ _), this, mul_one] #align finite_field.prod_univ_units_id_eq_neg_one FiniteField.prod_univ_units_id_eq_neg_one set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532 theorem card_cast_subgroup_card_ne_zero [Ring K] [NoZeroDivisors K] [Nontrivial K] (G : Subgroup KΛ£) [Fintype G] : (Fintype.card G : K) β‰  0 := by let n := Fintype.card G intro nzero have ⟨p, char_p⟩ := CharP.exists K have hd : p ∣ n := (CharP.cast_eq_zero_iff K p n).mp nzero cases CharP.char_is_prime_or_zero K p with | inr pzero => exact (Fintype.card_pos).ne' <| Nat.eq_zero_of_zero_dvd <| pzero β–Έ hd | inl pprime => have fact_pprime := Fact.mk pprime -- G has an element x of order p by Cauchy's theorem have ⟨x, hx⟩ := exists_prime_orderOf_dvd_card p hd -- F has an element u (= ↑↑x) of order p let u := ((x : KΛ£) : K) have hu : orderOf u = p := by rwa [orderOf_units, Subgroup.orderOf_coe] -- u ^ p = 1 implies (u - 1) ^ p = 0 and hence u = 1 ... have h : u = 1 := by rw [← sub_left_inj, sub_self 1] apply pow_eq_zero (n := p) rw [sub_pow_char_of_commute, one_pow, ← hu, pow_orderOf_eq_one, sub_self] exact Commute.one_right u -- ... meaning x didn't have order p after all, contradiction apply pprime.one_lt.ne rw [← hu, h, orderOf_one] theorem sum_subgroup_units_eq_zero [Ring K] [NoZeroDivisors K] {G : Subgroup KΛ£} [Fintype G] (hg : G β‰  βŠ₯) : βˆ‘ x : G, (x.val : K) = 0 := by rw [Subgroup.ne_bot_iff_exists_ne_one] at hg rcases hg with ⟨a, ha⟩ -- The action of a on G as an embedding let a_mul_emb : G β†ͺ G := mulLeftEmbedding a -- ... and leaves G unchanged have h_unchanged : Finset.univ.map a_mul_emb = Finset.univ := by simp -- Therefore the sum of x over a G is the sum of a x over G have h_sum_map := Finset.univ.sum_map a_mul_emb fun x => ((x : KΛ£) : K) -- ... and the former is the sum of x over G. -- By algebraic manipulation, we have Ξ£ G, x = βˆ‘ G, a x = a βˆ‘ G, x simp only [a_mul_emb, h_unchanged, Function.Embedding.coeFn_mk, Function.Embedding.toFun_eq_coe, mulLeftEmbedding_apply, Submonoid.coe_mul, Subgroup.coe_toSubmonoid, Units.val_mul, ← Finset.mul_sum] at h_sum_map -- thus one of (a - 1) or βˆ‘ G, x is zero have hzero : (((a : KΛ£) : K) - 1) = 0 ∨ βˆ‘ x : β†₯G, ((x : KΛ£) : K) = 0 := by rw [← mul_eq_zero, sub_mul, ← h_sum_map, one_mul, sub_self] apply Or.resolve_left hzero contrapose! ha ext rwa [← sub_eq_zero] @[simp]
Mathlib/FieldTheory/Finite/Basic.lean
168
176
theorem sum_subgroup_units [Ring K] [NoZeroDivisors K] {G : Subgroup KΛ£} [Fintype G] [Decidable (G = βŠ₯)] : βˆ‘ x : G, (x.val : K) = if G = βŠ₯ then 1 else 0 := by
by_cases G_bot : G = βŠ₯ Β· subst G_bot simp only [ite_true, Subgroup.mem_bot, Fintype.card_ofSubsingleton, Nat.cast_ite, Nat.cast_one, Nat.cast_zero, univ_unique, Set.default_coe_singleton, sum_singleton, Units.val_one] Β· simp only [G_bot, ite_false] exact sum_subgroup_units_eq_zero G_bot
6
403.428793
2
1.833333
6
1,921
import Mathlib.FieldTheory.Separable import Mathlib.RingTheory.IntegralDomain import Mathlib.Algebra.CharP.Reduced import Mathlib.Tactic.ApplyFun #align_import field_theory.finite.basic from "leanprover-community/mathlib"@"12a85fac627bea918960da036049d611b1a3ee43" variable {K : Type*} {R : Type*} local notation "q" => Fintype.card K open Finset open scoped Polynomial namespace FiniteField theorem prod_univ_units_id_eq_neg_one [CommRing K] [IsDomain K] [Fintype KΛ£] : ∏ x : KΛ£, x = (-1 : KΛ£) := by classical have : (∏ x ∈ (@univ KΛ£ _).erase (-1), x) = 1 := prod_involution (fun x _ => x⁻¹) (by simp) (fun a => by simp (config := { contextual := true }) [Units.inv_eq_self_iff]) (fun a => by simp [@inv_eq_iff_eq_inv _ _ a]) (by simp) rw [← insert_erase (mem_univ (-1 : KΛ£)), prod_insert (not_mem_erase _ _), this, mul_one] #align finite_field.prod_univ_units_id_eq_neg_one FiniteField.prod_univ_units_id_eq_neg_one set_option backward.synthInstance.canonInstances false in -- See https://github.com/leanprover-community/mathlib4/issues/12532 theorem card_cast_subgroup_card_ne_zero [Ring K] [NoZeroDivisors K] [Nontrivial K] (G : Subgroup KΛ£) [Fintype G] : (Fintype.card G : K) β‰  0 := by let n := Fintype.card G intro nzero have ⟨p, char_p⟩ := CharP.exists K have hd : p ∣ n := (CharP.cast_eq_zero_iff K p n).mp nzero cases CharP.char_is_prime_or_zero K p with | inr pzero => exact (Fintype.card_pos).ne' <| Nat.eq_zero_of_zero_dvd <| pzero β–Έ hd | inl pprime => have fact_pprime := Fact.mk pprime -- G has an element x of order p by Cauchy's theorem have ⟨x, hx⟩ := exists_prime_orderOf_dvd_card p hd -- F has an element u (= ↑↑x) of order p let u := ((x : KΛ£) : K) have hu : orderOf u = p := by rwa [orderOf_units, Subgroup.orderOf_coe] -- u ^ p = 1 implies (u - 1) ^ p = 0 and hence u = 1 ... have h : u = 1 := by rw [← sub_left_inj, sub_self 1] apply pow_eq_zero (n := p) rw [sub_pow_char_of_commute, one_pow, ← hu, pow_orderOf_eq_one, sub_self] exact Commute.one_right u -- ... meaning x didn't have order p after all, contradiction apply pprime.one_lt.ne rw [← hu, h, orderOf_one] theorem sum_subgroup_units_eq_zero [Ring K] [NoZeroDivisors K] {G : Subgroup KΛ£} [Fintype G] (hg : G β‰  βŠ₯) : βˆ‘ x : G, (x.val : K) = 0 := by rw [Subgroup.ne_bot_iff_exists_ne_one] at hg rcases hg with ⟨a, ha⟩ -- The action of a on G as an embedding let a_mul_emb : G β†ͺ G := mulLeftEmbedding a -- ... and leaves G unchanged have h_unchanged : Finset.univ.map a_mul_emb = Finset.univ := by simp -- Therefore the sum of x over a G is the sum of a x over G have h_sum_map := Finset.univ.sum_map a_mul_emb fun x => ((x : KΛ£) : K) -- ... and the former is the sum of x over G. -- By algebraic manipulation, we have Ξ£ G, x = βˆ‘ G, a x = a βˆ‘ G, x simp only [a_mul_emb, h_unchanged, Function.Embedding.coeFn_mk, Function.Embedding.toFun_eq_coe, mulLeftEmbedding_apply, Submonoid.coe_mul, Subgroup.coe_toSubmonoid, Units.val_mul, ← Finset.mul_sum] at h_sum_map -- thus one of (a - 1) or βˆ‘ G, x is zero have hzero : (((a : KΛ£) : K) - 1) = 0 ∨ βˆ‘ x : β†₯G, ((x : KΛ£) : K) = 0 := by rw [← mul_eq_zero, sub_mul, ← h_sum_map, one_mul, sub_self] apply Or.resolve_left hzero contrapose! ha ext rwa [← sub_eq_zero] @[simp] theorem sum_subgroup_units [Ring K] [NoZeroDivisors K] {G : Subgroup KΛ£} [Fintype G] [Decidable (G = βŠ₯)] : βˆ‘ x : G, (x.val : K) = if G = βŠ₯ then 1 else 0 := by by_cases G_bot : G = βŠ₯ Β· subst G_bot simp only [ite_true, Subgroup.mem_bot, Fintype.card_ofSubsingleton, Nat.cast_ite, Nat.cast_one, Nat.cast_zero, univ_unique, Set.default_coe_singleton, sum_singleton, Units.val_one] Β· simp only [G_bot, ite_false] exact sum_subgroup_units_eq_zero G_bot @[simp]
Mathlib/FieldTheory/Finite/Basic.lean
179
210
theorem sum_subgroup_pow_eq_zero [CommRing K] [NoZeroDivisors K] {G : Subgroup KΛ£} [Fintype G] {k : β„•} (k_pos : k β‰  0) (k_lt_card_G : k < Fintype.card G) : βˆ‘ x : G, ((x : KΛ£) : K) ^ k = 0 := by
nontriviality K have := NoZeroDivisors.to_isDomain K rcases (exists_pow_ne_one_of_isCyclic k_pos k_lt_card_G) with ⟨a, ha⟩ rw [Finset.sum_eq_multiset_sum] have h_multiset_map : Finset.univ.val.map (fun x : G => ((x : KΛ£) : K) ^ k) = Finset.univ.val.map (fun x : G => ((x : KΛ£) : K) ^ k * ((a : KΛ£) : K) ^ k) := by simp_rw [← mul_pow] have as_comp : (fun x : β†₯G => (((x : KΛ£) : K) * ((a : KΛ£) : K)) ^ k) = (fun x : β†₯G => ((x : KΛ£) : K) ^ k) ∘ fun x : β†₯G => x * a := by funext x simp only [Function.comp_apply, Submonoid.coe_mul, Subgroup.coe_toSubmonoid, Units.val_mul] rw [as_comp, ← Multiset.map_map] congr rw [eq_comm] exact Multiset.map_univ_val_equiv (Equiv.mulRight a) have h_multiset_map_sum : (Multiset.map (fun x : G => ((x : KΛ£) : K) ^ k) Finset.univ.val).sum = (Multiset.map (fun x : G => ((x : KΛ£) : K) ^ k * ((a : KΛ£) : K) ^ k) Finset.univ.val).sum := by rw [h_multiset_map] rw [Multiset.sum_map_mul_right] at h_multiset_map_sum have hzero : (((a : KΛ£) : K) ^ k - 1 : K) * (Multiset.map (fun i : G => (i.val : K) ^ k) Finset.univ.val).sum = 0 := by rw [sub_mul, mul_comm, ← h_multiset_map_sum, one_mul, sub_self] rw [mul_eq_zero] at hzero refine hzero.resolve_left fun h => ha ?_ ext rw [← sub_eq_zero] simp_rw [SubmonoidClass.coe_pow, Units.val_pow_eq_pow_val, OneMemClass.coe_one, Units.val_one, h]
29
3,931,334,297,144.042
2
1.833333
6
1,921
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral namespace Complex noncomputable def betaIntegral (u v : β„‚) : β„‚ := ∫ x : ℝ in (0)..1, (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) #align complex.beta_integral Complex.betaIntegral
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
63
76
theorem betaIntegral_convergent_left {u : β„‚} (hu : 0 < re u) (v : β„‚) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 (1 / 2) := by
apply IntervalIntegrable.mul_continuousOn Β· refine intervalIntegral.intervalIntegrable_cpow' ?_ rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right] Β· apply ContinuousAt.continuousOn intro x hx rw [uIcc_of_le (by positivity : (0 : ℝ) ≀ 1 / 2)] at hx apply ContinuousAt.cpow Β· exact (continuous_const.sub continuous_ofReal).continuousAt Β· exact continuousAt_const Β· norm_cast exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2]
11
59,874.141715
2
1.857143
7
1,923
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral namespace Complex noncomputable def betaIntegral (u v : β„‚) : β„‚ := ∫ x : ℝ in (0)..1, (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) #align complex.beta_integral Complex.betaIntegral theorem betaIntegral_convergent_left {u : β„‚} (hu : 0 < re u) (v : β„‚) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 (1 / 2) := by apply IntervalIntegrable.mul_continuousOn Β· refine intervalIntegral.intervalIntegrable_cpow' ?_ rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right] Β· apply ContinuousAt.continuousOn intro x hx rw [uIcc_of_le (by positivity : (0 : ℝ) ≀ 1 / 2)] at hx apply ContinuousAt.cpow Β· exact (continuous_const.sub continuous_ofReal).continuousAt Β· exact continuousAt_const Β· norm_cast exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2] #align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
80
90
theorem betaIntegral_convergent {u v : β„‚} (hu : 0 < re u) (hv : 0 < re v) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 1 := by
refine (betaIntegral_convergent_left hu v).trans ?_ rw [IntervalIntegrable.iff_comp_neg] convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1 Β· ext1 x conv_lhs => rw [mul_comm] congr 2 <;> Β· push_cast; ring Β· norm_num Β· norm_num
8
2,980.957987
2
1.857143
7
1,923
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral namespace Complex noncomputable def betaIntegral (u v : β„‚) : β„‚ := ∫ x : ℝ in (0)..1, (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) #align complex.beta_integral Complex.betaIntegral theorem betaIntegral_convergent_left {u : β„‚} (hu : 0 < re u) (v : β„‚) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 (1 / 2) := by apply IntervalIntegrable.mul_continuousOn Β· refine intervalIntegral.intervalIntegrable_cpow' ?_ rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right] Β· apply ContinuousAt.continuousOn intro x hx rw [uIcc_of_le (by positivity : (0 : ℝ) ≀ 1 / 2)] at hx apply ContinuousAt.cpow Β· exact (continuous_const.sub continuous_ofReal).continuousAt Β· exact continuousAt_const Β· norm_cast exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2] #align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left theorem betaIntegral_convergent {u v : β„‚} (hu : 0 < re u) (hv : 0 < re v) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 1 := by refine (betaIntegral_convergent_left hu v).trans ?_ rw [IntervalIntegrable.iff_comp_neg] convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1 Β· ext1 x conv_lhs => rw [mul_comm] congr 2 <;> Β· push_cast; ring Β· norm_num Β· norm_num #align complex.beta_integral_convergent Complex.betaIntegral_convergent
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
93
102
theorem betaIntegral_symm (u v : β„‚) : betaIntegral v u = betaIntegral u v := by
rw [betaIntegral, betaIntegral] have := intervalIntegral.integral_comp_mul_add (a := 0) (b := 1) (c := -1) (fun x : ℝ => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1)) neg_one_lt_zero.ne 1 rw [inv_neg, inv_one, neg_one_smul, ← intervalIntegral.integral_symm] at this simp? at this says simp only [neg_mul, one_mul, ofReal_add, ofReal_neg, ofReal_one, sub_add_cancel_right, neg_neg, mul_one, add_left_neg, mul_zero, zero_add] at this conv_lhs at this => arg 1; intro x; rw [add_comm, ← sub_eq_add_neg, mul_comm] exact this
9
8,103.083928
2
1.857143
7
1,923
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral namespace Complex noncomputable def betaIntegral (u v : β„‚) : β„‚ := ∫ x : ℝ in (0)..1, (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) #align complex.beta_integral Complex.betaIntegral theorem betaIntegral_convergent_left {u : β„‚} (hu : 0 < re u) (v : β„‚) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 (1 / 2) := by apply IntervalIntegrable.mul_continuousOn Β· refine intervalIntegral.intervalIntegrable_cpow' ?_ rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right] Β· apply ContinuousAt.continuousOn intro x hx rw [uIcc_of_le (by positivity : (0 : ℝ) ≀ 1 / 2)] at hx apply ContinuousAt.cpow Β· exact (continuous_const.sub continuous_ofReal).continuousAt Β· exact continuousAt_const Β· norm_cast exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2] #align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left theorem betaIntegral_convergent {u v : β„‚} (hu : 0 < re u) (hv : 0 < re v) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 1 := by refine (betaIntegral_convergent_left hu v).trans ?_ rw [IntervalIntegrable.iff_comp_neg] convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1 Β· ext1 x conv_lhs => rw [mul_comm] congr 2 <;> Β· push_cast; ring Β· norm_num Β· norm_num #align complex.beta_integral_convergent Complex.betaIntegral_convergent theorem betaIntegral_symm (u v : β„‚) : betaIntegral v u = betaIntegral u v := by rw [betaIntegral, betaIntegral] have := intervalIntegral.integral_comp_mul_add (a := 0) (b := 1) (c := -1) (fun x : ℝ => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1)) neg_one_lt_zero.ne 1 rw [inv_neg, inv_one, neg_one_smul, ← intervalIntegral.integral_symm] at this simp? at this says simp only [neg_mul, one_mul, ofReal_add, ofReal_neg, ofReal_one, sub_add_cancel_right, neg_neg, mul_one, add_left_neg, mul_zero, zero_add] at this conv_lhs at this => arg 1; intro x; rw [add_comm, ← sub_eq_add_neg, mul_comm] exact this #align complex.beta_integral_symm Complex.betaIntegral_symm
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
105
111
theorem betaIntegral_eval_one_right {u : β„‚} (hu : 0 < re u) : betaIntegral u 1 = 1 / u := by
simp_rw [betaIntegral, sub_self, cpow_zero, mul_one] rw [integral_cpow (Or.inl _)] Β· rw [ofReal_zero, ofReal_one, one_cpow, zero_cpow, sub_zero, sub_add_cancel] rw [sub_add_cancel] contrapose! hu; rw [hu, zero_re] Β· rwa [sub_re, one_re, ← sub_pos, sub_neg_eq_add, sub_add_cancel]
6
403.428793
2
1.857143
7
1,923
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral namespace Complex noncomputable def betaIntegral (u v : β„‚) : β„‚ := ∫ x : ℝ in (0)..1, (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) #align complex.beta_integral Complex.betaIntegral theorem betaIntegral_convergent_left {u : β„‚} (hu : 0 < re u) (v : β„‚) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 (1 / 2) := by apply IntervalIntegrable.mul_continuousOn Β· refine intervalIntegral.intervalIntegrable_cpow' ?_ rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right] Β· apply ContinuousAt.continuousOn intro x hx rw [uIcc_of_le (by positivity : (0 : ℝ) ≀ 1 / 2)] at hx apply ContinuousAt.cpow Β· exact (continuous_const.sub continuous_ofReal).continuousAt Β· exact continuousAt_const Β· norm_cast exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2] #align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left theorem betaIntegral_convergent {u v : β„‚} (hu : 0 < re u) (hv : 0 < re v) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 1 := by refine (betaIntegral_convergent_left hu v).trans ?_ rw [IntervalIntegrable.iff_comp_neg] convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1 Β· ext1 x conv_lhs => rw [mul_comm] congr 2 <;> Β· push_cast; ring Β· norm_num Β· norm_num #align complex.beta_integral_convergent Complex.betaIntegral_convergent theorem betaIntegral_symm (u v : β„‚) : betaIntegral v u = betaIntegral u v := by rw [betaIntegral, betaIntegral] have := intervalIntegral.integral_comp_mul_add (a := 0) (b := 1) (c := -1) (fun x : ℝ => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1)) neg_one_lt_zero.ne 1 rw [inv_neg, inv_one, neg_one_smul, ← intervalIntegral.integral_symm] at this simp? at this says simp only [neg_mul, one_mul, ofReal_add, ofReal_neg, ofReal_one, sub_add_cancel_right, neg_neg, mul_one, add_left_neg, mul_zero, zero_add] at this conv_lhs at this => arg 1; intro x; rw [add_comm, ← sub_eq_add_neg, mul_comm] exact this #align complex.beta_integral_symm Complex.betaIntegral_symm theorem betaIntegral_eval_one_right {u : β„‚} (hu : 0 < re u) : betaIntegral u 1 = 1 / u := by simp_rw [betaIntegral, sub_self, cpow_zero, mul_one] rw [integral_cpow (Or.inl _)] Β· rw [ofReal_zero, ofReal_one, one_cpow, zero_cpow, sub_zero, sub_add_cancel] rw [sub_add_cancel] contrapose! hu; rw [hu, zero_re] Β· rwa [sub_re, one_re, ← sub_pos, sub_neg_eq_add, sub_add_cancel] #align complex.beta_integral_eval_one_right Complex.betaIntegral_eval_one_right
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
114
132
theorem betaIntegral_scaled (s t : β„‚) {a : ℝ} (ha : 0 < a) : ∫ x in (0)..a, (x : β„‚) ^ (s - 1) * ((a : β„‚) - x) ^ (t - 1) = (a : β„‚) ^ (s + t - 1) * betaIntegral s t := by
have ha' : (a : β„‚) β‰  0 := ofReal_ne_zero.mpr ha.ne' rw [betaIntegral] have A : (a : β„‚) ^ (s + t - 1) = a * ((a : β„‚) ^ (s - 1) * (a : β„‚) ^ (t - 1)) := by rw [(by abel : s + t - 1 = 1 + (s - 1) + (t - 1)), cpow_add _ _ ha', cpow_add 1 _ ha', cpow_one, mul_assoc] rw [A, mul_assoc, ← intervalIntegral.integral_const_mul, ← real_smul, ← zero_div a, ← div_self ha.ne', ← intervalIntegral.integral_comp_div _ ha.ne', zero_div] simp_rw [intervalIntegral.integral_of_le ha.le] refine setIntegral_congr measurableSet_Ioc fun x hx => ?_ rw [mul_mul_mul_comm] congr 1 Β· rw [← mul_cpow_ofReal_nonneg ha.le (div_pos hx.1 ha).le, ofReal_div, mul_div_cancelβ‚€ _ ha'] Β· rw [(by norm_cast : (1 : β„‚) - ↑(x / a) = ↑(1 - x / a)), ← mul_cpow_ofReal_nonneg ha.le (sub_nonneg.mpr <| (div_le_one ha).mpr hx.2)] push_cast rw [mul_sub, mul_one, mul_div_cancelβ‚€ _ ha']
16
8,886,110.520508
2
1.857143
7
1,923
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral namespace Complex noncomputable def betaIntegral (u v : β„‚) : β„‚ := ∫ x : ℝ in (0)..1, (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) #align complex.beta_integral Complex.betaIntegral theorem betaIntegral_convergent_left {u : β„‚} (hu : 0 < re u) (v : β„‚) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 (1 / 2) := by apply IntervalIntegrable.mul_continuousOn Β· refine intervalIntegral.intervalIntegrable_cpow' ?_ rwa [sub_re, one_re, ← zero_sub, sub_lt_sub_iff_right] Β· apply ContinuousAt.continuousOn intro x hx rw [uIcc_of_le (by positivity : (0 : ℝ) ≀ 1 / 2)] at hx apply ContinuousAt.cpow Β· exact (continuous_const.sub continuous_ofReal).continuousAt Β· exact continuousAt_const Β· norm_cast exact ofReal_mem_slitPlane.2 <| by linarith only [hx.2] #align complex.beta_integral_convergent_left Complex.betaIntegral_convergent_left theorem betaIntegral_convergent {u v : β„‚} (hu : 0 < re u) (hv : 0 < re v) : IntervalIntegrable (fun x => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1) : ℝ β†’ β„‚) volume 0 1 := by refine (betaIntegral_convergent_left hu v).trans ?_ rw [IntervalIntegrable.iff_comp_neg] convert ((betaIntegral_convergent_left hv u).comp_add_right 1).symm using 1 Β· ext1 x conv_lhs => rw [mul_comm] congr 2 <;> Β· push_cast; ring Β· norm_num Β· norm_num #align complex.beta_integral_convergent Complex.betaIntegral_convergent theorem betaIntegral_symm (u v : β„‚) : betaIntegral v u = betaIntegral u v := by rw [betaIntegral, betaIntegral] have := intervalIntegral.integral_comp_mul_add (a := 0) (b := 1) (c := -1) (fun x : ℝ => (x : β„‚) ^ (u - 1) * (1 - (x : β„‚)) ^ (v - 1)) neg_one_lt_zero.ne 1 rw [inv_neg, inv_one, neg_one_smul, ← intervalIntegral.integral_symm] at this simp? at this says simp only [neg_mul, one_mul, ofReal_add, ofReal_neg, ofReal_one, sub_add_cancel_right, neg_neg, mul_one, add_left_neg, mul_zero, zero_add] at this conv_lhs at this => arg 1; intro x; rw [add_comm, ← sub_eq_add_neg, mul_comm] exact this #align complex.beta_integral_symm Complex.betaIntegral_symm theorem betaIntegral_eval_one_right {u : β„‚} (hu : 0 < re u) : betaIntegral u 1 = 1 / u := by simp_rw [betaIntegral, sub_self, cpow_zero, mul_one] rw [integral_cpow (Or.inl _)] Β· rw [ofReal_zero, ofReal_one, one_cpow, zero_cpow, sub_zero, sub_add_cancel] rw [sub_add_cancel] contrapose! hu; rw [hu, zero_re] Β· rwa [sub_re, one_re, ← sub_pos, sub_neg_eq_add, sub_add_cancel] #align complex.beta_integral_eval_one_right Complex.betaIntegral_eval_one_right theorem betaIntegral_scaled (s t : β„‚) {a : ℝ} (ha : 0 < a) : ∫ x in (0)..a, (x : β„‚) ^ (s - 1) * ((a : β„‚) - x) ^ (t - 1) = (a : β„‚) ^ (s + t - 1) * betaIntegral s t := by have ha' : (a : β„‚) β‰  0 := ofReal_ne_zero.mpr ha.ne' rw [betaIntegral] have A : (a : β„‚) ^ (s + t - 1) = a * ((a : β„‚) ^ (s - 1) * (a : β„‚) ^ (t - 1)) := by rw [(by abel : s + t - 1 = 1 + (s - 1) + (t - 1)), cpow_add _ _ ha', cpow_add 1 _ ha', cpow_one, mul_assoc] rw [A, mul_assoc, ← intervalIntegral.integral_const_mul, ← real_smul, ← zero_div a, ← div_self ha.ne', ← intervalIntegral.integral_comp_div _ ha.ne', zero_div] simp_rw [intervalIntegral.integral_of_le ha.le] refine setIntegral_congr measurableSet_Ioc fun x hx => ?_ rw [mul_mul_mul_comm] congr 1 Β· rw [← mul_cpow_ofReal_nonneg ha.le (div_pos hx.1 ha).le, ofReal_div, mul_div_cancelβ‚€ _ ha'] Β· rw [(by norm_cast : (1 : β„‚) - ↑(x / a) = ↑(1 - x / a)), ← mul_cpow_ofReal_nonneg ha.le (sub_nonneg.mpr <| (div_le_one ha).mpr hx.2)] push_cast rw [mul_sub, mul_one, mul_div_cancelβ‚€ _ ha'] #align complex.beta_integral_scaled Complex.betaIntegral_scaled
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
136
151
theorem Gamma_mul_Gamma_eq_betaIntegral {s t : β„‚} (hs : 0 < re s) (ht : 0 < re t) : Gamma s * Gamma t = Gamma (s + t) * betaIntegral s t := by
-- Note that we haven't proved (yet) that the Gamma function has no zeroes, so we can't formulate -- this as a formula for the Beta function. have conv_int := integral_posConvolution (GammaIntegral_convergent hs) (GammaIntegral_convergent ht) (ContinuousLinearMap.mul ℝ β„‚) simp_rw [ContinuousLinearMap.mul_apply'] at conv_int have hst : 0 < re (s + t) := by rw [add_re]; exact add_pos hs ht rw [Gamma_eq_integral hs, Gamma_eq_integral ht, Gamma_eq_integral hst, GammaIntegral, GammaIntegral, GammaIntegral, ← conv_int, ← integral_mul_right (betaIntegral _ _)] refine setIntegral_congr measurableSet_Ioi fun x hx => ?_ rw [mul_assoc, ← betaIntegral_scaled s t hx, ← intervalIntegral.integral_const_mul] congr 1 with y : 1 push_cast suffices Complex.exp (-x) = Complex.exp (-y) * Complex.exp (-(x - y)) by rw [this]; ring rw [← Complex.exp_add]; congr 1; abel
14
1,202,604.284165
2
1.857143
7
1,923
import Mathlib.Analysis.Convolution import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd import Mathlib.Analysis.SpecialFunctions.Gamma.BohrMollerup import Mathlib.Analysis.Analytic.IsolatedZeros import Mathlib.Analysis.Complex.CauchyIntegral #align_import analysis.special_functions.gamma.beta from "leanprover-community/mathlib"@"a3209ddf94136d36e5e5c624b10b2a347cc9d090" noncomputable section set_option linter.uppercaseLean3 false open Filter intervalIntegral Set Real MeasureTheory open scoped Nat Topology Real section BetaIntegral section InvGamma open scoped Real namespace Complex
Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean
530
534
theorem one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (s : β„‚) : (Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹ := by
rcases ne_or_eq s 0 with (h | rfl) Β· rw [Gamma_add_one s h, mul_inv, mul_inv_cancel_leftβ‚€ h] Β· rw [zero_add, Gamma_zero, inv_zero, zero_mul]
3
20.085537
1
1.857143
7
1,923
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)]
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
34
43
theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by
have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one]
8
2,980.957987
2
1.857143
7
1,924
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
48
54
theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by
have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar]
5
148.413159
2
1.857143
7
1,924
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar] #align orientation.measure_eq_volume Orientation.measure_eq_volume end
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
61
66
theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ ℝ F) : volume (parallelepiped b) = 1 := by
haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b
4
54.59815
2
1.857143
7
1,924
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar] #align orientation.measure_eq_volume Orientation.measure_eq_volume end theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ ℝ F) : volume (parallelepiped b) = 1 := by haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b #align orthonormal_basis.volume_parallelepiped OrthonormalBasis.volume_parallelepiped
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
71
76
theorem OrthonormalBasis.addHaar_eq_volume {ΞΉ F : Type*} [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] (b : OrthonormalBasis ΞΉ ℝ F) : b.toBasis.addHaar = volume := by
rw [Basis.addHaar_eq_iff] exact b.volume_parallelepiped
2
7.389056
1
1.857143
7
1,924
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar] #align orientation.measure_eq_volume Orientation.measure_eq_volume end theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ ℝ F) : volume (parallelepiped b) = 1 := by haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b #align orthonormal_basis.volume_parallelepiped OrthonormalBasis.volume_parallelepiped theorem OrthonormalBasis.addHaar_eq_volume {ΞΉ F : Type*} [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] (b : OrthonormalBasis ΞΉ ℝ F) : b.toBasis.addHaar = volume := by rw [Basis.addHaar_eq_iff] exact b.volume_parallelepiped noncomputable def OrthonormalBasis.measurableEquiv (b : OrthonormalBasis ΞΉ ℝ F) : F ≃ᡐ EuclideanSpace ℝ ΞΉ := b.repr.toHomeomorph.toMeasurableEquiv
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
84
89
theorem OrthonormalBasis.measurePreserving_measurableEquiv (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.measurableEquiv volume volume := by
convert (b.measurableEquiv.symm.measurable.measurePreserving _).symm rw [← (EuclideanSpace.basisFun ΞΉ ℝ).addHaar_eq_volume] erw [MeasurableEquiv.coe_toEquiv_symm, Basis.map_addHaar _ b.repr.symm.toContinuousLinearEquiv] exact b.addHaar_eq_volume.symm
4
54.59815
2
1.857143
7
1,924
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar] #align orientation.measure_eq_volume Orientation.measure_eq_volume end theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ ℝ F) : volume (parallelepiped b) = 1 := by haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b #align orthonormal_basis.volume_parallelepiped OrthonormalBasis.volume_parallelepiped theorem OrthonormalBasis.addHaar_eq_volume {ΞΉ F : Type*} [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] (b : OrthonormalBasis ΞΉ ℝ F) : b.toBasis.addHaar = volume := by rw [Basis.addHaar_eq_iff] exact b.volume_parallelepiped noncomputable def OrthonormalBasis.measurableEquiv (b : OrthonormalBasis ΞΉ ℝ F) : F ≃ᡐ EuclideanSpace ℝ ΞΉ := b.repr.toHomeomorph.toMeasurableEquiv theorem OrthonormalBasis.measurePreserving_measurableEquiv (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.measurableEquiv volume volume := by convert (b.measurableEquiv.symm.measurable.measurePreserving _).symm rw [← (EuclideanSpace.basisFun ΞΉ ℝ).addHaar_eq_volume] erw [MeasurableEquiv.coe_toEquiv_symm, Basis.map_addHaar _ b.repr.symm.toContinuousLinearEquiv] exact b.addHaar_eq_volume.symm theorem OrthonormalBasis.measurePreserving_repr (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.repr volume volume := b.measurePreserving_measurableEquiv theorem OrthonormalBasis.measurePreserving_repr_symm (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.repr.symm volume volume := b.measurePreserving_measurableEquiv.symm section PiLp variable (ΞΉ : Type*) [Fintype ΞΉ]
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
102
108
theorem EuclideanSpace.volume_preserving_measurableEquiv : MeasurePreserving (EuclideanSpace.measurableEquiv ΞΉ) := by
suffices volume = map (EuclideanSpace.measurableEquiv ΞΉ).symm volume by convert ((EuclideanSpace.measurableEquiv ΞΉ).symm.measurable.measurePreserving _).symm rw [← addHaarMeasure_eq_volume_pi, ← Basis.parallelepiped_basisFun, ← Basis.addHaar_def, coe_measurableEquiv_symm, ← PiLp.continuousLinearEquiv_symm_apply 2 ℝ, Basis.map_addHaar] exact (EuclideanSpace.basisFun _ _).addHaar_eq_volume.symm
5
148.413159
2
1.857143
7
1,924
import Mathlib.Analysis.InnerProductSpace.Orientation import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar #align_import measure_theory.measure.haar.inner_product_space from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" open FiniteDimensional MeasureTheory MeasureTheory.Measure Set variable {ΞΉ E F : Type*} variable [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] section variable {m n : β„•} [_i : Fact (finrank ℝ F = n)] theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n)) (b : OrthonormalBasis ΞΉ ℝ F) : o.volumeForm.measure (parallelepiped b) = 1 := by have e : ΞΉ ≃ Fin n := by refine Fintype.equivFinOfCardEq ?_ rw [← _i.out, finrank_eq_card_basis b.toBasis] have A : ⇑b = b.reindex e ∘ e := by ext x simp only [OrthonormalBasis.coe_reindex, Function.comp_apply, Equiv.symm_apply_apply] rw [A, parallelepiped_comp_equiv, AlternatingMap.measure_parallelepiped, o.abs_volumeForm_apply_of_orthonormal, ENNReal.ofReal_one] #align orientation.measure_orthonormal_basis Orientation.measure_orthonormalBasis theorem Orientation.measure_eq_volume (o : Orientation ℝ F (Fin n)) : o.volumeForm.measure = volume := by have A : o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped = 1 := Orientation.measure_orthonormalBasis o (stdOrthonormalBasis ℝ F) rw [addHaarMeasure_unique o.volumeForm.measure (stdOrthonormalBasis ℝ F).toBasis.parallelepiped, A, one_smul] simp only [volume, Basis.addHaar] #align orientation.measure_eq_volume Orientation.measure_eq_volume end theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ΞΉ ℝ F) : volume (parallelepiped b) = 1 := by haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b #align orthonormal_basis.volume_parallelepiped OrthonormalBasis.volume_parallelepiped theorem OrthonormalBasis.addHaar_eq_volume {ΞΉ F : Type*} [Fintype ΞΉ] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] (b : OrthonormalBasis ΞΉ ℝ F) : b.toBasis.addHaar = volume := by rw [Basis.addHaar_eq_iff] exact b.volume_parallelepiped noncomputable def OrthonormalBasis.measurableEquiv (b : OrthonormalBasis ΞΉ ℝ F) : F ≃ᡐ EuclideanSpace ℝ ΞΉ := b.repr.toHomeomorph.toMeasurableEquiv theorem OrthonormalBasis.measurePreserving_measurableEquiv (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.measurableEquiv volume volume := by convert (b.measurableEquiv.symm.measurable.measurePreserving _).symm rw [← (EuclideanSpace.basisFun ΞΉ ℝ).addHaar_eq_volume] erw [MeasurableEquiv.coe_toEquiv_symm, Basis.map_addHaar _ b.repr.symm.toContinuousLinearEquiv] exact b.addHaar_eq_volume.symm theorem OrthonormalBasis.measurePreserving_repr (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.repr volume volume := b.measurePreserving_measurableEquiv theorem OrthonormalBasis.measurePreserving_repr_symm (b : OrthonormalBasis ΞΉ ℝ F) : MeasurePreserving b.repr.symm volume volume := b.measurePreserving_measurableEquiv.symm namespace LinearIsometryEquiv variable [NormedAddCommGroup E] [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] variable (f : E ≃ₗᡒ[ℝ] F)
Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean
138
143
theorem measurePreserving : MeasurePreserving f := by
refine ⟨f.continuous.measurable, ?_⟩ rcases exists_orthonormalBasis ℝ E with ⟨w, b, _hw⟩ erw [← OrthonormalBasis.addHaar_eq_volume b, ← OrthonormalBasis.addHaar_eq_volume (b.map f), Basis.map_addHaar _ f.toContinuousLinearEquiv] congr
5
148.413159
2
1.857143
7
1,924
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E}
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
39
44
theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by
refine h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right ?_) refine isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, ?_, EventuallyEq.rfl⟩ refine (continuous_id.sub continuous_const).norm.tendsto' _ _ ?_ rw [_root_.id, sub_self, norm_zero]
4
54.59815
2
1.857143
7
1,925
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right ?_) refine isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, ?_, EventuallyEq.rfl⟩ refine (continuous_id.sub continuous_const).norm.tendsto' _ _ ?_ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
91
101
theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) p.derivSeries x r := by
refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ?_ fun z hz ↦ ?_ Β· refine continuousMultilinearCurryFin1 π•œ E F |>.toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall ?_ simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x dsimp only rw [← h.fderiv_eq, add_sub_cancel] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
9
8,103.083928
2
1.857143
7
1,925
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right ?_) refine isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, ?_, EventuallyEq.rfl⟩ refine (continuous_id.sub continuous_const).norm.tendsto' _ _ ?_ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) p.derivSeries x r := by refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ?_ fun z hz ↦ ?_ Β· refine continuousMultilinearCurryFin1 π•œ E F |>.toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall ?_ simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x dsimp only rw [← h.fderiv_eq, add_sub_cancel] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
105
109
theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by
intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt
3
20.085537
1
1.857143
7
1,925
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] section fderiv variable {p : FormalMultilinearSeries π•œ E F} {r : ℝβ‰₯0∞} variable {f : E β†’ F} {x : E} {s : Set E} theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) : HasStrictFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := by refine h.isBigO_image_sub_norm_mul_norm_sub.trans_isLittleO (IsLittleO.of_norm_right ?_) refine isLittleO_iff_exists_eq_mul.2 ⟨fun y => β€–y - (x, x)β€–, ?_, EventuallyEq.rfl⟩ refine (continuous_id.sub continuous_const).norm.tendsto' _ _ ?_ rw [_root_.id, sub_self, norm_zero] #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p 1)) x := h.hasStrictFDerivAt.hasFDerivAt #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt π•œ f x := h.hasFDerivAt.differentiableAt #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt theorem AnalyticAt.differentiableAt : AnalyticAt π•œ f x β†’ DifferentiableAt π•œ f x | ⟨_, hp⟩ => hp.differentiableAt #align analytic_at.differentiable_at AnalyticAt.differentiableAt theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt π•œ f x) : DifferentiableWithinAt π•œ f s x := h.differentiableAt.differentiableWithinAt #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) : fderiv π•œ f x = continuousMultilinearCurryFin1 π•œ E F (p 1) := h.hasFDerivAt.fderiv #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn π•œ f (EMetric.ball x r) := fun _ hy => (h.analyticAt_of_mem hy).differentiableWithinAt #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn theorem AnalyticOn.differentiableOn (h : AnalyticOn π•œ f s) : DifferentiableOn π•œ f s := fun y hy => (h y hy).differentiableWithinAt #align analytic_on.differentiable_on AnalyticOn.differentiableOn theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1)) (x + y) := (h.changeOrigin hy).hasFPowerSeriesAt.hasFDerivAt #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : fderiv π•œ f (x + y) = continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin y 1) := (h.hasFDerivAt hy).fderiv #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (fderiv π•œ f) p.derivSeries x r := by refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 π•œ E F (p.changeOrigin (z - x) 1)) ?_ fun z hz ↦ ?_ Β· refine continuousMultilinearCurryFin1 π•œ E F |>.toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall ?_ simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x dsimp only rw [← h.fderiv_eq, add_sub_cancel] simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn π•œ f s) : AnalyticOn π•œ (fderiv π•œ f) s := by intro y hy rcases h y hy with ⟨p, r, hp⟩ exact hp.fderiv.analyticAt #align analytic_on.fderiv AnalyticOn.fderiv
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
113
122
theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn π•œ f s) (n : β„•) : AnalyticOn π•œ (iteratedFDeriv π•œ n f) s := by
induction' n with n IH Β· rw [iteratedFDeriv_zero_eq_comp] exact ((continuousMultilinearCurryFin0 π•œ E F).symm : F β†’L[π•œ] E[Γ—0]β†’L[π•œ] F).comp_analyticOn h Β· rw [iteratedFDeriv_succ_eq_comp_left] -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined. convert ContinuousLinearMap.comp_analyticOn ?g IH.fderiv case g => exact ↑(continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) ↦ E) F) simp
8
2,980.957987
2
1.857143
7
1,925
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] namespace ContinuousMultilinearMap variable {ΞΉ : Type*} {E : ΞΉ β†’ Type*} [βˆ€ i, NormedAddCommGroup (E i)] [βˆ€ i, NormedSpace π•œ (E i)] [Fintype ΞΉ] (f : ContinuousMultilinearMap π•œ E F) open FormalMultilinearSeries protected theorem hasFiniteFPowerSeriesOnBall : HasFiniteFPowerSeriesOnBall f f.toFormalMultilinearSeries 0 (Fintype.card ΞΉ + 1) ⊀ := .mk' (fun m hm ↦ dif_neg (Nat.succ_le_iff.mp hm).ne) ENNReal.zero_lt_top fun y _ ↦ by rw [Finset.sum_eq_single_of_mem _ (Finset.self_mem_range_succ _), zero_add] Β· rw [toFormalMultilinearSeries, dif_pos rfl]; rfl Β· intro m _ ne; rw [toFormalMultilinearSeries, dif_neg ne.symm]; rfl theorem changeOriginSeries_support {k l : β„•} (h : k + l β‰  Fintype.card ΞΉ) : f.toFormalMultilinearSeries.changeOriginSeries k l = 0 := Finset.sum_eq_zero fun _ _ ↦ by simp_rw [FormalMultilinearSeries.changeOriginSeriesTerm, toFormalMultilinearSeries, dif_neg h.symm, LinearIsometryEquiv.map_zero] variable {n : β„•βˆž} (x : βˆ€ i, E i) open Finset in
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
314
346
theorem changeOrigin_toFormalMultilinearSeries [DecidableEq ΞΉ] : continuousMultilinearCurryFin1 π•œ (βˆ€ i, E i) F (f.toFormalMultilinearSeries.changeOrigin x 1) = f.linearDeriv x := by
ext y rw [continuousMultilinearCurryFin1_apply, linearDeriv_apply, changeOrigin, FormalMultilinearSeries.sum] cases isEmpty_or_nonempty ΞΉ Β· have (l) : 1 + l β‰  Fintype.card ΞΉ := by rw [add_comm, Fintype.card_eq_zero]; exact Nat.succ_ne_zero _ simp_rw [Fintype.sum_empty, changeOriginSeries_support _ (this _), zero_apply _, tsum_zero]; rfl rw [tsum_eq_single (Fintype.card ΞΉ - 1), changeOriginSeries]; swap Β· intro m hm rw [Ne, eq_tsub_iff_add_eq_of_le (by exact Fintype.card_pos), add_comm] at hm rw [f.changeOriginSeries_support hm, zero_apply] rw [sum_apply, ContinuousMultilinearMap.sum_apply, Fin.snoc_zero] simp_rw [changeOriginSeriesTerm_apply] refine (Fintype.sum_bijective (?_ ∘ Fintype.equivFinOfCardEq (Nat.add_sub_of_le Fintype.card_pos).symm) (.comp ?_ <| Equiv.bijective _) _ _ fun i ↦ ?_).symm Β· exact (⟨{Β·}ᢜ, by rw [card_compl, Fintype.card_fin, card_singleton, Nat.add_sub_cancel_left]⟩) Β· use fun _ _ ↦ (singleton_injective <| compl_injective <| Subtype.ext_iff.mp Β·) intro ⟨s, hs⟩ have h : sᢜ.card = 1 := by rw [card_compl, hs, Fintype.card_fin, Nat.add_sub_cancel] obtain ⟨a, ha⟩ := card_eq_one.mp h exact ⟨a, Subtype.ext (compl_eq_comm.mp ha)⟩ rw [Function.comp_apply, Subtype.coe_mk, compl_singleton, piecewise_erase_univ, toFormalMultilinearSeries, dif_pos (Nat.add_sub_of_le Fintype.card_pos).symm] simp_rw [domDomCongr_apply, compContinuousLinearMap_apply, ContinuousLinearMap.proj_apply, Function.update_apply, (Equiv.injective _).eq_iff, ite_apply] congr; ext j obtain rfl | hj := eq_or_ne j i Β· rw [Function.update_same, if_pos rfl] Β· rw [Function.update_noteq hj, if_neg hj]
30
10,686,474,581,524.463
2
1.857143
7
1,925
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) open Fintype ContinuousLinearMap in
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
449
458
theorem derivSeries_apply_diag (n : β„•) (x : E) : derivSeries p n (fun _ ↦ x) x = (n + 1) β€’ p (n + 1) fun _ ↦ x := by
simp only [derivSeries, compFormalMultilinearSeries_apply, changeOriginSeries, compContinuousMultilinearMap_coe, ContinuousLinearEquiv.coe_coe, LinearIsometryEquiv.coe_coe, Function.comp_apply, ContinuousMultilinearMap.sum_apply, map_sum, coe_sum', Finset.sum_apply, continuousMultilinearCurryFin1_apply, Matrix.zero_empty] convert Finset.sum_const _ Β· rw [Fin.snoc_zero, changeOriginSeriesTerm_apply, Finset.piecewise_same, add_comm] Β· rw [← card, card_subtype, ← Finset.powerset_univ, ← Finset.powersetCard_eq_filter, Finset.card_powersetCard, ← card, card_fin, eq_comm, add_comm, Nat.choose_succ_self_right]
8
2,980.957987
2
1.857143
7
1,925
import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.CPolynomial import Mathlib.Analysis.Calculus.Deriv.Basic import Mathlib.Analysis.Calculus.ContDiff.Defs import Mathlib.Analysis.Calculus.FDeriv.Add #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" open Filter Asymptotics open scoped ENNReal universe u v variable {π•œ : Type*} [NontriviallyNormedField π•œ] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace π•œ E] variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π•œ F] namespace HasFPowerSeriesOnBall open FormalMultilinearSeries ENNReal Nat variable {p : FormalMultilinearSeries π•œ E F} {f : E β†’ F} {x : E} {r : ℝβ‰₯0∞} (h : HasFPowerSeriesOnBall f p x r) (y : E)
Mathlib/Analysis/Calculus/FDeriv/Analytic.lean
469
474
theorem iteratedFDeriv_zero_apply_diag : iteratedFDeriv π•œ 0 f x = p 0 := by
ext convert (h.hasSum <| EMetric.mem_ball_self h.r_pos).tsum_eq.symm Β· rw [iteratedFDeriv_zero_apply, add_zero] Β· rw [tsum_eq_single 0 fun n hn ↦ by haveI := NeZero.mk hn; exact (p n).map_zero] exact congr(p 0 $(Subsingleton.elim _ _))
5
148.413159
2
1.857143
7
1,925
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*}
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
36
41
theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by
suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb
5
148.413159
2
1.857143
7
1,926
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
44
50
theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by
suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha
5
148.413159
2
1.857143
7
1,926
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha #align cpow_eq_nhds cpow_eq_nhds
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
53
62
theorem cpow_eq_nhds' {p : β„‚ Γ— β„‚} (hp_fst : p.fst β‰  0) : (fun x => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := by
suffices βˆ€αΆ  x : β„‚ Γ— β„‚ in 𝓝 p, x.1 β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] refine IsOpen.eventually_mem ?_ hp_fst change IsOpen { x : β„‚ Γ— β„‚ | x.1 = 0 }ᢜ rw [isOpen_compl_iff] exact isClosed_eq continuous_fst continuous_const
8
2,980.957987
2
1.857143
7
1,926
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha #align cpow_eq_nhds cpow_eq_nhds theorem cpow_eq_nhds' {p : β„‚ Γ— β„‚} (hp_fst : p.fst β‰  0) : (fun x => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := by suffices βˆ€αΆ  x : β„‚ Γ— β„‚ in 𝓝 p, x.1 β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] refine IsOpen.eventually_mem ?_ hp_fst change IsOpen { x : β„‚ Γ— β„‚ | x.1 = 0 }ᢜ rw [isOpen_compl_iff] exact isClosed_eq continuous_fst continuous_const #align cpow_eq_nhds' cpow_eq_nhds' -- Continuity of `fun x => a ^ x`: union of these two lemmas is optimal.
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
66
71
theorem continuousAt_const_cpow {a b : β„‚} (ha : a β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by
have cpow_eq : (fun x : β„‚ => a ^ x) = fun x => exp (log a * x) := by ext1 b rw [cpow_def_of_ne_zero ha] rw [cpow_eq] exact continuous_exp.continuousAt.comp (ContinuousAt.mul continuousAt_const continuousAt_id)
5
148.413159
2
1.857143
7
1,926
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha #align cpow_eq_nhds cpow_eq_nhds theorem cpow_eq_nhds' {p : β„‚ Γ— β„‚} (hp_fst : p.fst β‰  0) : (fun x => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := by suffices βˆ€αΆ  x : β„‚ Γ— β„‚ in 𝓝 p, x.1 β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] refine IsOpen.eventually_mem ?_ hp_fst change IsOpen { x : β„‚ Γ— β„‚ | x.1 = 0 }ᢜ rw [isOpen_compl_iff] exact isClosed_eq continuous_fst continuous_const #align cpow_eq_nhds' cpow_eq_nhds' -- Continuity of `fun x => a ^ x`: union of these two lemmas is optimal. theorem continuousAt_const_cpow {a b : β„‚} (ha : a β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by have cpow_eq : (fun x : β„‚ => a ^ x) = fun x => exp (log a * x) := by ext1 b rw [cpow_def_of_ne_zero ha] rw [cpow_eq] exact continuous_exp.continuousAt.comp (ContinuousAt.mul continuousAt_const continuousAt_id) #align continuous_at_const_cpow continuousAt_const_cpow
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
74
78
theorem continuousAt_const_cpow' {a b : β„‚} (h : b β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by
by_cases ha : a = 0 Β· rw [ha, continuousAt_congr (zero_cpow_eq_nhds h)] exact continuousAt_const Β· exact continuousAt_const_cpow ha
4
54.59815
2
1.857143
7
1,926
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha #align cpow_eq_nhds cpow_eq_nhds theorem cpow_eq_nhds' {p : β„‚ Γ— β„‚} (hp_fst : p.fst β‰  0) : (fun x => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := by suffices βˆ€αΆ  x : β„‚ Γ— β„‚ in 𝓝 p, x.1 β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] refine IsOpen.eventually_mem ?_ hp_fst change IsOpen { x : β„‚ Γ— β„‚ | x.1 = 0 }ᢜ rw [isOpen_compl_iff] exact isClosed_eq continuous_fst continuous_const #align cpow_eq_nhds' cpow_eq_nhds' -- Continuity of `fun x => a ^ x`: union of these two lemmas is optimal. theorem continuousAt_const_cpow {a b : β„‚} (ha : a β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by have cpow_eq : (fun x : β„‚ => a ^ x) = fun x => exp (log a * x) := by ext1 b rw [cpow_def_of_ne_zero ha] rw [cpow_eq] exact continuous_exp.continuousAt.comp (ContinuousAt.mul continuousAt_const continuousAt_id) #align continuous_at_const_cpow continuousAt_const_cpow theorem continuousAt_const_cpow' {a b : β„‚} (h : b β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by by_cases ha : a = 0 Β· rw [ha, continuousAt_congr (zero_cpow_eq_nhds h)] exact continuousAt_const Β· exact continuousAt_const_cpow ha #align continuous_at_const_cpow' continuousAt_const_cpow'
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
84
91
theorem continuousAt_cpow {p : β„‚ Γ— β„‚} (hp_fst : p.fst ∈ slitPlane) : ContinuousAt (fun x : β„‚ Γ— β„‚ => x.1 ^ x.2) p := by
rw [continuousAt_congr (cpow_eq_nhds' <| slitPlane_ne_zero hp_fst)] refine continuous_exp.continuousAt.comp ?_ exact ContinuousAt.mul (ContinuousAt.comp (continuousAt_clog hp_fst) continuous_fst.continuousAt) continuous_snd.continuousAt
6
403.428793
2
1.857143
7
1,926
import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics #align_import analysis.special_functions.pow.continuity from "leanprover-community/mathlib"@"0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8" noncomputable section open scoped Classical open Real Topology NNReal ENNReal Filter ComplexConjugate open Filter Finset Set section CpowLimits open Complex variable {Ξ± : Type*} theorem zero_cpow_eq_nhds {b : β„‚} (hb : b β‰  0) : (fun x : β„‚ => (0 : β„‚) ^ x) =αΆ [𝓝 b] 0 := by suffices βˆ€αΆ  x : β„‚ in 𝓝 b, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [zero_cpow hx, Pi.zero_apply] exact IsOpen.eventually_mem isOpen_ne hb #align zero_cpow_eq_nhds zero_cpow_eq_nhds theorem cpow_eq_nhds {a b : β„‚} (ha : a β‰  0) : (fun x => x ^ b) =αΆ [𝓝 a] fun x => exp (log x * b) := by suffices βˆ€αΆ  x : β„‚ in 𝓝 a, x β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] exact IsOpen.eventually_mem isOpen_ne ha #align cpow_eq_nhds cpow_eq_nhds theorem cpow_eq_nhds' {p : β„‚ Γ— β„‚} (hp_fst : p.fst β‰  0) : (fun x => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := by suffices βˆ€αΆ  x : β„‚ Γ— β„‚ in 𝓝 p, x.1 β‰  0 from this.mono fun x hx ↦ by dsimp only rw [cpow_def_of_ne_zero hx] refine IsOpen.eventually_mem ?_ hp_fst change IsOpen { x : β„‚ Γ— β„‚ | x.1 = 0 }ᢜ rw [isOpen_compl_iff] exact isClosed_eq continuous_fst continuous_const #align cpow_eq_nhds' cpow_eq_nhds' -- Continuity of `fun x => a ^ x`: union of these two lemmas is optimal. theorem continuousAt_const_cpow {a b : β„‚} (ha : a β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by have cpow_eq : (fun x : β„‚ => a ^ x) = fun x => exp (log a * x) := by ext1 b rw [cpow_def_of_ne_zero ha] rw [cpow_eq] exact continuous_exp.continuousAt.comp (ContinuousAt.mul continuousAt_const continuousAt_id) #align continuous_at_const_cpow continuousAt_const_cpow theorem continuousAt_const_cpow' {a b : β„‚} (h : b β‰  0) : ContinuousAt (fun x : β„‚ => a ^ x) b := by by_cases ha : a = 0 Β· rw [ha, continuousAt_congr (zero_cpow_eq_nhds h)] exact continuousAt_const Β· exact continuousAt_const_cpow ha #align continuous_at_const_cpow' continuousAt_const_cpow' theorem continuousAt_cpow {p : β„‚ Γ— β„‚} (hp_fst : p.fst ∈ slitPlane) : ContinuousAt (fun x : β„‚ Γ— β„‚ => x.1 ^ x.2) p := by rw [continuousAt_congr (cpow_eq_nhds' <| slitPlane_ne_zero hp_fst)] refine continuous_exp.continuousAt.comp ?_ exact ContinuousAt.mul (ContinuousAt.comp (continuousAt_clog hp_fst) continuous_fst.continuousAt) continuous_snd.continuousAt #align continuous_at_cpow continuousAt_cpow theorem continuousAt_cpow_const {a b : β„‚} (ha : a ∈ slitPlane) : ContinuousAt (Β· ^ b) a := Tendsto.comp (@continuousAt_cpow (a, b) ha) (continuousAt_id.prod continuousAt_const) #align continuous_at_cpow_const continuousAt_cpow_const theorem Filter.Tendsto.cpow {l : Filter Ξ±} {f g : Ξ± β†’ β„‚} {a b : β„‚} (hf : Tendsto f l (𝓝 a)) (hg : Tendsto g l (𝓝 b)) (ha : a ∈ slitPlane) : Tendsto (fun x => f x ^ g x) l (𝓝 (a ^ b)) := (@continuousAt_cpow (a, b) ha).tendsto.comp (hf.prod_mk_nhds hg) #align filter.tendsto.cpow Filter.Tendsto.cpow
Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
105
109
theorem Filter.Tendsto.const_cpow {l : Filter Ξ±} {f : Ξ± β†’ β„‚} {a b : β„‚} (hf : Tendsto f l (𝓝 b)) (h : a β‰  0 ∨ b β‰  0) : Tendsto (fun x => a ^ f x) l (𝓝 (a ^ b)) := by
cases h with | inl h => exact (continuousAt_const_cpow h).tendsto.comp hf | inr h => exact (continuousAt_const_cpow' h).tendsto.comp hf
3
20.085537
1
1.857143
7
1,926
import Mathlib.Probability.Notation import Mathlib.Probability.Integration import Mathlib.MeasureTheory.Function.L2Space #align_import probability.variance from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open MeasureTheory Filter Finset noncomputable section open scoped MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory -- Porting note: this lemma replaces `ENNReal.toReal_bit0`, which does not exist in Lean 4 private lemma coe_two : ENNReal.toReal 2 = (2 : ℝ) := rfl -- Porting note: Consider if `evariance` or `eVariance` is better. Also, -- consider `eVariationOn` in `Mathlib.Analysis.BoundedVariation`. def evariance {Ξ© : Type*} {_ : MeasurableSpace Ξ©} (X : Ξ© β†’ ℝ) (ΞΌ : Measure Ξ©) : ℝβ‰₯0∞ := ∫⁻ Ο‰, (β€–X Ο‰ - ΞΌ[X]β€–β‚Š : ℝβ‰₯0∞) ^ 2 βˆ‚ΞΌ #align probability_theory.evariance ProbabilityTheory.evariance def variance {Ξ© : Type*} {_ : MeasurableSpace Ξ©} (X : Ξ© β†’ ℝ) (ΞΌ : Measure Ξ©) : ℝ := (evariance X ΞΌ).toReal #align probability_theory.variance ProbabilityTheory.variance variable {Ξ© : Type*} {m : MeasurableSpace Ξ©} {X : Ξ© β†’ ℝ} {ΞΌ : Measure Ξ©}
Mathlib/Probability/Variance.lean
65
72
theorem _root_.MeasureTheory.Memβ„’p.evariance_lt_top [IsFiniteMeasure ΞΌ] (hX : Memβ„’p X 2 ΞΌ) : evariance X ΞΌ < ∞ := by
have := ENNReal.pow_lt_top (hX.sub <| memβ„’p_const <| ΞΌ[X]).2 2 rw [snorm_eq_lintegral_rpow_nnnorm two_ne_zero ENNReal.two_ne_top, ← ENNReal.rpow_two] at this simp only [coe_two, Pi.sub_apply, ENNReal.one_toReal, one_div] at this rw [← ENNReal.rpow_mul, inv_mul_cancel (two_ne_zero : (2 : ℝ) β‰  0), ENNReal.rpow_one] at this simp_rw [ENNReal.rpow_two] at this exact this
6
403.428793
2
1.857143
7
1,927
import Mathlib.Probability.Notation import Mathlib.Probability.Integration import Mathlib.MeasureTheory.Function.L2Space #align_import probability.variance from "leanprover-community/mathlib"@"f0c8bf9245297a541f468be517f1bde6195105e9" open MeasureTheory Filter Finset noncomputable section open scoped MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory -- Porting note: this lemma replaces `ENNReal.toReal_bit0`, which does not exist in Lean 4 private lemma coe_two : ENNReal.toReal 2 = (2 : ℝ) := rfl -- Porting note: Consider if `evariance` or `eVariance` is better. Also, -- consider `eVariationOn` in `Mathlib.Analysis.BoundedVariation`. def evariance {Ξ© : Type*} {_ : MeasurableSpace Ξ©} (X : Ξ© β†’ ℝ) (ΞΌ : Measure Ξ©) : ℝβ‰₯0∞ := ∫⁻ Ο‰, (β€–X Ο‰ - ΞΌ[X]β€–β‚Š : ℝβ‰₯0∞) ^ 2 βˆ‚ΞΌ #align probability_theory.evariance ProbabilityTheory.evariance def variance {Ξ© : Type*} {_ : MeasurableSpace Ξ©} (X : Ξ© β†’ ℝ) (ΞΌ : Measure Ξ©) : ℝ := (evariance X ΞΌ).toReal #align probability_theory.variance ProbabilityTheory.variance variable {Ξ© : Type*} {m : MeasurableSpace Ξ©} {X : Ξ© β†’ ℝ} {ΞΌ : Measure Ξ©} theorem _root_.MeasureTheory.Memβ„’p.evariance_lt_top [IsFiniteMeasure ΞΌ] (hX : Memβ„’p X 2 ΞΌ) : evariance X ΞΌ < ∞ := by have := ENNReal.pow_lt_top (hX.sub <| memβ„’p_const <| ΞΌ[X]).2 2 rw [snorm_eq_lintegral_rpow_nnnorm two_ne_zero ENNReal.two_ne_top, ← ENNReal.rpow_two] at this simp only [coe_two, Pi.sub_apply, ENNReal.one_toReal, one_div] at this rw [← ENNReal.rpow_mul, inv_mul_cancel (two_ne_zero : (2 : ℝ) β‰  0), ENNReal.rpow_one] at this simp_rw [ENNReal.rpow_two] at this exact this #align measure_theory.mem_β„’p.evariance_lt_top MeasureTheory.Memβ„’p.evariance_lt_top
Mathlib/Probability/Variance.lean
75
89
theorem evariance_eq_top [IsFiniteMeasure ΞΌ] (hXm : AEStronglyMeasurable X ΞΌ) (hX : Β¬Memβ„’p X 2 ΞΌ) : evariance X ΞΌ = ∞ := by
by_contra h rw [← Ne, ← lt_top_iff_ne_top] at h have : Memβ„’p (fun Ο‰ => X Ο‰ - ΞΌ[X]) 2 ΞΌ := by refine ⟨hXm.sub aestronglyMeasurable_const, ?_⟩ rw [snorm_eq_lintegral_rpow_nnnorm two_ne_zero ENNReal.two_ne_top] simp only [coe_two, ENNReal.one_toReal, ENNReal.rpow_two, Ne] exact ENNReal.rpow_lt_top_of_nonneg (by linarith) h.ne refine hX ?_ -- Porting note: `ΞΌ[X]` without whitespace is ambiguous as it could be GetElem, -- and `convert` cannot disambiguate based on typeclass inference failure. convert this.add (memβ„’p_const <| ΞΌ [X]) ext Ο‰ rw [Pi.add_apply, sub_add_cancel]
13
442,413.392009
2
1.857143
7
1,927