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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.