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
rank
int64
0
2.4k
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Complex theorem hasStrictFDerivAt_cpow {p : β„‚ Γ— β„‚} (hp : p.1 ∈ slitPlane) : HasStrictFDerivAt (fun x : β„‚ Γ— β„‚ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst β„‚ β„‚ β„‚ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd β„‚ β„‚ β„‚) p := by have A : p.1 β‰  0 := slitPlane_ne_zero hp have : (fun x : β„‚ Γ— β„‚ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := ((isOpen_ne.preimage continuous_fst).eventually_mem A).mono fun p hp => cpow_def_of_ne_zero hp _ rw [cpow_sub _ _ A, cpow_one, mul_div_left_comm, mul_smul, mul_smul] refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm simpa only [cpow_def_of_ne_zero A, div_eq_mul_inv, mul_smul, add_comm, smul_add] using ((hasStrictFDerivAt_fst.clog hp).mul hasStrictFDerivAt_snd).cexp #align complex.has_strict_fderiv_at_cpow Complex.hasStrictFDerivAt_cpow theorem hasStrictFDerivAt_cpow' {x y : β„‚} (hp : x ∈ slitPlane) : HasStrictFDerivAt (fun x : β„‚ Γ— β„‚ => x.1 ^ x.2) ((y * x ^ (y - 1)) β€’ ContinuousLinearMap.fst β„‚ β„‚ β„‚ + (x ^ y * log x) β€’ ContinuousLinearMap.snd β„‚ β„‚ β„‚) (x, y) := @hasStrictFDerivAt_cpow (x, y) hp #align complex.has_strict_fderiv_at_cpow' Complex.hasStrictFDerivAt_cpow'
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
52
60
theorem hasStrictDerivAt_const_cpow {x y : β„‚} (h : x β‰  0 ∨ y β‰  0) : HasStrictDerivAt (fun y => x ^ y) (x ^ y * log x) y := by
rcases em (x = 0) with (rfl | hx) Β· replace h := h.neg_resolve_left rfl rw [log_zero, mul_zero] refine (hasStrictDerivAt_const _ 0).congr_of_eventuallyEq ?_ exact (isOpen_ne.eventually_mem h).mono fun y hy => (zero_cpow hy).symm Β· simpa only [cpow_def_of_ne_zero hx, mul_one] using ((hasStrictDerivAt_id y).const_mul (log x)).cexp
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Real variable {x y z : ℝ}
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
276
285
theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ Γ— ℝ) (hp : 0 < p.1) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by
have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := (continuousAt_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp using 1 rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm, div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm]
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Real variable {x y z : ℝ} theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ Γ— ℝ) (hp : 0 < p.1) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := (continuousAt_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp using 1 rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm, div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm] #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
289
301
theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ Γ— ℝ) (hp : p.1 < 0) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1 - exp (log p.1 * p.2) * sin (p.2 * Ο€) * Ο€) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by
have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * Ο€) := (continuousAt_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul (hasStrictFDerivAt_snd.mul_const Ο€).cos using 1 simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc, mul_comm (cos _), ← rpow_def_of_neg hp] rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Real variable {x y z : ℝ} theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ Γ— ℝ) (hp : 0 < p.1) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := (continuousAt_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp using 1 rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm, div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm] #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ Γ— ℝ) (hp : p.1 < 0) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1 - exp (log p.1 * p.2) * sin (p.2 * Ο€) * Ο€) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * Ο€) := (continuousAt_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul (hasStrictFDerivAt_snd.mul_const Ο€).cos using 1 simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc, mul_comm (cos _), ← rpow_def_of_neg hp] rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring #align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
305
313
theorem contDiffAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) {n : β„•βˆž} : ContDiffAt ℝ n (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := by
cases' hp.lt_or_lt with hneg hpos exacts [(((contDiffAt_fst.log hneg.ne).mul contDiffAt_snd).exp.mul (contDiffAt_snd.mul contDiffAt_const).cos).congr_of_eventuallyEq ((continuousAt_fst.eventually (gt_mem_nhds hneg)).mono fun p hp => rpow_def_of_neg hp _), ((contDiffAt_fst.log hpos.ne').mul contDiffAt_snd).exp.congr_of_eventuallyEq ((continuousAt_fst.eventually (lt_mem_nhds hpos)).mono fun p hp => rpow_def_of_pos hp _)]
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Real variable {x y z : ℝ} theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ Γ— ℝ) (hp : 0 < p.1) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := (continuousAt_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp using 1 rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm, div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm] #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ Γ— ℝ) (hp : p.1 < 0) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1 - exp (log p.1 * p.2) * sin (p.2 * Ο€) * Ο€) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * Ο€) := (continuousAt_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul (hasStrictFDerivAt_snd.mul_const Ο€).cos using 1 simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc, mul_comm (cos _), ← rpow_def_of_neg hp] rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring #align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg theorem contDiffAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) {n : β„•βˆž} : ContDiffAt ℝ n (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := by cases' hp.lt_or_lt with hneg hpos exacts [(((contDiffAt_fst.log hneg.ne).mul contDiffAt_snd).exp.mul (contDiffAt_snd.mul contDiffAt_const).cos).congr_of_eventuallyEq ((continuousAt_fst.eventually (gt_mem_nhds hneg)).mono fun p hp => rpow_def_of_neg hp _), ((contDiffAt_fst.log hpos.ne').mul contDiffAt_snd).exp.congr_of_eventuallyEq ((continuousAt_fst.eventually (lt_mem_nhds hpos)).mono fun p hp => rpow_def_of_pos hp _)] #align real.cont_diff_at_rpow_of_ne Real.contDiffAt_rpow_of_ne theorem differentiableAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) : DifferentiableAt ℝ (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := (contDiffAt_rpow_of_ne p hp).differentiableAt le_rfl #align real.differentiable_at_rpow_of_ne Real.differentiableAt_rpow_of_ne
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
321
326
theorem _root_.HasStrictDerivAt.rpow {f g : ℝ β†’ ℝ} {f' g' : ℝ} (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x) (h : 0 < f x) : HasStrictDerivAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * Real.log (f x)) x := by
convert (hasStrictFDerivAt_rpow_of_pos ((fun x => (f x, g x)) x) h).comp_hasStrictDerivAt x (hf.prod hg) using 1 simp [mul_assoc, mul_comm, mul_left_comm]
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Real variable {x y z : ℝ} theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ Γ— ℝ) (hp : 0 < p.1) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := (continuousAt_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp using 1 rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm, div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm] #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ Γ— ℝ) (hp : p.1 < 0) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1 - exp (log p.1 * p.2) * sin (p.2 * Ο€) * Ο€) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * Ο€) := (continuousAt_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul (hasStrictFDerivAt_snd.mul_const Ο€).cos using 1 simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc, mul_comm (cos _), ← rpow_def_of_neg hp] rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring #align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg theorem contDiffAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) {n : β„•βˆž} : ContDiffAt ℝ n (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := by cases' hp.lt_or_lt with hneg hpos exacts [(((contDiffAt_fst.log hneg.ne).mul contDiffAt_snd).exp.mul (contDiffAt_snd.mul contDiffAt_const).cos).congr_of_eventuallyEq ((continuousAt_fst.eventually (gt_mem_nhds hneg)).mono fun p hp => rpow_def_of_neg hp _), ((contDiffAt_fst.log hpos.ne').mul contDiffAt_snd).exp.congr_of_eventuallyEq ((continuousAt_fst.eventually (lt_mem_nhds hpos)).mono fun p hp => rpow_def_of_pos hp _)] #align real.cont_diff_at_rpow_of_ne Real.contDiffAt_rpow_of_ne theorem differentiableAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) : DifferentiableAt ℝ (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := (contDiffAt_rpow_of_ne p hp).differentiableAt le_rfl #align real.differentiable_at_rpow_of_ne Real.differentiableAt_rpow_of_ne theorem _root_.HasStrictDerivAt.rpow {f g : ℝ β†’ ℝ} {f' g' : ℝ} (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x) (h : 0 < f x) : HasStrictDerivAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * Real.log (f x)) x := by convert (hasStrictFDerivAt_rpow_of_pos ((fun x => (f x, g x)) x) h).comp_hasStrictDerivAt x (hf.prod hg) using 1 simp [mul_assoc, mul_comm, mul_left_comm] #align has_strict_deriv_at.rpow HasStrictDerivAt.rpow
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
329
335
theorem hasStrictDerivAt_rpow_const_of_ne {x : ℝ} (hx : x β‰  0) (p : ℝ) : HasStrictDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x := by
cases' hx.lt_or_lt with hx hx Β· have := (hasStrictFDerivAt_rpow_of_neg (x, p) hx).comp_hasStrictDerivAt x ((hasStrictDerivAt_id x).prod (hasStrictDerivAt_const _ _)) convert this using 1; simp Β· simpa using (hasStrictDerivAt_id x).rpow (hasStrictDerivAt_const x p) hx
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter namespace Real variable {x y z : ℝ} theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ Γ— ℝ) (hp : 0 < p.1) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) := (continuousAt_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp using 1 rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm, div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm] #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ Γ— ℝ) (hp : p.1 < 0) : HasStrictFDerivAt (fun x : ℝ Γ— ℝ => x.1 ^ x.2) ((p.2 * p.1 ^ (p.2 - 1)) β€’ ContinuousLinearMap.fst ℝ ℝ ℝ + (p.1 ^ p.2 * log p.1 - exp (log p.1 * p.2) * sin (p.2 * Ο€) * Ο€) β€’ ContinuousLinearMap.snd ℝ ℝ ℝ) p := by have : (fun x : ℝ Γ— ℝ => x.1 ^ x.2) =αΆ [𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * Ο€) := (continuousAt_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _ refine HasStrictFDerivAt.congr_of_eventuallyEq ?_ this.symm convert ((hasStrictFDerivAt_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul (hasStrictFDerivAt_snd.mul_const Ο€).cos using 1 simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc, mul_comm (cos _), ← rpow_def_of_neg hp] rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring #align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg theorem contDiffAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) {n : β„•βˆž} : ContDiffAt ℝ n (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := by cases' hp.lt_or_lt with hneg hpos exacts [(((contDiffAt_fst.log hneg.ne).mul contDiffAt_snd).exp.mul (contDiffAt_snd.mul contDiffAt_const).cos).congr_of_eventuallyEq ((continuousAt_fst.eventually (gt_mem_nhds hneg)).mono fun p hp => rpow_def_of_neg hp _), ((contDiffAt_fst.log hpos.ne').mul contDiffAt_snd).exp.congr_of_eventuallyEq ((continuousAt_fst.eventually (lt_mem_nhds hpos)).mono fun p hp => rpow_def_of_pos hp _)] #align real.cont_diff_at_rpow_of_ne Real.contDiffAt_rpow_of_ne theorem differentiableAt_rpow_of_ne (p : ℝ Γ— ℝ) (hp : p.1 β‰  0) : DifferentiableAt ℝ (fun p : ℝ Γ— ℝ => p.1 ^ p.2) p := (contDiffAt_rpow_of_ne p hp).differentiableAt le_rfl #align real.differentiable_at_rpow_of_ne Real.differentiableAt_rpow_of_ne theorem _root_.HasStrictDerivAt.rpow {f g : ℝ β†’ ℝ} {f' g' : ℝ} (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x) (h : 0 < f x) : HasStrictDerivAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * Real.log (f x)) x := by convert (hasStrictFDerivAt_rpow_of_pos ((fun x => (f x, g x)) x) h).comp_hasStrictDerivAt x (hf.prod hg) using 1 simp [mul_assoc, mul_comm, mul_left_comm] #align has_strict_deriv_at.rpow HasStrictDerivAt.rpow theorem hasStrictDerivAt_rpow_const_of_ne {x : ℝ} (hx : x β‰  0) (p : ℝ) : HasStrictDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x := by cases' hx.lt_or_lt with hx hx Β· have := (hasStrictFDerivAt_rpow_of_neg (x, p) hx).comp_hasStrictDerivAt x ((hasStrictDerivAt_id x).prod (hasStrictDerivAt_const _ _)) convert this using 1; simp Β· simpa using (hasStrictDerivAt_id x).rpow (hasStrictDerivAt_const x p) hx #align real.has_strict_deriv_at_rpow_const_of_ne Real.hasStrictDerivAt_rpow_const_of_ne
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
338
340
theorem hasStrictDerivAt_const_rpow {a : ℝ} (ha : 0 < a) (x : ℝ) : HasStrictDerivAt (fun x => a ^ x) (a ^ x * log a) x := by
simpa using (hasStrictDerivAt_const _ _).rpow (hasStrictDerivAt_id x) ha
2,159
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv import Mathlib.Analysis.Calculus.FDeriv.Extend import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.SpecialFunctions.Log.Deriv import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section open scoped Classical Real Topology NNReal ENNReal Filter open Filter section Limits open Real Filter
Mathlib/Analysis/SpecialFunctions/Pow/Deriv.lean
648
656
theorem tendsto_one_plus_div_rpow_exp (t : ℝ) : Tendsto (fun x : ℝ => (1 + t / x) ^ x) atTop (𝓝 (exp t)) := by
apply ((Real.continuous_exp.tendsto _).comp (tendsto_mul_log_one_plus_div_atTop t)).congr' _ have h₁ : (1 : ℝ) / 2 < 1 := by linarith have hβ‚‚ : Tendsto (fun x : ℝ => 1 + t / x) atTop (𝓝 1) := by simpa using (tendsto_inv_atTop_zero.const_mul t).const_add 1 refine (eventually_ge_of_tendsto_gt h₁ hβ‚‚).mono fun x hx => ?_ have hx' : 0 < 1 + t / x := by linarith simp [mul_comm x, exp_mul, exp_log hx']
2,159
import Mathlib.Analysis.Convex.Combination import Mathlib.LinearAlgebra.AffineSpace.Independent import Mathlib.Tactic.FieldSimp #align_import analysis.convex.caratheodory from "leanprover-community/mathlib"@"e6fab1dc073396d45da082c644642c4f8bff2264" open Set Finset universe u variable {π•œ : Type*} {E : Type u} [LinearOrderedField π•œ] [AddCommGroup E] [Module π•œ E] namespace Caratheodory
Mathlib/Analysis/Convex/Caratheodory.lean
52
98
theorem mem_convexHull_erase [DecidableEq E] {t : Finset E} (h : Β¬AffineIndependent π•œ ((↑) : t β†’ E)) {x : E} (m : x ∈ convexHull π•œ (↑t : Set E)) : βˆƒ y : (↑t : Set E), x ∈ convexHull π•œ (↑(t.erase y) : Set E) := by
simp only [Finset.convexHull_eq, mem_setOf_eq] at m ⊒ obtain ⟨f, fpos, fsum, rfl⟩ := m obtain ⟨g, gcombo, gsum, gpos⟩ := exists_nontrivial_relation_sum_zero_of_not_affine_ind h replace gpos := exists_pos_of_sum_zero_of_exists_nonzero g gsum gpos clear h let s := @Finset.filter _ (fun z => 0 < g z) (fun _ => LinearOrder.decidableLT _ _) t obtain ⟨iβ‚€, mem, w⟩ : βˆƒ iβ‚€ ∈ s, βˆ€ i ∈ s, f iβ‚€ / g iβ‚€ ≀ f i / g i := by apply s.exists_min_image fun z => f z / g z obtain ⟨x, hx, hgx⟩ : βˆƒ x ∈ t, 0 < g x := gpos exact ⟨x, mem_filter.mpr ⟨hx, hgx⟩⟩ have hg : 0 < g iβ‚€ := by rw [mem_filter] at mem exact mem.2 have hiβ‚€ : iβ‚€ ∈ t := filter_subset _ _ mem let k : E β†’ π•œ := fun z => f z - f iβ‚€ / g iβ‚€ * g z have hk : k iβ‚€ = 0 := by field_simp [k, ne_of_gt hg] have ksum : βˆ‘ e ∈ t.erase iβ‚€, k e = 1 := by calc βˆ‘ e ∈ t.erase iβ‚€, k e = βˆ‘ e ∈ t, k e := by conv_rhs => rw [← insert_erase hiβ‚€, sum_insert (not_mem_erase iβ‚€ t), hk, zero_add] _ = βˆ‘ e ∈ t, (f e - f iβ‚€ / g iβ‚€ * g e) := rfl _ = 1 := by rw [sum_sub_distrib, fsum, ← mul_sum, gsum, mul_zero, sub_zero] refine ⟨⟨iβ‚€, hiβ‚€βŸ©, k, ?_, by convert ksum, ?_⟩ Β· simp only [k, and_imp, sub_nonneg, mem_erase, Ne, Subtype.coe_mk] intro e _ het by_cases hes : e ∈ s Β· have hge : 0 < g e := by rw [mem_filter] at hes exact hes.2 rw [← le_div_iff hge] exact w _ hes Β· calc _ ≀ 0 := by apply mul_nonpos_of_nonneg_of_nonpos Β· apply div_nonneg (fpos iβ‚€ (mem_of_subset (filter_subset _ t) mem)) (le_of_lt hg) Β· simpa only [s, mem_filter, het, true_and_iff, not_lt] using hes _ ≀ f e := fpos e het Β· rw [Subtype.coe_mk, centerMass_eq_of_sum_1 _ id ksum] calc βˆ‘ e ∈ t.erase iβ‚€, k e β€’ e = βˆ‘ e ∈ t, k e β€’ e := sum_erase _ (by rw [hk, zero_smul]) _ = βˆ‘ e ∈ t, (f e - f iβ‚€ / g iβ‚€ * g e) β€’ e := rfl _ = t.centerMass f id := by simp only [sub_smul, mul_smul, sum_sub_distrib, ← smul_sum, gcombo, smul_zero, sub_zero, centerMass, fsum, inv_one, one_smul, id]
2,160
import Mathlib.Analysis.Convex.Combination import Mathlib.LinearAlgebra.AffineSpace.Independent import Mathlib.Tactic.FieldSimp #align_import analysis.convex.caratheodory from "leanprover-community/mathlib"@"e6fab1dc073396d45da082c644642c4f8bff2264" open Set Finset universe u variable {π•œ : Type*} {E : Type u} [LinearOrderedField π•œ] [AddCommGroup E] [Module π•œ E] namespace Caratheodory theorem mem_convexHull_erase [DecidableEq E] {t : Finset E} (h : Β¬AffineIndependent π•œ ((↑) : t β†’ E)) {x : E} (m : x ∈ convexHull π•œ (↑t : Set E)) : βˆƒ y : (↑t : Set E), x ∈ convexHull π•œ (↑(t.erase y) : Set E) := by simp only [Finset.convexHull_eq, mem_setOf_eq] at m ⊒ obtain ⟨f, fpos, fsum, rfl⟩ := m obtain ⟨g, gcombo, gsum, gpos⟩ := exists_nontrivial_relation_sum_zero_of_not_affine_ind h replace gpos := exists_pos_of_sum_zero_of_exists_nonzero g gsum gpos clear h let s := @Finset.filter _ (fun z => 0 < g z) (fun _ => LinearOrder.decidableLT _ _) t obtain ⟨iβ‚€, mem, w⟩ : βˆƒ iβ‚€ ∈ s, βˆ€ i ∈ s, f iβ‚€ / g iβ‚€ ≀ f i / g i := by apply s.exists_min_image fun z => f z / g z obtain ⟨x, hx, hgx⟩ : βˆƒ x ∈ t, 0 < g x := gpos exact ⟨x, mem_filter.mpr ⟨hx, hgx⟩⟩ have hg : 0 < g iβ‚€ := by rw [mem_filter] at mem exact mem.2 have hiβ‚€ : iβ‚€ ∈ t := filter_subset _ _ mem let k : E β†’ π•œ := fun z => f z - f iβ‚€ / g iβ‚€ * g z have hk : k iβ‚€ = 0 := by field_simp [k, ne_of_gt hg] have ksum : βˆ‘ e ∈ t.erase iβ‚€, k e = 1 := by calc βˆ‘ e ∈ t.erase iβ‚€, k e = βˆ‘ e ∈ t, k e := by conv_rhs => rw [← insert_erase hiβ‚€, sum_insert (not_mem_erase iβ‚€ t), hk, zero_add] _ = βˆ‘ e ∈ t, (f e - f iβ‚€ / g iβ‚€ * g e) := rfl _ = 1 := by rw [sum_sub_distrib, fsum, ← mul_sum, gsum, mul_zero, sub_zero] refine ⟨⟨iβ‚€, hiβ‚€βŸ©, k, ?_, by convert ksum, ?_⟩ Β· simp only [k, and_imp, sub_nonneg, mem_erase, Ne, Subtype.coe_mk] intro e _ het by_cases hes : e ∈ s Β· have hge : 0 < g e := by rw [mem_filter] at hes exact hes.2 rw [← le_div_iff hge] exact w _ hes Β· calc _ ≀ 0 := by apply mul_nonpos_of_nonneg_of_nonpos Β· apply div_nonneg (fpos iβ‚€ (mem_of_subset (filter_subset _ t) mem)) (le_of_lt hg) Β· simpa only [s, mem_filter, het, true_and_iff, not_lt] using hes _ ≀ f e := fpos e het Β· rw [Subtype.coe_mk, centerMass_eq_of_sum_1 _ id ksum] calc βˆ‘ e ∈ t.erase iβ‚€, k e β€’ e = βˆ‘ e ∈ t, k e β€’ e := sum_erase _ (by rw [hk, zero_smul]) _ = βˆ‘ e ∈ t, (f e - f iβ‚€ / g iβ‚€ * g e) β€’ e := rfl _ = t.centerMass f id := by simp only [sub_smul, mul_smul, sum_sub_distrib, ← smul_sum, gcombo, smul_zero, sub_zero, centerMass, fsum, inv_one, one_smul, id] #align caratheodory.mem_convex_hull_erase Caratheodory.mem_convexHull_erase variable {s : Set E} {x : E} (hx : x ∈ convexHull π•œ s) noncomputable def minCardFinsetOfMemConvexHull : Finset E := Function.argminOn Finset.card Nat.lt_wfRel.2 { t | ↑t βŠ† s ∧ x ∈ convexHull π•œ (t : Set E) } <| by simpa only [convexHull_eq_union_convexHull_finite_subsets s, exists_prop, mem_iUnion] using hx #align caratheodory.min_card_finset_of_mem_convex_hull Caratheodory.minCardFinsetOfMemConvexHull theorem minCardFinsetOfMemConvexHull_subseteq : ↑(minCardFinsetOfMemConvexHull hx) βŠ† s := (Function.argminOn_mem _ _ { t : Finset E | ↑t βŠ† s ∧ x ∈ convexHull π•œ (t : Set E) } _).1 #align caratheodory.min_card_finset_of_mem_convex_hull_subseteq Caratheodory.minCardFinsetOfMemConvexHull_subseteq theorem mem_minCardFinsetOfMemConvexHull : x ∈ convexHull π•œ (minCardFinsetOfMemConvexHull hx : Set E) := (Function.argminOn_mem _ _ { t : Finset E | ↑t βŠ† s ∧ x ∈ convexHull π•œ (t : Set E) } _).2 #align caratheodory.mem_min_card_finset_of_mem_convex_hull Caratheodory.mem_minCardFinsetOfMemConvexHull
Mathlib/Analysis/Convex/Caratheodory.lean
119
121
theorem minCardFinsetOfMemConvexHull_nonempty : (minCardFinsetOfMemConvexHull hx).Nonempty := by
rw [← Finset.coe_nonempty, ← @convexHull_nonempty_iff π•œ] exact ⟨x, mem_minCardFinsetOfMemConvexHull hx⟩
2,160
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp]
Mathlib/SetTheory/Cardinal/Divisibility.lean
43
58
theorem isUnit_iff : IsUnit a ↔ a = 1 := by
refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) · exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht · exact ht.1 · exact one_le_iff_ne_zero.mpr ha · apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht
2,161
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) Β· exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht Β· exact ht.1 Β· exact one_le_iff_ne_zero.mpr ha Β· apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}Λ£ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : βˆ€ {a b : Cardinal}, b β‰  0 β†’ a ∣ b β†’ a ≀ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a β‰  0) (h : a ≀ b) (hb : β„΅β‚€ ≀ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp]
Mathlib/SetTheory/Cardinal/Divisibility.lean
76
89
theorem prime_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Prime a := by
refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ Β· rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz Β· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≀ b Β· cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
2,161
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) Β· exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht Β· exact ht.1 Β· exact one_le_iff_ne_zero.mpr ha Β· apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}Λ£ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : βˆ€ {a b : Cardinal}, b β‰  0 β†’ a ∣ b β†’ a ≀ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a β‰  0) (h : a ≀ b) (hb : β„΅β‚€ ≀ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp] theorem prime_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Prime a := by refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ Β· rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz Β· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≀ b Β· cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc #align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
Mathlib/SetTheory/Cardinal/Divisibility.lean
92
96
theorem not_irreducible_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Β¬Irreducible a := by
rw [irreducible_iff, not_and_or] refine Or.inr fun h => ?_ simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using h a β„΅β‚€
2,161
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) Β· exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht Β· exact ht.1 Β· exact one_le_iff_ne_zero.mpr ha Β· apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}Λ£ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : βˆ€ {a b : Cardinal}, b β‰  0 β†’ a ∣ b β†’ a ≀ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a β‰  0) (h : a ≀ b) (hb : β„΅β‚€ ≀ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp] theorem prime_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Prime a := by refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ Β· rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz Β· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≀ b Β· cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc #align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le theorem not_irreducible_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Β¬Irreducible a := by rw [irreducible_iff, not_and_or] refine Or.inr fun h => ?_ simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using h a β„΅β‚€ #align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le @[simp, norm_cast]
Mathlib/SetTheory/Cardinal/Divisibility.lean
100
108
theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by
refine ⟨?_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩ rintro ⟨k, hk⟩ have : ↑m < β„΅β‚€ := nat_lt_aleph0 m rw [hk, mul_lt_aleph0_iff] at this rcases this with (h | h | ⟨-, hk'⟩) iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk] lift k to β„• using hk' exact ⟨k, mod_cast hk⟩
2,161
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) Β· exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht Β· exact ht.1 Β· exact one_le_iff_ne_zero.mpr ha Β· apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}Λ£ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : βˆ€ {a b : Cardinal}, b β‰  0 β†’ a ∣ b β†’ a ≀ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a β‰  0) (h : a ≀ b) (hb : β„΅β‚€ ≀ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp] theorem prime_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Prime a := by refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ Β· rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz Β· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≀ b Β· cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc #align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le theorem not_irreducible_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Β¬Irreducible a := by rw [irreducible_iff, not_and_or] refine Or.inr fun h => ?_ simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using h a β„΅β‚€ #align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le @[simp, norm_cast] theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by refine ⟨?_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩ rintro ⟨k, hk⟩ have : ↑m < β„΅β‚€ := nat_lt_aleph0 m rw [hk, mul_lt_aleph0_iff] at this rcases this with (h | h | ⟨-, hk'⟩) iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk] lift k to β„• using hk' exact ⟨k, mod_cast hk⟩ #align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff @[simp]
Mathlib/SetTheory/Cardinal/Divisibility.lean
112
134
theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by
simp only [Prime, Nat.prime_iff] refine and_congr (by simp) (and_congr ?_ ⟨fun h b c hbc => ?_, fun h b c hbc => ?_⟩) Β· simp only [isUnit_iff, Nat.isUnit_iff] exact mod_cast Iff.rfl Β· exact mod_cast h b c (mod_cast hbc) cases' lt_or_le (b * c) β„΅β‚€ with h' h' Β· rcases mul_lt_aleph0_iff.mp h' with (rfl | rfl | ⟨hb, hc⟩) Β· simp Β· simp lift b to β„• using hb lift c to β„• using hc exact mod_cast h b c (mod_cast hbc) rcases aleph0_le_mul_iff.mp h' with ⟨hb, hc, hβ„΅β‚€βŸ© have hn : (n : Cardinal) β‰  0 := by intro h rw [h, zero_dvd_iff, mul_eq_zero] at hbc cases hbc <;> contradiction wlog hβ„΅β‚€b : β„΅β‚€ ≀ b apply (this h c b _ _ hc hb hβ„΅β‚€.symm hn (hβ„΅β‚€.resolve_left hβ„΅β‚€b)).symm <;> try assumption Β· rwa [mul_comm] at hbc Β· rwa [mul_comm] at h' Β· exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hβ„΅β‚€b) hβ„΅β‚€b)
2,161
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) Β· exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht Β· exact ht.1 Β· exact one_le_iff_ne_zero.mpr ha Β· apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}Λ£ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : βˆ€ {a b : Cardinal}, b β‰  0 β†’ a ∣ b β†’ a ≀ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a β‰  0) (h : a ≀ b) (hb : β„΅β‚€ ≀ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp] theorem prime_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Prime a := by refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ Β· rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz Β· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≀ b Β· cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc #align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le theorem not_irreducible_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Β¬Irreducible a := by rw [irreducible_iff, not_and_or] refine Or.inr fun h => ?_ simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using h a β„΅β‚€ #align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le @[simp, norm_cast] theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by refine ⟨?_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩ rintro ⟨k, hk⟩ have : ↑m < β„΅β‚€ := nat_lt_aleph0 m rw [hk, mul_lt_aleph0_iff] at this rcases this with (h | h | ⟨-, hk'⟩) iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk] lift k to β„• using hk' exact ⟨k, mod_cast hk⟩ #align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff @[simp] theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by simp only [Prime, Nat.prime_iff] refine and_congr (by simp) (and_congr ?_ ⟨fun h b c hbc => ?_, fun h b c hbc => ?_⟩) Β· simp only [isUnit_iff, Nat.isUnit_iff] exact mod_cast Iff.rfl Β· exact mod_cast h b c (mod_cast hbc) cases' lt_or_le (b * c) β„΅β‚€ with h' h' Β· rcases mul_lt_aleph0_iff.mp h' with (rfl | rfl | ⟨hb, hc⟩) Β· simp Β· simp lift b to β„• using hb lift c to β„• using hc exact mod_cast h b c (mod_cast hbc) rcases aleph0_le_mul_iff.mp h' with ⟨hb, hc, hβ„΅β‚€βŸ© have hn : (n : Cardinal) β‰  0 := by intro h rw [h, zero_dvd_iff, mul_eq_zero] at hbc cases hbc <;> contradiction wlog hβ„΅β‚€b : β„΅β‚€ ≀ b apply (this h c b _ _ hc hb hβ„΅β‚€.symm hn (hβ„΅β‚€.resolve_left hβ„΅β‚€b)).symm <;> try assumption Β· rwa [mul_comm] at hbc Β· rwa [mul_comm] at h' Β· exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hβ„΅β‚€b) hβ„΅β‚€b) #align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff
Mathlib/SetTheory/Cardinal/Divisibility.lean
137
141
theorem is_prime_iff {a : Cardinal} : Prime a ↔ β„΅β‚€ ≀ a ∨ βˆƒ p : β„•, a = p ∧ p.Prime := by
rcases le_or_lt β„΅β‚€ a with h | h Β· simp [h] lift a to β„• using id h simp [not_le.mpr h]
2,161
import Mathlib.Algebra.IsPrimePow import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.Tactic.WLOG #align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567" namespace Cardinal open Cardinal universe u variable {a b : Cardinal.{u}} {n m : β„•} @[simp] theorem isUnit_iff : IsUnit a ↔ a = 1 := by refine ⟨fun h => ?_, by rintro rfl exact isUnit_one⟩ rcases eq_or_ne a 0 with (rfl | ha) Β· exact (not_isUnit_zero h).elim rw [isUnit_iff_forall_dvd] at h cases' h 1 with t ht rw [eq_comm, mul_eq_one_iff'] at ht Β· exact ht.1 Β· exact one_le_iff_ne_zero.mpr ha Β· apply one_le_iff_ne_zero.mpr intro h rw [h, mul_zero] at ht exact zero_ne_one ht #align cardinal.is_unit_iff Cardinal.isUnit_iff instance : Unique Cardinal.{u}Λ£ where default := 1 uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.isUnit theorem le_of_dvd : βˆ€ {a b : Cardinal}, b β‰  0 β†’ a ∣ b β†’ a ≀ b | a, x, b0, ⟨b, hab⟩ => by simpa only [hab, mul_one] using mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a #align cardinal.le_of_dvd Cardinal.le_of_dvd theorem dvd_of_le_of_aleph0_le (ha : a β‰  0) (h : a ≀ b) (hb : β„΅β‚€ ≀ b) : a ∣ b := ⟨b, (mul_eq_right hb h ha).symm⟩ #align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le @[simp] theorem prime_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Prime a := by refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩ Β· rw [isUnit_iff] exact (one_lt_aleph0.trans_le ha).ne' rcases eq_or_ne (b * c) 0 with hz | hz Β· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp wlog h : c ≀ b Β· cases le_total c b <;> [solve_by_elim; rw [or_comm]] apply_assumption assumption' all_goals rwa [mul_comm] left have habc := le_of_dvd hz hbc rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc #align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le theorem not_irreducible_of_aleph0_le (ha : β„΅β‚€ ≀ a) : Β¬Irreducible a := by rw [irreducible_iff, not_and_or] refine Or.inr fun h => ?_ simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using h a β„΅β‚€ #align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le @[simp, norm_cast] theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by refine ⟨?_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩ rintro ⟨k, hk⟩ have : ↑m < β„΅β‚€ := nat_lt_aleph0 m rw [hk, mul_lt_aleph0_iff] at this rcases this with (h | h | ⟨-, hk'⟩) iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk] lift k to β„• using hk' exact ⟨k, mod_cast hk⟩ #align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff @[simp] theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by simp only [Prime, Nat.prime_iff] refine and_congr (by simp) (and_congr ?_ ⟨fun h b c hbc => ?_, fun h b c hbc => ?_⟩) Β· simp only [isUnit_iff, Nat.isUnit_iff] exact mod_cast Iff.rfl Β· exact mod_cast h b c (mod_cast hbc) cases' lt_or_le (b * c) β„΅β‚€ with h' h' Β· rcases mul_lt_aleph0_iff.mp h' with (rfl | rfl | ⟨hb, hc⟩) Β· simp Β· simp lift b to β„• using hb lift c to β„• using hc exact mod_cast h b c (mod_cast hbc) rcases aleph0_le_mul_iff.mp h' with ⟨hb, hc, hβ„΅β‚€βŸ© have hn : (n : Cardinal) β‰  0 := by intro h rw [h, zero_dvd_iff, mul_eq_zero] at hbc cases hbc <;> contradiction wlog hβ„΅β‚€b : β„΅β‚€ ≀ b apply (this h c b _ _ hc hb hβ„΅β‚€.symm hn (hβ„΅β‚€.resolve_left hβ„΅β‚€b)).symm <;> try assumption Β· rwa [mul_comm] at hbc Β· rwa [mul_comm] at h' Β· exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hβ„΅β‚€b) hβ„΅β‚€b) #align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff theorem is_prime_iff {a : Cardinal} : Prime a ↔ β„΅β‚€ ≀ a ∨ βˆƒ p : β„•, a = p ∧ p.Prime := by rcases le_or_lt β„΅β‚€ a with h | h Β· simp [h] lift a to β„• using id h simp [not_le.mpr h] #align cardinal.is_prime_iff Cardinal.is_prime_iff
Mathlib/SetTheory/Cardinal/Divisibility.lean
144
158
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ β„΅β‚€ ≀ a ∨ βˆƒ n : β„•, a = n ∧ IsPrimePow n := by
by_cases h : β„΅β‚€ ≀ a Β· simp [h, (prime_of_aleph0_le h).isPrimePow] simp only [h, Nat.cast_inj, exists_eq_left', false_or_iff, isPrimePow_nat_iff] lift a to β„• using not_le.mp h rw [isPrimePow_def] refine ⟨?_, fun ⟨n, han, p, k, hp, hk, h⟩ => ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩ rintro ⟨p, k, hp, hk, hpk⟩ have key : p ^ (1 : Cardinal) ≀ ↑a := by rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk rw [power_one] at key lift p to β„• using key.trans_lt (nat_lt_aleph0 a) exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, mod_cast hpk⟩
2,161
import Mathlib.Algebra.Field.ULift import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.Nat.Factorization.PrimePow import Mathlib.Data.Rat.Denumerable import Mathlib.FieldTheory.Finite.GaloisField import Mathlib.Logic.Equiv.TransferInstance import Mathlib.RingTheory.Localization.Cardinality import Mathlib.SetTheory.Cardinal.Divisibility #align_import field_theory.cardinality from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" local notation "β€–" x "β€–" => Fintype.card x open scoped Cardinal nonZeroDivisors universe u
Mathlib/FieldTheory/Cardinality.lean
40
49
theorem Fintype.isPrimePow_card_of_field {Ξ±} [Fintype Ξ±] [Field Ξ±] : IsPrimePow β€–Ξ±β€– := by
-- TODO: `Algebra` version of `CharP.exists`, of type `βˆ€ p, Algebra (ZMod p) Ξ±` cases' CharP.exists Ξ± with p _ haveI hp := Fact.mk (CharP.char_is_prime Ξ± p) letI : Algebra (ZMod p) Ξ± := ZMod.algebra _ _ let b := IsNoetherian.finsetBasis (ZMod p) Ξ± rw [Module.card_fintype b, ZMod.card, isPrimePow_pow_iff] Β· exact hp.1.isPrimePow rw [← FiniteDimensional.finrank_eq_card_basis b] exact FiniteDimensional.finrank_pos.ne'
2,162
import Mathlib.Algebra.Field.ULift import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.Nat.Factorization.PrimePow import Mathlib.Data.Rat.Denumerable import Mathlib.FieldTheory.Finite.GaloisField import Mathlib.Logic.Equiv.TransferInstance import Mathlib.RingTheory.Localization.Cardinality import Mathlib.SetTheory.Cardinal.Divisibility #align_import field_theory.cardinality from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" local notation "β€–" x "β€–" => Fintype.card x open scoped Cardinal nonZeroDivisors universe u theorem Fintype.isPrimePow_card_of_field {Ξ±} [Fintype Ξ±] [Field Ξ±] : IsPrimePow β€–Ξ±β€– := by -- TODO: `Algebra` version of `CharP.exists`, of type `βˆ€ p, Algebra (ZMod p) Ξ±` cases' CharP.exists Ξ± with p _ haveI hp := Fact.mk (CharP.char_is_prime Ξ± p) letI : Algebra (ZMod p) Ξ± := ZMod.algebra _ _ let b := IsNoetherian.finsetBasis (ZMod p) Ξ± rw [Module.card_fintype b, ZMod.card, isPrimePow_pow_iff] Β· exact hp.1.isPrimePow rw [← FiniteDimensional.finrank_eq_card_basis b] exact FiniteDimensional.finrank_pos.ne' #align fintype.is_prime_pow_card_of_field Fintype.isPrimePow_card_of_field
Mathlib/FieldTheory/Cardinality.lean
53
57
theorem Fintype.nonempty_field_iff {Ξ±} [Fintype Ξ±] : Nonempty (Field Ξ±) ↔ IsPrimePow β€–Ξ±β€– := by
refine ⟨fun ⟨h⟩ => Fintype.isPrimePow_card_of_field, ?_⟩ rintro ⟨p, n, hp, hn, hα⟩ haveI := Fact.mk hp.nat_prime exact ⟨(Fintype.equivOfCardEq ((GaloisField.card p n hn.ne').trans hα)).symm.field⟩
2,162
import Mathlib.Algebra.Field.ULift import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.Nat.Factorization.PrimePow import Mathlib.Data.Rat.Denumerable import Mathlib.FieldTheory.Finite.GaloisField import Mathlib.Logic.Equiv.TransferInstance import Mathlib.RingTheory.Localization.Cardinality import Mathlib.SetTheory.Cardinal.Divisibility #align_import field_theory.cardinality from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" local notation "β€–" x "β€–" => Fintype.card x open scoped Cardinal nonZeroDivisors universe u theorem Fintype.isPrimePow_card_of_field {Ξ±} [Fintype Ξ±] [Field Ξ±] : IsPrimePow β€–Ξ±β€– := by -- TODO: `Algebra` version of `CharP.exists`, of type `βˆ€ p, Algebra (ZMod p) Ξ±` cases' CharP.exists Ξ± with p _ haveI hp := Fact.mk (CharP.char_is_prime Ξ± p) letI : Algebra (ZMod p) Ξ± := ZMod.algebra _ _ let b := IsNoetherian.finsetBasis (ZMod p) Ξ± rw [Module.card_fintype b, ZMod.card, isPrimePow_pow_iff] Β· exact hp.1.isPrimePow rw [← FiniteDimensional.finrank_eq_card_basis b] exact FiniteDimensional.finrank_pos.ne' #align fintype.is_prime_pow_card_of_field Fintype.isPrimePow_card_of_field theorem Fintype.nonempty_field_iff {Ξ±} [Fintype Ξ±] : Nonempty (Field Ξ±) ↔ IsPrimePow β€–Ξ±β€– := by refine ⟨fun ⟨h⟩ => Fintype.isPrimePow_card_of_field, ?_⟩ rintro ⟨p, n, hp, hn, hα⟩ haveI := Fact.mk hp.nat_prime exact ⟨(Fintype.equivOfCardEq ((GaloisField.card p n hn.ne').trans hΞ±)).symm.field⟩ #align fintype.nonempty_field_iff Fintype.nonempty_field_iff theorem Fintype.not_isField_of_card_not_prime_pow {Ξ±} [Fintype Ξ±] [Ring Ξ±] : Β¬IsPrimePow β€–Ξ±β€– β†’ Β¬IsField Ξ± := mt fun h => Fintype.nonempty_field_iff.mp ⟨h.toField⟩ #align fintype.not_is_field_of_card_not_prime_pow Fintype.not_isField_of_card_not_prime_pow
Mathlib/FieldTheory/Cardinality.lean
66
76
theorem Infinite.nonempty_field {Ξ± : Type u} [Infinite Ξ±] : Nonempty (Field Ξ±) := by
letI K := FractionRing (MvPolynomial Ξ± <| ULift.{u} β„š) suffices #Ξ± = #K by obtain ⟨e⟩ := Cardinal.eq.1 this exact ⟨e.field⟩ rw [← IsLocalization.card (MvPolynomial Ξ± <| ULift.{u} β„š)⁰ K le_rfl] apply le_antisymm Β· refine ⟨⟨fun a => MvPolynomial.monomial (Finsupp.single a 1) (1 : ULift.{u} β„š), fun x y h => ?_⟩⟩ simpa [MvPolynomial.monomial_eq_monomial_iff, Finsupp.single_eq_single_iff] using h Β· simp
2,162
import Mathlib.Algebra.Field.ULift import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.Nat.Factorization.PrimePow import Mathlib.Data.Rat.Denumerable import Mathlib.FieldTheory.Finite.GaloisField import Mathlib.Logic.Equiv.TransferInstance import Mathlib.RingTheory.Localization.Cardinality import Mathlib.SetTheory.Cardinal.Divisibility #align_import field_theory.cardinality from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" local notation "β€–" x "β€–" => Fintype.card x open scoped Cardinal nonZeroDivisors universe u theorem Fintype.isPrimePow_card_of_field {Ξ±} [Fintype Ξ±] [Field Ξ±] : IsPrimePow β€–Ξ±β€– := by -- TODO: `Algebra` version of `CharP.exists`, of type `βˆ€ p, Algebra (ZMod p) Ξ±` cases' CharP.exists Ξ± with p _ haveI hp := Fact.mk (CharP.char_is_prime Ξ± p) letI : Algebra (ZMod p) Ξ± := ZMod.algebra _ _ let b := IsNoetherian.finsetBasis (ZMod p) Ξ± rw [Module.card_fintype b, ZMod.card, isPrimePow_pow_iff] Β· exact hp.1.isPrimePow rw [← FiniteDimensional.finrank_eq_card_basis b] exact FiniteDimensional.finrank_pos.ne' #align fintype.is_prime_pow_card_of_field Fintype.isPrimePow_card_of_field theorem Fintype.nonempty_field_iff {Ξ±} [Fintype Ξ±] : Nonempty (Field Ξ±) ↔ IsPrimePow β€–Ξ±β€– := by refine ⟨fun ⟨h⟩ => Fintype.isPrimePow_card_of_field, ?_⟩ rintro ⟨p, n, hp, hn, hα⟩ haveI := Fact.mk hp.nat_prime exact ⟨(Fintype.equivOfCardEq ((GaloisField.card p n hn.ne').trans hΞ±)).symm.field⟩ #align fintype.nonempty_field_iff Fintype.nonempty_field_iff theorem Fintype.not_isField_of_card_not_prime_pow {Ξ±} [Fintype Ξ±] [Ring Ξ±] : Β¬IsPrimePow β€–Ξ±β€– β†’ Β¬IsField Ξ± := mt fun h => Fintype.nonempty_field_iff.mp ⟨h.toField⟩ #align fintype.not_is_field_of_card_not_prime_pow Fintype.not_isField_of_card_not_prime_pow theorem Infinite.nonempty_field {Ξ± : Type u} [Infinite Ξ±] : Nonempty (Field Ξ±) := by letI K := FractionRing (MvPolynomial Ξ± <| ULift.{u} β„š) suffices #Ξ± = #K by obtain ⟨e⟩ := Cardinal.eq.1 this exact ⟨e.field⟩ rw [← IsLocalization.card (MvPolynomial Ξ± <| ULift.{u} β„š)⁰ K le_rfl] apply le_antisymm Β· refine ⟨⟨fun a => MvPolynomial.monomial (Finsupp.single a 1) (1 : ULift.{u} β„š), fun x y h => ?_⟩⟩ simpa [MvPolynomial.monomial_eq_monomial_iff, Finsupp.single_eq_single_iff] using h Β· simp #align infinite.nonempty_field Infinite.nonempty_field
Mathlib/FieldTheory/Cardinality.lean
80
85
theorem Field.nonempty_iff {Ξ± : Type u} : Nonempty (Field Ξ±) ↔ IsPrimePow #Ξ± := by
rw [Cardinal.isPrimePow_iff] cases' fintypeOrInfinite Ξ± with h h Β· simpa only [Cardinal.mk_fintype, Nat.cast_inj, exists_eq_left', (Cardinal.nat_lt_aleph0 _).not_le, false_or_iff] using Fintype.nonempty_field_iff Β· simpa only [← Cardinal.infinite_iff, h, true_or_iff, iff_true_iff] using Infinite.nonempty_field
2,162
import Mathlib.Computability.Encoding import Mathlib.Logic.Small.List import Mathlib.ModelTheory.Syntax import Mathlib.SetTheory.Cardinal.Ordinal #align_import model_theory.encoding from "leanprover-community/mathlib"@"91288e351d51b3f0748f0a38faa7613fb0ae2ada" universe u v w u' v' namespace FirstOrder namespace Language variable {L : Language.{u, v}} variable {M : Type w} {N P : Type*} [L.Structure M] [L.Structure N] [L.Structure P] variable {Ξ± : Type u'} {Ξ² : Type v'} open FirstOrder Cardinal open Computability List Structure Cardinal Fin namespace Term def listEncode : L.Term Ξ± β†’ List (Sum Ξ± (Ξ£i, L.Functions i)) | var i => [Sum.inl i] | func f ts => Sum.inr (⟨_, f⟩ : Ξ£i, L.Functions i)::(List.finRange _).bind fun i => (ts i).listEncode #align first_order.language.term.list_encode FirstOrder.Language.Term.listEncode def listDecode : List (Sum Ξ± (Ξ£i, L.Functions i)) β†’ List (Option (L.Term Ξ±)) | [] => [] | Sum.inl a::l => some (var a)::listDecode l | Sum.inr ⟨n, f⟩::l => if h : βˆ€ i : Fin n, ((listDecode l).get? i).join.isSome then (func f fun i => Option.get _ (h i))::(listDecode l).drop n else [none] #align first_order.language.term.list_decode FirstOrder.Language.Term.listDecode
Mathlib/ModelTheory/Encoding.lean
67
98
theorem listDecode_encode_list (l : List (L.Term Ξ±)) : listDecode (l.bind listEncode) = l.map Option.some := by
suffices h : βˆ€ (t : L.Term Ξ±) (l : List (Sum Ξ± (Ξ£i, L.Functions i))), listDecode (t.listEncode ++ l) = some t::listDecode l by induction' l with t l lih Β· rfl Β· rw [cons_bind, h t (l.bind listEncode), lih, List.map] intro t induction' t with a n f ts ih <;> intro l Β· rw [listEncode, singleton_append, listDecode] Β· rw [listEncode, cons_append, listDecode] have h : listDecode (((finRange n).bind fun i : Fin n => (ts i).listEncode) ++ l) = (finRange n).map (Option.some ∘ ts) ++ listDecode l := by induction' finRange n with i l' l'ih Β· rfl Β· rw [cons_bind, List.append_assoc, ih, map_cons, l'ih, cons_append, Function.comp] have h' : βˆ€ i : Fin n, (listDecode (((finRange n).bind fun i : Fin n => (ts i).listEncode) ++ l)).get? ↑i = some (some (ts i)) := by intro i rw [h, get?_append, get?_map] Β· simp only [Option.map_eq_some', Function.comp_apply, get?_eq_some] refine ⟨i, ⟨lt_of_lt_of_le i.2 (ge_of_eq (length_finRange _)), ?_⟩, rfl⟩ rw [get_finRange, Fin.eta] Β· refine lt_of_lt_of_le i.2 ?_ simp refine (dif_pos fun i => Option.isSome_iff_exists.2 ⟨ts i, ?_⟩).trans ?_ Β· rw [Option.join_eq_some, h'] refine congr (congr rfl (congr rfl (congr rfl (funext fun i => Option.get_of_mem _ ?_)))) ?_ Β· simp [h'] Β· rw [h, drop_left'] rw [length_map, length_finRange]
2,163
import Mathlib.Computability.Encoding import Mathlib.Logic.Small.List import Mathlib.ModelTheory.Syntax import Mathlib.SetTheory.Cardinal.Ordinal #align_import model_theory.encoding from "leanprover-community/mathlib"@"91288e351d51b3f0748f0a38faa7613fb0ae2ada" universe u v w u' v' namespace FirstOrder namespace Language variable {L : Language.{u, v}} variable {M : Type w} {N P : Type*} [L.Structure M] [L.Structure N] [L.Structure P] variable {Ξ± : Type u'} {Ξ² : Type v'} open FirstOrder Cardinal open Computability List Structure Cardinal Fin namespace Term def listEncode : L.Term Ξ± β†’ List (Sum Ξ± (Ξ£i, L.Functions i)) | var i => [Sum.inl i] | func f ts => Sum.inr (⟨_, f⟩ : Ξ£i, L.Functions i)::(List.finRange _).bind fun i => (ts i).listEncode #align first_order.language.term.list_encode FirstOrder.Language.Term.listEncode def listDecode : List (Sum Ξ± (Ξ£i, L.Functions i)) β†’ List (Option (L.Term Ξ±)) | [] => [] | Sum.inl a::l => some (var a)::listDecode l | Sum.inr ⟨n, f⟩::l => if h : βˆ€ i : Fin n, ((listDecode l).get? i).join.isSome then (func f fun i => Option.get _ (h i))::(listDecode l).drop n else [none] #align first_order.language.term.list_decode FirstOrder.Language.Term.listDecode theorem listDecode_encode_list (l : List (L.Term Ξ±)) : listDecode (l.bind listEncode) = l.map Option.some := by suffices h : βˆ€ (t : L.Term Ξ±) (l : List (Sum Ξ± (Ξ£i, L.Functions i))), listDecode (t.listEncode ++ l) = some t::listDecode l by induction' l with t l lih Β· rfl Β· rw [cons_bind, h t (l.bind listEncode), lih, List.map] intro t induction' t with a n f ts ih <;> intro l Β· rw [listEncode, singleton_append, listDecode] Β· rw [listEncode, cons_append, listDecode] have h : listDecode (((finRange n).bind fun i : Fin n => (ts i).listEncode) ++ l) = (finRange n).map (Option.some ∘ ts) ++ listDecode l := by induction' finRange n with i l' l'ih Β· rfl Β· rw [cons_bind, List.append_assoc, ih, map_cons, l'ih, cons_append, Function.comp] have h' : βˆ€ i : Fin n, (listDecode (((finRange n).bind fun i : Fin n => (ts i).listEncode) ++ l)).get? ↑i = some (some (ts i)) := by intro i rw [h, get?_append, get?_map] Β· simp only [Option.map_eq_some', Function.comp_apply, get?_eq_some] refine ⟨i, ⟨lt_of_lt_of_le i.2 (ge_of_eq (length_finRange _)), ?_⟩, rfl⟩ rw [get_finRange, Fin.eta] Β· refine lt_of_lt_of_le i.2 ?_ simp refine (dif_pos fun i => Option.isSome_iff_exists.2 ⟨ts i, ?_⟩).trans ?_ Β· rw [Option.join_eq_some, h'] refine congr (congr rfl (congr rfl (congr rfl (funext fun i => Option.get_of_mem _ ?_)))) ?_ Β· simp [h'] Β· rw [h, drop_left'] rw [length_map, length_finRange] #align first_order.language.term.list_decode_encode_list FirstOrder.Language.Term.listDecode_encode_list @[simps] protected def encoding : Encoding (L.Term Ξ±) where Ξ“ := Sum Ξ± (Ξ£i, L.Functions i) encode := listEncode decode l := (listDecode l).head?.join decode_encode t := by have h := listDecode_encode_list [t] rw [bind_singleton] at h simp only [h, Option.join, head?, List.map, Option.some_bind, id] #align first_order.language.term.encoding FirstOrder.Language.Term.encoding theorem listEncode_injective : Function.Injective (listEncode : L.Term Ξ± β†’ List (Sum Ξ± (Ξ£i, L.Functions i))) := Term.encoding.encode_injective #align first_order.language.term.list_encode_injective FirstOrder.Language.Term.listEncode_injective theorem card_le : #(L.Term Ξ±) ≀ max β„΅β‚€ #(Sum Ξ± (Ξ£i, L.Functions i)) := lift_le.1 (_root_.trans Term.encoding.card_le_card_list (lift_le.2 (mk_list_le_max _))) #align first_order.language.term.card_le FirstOrder.Language.Term.card_le
Mathlib/ModelTheory/Encoding.lean
122
151
theorem card_sigma : #(Ξ£n, L.Term (Sum Ξ± (Fin n))) = max β„΅β‚€ #(Sum Ξ± (Ξ£i, L.Functions i)) := by
refine le_antisymm ?_ ?_ Β· rw [mk_sigma] refine (sum_le_iSup_lift _).trans ?_ rw [mk_nat, lift_aleph0, mul_eq_max_of_aleph0_le_left le_rfl, max_le_iff, ciSup_le_iff' (bddAbove_range _)] Β· refine ⟨le_max_left _ _, fun i => card_le.trans ?_⟩ refine max_le (le_max_left _ _) ?_ rw [← add_eq_max le_rfl, mk_sum, mk_sum, mk_sum, add_comm (Cardinal.lift #Ξ±), lift_add, add_assoc, lift_lift, lift_lift, mk_fin, lift_natCast] exact add_le_add_right (nat_lt_aleph0 _).le _ Β· rw [← one_le_iff_ne_zero] refine _root_.trans ?_ (le_ciSup (bddAbove_range _) 1) rw [one_le_iff_ne_zero, mk_ne_zero_iff] exact ⟨var (Sum.inr 0)⟩ Β· rw [max_le_iff, ← infinite_iff] refine ⟨Infinite.of_injective (fun i => ⟨i + 1, var (Sum.inr i)⟩) fun i j ij => ?_, ?_⟩ Β· cases ij rfl Β· rw [Cardinal.le_def] refine ⟨⟨Sum.elim (fun i => ⟨0, var (Sum.inl i)⟩) fun F => ⟨1, func F.2 fun _ => var (Sum.inr 0)⟩, ?_⟩⟩ rintro (a | a) (b | b) h Β· simp only [Sum.elim_inl, Sigma.mk.inj_iff, heq_eq_eq, var.injEq, Sum.inl.injEq, true_and] at h rw [h] Β· simp only [Sum.elim_inl, Sum.elim_inr, Sigma.mk.inj_iff, false_and] at h Β· simp only [Sum.elim_inr, Sum.elim_inl, Sigma.mk.inj_iff, false_and] at h Β· simp only [Sum.elim_inr, Sigma.mk.inj_iff, heq_eq_eq, func.injEq, true_and] at h rw [Sigma.ext_iff.2 ⟨h.1, h.2.1⟩]
2,163
import Mathlib.Computability.Encoding import Mathlib.Logic.Small.List import Mathlib.ModelTheory.Syntax import Mathlib.SetTheory.Cardinal.Ordinal #align_import model_theory.encoding from "leanprover-community/mathlib"@"91288e351d51b3f0748f0a38faa7613fb0ae2ada" universe u v w u' v' namespace FirstOrder namespace Language variable {L : Language.{u, v}} variable {M : Type w} {N P : Type*} [L.Structure M] [L.Structure N] [L.Structure P] variable {Ξ± : Type u'} {Ξ² : Type v'} open FirstOrder Cardinal open Computability List Structure Cardinal Fin namespace BoundedFormula def listEncode : βˆ€ {n : β„•}, L.BoundedFormula Ξ± n β†’ List (Sum (Ξ£k, L.Term (Sum Ξ± (Fin k))) (Sum (Ξ£n, L.Relations n) β„•)) | n, falsum => [Sum.inr (Sum.inr (n + 2))] | _, equal t₁ tβ‚‚ => [Sum.inl ⟨_, tβ‚βŸ©, Sum.inl ⟨_, tβ‚‚βŸ©] | n, rel R ts => [Sum.inr (Sum.inl ⟨_, R⟩), Sum.inr (Sum.inr n)] ++ (List.finRange _).map fun i => Sum.inl ⟨n, ts i⟩ | _, imp φ₁ Ο†β‚‚ => (Sum.inr (Sum.inr 0)::φ₁.listEncode) ++ Ο†β‚‚.listEncode | _, all Ο† => Sum.inr (Sum.inr 1)::Ο†.listEncode #align first_order.language.bounded_formula.list_encode FirstOrder.Language.BoundedFormula.listEncode def sigmaAll : (Ξ£n, L.BoundedFormula Ξ± n) β†’ Ξ£n, L.BoundedFormula Ξ± n | ⟨n + 1, Ο†βŸ© => ⟨n, Ο†.all⟩ | _ => default #align first_order.language.bounded_formula.sigma_all FirstOrder.Language.BoundedFormula.sigmaAll def sigmaImp : (Ξ£n, L.BoundedFormula Ξ± n) β†’ (Ξ£n, L.BoundedFormula Ξ± n) β†’ Ξ£n, L.BoundedFormula Ξ± n | ⟨m, Ο†βŸ©, ⟨n, ψ⟩ => if h : m = n then ⟨m, Ο†.imp (Eq.mp (by rw [h]) ψ)⟩ else default #align first_order.language.bounded_formula.sigma_imp FirstOrder.Language.BoundedFormula.sigmaImp @[simp] def listDecode : βˆ€ l : List (Sum (Ξ£k, L.Term (Sum Ξ± (Fin k))) (Sum (Ξ£n, L.Relations n) β„•)), (Ξ£n, L.BoundedFormula Ξ± n) Γ— { l' : List (Sum (Ξ£k, L.Term (Sum Ξ± (Fin k))) (Sum (Ξ£n, L.Relations n) β„•)) // SizeOf.sizeOf l' ≀ max 1 (SizeOf.sizeOf l) } | Sum.inr (Sum.inr (n + 2))::l => ⟨⟨n, falsum⟩, l, le_max_of_le_right le_add_self⟩ | Sum.inl ⟨n₁, tβ‚βŸ©::Sum.inl ⟨nβ‚‚, tβ‚‚βŸ©::l => ⟨if h : n₁ = nβ‚‚ then ⟨n₁, equal t₁ (Eq.mp (by rw [h]) tβ‚‚)⟩ else default, l, by simp only [SizeOf.sizeOf, List._sizeOf_1, ← add_assoc] exact le_max_of_le_right le_add_self⟩ | Sum.inr (Sum.inl ⟨n, R⟩)::Sum.inr (Sum.inr k)::l => ⟨if h : βˆ€ i : Fin n, ((l.map Sum.getLeft?).get? i).join.isSome then if h' : βˆ€ i, (Option.get _ (h i)).1 = k then ⟨k, BoundedFormula.rel R fun i => Eq.mp (by rw [h' i]) (Option.get _ (h i)).2⟩ else default else default, l.drop n, le_max_of_le_right (le_add_left (le_add_left (List.drop_sizeOf_le _ _)))⟩ | Sum.inr (Sum.inr 0)::l => have : SizeOf.sizeOf (↑(listDecode l).2 : List (Sum (Ξ£k, L.Term (Sum Ξ± (Fin k))) (Sum (Ξ£n, L.Relations n) β„•))) < 1 + (1 + 1) + SizeOf.sizeOf l := by refine lt_of_le_of_lt (listDecode l).2.2 (max_lt ?_ (Nat.lt_add_of_pos_left (by decide))) rw [add_assoc, lt_add_iff_pos_right, add_pos_iff] exact Or.inl zero_lt_two ⟨sigmaImp (listDecode l).1 (listDecode (listDecode l).2).1, (listDecode (listDecode l).2).2, le_max_of_le_right (_root_.trans (listDecode _).2.2 (max_le (le_add_right le_self_add) (_root_.trans (listDecode _).2.2 (max_le (le_add_right le_self_add) le_add_self))))⟩ | Sum.inr (Sum.inr 1)::l => ⟨sigmaAll (listDecode l).1, (listDecode l).2, (listDecode l).2.2.trans (max_le_max le_rfl le_add_self)⟩ | _ => ⟨default, [], le_max_left _ _⟩ #align first_order.language.bounded_formula.list_decode FirstOrder.Language.BoundedFormula.listDecode @[simp]
Mathlib/ModelTheory/Encoding.lean
235
287
theorem listDecode_encode_list (l : List (Ξ£n, L.BoundedFormula Ξ± n)) : (listDecode (l.bind fun Ο† => Ο†.2.listEncode)).1 = l.headI := by
suffices h : βˆ€ (Ο† : Ξ£n, L.BoundedFormula Ξ± n) (l), (listDecode (listEncode Ο†.2 ++ l)).1 = Ο† ∧ (listDecode (listEncode Ο†.2 ++ l)).2.1 = l by induction' l with Ο† l _ Β· rw [List.nil_bind] simp [listDecode] Β· rw [cons_bind, (h Ο† _).1, headI_cons] rintro ⟨n, Ο†βŸ© induction' Ο† with _ _ _ _ Ο†_n Ο†_l Ο†_R ts _ _ _ ih1 ih2 _ _ ih <;> intro l Β· rw [listEncode, singleton_append, listDecode] simp only [eq_self_iff_true, heq_iff_eq, and_self_iff] Β· rw [listEncode, cons_append, cons_append, listDecode, dif_pos] Β· simp only [eq_mp_eq_cast, cast_eq, eq_self_iff_true, heq_iff_eq, and_self_iff, nil_append] Β· simp only [eq_self_iff_true, heq_iff_eq, and_self_iff] Β· rw [listEncode, cons_append, cons_append, singleton_append, cons_append, listDecode] have h : βˆ€ i : Fin Ο†_l, ((List.map Sum.getLeft? (List.map (fun i : Fin Ο†_l => Sum.inl (⟨(βŸ¨Ο†_n, rel Ο†_R ts⟩ : Ξ£n, L.BoundedFormula Ξ± n).fst, ts i⟩ : Ξ£n, L.Term (Sum Ξ± (Fin n)))) (finRange Ο†_l) ++ l)).get? ↑i).join = some ⟨_, ts i⟩ := by intro i simp only [Option.join, map_append, map_map, Option.bind_eq_some, id, exists_eq_right, get?_eq_some, length_append, length_map, length_finRange] refine ⟨lt_of_lt_of_le i.2 le_self_add, ?_⟩ rw [get_append, get_map] Β· simp only [Sum.getLeft?, get_finRange, Fin.eta, Function.comp_apply, eq_self_iff_true, heq_iff_eq, and_self_iff] Β· simp only [length_map, length_finRange, is_lt] rw [dif_pos] swap Β· exact fun i => Option.isSome_iff_exists.2 ⟨⟨_, ts i⟩, h i⟩ rw [dif_pos] swap Β· intro i obtain ⟨h1, h2⟩ := Option.eq_some_iff_get_eq.1 (h i) rw [h2] simp only [Sigma.mk.inj_iff, heq_eq_eq, rel.injEq, true_and] refine ⟨funext fun i => ?_, ?_⟩ Β· obtain ⟨h1, h2⟩ := Option.eq_some_iff_get_eq.1 (h i) rw [eq_mp_eq_cast, cast_eq_iff_heq] exact (Sigma.ext_iff.1 ((Sigma.eta (Option.get _ h1)).trans h2)).2 rw [List.drop_append_eq_append_drop, length_map, length_finRange, Nat.sub_self, drop, drop_eq_nil_of_le, nil_append] rw [length_map, length_finRange] Β· rw [listEncode, List.append_assoc, cons_append, listDecode] simp only [] at * rw [(ih1 _).1, (ih1 _).2, (ih2 _).1, (ih2 _).2, sigmaImp] simp only [dite_true] exact ⟨rfl, trivial⟩ Β· rw [listEncode, cons_append, listDecode] simp only simp only [] at * rw [(ih _).1, (ih _).2, sigmaAll] exact ⟨rfl, rfl⟩
2,163
import Mathlib.Algebra.Polynomial.Basic import Mathlib.SetTheory.Cardinal.Ordinal #align_import data.polynomial.cardinal from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" universe u open Cardinal Polynomial open Cardinal namespace Polynomial @[simp] theorem cardinal_mk_eq_max {R : Type u} [Semiring R] [Nontrivial R] : #(R[X]) = max #R β„΅β‚€ := (toFinsuppIso R).toEquiv.cardinal_eq.trans <| by rw [AddMonoidAlgebra, mk_finsupp_lift_of_infinite, lift_uzero, max_comm] rfl #align polynomial.cardinal_mk_eq_max Polynomial.cardinal_mk_eq_max
Mathlib/Algebra/Polynomial/Cardinal.lean
34
37
theorem cardinal_mk_le_max {R : Type u} [Semiring R] : #(R[X]) ≀ max #R β„΅β‚€ := by
cases subsingleton_or_nontrivial R Β· exact (mk_eq_one _).trans_le (le_max_of_le_right one_le_aleph0) Β· exact cardinal_mk_eq_max.le
2,164
import Mathlib.Algebra.Polynomial.Cardinal import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.RingTheory.AlgebraicIndependent #align_import field_theory.is_alg_closed.classification from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" universe u open scoped Cardinal Polynomial open Cardinal section AlgebraicClosure namespace Algebra.IsAlgebraic variable (R L : Type u) [CommRing R] [CommRing L] [IsDomain L] [Algebra R L] variable [NoZeroSMulDivisors R L] [Algebra.IsAlgebraic R L]
Mathlib/FieldTheory/IsAlgClosed/Classification.lean
41
59
theorem cardinal_mk_le_sigma_polynomial : #L ≀ #(Ξ£ p : R[X], { x : L // x ∈ p.aroots L }) := @mk_le_of_injective L (Ξ£ p : R[X], {x : L | x ∈ p.aroots L}) (fun x : L => let p := Classical.indefiniteDescription _ (Algebra.IsAlgebraic.isAlgebraic x) ⟨p.1, x, by dsimp have h : p.1.map (algebraMap R L) β‰  0 := by
rw [Ne, ← Polynomial.degree_eq_bot, Polynomial.degree_map_eq_of_injective (NoZeroSMulDivisors.algebraMap_injective R L), Polynomial.degree_eq_bot] exact p.2.1 erw [Polynomial.mem_roots h, Polynomial.IsRoot, Polynomial.eval_map, ← Polynomial.aeval_def, p.2.2]⟩) fun x y => by intro h simp? at h says simp only [Set.coe_setOf, ne_eq, Set.mem_setOf_eq, Sigma.mk.inj_iff] at h refine (Subtype.heq_iff_coe_eq ?_).1 h.2 simp only [h.1, iff_self_iff, forall_true_iff]
2,165
import Mathlib.Algebra.Polynomial.Cardinal import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.RingTheory.AlgebraicIndependent #align_import field_theory.is_alg_closed.classification from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" universe u open scoped Cardinal Polynomial open Cardinal section AlgebraicClosure namespace Algebra.IsAlgebraic variable (R L : Type u) [CommRing R] [CommRing L] [IsDomain L] [Algebra R L] variable [NoZeroSMulDivisors R L] [Algebra.IsAlgebraic R L] theorem cardinal_mk_le_sigma_polynomial : #L ≀ #(Ξ£ p : R[X], { x : L // x ∈ p.aroots L }) := @mk_le_of_injective L (Ξ£ p : R[X], {x : L | x ∈ p.aroots L}) (fun x : L => let p := Classical.indefiniteDescription _ (Algebra.IsAlgebraic.isAlgebraic x) ⟨p.1, x, by dsimp have h : p.1.map (algebraMap R L) β‰  0 := by rw [Ne, ← Polynomial.degree_eq_bot, Polynomial.degree_map_eq_of_injective (NoZeroSMulDivisors.algebraMap_injective R L), Polynomial.degree_eq_bot] exact p.2.1 erw [Polynomial.mem_roots h, Polynomial.IsRoot, Polynomial.eval_map, ← Polynomial.aeval_def, p.2.2]⟩) fun x y => by intro h simp? at h says simp only [Set.coe_setOf, ne_eq, Set.mem_setOf_eq, Sigma.mk.inj_iff] at h refine (Subtype.heq_iff_coe_eq ?_).1 h.2 simp only [h.1, iff_self_iff, forall_true_iff] #align algebra.is_algebraic.cardinal_mk_le_sigma_polynomial Algebra.IsAlgebraic.cardinal_mk_le_sigma_polynomial
Mathlib/FieldTheory/IsAlgClosed/Classification.lean
64
76
theorem cardinal_mk_le_max : #L ≀ max #R β„΅β‚€ := calc #L ≀ #(Ξ£ p : R[X], { x : L // x ∈ p.aroots L }) := cardinal_mk_le_sigma_polynomial R L _ = Cardinal.sum fun p : R[X] => #{x : L | x ∈ p.aroots L} := by
rw [← mk_sigma]; rfl _ ≀ Cardinal.sum.{u, u} fun _ : R[X] => β„΅β‚€ := (sum_le_sum _ _ fun p => (Multiset.finite_toSet _).lt_aleph0.le) _ = #(R[X]) * β„΅β‚€ := sum_const' _ _ _ ≀ max (max #(R[X]) β„΅β‚€) β„΅β‚€ := mul_le_max _ _ _ ≀ max (max (max #R β„΅β‚€) β„΅β‚€) β„΅β‚€ := (max_le_max (max_le_max Polynomial.cardinal_mk_le_max le_rfl) le_rfl) _ = max #R β„΅β‚€ := by simp only [max_assoc, max_comm β„΅β‚€, max_left_comm β„΅β‚€, max_self]
2,165
import Mathlib.Algebra.Polynomial.Cardinal import Mathlib.Algebra.MvPolynomial.Cardinal import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.IsAlgClosed.Basic import Mathlib.RingTheory.AlgebraicIndependent #align_import field_theory.is_alg_closed.classification from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" universe u open scoped Cardinal Polynomial open Cardinal section AlgebraicClosure namespace IsAlgClosed section Classification noncomputable section variable {R L K : Type*} [CommRing R] variable [Field K] [Algebra R K] variable [Field L] [Algebra R L] variable {ΞΉ : Type*} (v : ΞΉ β†’ K) variable {ΞΊ : Type*} (w : ΞΊ β†’ L) variable (hv : AlgebraicIndependent R v)
Mathlib/FieldTheory/IsAlgClosed/Classification.lean
96
100
theorem isAlgClosure_of_transcendence_basis [IsAlgClosed K] (hv : IsTranscendenceBasis R v) : IsAlgClosure (Algebra.adjoin R (Set.range v)) K := letI := RingHom.domain_nontrivial (algebraMap R K) { alg_closed := by
infer_instance algebraic := hv.isAlgebraic }
2,165
import Mathlib.Algebra.Polynomial.Cardinal import Mathlib.RingTheory.Algebraic #align_import algebra.algebraic_card from "leanprover-community/mathlib"@"40494fe75ecbd6d2ec61711baa630cf0a7b7d064" universe u v open Cardinal Polynomial Set open Cardinal Polynomial namespace Algebraic theorem infinite_of_charZero (R A : Type*) [CommRing R] [IsDomain R] [Ring A] [Algebra R A] [CharZero A] : { x : A | IsAlgebraic R x }.Infinite := infinite_of_injective_forall_mem Nat.cast_injective isAlgebraic_nat #align algebraic.infinite_of_char_zero Algebraic.infinite_of_charZero theorem aleph0_le_cardinal_mk_of_charZero (R A : Type*) [CommRing R] [IsDomain R] [Ring A] [Algebra R A] [CharZero A] : β„΅β‚€ ≀ #{ x : A // IsAlgebraic R x } := infinite_iff.1 (Set.infinite_coe_iff.2 <| infinite_of_charZero R A) #align algebraic.aleph_0_le_cardinal_mk_of_char_zero Algebraic.aleph0_le_cardinal_mk_of_charZero section lift variable (R : Type u) (A : Type v) [CommRing R] [CommRing A] [IsDomain A] [Algebra R A] [NoZeroSMulDivisors R A]
Mathlib/Algebra/AlgebraicCard.lean
45
54
theorem cardinal_mk_lift_le_mul : Cardinal.lift.{u} #{ x : A // IsAlgebraic R x } ≀ Cardinal.lift.{v} #R[X] * β„΅β‚€ := by
rw [← mk_uLift, ← mk_uLift] choose g hg₁ hgβ‚‚ using fun x : { x : A | IsAlgebraic R x } => x.coe_prop refine lift_mk_le_lift_mk_mul_of_lift_mk_preimage_le g fun f => ?_ rw [lift_le_aleph0, le_aleph0_iff_set_countable] suffices MapsTo (↑) (g ⁻¹' {f}) (f.rootSet A) from this.countable_of_injOn Subtype.coe_injective.injOn (f.rootSet_finite A).countable rintro x (rfl : g x = f) exact mem_rootSet.2 ⟨hg₁ x, hgβ‚‚ x⟩
2,166
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩
Mathlib/Order/Filter/CardinalInter.lean
52
55
theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by
simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const]
2,167
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter Ξ±) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter Ξ±) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≀ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c]
Mathlib/Order/Filter/CardinalInter.lean
90
94
theorem cardinal_iInter_mem {s : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) : (β‹‚ i, s i) ∈ l ↔ βˆ€ i, s i ∈ l := by
rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range
2,167
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter Ξ±) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter Ξ±) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≀ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c] theorem cardinal_iInter_mem {s : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) : (β‹‚ i, s i) ∈ l ↔ βˆ€ i, s i ∈ l := by rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range
Mathlib/Order/Filter/CardinalInter.lean
96
100
theorem cardinal_bInter_mem {S : Set ΞΉ} (hS : #S < c) {s : βˆ€ i ∈ S, Set Ξ±} : (β‹‚ i, β‹‚ hi : i ∈ S, s i β€Ή_β€Ί) ∈ l ↔ βˆ€ i, βˆ€ hi : i ∈ S, s i β€Ή_β€Ί ∈ l := by
rw [biInter_eq_iInter] exact (cardinal_iInter_mem hS).trans Subtype.forall
2,167
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter Ξ±) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter Ξ±) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≀ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c] theorem cardinal_iInter_mem {s : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) : (β‹‚ i, s i) ∈ l ↔ βˆ€ i, s i ∈ l := by rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range theorem cardinal_bInter_mem {S : Set ΞΉ} (hS : #S < c) {s : βˆ€ i ∈ S, Set Ξ±} : (β‹‚ i, β‹‚ hi : i ∈ S, s i β€Ή_β€Ί) ∈ l ↔ βˆ€ i, βˆ€ hi : i ∈ S, s i β€Ή_β€Ί ∈ l := by rw [biInter_eq_iInter] exact (cardinal_iInter_mem hS).trans Subtype.forall
Mathlib/Order/Filter/CardinalInter.lean
102
105
theorem eventually_cardinal_forall {p : Ξ± β†’ ΞΉ β†’ Prop} (hic : #ΞΉ < c) : (βˆ€αΆ  x in l, βˆ€ i, p x i) ↔ βˆ€ i, βˆ€αΆ  x in l, p x i := by
simp only [Filter.Eventually, setOf_forall] exact cardinal_iInter_mem hic
2,167
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter Ξ±) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter Ξ±) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≀ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c] theorem cardinal_iInter_mem {s : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) : (β‹‚ i, s i) ∈ l ↔ βˆ€ i, s i ∈ l := by rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range theorem cardinal_bInter_mem {S : Set ΞΉ} (hS : #S < c) {s : βˆ€ i ∈ S, Set Ξ±} : (β‹‚ i, β‹‚ hi : i ∈ S, s i β€Ή_β€Ί) ∈ l ↔ βˆ€ i, βˆ€ hi : i ∈ S, s i β€Ή_β€Ί ∈ l := by rw [biInter_eq_iInter] exact (cardinal_iInter_mem hS).trans Subtype.forall theorem eventually_cardinal_forall {p : Ξ± β†’ ΞΉ β†’ Prop} (hic : #ΞΉ < c) : (βˆ€αΆ  x in l, βˆ€ i, p x i) ↔ βˆ€ i, βˆ€αΆ  x in l, p x i := by simp only [Filter.Eventually, setOf_forall] exact cardinal_iInter_mem hic
Mathlib/Order/Filter/CardinalInter.lean
107
111
theorem eventually_cardinal_ball {S : Set ΞΉ} (hS : #S < c) {p : Ξ± β†’ βˆ€ i ∈ S, Prop} : (βˆ€αΆ  x in l, βˆ€ i hi, p x i hi) ↔ βˆ€ i hi, βˆ€αΆ  x in l, p x i hi := by
simp only [Filter.Eventually, setOf_forall] exact cardinal_bInter_mem hS
2,167
import Mathlib.Order.Filter.Basic import Mathlib.Order.Filter.CountableInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} {c : Cardinal.{u}} class CardinalInterFilter (l : Filter Ξ±) (c : Cardinal.{u}) : Prop where cardinal_sInter_mem : βˆ€ S : Set (Set Ξ±), (#S < c) β†’ (βˆ€ s ∈ S, s ∈ l) β†’ β‹‚β‚€ S ∈ l variable {l : Filter Ξ±} theorem cardinal_sInter_mem {S : Set (Set Ξ±)} [CardinalInterFilter l c] (hSc : #S < c) : β‹‚β‚€ S ∈ l ↔ βˆ€ s ∈ S, s ∈ l := ⟨fun hS _s hs => mem_of_superset hS (sInter_subset_of_mem hs), CardinalInterFilter.cardinal_sInter_mem _ hSc⟩ theorem _root_.Filter.cardinalInterFilter_aleph0 (l : Filter Ξ±) : CardinalInterFilter l aleph0 where cardinal_sInter_mem := by simp_all only [aleph_zero, lt_aleph0_iff_subtype_finite, setOf_mem_eq, sInter_mem, implies_true, forall_const] theorem CardinalInterFilter.toCountableInterFilter (l : Filter Ξ±) [CardinalInterFilter l c] (hc : aleph0 < c) : CountableInterFilter l where countable_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_le_of_lt (Set.Countable.le_aleph0 hS) hc) a instance CountableInterFilter.toCardinalInterFilter (l : Filter Ξ±) [CountableInterFilter l] : CardinalInterFilter l (aleph 1) where cardinal_sInter_mem S hS a := CountableInterFilter.countable_sInter_mem S ((countable_iff_lt_aleph_one S).mpr hS) a theorem cardinalInterFilter_aleph_one_iff : CardinalInterFilter l (aleph 1) ↔ CountableInterFilter l := ⟨fun _ ↦ ⟨fun S h a ↦ CardinalInterFilter.cardinal_sInter_mem S ((countable_iff_lt_aleph_one S).1 h) a⟩, fun _ ↦ CountableInterFilter.toCardinalInterFilter l⟩ theorem CardinalInterFilter.of_cardinalInterFilter_of_le (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a ≀ c) : CardinalInterFilter l a where cardinal_sInter_mem S hS a := CardinalInterFilter.cardinal_sInter_mem S (lt_of_lt_of_le hS hac) a theorem CardinalInterFilter.of_cardinalInterFilter_of_lt (l : Filter Ξ±) [CardinalInterFilter l c] {a : Cardinal.{u}} (hac : a < c) : CardinalInterFilter l a := CardinalInterFilter.of_cardinalInterFilter_of_le l (hac.le) namespace Filter variable [CardinalInterFilter l c] theorem cardinal_iInter_mem {s : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) : (β‹‚ i, s i) ∈ l ↔ βˆ€ i, s i ∈ l := by rw [← sInter_range _] apply (cardinal_sInter_mem (lt_of_le_of_lt Cardinal.mk_range_le hic)).trans exact forall_mem_range theorem cardinal_bInter_mem {S : Set ΞΉ} (hS : #S < c) {s : βˆ€ i ∈ S, Set Ξ±} : (β‹‚ i, β‹‚ hi : i ∈ S, s i β€Ή_β€Ί) ∈ l ↔ βˆ€ i, βˆ€ hi : i ∈ S, s i β€Ή_β€Ί ∈ l := by rw [biInter_eq_iInter] exact (cardinal_iInter_mem hS).trans Subtype.forall theorem eventually_cardinal_forall {p : Ξ± β†’ ΞΉ β†’ Prop} (hic : #ΞΉ < c) : (βˆ€αΆ  x in l, βˆ€ i, p x i) ↔ βˆ€ i, βˆ€αΆ  x in l, p x i := by simp only [Filter.Eventually, setOf_forall] exact cardinal_iInter_mem hic theorem eventually_cardinal_ball {S : Set ΞΉ} (hS : #S < c) {p : Ξ± β†’ βˆ€ i ∈ S, Prop} : (βˆ€αΆ  x in l, βˆ€ i hi, p x i hi) ↔ βˆ€ i hi, βˆ€αΆ  x in l, p x i hi := by simp only [Filter.Eventually, setOf_forall] exact cardinal_bInter_mem hS theorem EventuallyLE.cardinal_iUnion {s t : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) (h : βˆ€ i, s i ≀ᢠ[l] t i) : ⋃ i, s i ≀ᢠ[l] ⋃ i, t i := ((eventually_cardinal_forall hic).2 h).mono fun _ hst hs => mem_iUnion.2 <| (mem_iUnion.1 hs).imp hst theorem EventuallyEq.cardinal_iUnion {s t : ΞΉ β†’ Set Ξ±} (hic : #ΞΉ < c) (h : βˆ€ i, s i =αΆ [l] t i) : ⋃ i, s i =αΆ [l] ⋃ i, t i := (EventuallyLE.cardinal_iUnion hic fun i => (h i).le).antisymm (EventuallyLE.cardinal_iUnion hic fun i => (h i).symm.le)
Mathlib/Order/Filter/CardinalInter.lean
123
127
theorem EventuallyLE.cardinal_bUnion {S : Set ΞΉ} (hS : #S < c) {s t : βˆ€ i ∈ S, Set Ξ±} (h : βˆ€ i hi, s i hi ≀ᢠ[l] t i hi) : ⋃ i ∈ S, s i β€Ή_β€Ί ≀ᢠ[l] ⋃ i ∈ S, t i β€Ή_β€Ί := by
simp only [biUnion_eq_iUnion] exact EventuallyLE.cardinal_iUnion hS fun i => h i i.2
2,167
import Mathlib.Order.Filter.Cofinite import Mathlib.Order.Filter.CountableInter import Mathlib.Order.Filter.CardinalInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.Order.Filter.Bases open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} variable {c : Cardinal.{u}} {hreg : c.IsRegular} variable {l : Filter Ξ±} namespace Filter variable (Ξ±) in def cocardinal (hreg : c.IsRegular) : Filter Ξ± := by apply ofCardinalUnion {s | Cardinal.mk s < c} (lt_of_lt_of_le (nat_lt_aleph0 2) hreg.aleph0_le) Β· refine fun s hS hSc ↦ lt_of_le_of_lt (mk_sUnion_le _) <| mul_lt_of_lt hreg.aleph0_le hS ?_ exact iSup_lt_of_isRegular hreg hS fun i ↦ hSc i i.property Β· exact fun _ hSc _ ht ↦ lt_of_le_of_lt (mk_le_mk_of_subset ht) hSc @[simp] theorem mem_cocardinal {s : Set Ξ±} : s ∈ cocardinal Ξ± hreg ↔ Cardinal.mk (sᢜ : Set Ξ±) < c := Iff.rfl @[simp] lemma cocardinal_aleph0_eq_cofinite : cocardinal (Ξ± := Ξ±) isRegular_aleph0 = cofinite := by aesop instance instCardinalInterFilter_cocardinal : CardinalInterFilter (cocardinal (Ξ± := Ξ±) hreg) c where cardinal_sInter_mem S hS hSs := by rw [mem_cocardinal, Set.compl_sInter] apply lt_of_le_of_lt (mk_sUnion_le _) apply mul_lt_of_lt hreg.aleph0_le (lt_of_le_of_lt mk_image_le hS) apply iSup_lt_of_isRegular hreg <| lt_of_le_of_lt mk_image_le hS intro i aesop @[simp] theorem eventually_cocardinal {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in cocardinal Ξ± hreg, p x) ↔ #{ x | Β¬p x } < c := Iff.rfl
Mathlib/Order/Filter/Cocardinal.lean
61
68
theorem hasBasis_cocardinal : HasBasis (cocardinal Ξ± hreg) {s : Set Ξ± | #s < c} compl := ⟨fun s => ⟨fun h => ⟨sᢜ, h, (compl_compl s).subset⟩, fun ⟨_t, htf, hts⟩ => by have : #↑sᢜ < c := by
apply lt_of_le_of_lt _ htf rw [compl_subset_comm] at hts apply Cardinal.mk_le_mk_of_subset hts simp_all only [mem_cocardinal] ⟩⟩
2,168
import Mathlib.Order.Filter.Cofinite import Mathlib.Order.Filter.CountableInter import Mathlib.Order.Filter.CardinalInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.Order.Filter.Bases open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} variable {c : Cardinal.{u}} {hreg : c.IsRegular} variable {l : Filter Ξ±} namespace Filter variable (Ξ±) in def cocardinal (hreg : c.IsRegular) : Filter Ξ± := by apply ofCardinalUnion {s | Cardinal.mk s < c} (lt_of_lt_of_le (nat_lt_aleph0 2) hreg.aleph0_le) Β· refine fun s hS hSc ↦ lt_of_le_of_lt (mk_sUnion_le _) <| mul_lt_of_lt hreg.aleph0_le hS ?_ exact iSup_lt_of_isRegular hreg hS fun i ↦ hSc i i.property Β· exact fun _ hSc _ ht ↦ lt_of_le_of_lt (mk_le_mk_of_subset ht) hSc @[simp] theorem mem_cocardinal {s : Set Ξ±} : s ∈ cocardinal Ξ± hreg ↔ Cardinal.mk (sᢜ : Set Ξ±) < c := Iff.rfl @[simp] lemma cocardinal_aleph0_eq_cofinite : cocardinal (Ξ± := Ξ±) isRegular_aleph0 = cofinite := by aesop instance instCardinalInterFilter_cocardinal : CardinalInterFilter (cocardinal (Ξ± := Ξ±) hreg) c where cardinal_sInter_mem S hS hSs := by rw [mem_cocardinal, Set.compl_sInter] apply lt_of_le_of_lt (mk_sUnion_le _) apply mul_lt_of_lt hreg.aleph0_le (lt_of_le_of_lt mk_image_le hS) apply iSup_lt_of_isRegular hreg <| lt_of_le_of_lt mk_image_le hS intro i aesop @[simp] theorem eventually_cocardinal {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in cocardinal Ξ± hreg, p x) ↔ #{ x | Β¬p x } < c := Iff.rfl theorem hasBasis_cocardinal : HasBasis (cocardinal Ξ± hreg) {s : Set Ξ± | #s < c} compl := ⟨fun s => ⟨fun h => ⟨sᢜ, h, (compl_compl s).subset⟩, fun ⟨_t, htf, hts⟩ => by have : #↑sᢜ < c := by apply lt_of_le_of_lt _ htf rw [compl_subset_comm] at hts apply Cardinal.mk_le_mk_of_subset hts simp_all only [mem_cocardinal] ⟩⟩
Mathlib/Order/Filter/Cocardinal.lean
70
72
theorem frequently_cocardinal {p : Ξ± β†’ Prop} : (βˆƒαΆ  x in cocardinal Ξ± hreg, p x) ↔ c ≀ # { x | p x } := by
simp only [Filter.Frequently, eventually_cocardinal, not_not,coe_setOf, not_lt]
2,168
import Mathlib.Order.Filter.Cofinite import Mathlib.Order.Filter.CountableInter import Mathlib.Order.Filter.CardinalInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.Order.Filter.Bases open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} variable {c : Cardinal.{u}} {hreg : c.IsRegular} variable {l : Filter Ξ±} namespace Filter variable (Ξ±) in def cocardinal (hreg : c.IsRegular) : Filter Ξ± := by apply ofCardinalUnion {s | Cardinal.mk s < c} (lt_of_lt_of_le (nat_lt_aleph0 2) hreg.aleph0_le) Β· refine fun s hS hSc ↦ lt_of_le_of_lt (mk_sUnion_le _) <| mul_lt_of_lt hreg.aleph0_le hS ?_ exact iSup_lt_of_isRegular hreg hS fun i ↦ hSc i i.property Β· exact fun _ hSc _ ht ↦ lt_of_le_of_lt (mk_le_mk_of_subset ht) hSc @[simp] theorem mem_cocardinal {s : Set Ξ±} : s ∈ cocardinal Ξ± hreg ↔ Cardinal.mk (sᢜ : Set Ξ±) < c := Iff.rfl @[simp] lemma cocardinal_aleph0_eq_cofinite : cocardinal (Ξ± := Ξ±) isRegular_aleph0 = cofinite := by aesop instance instCardinalInterFilter_cocardinal : CardinalInterFilter (cocardinal (Ξ± := Ξ±) hreg) c where cardinal_sInter_mem S hS hSs := by rw [mem_cocardinal, Set.compl_sInter] apply lt_of_le_of_lt (mk_sUnion_le _) apply mul_lt_of_lt hreg.aleph0_le (lt_of_le_of_lt mk_image_le hS) apply iSup_lt_of_isRegular hreg <| lt_of_le_of_lt mk_image_le hS intro i aesop @[simp] theorem eventually_cocardinal {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in cocardinal Ξ± hreg, p x) ↔ #{ x | Β¬p x } < c := Iff.rfl theorem hasBasis_cocardinal : HasBasis (cocardinal Ξ± hreg) {s : Set Ξ± | #s < c} compl := ⟨fun s => ⟨fun h => ⟨sᢜ, h, (compl_compl s).subset⟩, fun ⟨_t, htf, hts⟩ => by have : #↑sᢜ < c := by apply lt_of_le_of_lt _ htf rw [compl_subset_comm] at hts apply Cardinal.mk_le_mk_of_subset hts simp_all only [mem_cocardinal] ⟩⟩ theorem frequently_cocardinal {p : Ξ± β†’ Prop} : (βˆƒαΆ  x in cocardinal Ξ± hreg, p x) ↔ c ≀ # { x | p x } := by simp only [Filter.Frequently, eventually_cocardinal, not_not,coe_setOf, not_lt] lemma frequently_cocardinal_mem {s : Set Ξ±} : (βˆƒαΆ  x in cocardinal Ξ± hreg, x ∈ s) ↔ c ≀ #s := frequently_cocardinal @[simp] lemma cocardinal_inf_principal_neBot_iff {s : Set Ξ±} : (cocardinal Ξ± hreg βŠ“ π“Ÿ s).NeBot ↔ c ≀ #s := frequently_mem_iff_neBot.symm.trans frequently_cocardinal theorem compl_mem_cocardinal_of_card_lt {s : Set Ξ±} (hs : #s < c) : sᢜ ∈ cocardinal Ξ± hreg := mem_cocardinal.2 <| (compl_compl s).symm β–Έ hs theorem _root_.Set.Finite.compl_mem_cocardinal {s : Set Ξ±} (hs : s.Finite) : sᢜ ∈ cocardinal Ξ± hreg := compl_mem_cocardinal_of_card_lt <| lt_of_lt_of_le (Finite.lt_aleph0 hs) (hreg.aleph0_le) theorem eventually_cocardinal_nmem_of_card_lt {s : Set Ξ±} (hs : #s < c) : βˆ€αΆ  x in cocardinal Ξ± hreg, x βˆ‰ s := compl_mem_cocardinal_of_card_lt hs theorem _root_.Finset.eventually_cocardinal_nmem (s : Finset Ξ±) : βˆ€αΆ  x in cocardinal Ξ± hreg, x βˆ‰ s := eventually_cocardinal_nmem_of_card_lt <| lt_of_lt_of_le (finset_card_lt_aleph0 s) (hreg.aleph0_le)
Mathlib/Order/Filter/Cocardinal.lean
98
100
theorem eventually_cocardinal_ne (x : Ξ±) : βˆ€αΆ  a in cocardinal Ξ± hreg, a β‰  x := by
simp [Set.finite_singleton x] exact hreg.nat_lt 1
2,168
import Mathlib.Order.Filter.Cofinite import Mathlib.Order.Filter.CountableInter import Mathlib.Order.Filter.CardinalInter import Mathlib.SetTheory.Cardinal.Ordinal import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.Order.Filter.Bases open Set Filter Cardinal universe u variable {ΞΉ : Type u} {Ξ± Ξ² : Type u} variable {c : Cardinal.{u}} {hreg : c.IsRegular} variable {l : Filter Ξ±} namespace Filter variable (Ξ±) in def cocardinal (hreg : c.IsRegular) : Filter Ξ± := by apply ofCardinalUnion {s | Cardinal.mk s < c} (lt_of_lt_of_le (nat_lt_aleph0 2) hreg.aleph0_le) Β· refine fun s hS hSc ↦ lt_of_le_of_lt (mk_sUnion_le _) <| mul_lt_of_lt hreg.aleph0_le hS ?_ exact iSup_lt_of_isRegular hreg hS fun i ↦ hSc i i.property Β· exact fun _ hSc _ ht ↦ lt_of_le_of_lt (mk_le_mk_of_subset ht) hSc @[simp] theorem mem_cocardinal {s : Set Ξ±} : s ∈ cocardinal Ξ± hreg ↔ Cardinal.mk (sᢜ : Set Ξ±) < c := Iff.rfl @[simp] lemma cocardinal_aleph0_eq_cofinite : cocardinal (Ξ± := Ξ±) isRegular_aleph0 = cofinite := by aesop instance instCardinalInterFilter_cocardinal : CardinalInterFilter (cocardinal (Ξ± := Ξ±) hreg) c where cardinal_sInter_mem S hS hSs := by rw [mem_cocardinal, Set.compl_sInter] apply lt_of_le_of_lt (mk_sUnion_le _) apply mul_lt_of_lt hreg.aleph0_le (lt_of_le_of_lt mk_image_le hS) apply iSup_lt_of_isRegular hreg <| lt_of_le_of_lt mk_image_le hS intro i aesop @[simp] theorem eventually_cocardinal {p : Ξ± β†’ Prop} : (βˆ€αΆ  x in cocardinal Ξ± hreg, p x) ↔ #{ x | Β¬p x } < c := Iff.rfl theorem hasBasis_cocardinal : HasBasis (cocardinal Ξ± hreg) {s : Set Ξ± | #s < c} compl := ⟨fun s => ⟨fun h => ⟨sᢜ, h, (compl_compl s).subset⟩, fun ⟨_t, htf, hts⟩ => by have : #↑sᢜ < c := by apply lt_of_le_of_lt _ htf rw [compl_subset_comm] at hts apply Cardinal.mk_le_mk_of_subset hts simp_all only [mem_cocardinal] ⟩⟩ theorem frequently_cocardinal {p : Ξ± β†’ Prop} : (βˆƒαΆ  x in cocardinal Ξ± hreg, p x) ↔ c ≀ # { x | p x } := by simp only [Filter.Frequently, eventually_cocardinal, not_not,coe_setOf, not_lt] lemma frequently_cocardinal_mem {s : Set Ξ±} : (βˆƒαΆ  x in cocardinal Ξ± hreg, x ∈ s) ↔ c ≀ #s := frequently_cocardinal @[simp] lemma cocardinal_inf_principal_neBot_iff {s : Set Ξ±} : (cocardinal Ξ± hreg βŠ“ π“Ÿ s).NeBot ↔ c ≀ #s := frequently_mem_iff_neBot.symm.trans frequently_cocardinal theorem compl_mem_cocardinal_of_card_lt {s : Set Ξ±} (hs : #s < c) : sᢜ ∈ cocardinal Ξ± hreg := mem_cocardinal.2 <| (compl_compl s).symm β–Έ hs theorem _root_.Set.Finite.compl_mem_cocardinal {s : Set Ξ±} (hs : s.Finite) : sᢜ ∈ cocardinal Ξ± hreg := compl_mem_cocardinal_of_card_lt <| lt_of_lt_of_le (Finite.lt_aleph0 hs) (hreg.aleph0_le) theorem eventually_cocardinal_nmem_of_card_lt {s : Set Ξ±} (hs : #s < c) : βˆ€αΆ  x in cocardinal Ξ± hreg, x βˆ‰ s := compl_mem_cocardinal_of_card_lt hs theorem _root_.Finset.eventually_cocardinal_nmem (s : Finset Ξ±) : βˆ€αΆ  x in cocardinal Ξ± hreg, x βˆ‰ s := eventually_cocardinal_nmem_of_card_lt <| lt_of_lt_of_le (finset_card_lt_aleph0 s) (hreg.aleph0_le) theorem eventually_cocardinal_ne (x : Ξ±) : βˆ€αΆ  a in cocardinal Ξ± hreg, a β‰  x := by simp [Set.finite_singleton x] exact hreg.nat_lt 1 abbrev cocountable : Filter Ξ± := cocardinal Ξ± Cardinal.isRegular_aleph_one
Mathlib/Order/Filter/Cocardinal.lean
105
107
theorem mem_cocountable {s : Set Ξ±} : s ∈ cocountable ↔ (sᢜ : Set Ξ±).Countable := by
rw [Cardinal.countable_iff_lt_aleph_one, mem_cocardinal]
2,168
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
41
42
theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by
rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0]
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
46
48
theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by
-- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le]
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
52
54
theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by
-- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le]
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp] theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.lift_le_continuum Cardinal.lift_le_continuum @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
58
60
theorem continuum_lt_lift {c : Cardinal.{u}} : 𝔠 < lift.{v} c ↔ 𝔠 < c := by
-- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt]
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp] theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.lift_le_continuum Cardinal.lift_le_continuum @[simp] theorem continuum_lt_lift {c : Cardinal.{u}} : 𝔠 < lift.{v} c ↔ 𝔠 < c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.continuum_lt_lift Cardinal.continuum_lt_lift @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
64
66
theorem lift_lt_continuum {c : Cardinal.{u}} : lift.{v} c < 𝔠 ↔ c < 𝔠 := by
-- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt]
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp] theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.lift_le_continuum Cardinal.lift_le_continuum @[simp] theorem continuum_lt_lift {c : Cardinal.{u}} : 𝔠 < lift.{v} c ↔ 𝔠 < c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.continuum_lt_lift Cardinal.continuum_lt_lift @[simp] theorem lift_lt_continuum {c : Cardinal.{u}} : lift.{v} c < 𝔠 ↔ c < 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.lift_lt_continuum Cardinal.lift_lt_continuum theorem aleph0_lt_continuum : β„΅β‚€ < 𝔠 := cantor β„΅β‚€ #align cardinal.aleph_0_lt_continuum Cardinal.aleph0_lt_continuum theorem aleph0_le_continuum : β„΅β‚€ ≀ 𝔠 := aleph0_lt_continuum.le #align cardinal.aleph_0_le_continuum Cardinal.aleph0_le_continuum @[simp]
Mathlib/SetTheory/Cardinal/Continuum.lean
83
83
theorem beth_one : beth 1 = 𝔠 := by
simpa using beth_succ 0
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp] theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.lift_le_continuum Cardinal.lift_le_continuum @[simp] theorem continuum_lt_lift {c : Cardinal.{u}} : 𝔠 < lift.{v} c ↔ 𝔠 < c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.continuum_lt_lift Cardinal.continuum_lt_lift @[simp] theorem lift_lt_continuum {c : Cardinal.{u}} : lift.{v} c < 𝔠 ↔ c < 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.lift_lt_continuum Cardinal.lift_lt_continuum theorem aleph0_lt_continuum : β„΅β‚€ < 𝔠 := cantor β„΅β‚€ #align cardinal.aleph_0_lt_continuum Cardinal.aleph0_lt_continuum theorem aleph0_le_continuum : β„΅β‚€ ≀ 𝔠 := aleph0_lt_continuum.le #align cardinal.aleph_0_le_continuum Cardinal.aleph0_le_continuum @[simp] theorem beth_one : beth 1 = 𝔠 := by simpa using beth_succ 0 #align cardinal.beth_one Cardinal.beth_one theorem nat_lt_continuum (n : β„•) : ↑n < 𝔠 := (nat_lt_aleph0 n).trans aleph0_lt_continuum #align cardinal.nat_lt_continuum Cardinal.nat_lt_continuum
Mathlib/SetTheory/Cardinal/Continuum.lean
90
90
theorem mk_set_nat : #(Set β„•) = 𝔠 := by
simp
2,169
import Mathlib.SetTheory.Cardinal.Ordinal #align_import set_theory.cardinal.continuum from "leanprover-community/mathlib"@"e08a42b2dd544cf11eba72e5fc7bf199d4349925" namespace Cardinal universe u v open Cardinal def continuum : Cardinal.{u} := 2 ^ β„΅β‚€ #align cardinal.continuum Cardinal.continuum scoped notation "𝔠" => Cardinal.continuum @[simp] theorem two_power_aleph0 : 2 ^ aleph0.{u} = continuum.{u} := rfl #align cardinal.two_power_aleph_0 Cardinal.two_power_aleph0 @[simp] theorem lift_continuum : lift.{v} 𝔠 = 𝔠 := by rw [← two_power_aleph0, lift_two_power, lift_aleph0, two_power_aleph0] #align cardinal.lift_continuum Cardinal.lift_continuum @[simp] theorem continuum_le_lift {c : Cardinal.{u}} : 𝔠 ≀ lift.{v} c ↔ 𝔠 ≀ c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.continuum_le_lift Cardinal.continuum_le_lift @[simp] theorem lift_le_continuum {c : Cardinal.{u}} : lift.{v} c ≀ 𝔠 ↔ c ≀ 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_le] #align cardinal.lift_le_continuum Cardinal.lift_le_continuum @[simp] theorem continuum_lt_lift {c : Cardinal.{u}} : 𝔠 < lift.{v} c ↔ 𝔠 < c := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.continuum_lt_lift Cardinal.continuum_lt_lift @[simp] theorem lift_lt_continuum {c : Cardinal.{u}} : lift.{v} c < 𝔠 ↔ c < 𝔠 := by -- Porting note: added explicit universes rw [← lift_continuum.{u,v}, lift_lt] #align cardinal.lift_lt_continuum Cardinal.lift_lt_continuum theorem aleph0_lt_continuum : β„΅β‚€ < 𝔠 := cantor β„΅β‚€ #align cardinal.aleph_0_lt_continuum Cardinal.aleph0_lt_continuum theorem aleph0_le_continuum : β„΅β‚€ ≀ 𝔠 := aleph0_lt_continuum.le #align cardinal.aleph_0_le_continuum Cardinal.aleph0_le_continuum @[simp] theorem beth_one : beth 1 = 𝔠 := by simpa using beth_succ 0 #align cardinal.beth_one Cardinal.beth_one theorem nat_lt_continuum (n : β„•) : ↑n < 𝔠 := (nat_lt_aleph0 n).trans aleph0_lt_continuum #align cardinal.nat_lt_continuum Cardinal.nat_lt_continuum theorem mk_set_nat : #(Set β„•) = 𝔠 := by simp #align cardinal.mk_set_nat Cardinal.mk_set_nat theorem continuum_pos : 0 < 𝔠 := nat_lt_continuum 0 #align cardinal.continuum_pos Cardinal.continuum_pos theorem continuum_ne_zero : 𝔠 β‰  0 := continuum_pos.ne' #align cardinal.continuum_ne_zero Cardinal.continuum_ne_zero
Mathlib/SetTheory/Cardinal/Continuum.lean
101
103
theorem aleph_one_le_continuum : aleph 1 ≀ 𝔠 := by
rw [← succ_aleph0] exact Order.succ_le_of_lt aleph0_lt_continuum
2,169
import Mathlib.MeasureTheory.MeasurableSpace.Defs import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.SetTheory.Cardinal.Continuum #align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b" universe u variable {Ξ± : Type u} open Cardinal Set -- Porting note: fix universe below, not here local notation "ω₁" => (WellOrder.Ξ± <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal)) namespace MeasurableSpace def generateMeasurableRec (s : Set (Set Ξ±)) : (ω₁ : Type u) β†’ Set (Set Ξ±) | i => let S := ⋃ j : Iio i, generateMeasurableRec s (j.1) s βˆͺ {βˆ…} βˆͺ compl '' S βˆͺ Set.range fun f : β„• β†’ S => ⋃ n, (f n).1 termination_by i => i decreasing_by exact j.2 #align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec
Mathlib/MeasureTheory/MeasurableSpace/Card.lean
55
59
theorem self_subset_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : s βŠ† generateMeasurableRec s i := by
unfold generateMeasurableRec apply_rules [subset_union_of_subset_left] exact subset_rfl
2,170
import Mathlib.MeasureTheory.MeasurableSpace.Defs import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.SetTheory.Cardinal.Continuum #align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b" universe u variable {Ξ± : Type u} open Cardinal Set -- Porting note: fix universe below, not here local notation "ω₁" => (WellOrder.Ξ± <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal)) namespace MeasurableSpace def generateMeasurableRec (s : Set (Set Ξ±)) : (ω₁ : Type u) β†’ Set (Set Ξ±) | i => let S := ⋃ j : Iio i, generateMeasurableRec s (j.1) s βˆͺ {βˆ…} βˆͺ compl '' S βˆͺ Set.range fun f : β„• β†’ S => ⋃ n, (f n).1 termination_by i => i decreasing_by exact j.2 #align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec theorem self_subset_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : s βŠ† generateMeasurableRec s i := by unfold generateMeasurableRec apply_rules [subset_union_of_subset_left] exact subset_rfl #align measurable_space.self_subset_generate_measurable_rec MeasurableSpace.self_subset_generateMeasurableRec
Mathlib/MeasureTheory/MeasurableSpace/Card.lean
62
65
theorem empty_mem_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : βˆ… ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton βˆ…)))
2,170
import Mathlib.MeasureTheory.MeasurableSpace.Defs import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.SetTheory.Cardinal.Continuum #align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b" universe u variable {Ξ± : Type u} open Cardinal Set -- Porting note: fix universe below, not here local notation "ω₁" => (WellOrder.Ξ± <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal)) namespace MeasurableSpace def generateMeasurableRec (s : Set (Set Ξ±)) : (ω₁ : Type u) β†’ Set (Set Ξ±) | i => let S := ⋃ j : Iio i, generateMeasurableRec s (j.1) s βˆͺ {βˆ…} βˆͺ compl '' S βˆͺ Set.range fun f : β„• β†’ S => ⋃ n, (f n).1 termination_by i => i decreasing_by exact j.2 #align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec theorem self_subset_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : s βŠ† generateMeasurableRec s i := by unfold generateMeasurableRec apply_rules [subset_union_of_subset_left] exact subset_rfl #align measurable_space.self_subset_generate_measurable_rec MeasurableSpace.self_subset_generateMeasurableRec theorem empty_mem_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : βˆ… ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton βˆ…))) #align measurable_space.empty_mem_generate_measurable_rec MeasurableSpace.empty_mem_generateMeasurableRec
Mathlib/MeasureTheory/MeasurableSpace/Card.lean
68
71
theorem compl_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i j : ω₁} (h : j < i) {t : Set Ξ±} (ht : t ∈ generateMeasurableRec s j) : tᢜ ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩)
2,170
import Mathlib.MeasureTheory.MeasurableSpace.Defs import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.SetTheory.Cardinal.Continuum #align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b" universe u variable {Ξ± : Type u} open Cardinal Set -- Porting note: fix universe below, not here local notation "ω₁" => (WellOrder.Ξ± <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal)) namespace MeasurableSpace def generateMeasurableRec (s : Set (Set Ξ±)) : (ω₁ : Type u) β†’ Set (Set Ξ±) | i => let S := ⋃ j : Iio i, generateMeasurableRec s (j.1) s βˆͺ {βˆ…} βˆͺ compl '' S βˆͺ Set.range fun f : β„• β†’ S => ⋃ n, (f n).1 termination_by i => i decreasing_by exact j.2 #align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec theorem self_subset_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : s βŠ† generateMeasurableRec s i := by unfold generateMeasurableRec apply_rules [subset_union_of_subset_left] exact subset_rfl #align measurable_space.self_subset_generate_measurable_rec MeasurableSpace.self_subset_generateMeasurableRec theorem empty_mem_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : βˆ… ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton βˆ…))) #align measurable_space.empty_mem_generate_measurable_rec MeasurableSpace.empty_mem_generateMeasurableRec theorem compl_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i j : ω₁} (h : j < i) {t : Set Ξ±} (ht : t ∈ generateMeasurableRec s j) : tᢜ ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩) #align measurable_space.compl_mem_generate_measurable_rec MeasurableSpace.compl_mem_generateMeasurableRec
Mathlib/MeasureTheory/MeasurableSpace/Card.lean
74
78
theorem iUnion_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i : ω₁} {f : β„• β†’ Set Ξ±} (hf : βˆ€ n, βˆƒ j < i, f n ∈ generateMeasurableRec s j) : (⋃ n, f n) ∈ generateMeasurableRec s i := by
unfold generateMeasurableRec exact mem_union_right _ ⟨fun n => ⟨f n, let ⟨j, hj, hf⟩ := hf n; mem_iUnion.2 ⟨⟨j, hj⟩, hf⟩⟩, rfl⟩
2,170
import Mathlib.MeasureTheory.MeasurableSpace.Defs import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.SetTheory.Cardinal.Continuum #align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b" universe u variable {Ξ± : Type u} open Cardinal Set -- Porting note: fix universe below, not here local notation "ω₁" => (WellOrder.Ξ± <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal)) namespace MeasurableSpace def generateMeasurableRec (s : Set (Set Ξ±)) : (ω₁ : Type u) β†’ Set (Set Ξ±) | i => let S := ⋃ j : Iio i, generateMeasurableRec s (j.1) s βˆͺ {βˆ…} βˆͺ compl '' S βˆͺ Set.range fun f : β„• β†’ S => ⋃ n, (f n).1 termination_by i => i decreasing_by exact j.2 #align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec theorem self_subset_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : s βŠ† generateMeasurableRec s i := by unfold generateMeasurableRec apply_rules [subset_union_of_subset_left] exact subset_rfl #align measurable_space.self_subset_generate_measurable_rec MeasurableSpace.self_subset_generateMeasurableRec theorem empty_mem_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : βˆ… ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton βˆ…))) #align measurable_space.empty_mem_generate_measurable_rec MeasurableSpace.empty_mem_generateMeasurableRec theorem compl_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i j : ω₁} (h : j < i) {t : Set Ξ±} (ht : t ∈ generateMeasurableRec s j) : tᢜ ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩) #align measurable_space.compl_mem_generate_measurable_rec MeasurableSpace.compl_mem_generateMeasurableRec theorem iUnion_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i : ω₁} {f : β„• β†’ Set Ξ±} (hf : βˆ€ n, βˆƒ j < i, f n ∈ generateMeasurableRec s j) : (⋃ n, f n) ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_right _ ⟨fun n => ⟨f n, let ⟨j, hj, hf⟩ := hf n; mem_iUnion.2 ⟨⟨j, hj⟩, hf⟩⟩, rfl⟩ #align measurable_space.Union_mem_generate_measurable_rec MeasurableSpace.iUnion_mem_generateMeasurableRec theorem generateMeasurableRec_subset (s : Set (Set Ξ±)) {i j : ω₁} (h : i ≀ j) : generateMeasurableRec s i βŠ† generateMeasurableRec s j := fun x hx => by rcases eq_or_lt_of_le h with (rfl | h) Β· exact hx Β· convert iUnion_mem_generateMeasurableRec fun _ => ⟨i, h, hx⟩ exact (iUnion_const x).symm #align measurable_space.generate_measurable_rec_subset MeasurableSpace.generateMeasurableRec_subset
Mathlib/MeasureTheory/MeasurableSpace/Card.lean
91
113
theorem cardinal_generateMeasurableRec_le (s : Set (Set Ξ±)) (i : ω₁) : #(generateMeasurableRec s i) ≀ max #s 2 ^ aleph0.{u} := by
apply (aleph 1).ord.out.wo.wf.induction i intro i IH have A := aleph0_le_aleph 1 have B : aleph 1 ≀ max #s 2 ^ aleph0.{u} := aleph_one_le_continuum.trans (power_le_power_right (le_max_right _ _)) have C : β„΅β‚€ ≀ max #s 2 ^ aleph0.{u} := A.trans B have J : #(⋃ j : Iio i, generateMeasurableRec s j.1) ≀ max #s 2 ^ aleph0.{u} := by refine (mk_iUnion_le _).trans ?_ have D : ⨆ j : Iio i, #(generateMeasurableRec s j) ≀ _ := ciSup_le' fun ⟨j, hj⟩ => IH j hj apply (mul_le_mul' ((mk_subtype_le _).trans (aleph 1).mk_ord_out.le) D).trans rw [mul_eq_max A C] exact max_le B le_rfl rw [generateMeasurableRec] apply_rules [(mk_union_le _ _).trans, add_le_of_le C, mk_image_le.trans] Β· exact (le_max_left _ _).trans (self_le_power _ one_lt_aleph0.le) Β· rw [mk_singleton] exact one_lt_aleph0.le.trans C Β· apply mk_range_le.trans simp only [mk_pi, prod_const, lift_uzero, mk_denumerable, lift_aleph0] have := @power_le_power_right _ _ β„΅β‚€ J rwa [← power_mul, aleph0_mul_aleph0] at this
2,170
import Mathlib.MeasureTheory.MeasurableSpace.Defs import Mathlib.SetTheory.Cardinal.Cofinality import Mathlib.SetTheory.Cardinal.Continuum #align_import measure_theory.card_measurable_space from "leanprover-community/mathlib"@"f2b108e8e97ba393f22bf794989984ddcc1da89b" universe u variable {Ξ± : Type u} open Cardinal Set -- Porting note: fix universe below, not here local notation "ω₁" => (WellOrder.Ξ± <| Quotient.out <| Cardinal.ord (aleph 1 : Cardinal)) namespace MeasurableSpace def generateMeasurableRec (s : Set (Set Ξ±)) : (ω₁ : Type u) β†’ Set (Set Ξ±) | i => let S := ⋃ j : Iio i, generateMeasurableRec s (j.1) s βˆͺ {βˆ…} βˆͺ compl '' S βˆͺ Set.range fun f : β„• β†’ S => ⋃ n, (f n).1 termination_by i => i decreasing_by exact j.2 #align measurable_space.generate_measurable_rec MeasurableSpace.generateMeasurableRec theorem self_subset_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : s βŠ† generateMeasurableRec s i := by unfold generateMeasurableRec apply_rules [subset_union_of_subset_left] exact subset_rfl #align measurable_space.self_subset_generate_measurable_rec MeasurableSpace.self_subset_generateMeasurableRec theorem empty_mem_generateMeasurableRec (s : Set (Set Ξ±)) (i : ω₁) : βˆ… ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_left _ (mem_union_right _ (mem_singleton βˆ…))) #align measurable_space.empty_mem_generate_measurable_rec MeasurableSpace.empty_mem_generateMeasurableRec theorem compl_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i j : ω₁} (h : j < i) {t : Set Ξ±} (ht : t ∈ generateMeasurableRec s j) : tᢜ ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_left _ (mem_union_right _ ⟨t, mem_iUnion.2 ⟨⟨j, h⟩, ht⟩, rfl⟩) #align measurable_space.compl_mem_generate_measurable_rec MeasurableSpace.compl_mem_generateMeasurableRec theorem iUnion_mem_generateMeasurableRec {s : Set (Set Ξ±)} {i : ω₁} {f : β„• β†’ Set Ξ±} (hf : βˆ€ n, βˆƒ j < i, f n ∈ generateMeasurableRec s j) : (⋃ n, f n) ∈ generateMeasurableRec s i := by unfold generateMeasurableRec exact mem_union_right _ ⟨fun n => ⟨f n, let ⟨j, hj, hf⟩ := hf n; mem_iUnion.2 ⟨⟨j, hj⟩, hf⟩⟩, rfl⟩ #align measurable_space.Union_mem_generate_measurable_rec MeasurableSpace.iUnion_mem_generateMeasurableRec theorem generateMeasurableRec_subset (s : Set (Set Ξ±)) {i j : ω₁} (h : i ≀ j) : generateMeasurableRec s i βŠ† generateMeasurableRec s j := fun x hx => by rcases eq_or_lt_of_le h with (rfl | h) Β· exact hx Β· convert iUnion_mem_generateMeasurableRec fun _ => ⟨i, h, hx⟩ exact (iUnion_const x).symm #align measurable_space.generate_measurable_rec_subset MeasurableSpace.generateMeasurableRec_subset theorem cardinal_generateMeasurableRec_le (s : Set (Set Ξ±)) (i : ω₁) : #(generateMeasurableRec s i) ≀ max #s 2 ^ aleph0.{u} := by apply (aleph 1).ord.out.wo.wf.induction i intro i IH have A := aleph0_le_aleph 1 have B : aleph 1 ≀ max #s 2 ^ aleph0.{u} := aleph_one_le_continuum.trans (power_le_power_right (le_max_right _ _)) have C : β„΅β‚€ ≀ max #s 2 ^ aleph0.{u} := A.trans B have J : #(⋃ j : Iio i, generateMeasurableRec s j.1) ≀ max #s 2 ^ aleph0.{u} := by refine (mk_iUnion_le _).trans ?_ have D : ⨆ j : Iio i, #(generateMeasurableRec s j) ≀ _ := ciSup_le' fun ⟨j, hj⟩ => IH j hj apply (mul_le_mul' ((mk_subtype_le _).trans (aleph 1).mk_ord_out.le) D).trans rw [mul_eq_max A C] exact max_le B le_rfl rw [generateMeasurableRec] apply_rules [(mk_union_le _ _).trans, add_le_of_le C, mk_image_le.trans] Β· exact (le_max_left _ _).trans (self_le_power _ one_lt_aleph0.le) Β· rw [mk_singleton] exact one_lt_aleph0.le.trans C Β· apply mk_range_le.trans simp only [mk_pi, prod_const, lift_uzero, mk_denumerable, lift_aleph0] have := @power_le_power_right _ _ β„΅β‚€ J rwa [← power_mul, aleph0_mul_aleph0] at this #align measurable_space.cardinal_generate_measurable_rec_le MeasurableSpace.cardinal_generateMeasurableRec_le
Mathlib/MeasureTheory/MeasurableSpace/Card.lean
117
151
theorem generateMeasurable_eq_rec (s : Set (Set Ξ±)) : { t | GenerateMeasurable s t } = ⋃ (i : (Quotient.out (aleph 1).ord).Ξ±), generateMeasurableRec s i := by
ext t; refine ⟨fun ht => ?_, fun ht => ?_⟩ Β· inhabit ω₁ induction' ht with u hu u _ IH f _ IH Β· exact mem_iUnion.2 ⟨default, self_subset_generateMeasurableRec s _ hu⟩ Β· exact mem_iUnion.2 ⟨default, empty_mem_generateMeasurableRec s _⟩ Β· rcases mem_iUnion.1 IH with ⟨i, hi⟩ obtain ⟨j, hj⟩ := exists_gt i exact mem_iUnion.2 ⟨j, compl_mem_generateMeasurableRec hj hi⟩ Β· have : βˆ€ n, βˆƒ i, f n ∈ generateMeasurableRec s i := fun n => by simpa using IH n choose I hI using this have : IsWellOrder (ω₁ : Type u) (Β· < Β·) := isWellOrder_out_lt _ refine mem_iUnion.2 ⟨Ordinal.enum (Β· < Β·) (Ordinal.lsub fun n => Ordinal.typein.{u} (Β· < Β·) (I n)) ?_, iUnion_mem_generateMeasurableRec fun n => ⟨I n, ?_, hI n⟩⟩ Β· rw [Ordinal.type_lt] refine Ordinal.lsub_lt_ord_lift ?_ fun i => Ordinal.typein_lt_self _ rw [mk_denumerable, lift_aleph0, isRegular_aleph_one.cof_eq] exact aleph0_lt_aleph_one Β· rw [← Ordinal.typein_lt_typein (Β· < Β·), Ordinal.typein_enum] apply Ordinal.lt_lsub fun n : β„• => _ Β· rcases ht with ⟨t, ⟨i, rfl⟩, hx⟩ revert t apply (aleph 1).ord.out.wo.wf.induction i intro j H t ht unfold generateMeasurableRec at ht rcases ht with (((h | (rfl : t = βˆ…)) | ⟨u, ⟨-, ⟨⟨k, hk⟩, rfl⟩, hu⟩, rfl⟩) | ⟨f, rfl⟩) Β· exact .basic t h Β· exact .empty Β· exact .compl u (H k hk u hu) Β· refine .iUnion _ @fun n => ?_ obtain ⟨-, ⟨⟨k, hk⟩, rfl⟩, hf⟩ := (f n).prop exact H k hk _ hf
2,170
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp]
Mathlib/Data/Real/Cardinality.lean
64
65
theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by
simp [cantorFunctionAux, h]
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp]
Mathlib/Data/Real/Cardinality.lean
69
70
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by
simp [cantorFunctionAux, h]
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false
Mathlib/Data/Real/Cardinality.lean
73
75
theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by
cases h' : f n <;> simp [h'] apply pow_nonneg h
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg
Mathlib/Data/Real/Cardinality.lean
78
79
theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by
simp [cantorFunctionAux, h]
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq
Mathlib/Data/Real/Cardinality.lean
82
83
theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by
cases h : f 0 <;> simp [h]
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by cases h : f 0 <;> simp [h] #align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero
Mathlib/Data/Real/Cardinality.lean
86
90
theorem cantorFunctionAux_succ (f : β„• β†’ Bool) : (fun n => cantorFunctionAux c f (n + 1)) = fun n => c * cantorFunctionAux c (fun n => f (n + 1)) n := by
ext n cases h : f (n + 1) <;> simp [h, _root_.pow_succ']
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by cases h : f 0 <;> simp [h] #align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero theorem cantorFunctionAux_succ (f : β„• β†’ Bool) : (fun n => cantorFunctionAux c f (n + 1)) = fun n => c * cantorFunctionAux c (fun n => f (n + 1)) n := by ext n cases h : f (n + 1) <;> simp [h, _root_.pow_succ'] #align cardinal.cantor_function_aux_succ Cardinal.cantorFunctionAux_succ
Mathlib/Data/Real/Cardinality.lean
93
96
theorem summable_cantor_function (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : Summable (cantorFunctionAux c f) := by
apply (summable_geometric_of_lt_one h1 h2).summable_of_eq_zero_or_self intro n; cases h : f n <;> simp [h]
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by cases h : f 0 <;> simp [h] #align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero theorem cantorFunctionAux_succ (f : β„• β†’ Bool) : (fun n => cantorFunctionAux c f (n + 1)) = fun n => c * cantorFunctionAux c (fun n => f (n + 1)) n := by ext n cases h : f (n + 1) <;> simp [h, _root_.pow_succ'] #align cardinal.cantor_function_aux_succ Cardinal.cantorFunctionAux_succ theorem summable_cantor_function (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : Summable (cantorFunctionAux c f) := by apply (summable_geometric_of_lt_one h1 h2).summable_of_eq_zero_or_self intro n; cases h : f n <;> simp [h] #align cardinal.summable_cantor_function Cardinal.summable_cantor_function def cantorFunction (c : ℝ) (f : β„• β†’ Bool) : ℝ := βˆ‘' n, cantorFunctionAux c f n #align cardinal.cantor_function Cardinal.cantorFunction
Mathlib/Data/Real/Cardinality.lean
105
110
theorem cantorFunction_le (h1 : 0 ≀ c) (h2 : c < 1) (h3 : βˆ€ n, f n β†’ g n) : cantorFunction c f ≀ cantorFunction c g := by
apply tsum_le_tsum _ (summable_cantor_function f h1 h2) (summable_cantor_function g h1 h2) intro n; cases h : f n Β· simp [h, cantorFunctionAux_nonneg h1] replace h3 : g n = true := h3 n h; simp [h, h3]
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by cases h : f 0 <;> simp [h] #align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero theorem cantorFunctionAux_succ (f : β„• β†’ Bool) : (fun n => cantorFunctionAux c f (n + 1)) = fun n => c * cantorFunctionAux c (fun n => f (n + 1)) n := by ext n cases h : f (n + 1) <;> simp [h, _root_.pow_succ'] #align cardinal.cantor_function_aux_succ Cardinal.cantorFunctionAux_succ theorem summable_cantor_function (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : Summable (cantorFunctionAux c f) := by apply (summable_geometric_of_lt_one h1 h2).summable_of_eq_zero_or_self intro n; cases h : f n <;> simp [h] #align cardinal.summable_cantor_function Cardinal.summable_cantor_function def cantorFunction (c : ℝ) (f : β„• β†’ Bool) : ℝ := βˆ‘' n, cantorFunctionAux c f n #align cardinal.cantor_function Cardinal.cantorFunction theorem cantorFunction_le (h1 : 0 ≀ c) (h2 : c < 1) (h3 : βˆ€ n, f n β†’ g n) : cantorFunction c f ≀ cantorFunction c g := by apply tsum_le_tsum _ (summable_cantor_function f h1 h2) (summable_cantor_function g h1 h2) intro n; cases h : f n Β· simp [h, cantorFunctionAux_nonneg h1] replace h3 : g n = true := h3 n h; simp [h, h3] #align cardinal.cantor_function_le Cardinal.cantorFunction_le
Mathlib/Data/Real/Cardinality.lean
113
117
theorem cantorFunction_succ (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : cantorFunction c f = cond (f 0) 1 0 + c * cantorFunction c fun n => f (n + 1) := by
rw [cantorFunction, tsum_eq_zero_add (summable_cantor_function f h1 h2)] rw [cantorFunctionAux_succ, tsum_mul_left, cantorFunctionAux, _root_.pow_zero] rfl
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by cases h : f 0 <;> simp [h] #align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero theorem cantorFunctionAux_succ (f : β„• β†’ Bool) : (fun n => cantorFunctionAux c f (n + 1)) = fun n => c * cantorFunctionAux c (fun n => f (n + 1)) n := by ext n cases h : f (n + 1) <;> simp [h, _root_.pow_succ'] #align cardinal.cantor_function_aux_succ Cardinal.cantorFunctionAux_succ theorem summable_cantor_function (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : Summable (cantorFunctionAux c f) := by apply (summable_geometric_of_lt_one h1 h2).summable_of_eq_zero_or_self intro n; cases h : f n <;> simp [h] #align cardinal.summable_cantor_function Cardinal.summable_cantor_function def cantorFunction (c : ℝ) (f : β„• β†’ Bool) : ℝ := βˆ‘' n, cantorFunctionAux c f n #align cardinal.cantor_function Cardinal.cantorFunction theorem cantorFunction_le (h1 : 0 ≀ c) (h2 : c < 1) (h3 : βˆ€ n, f n β†’ g n) : cantorFunction c f ≀ cantorFunction c g := by apply tsum_le_tsum _ (summable_cantor_function f h1 h2) (summable_cantor_function g h1 h2) intro n; cases h : f n Β· simp [h, cantorFunctionAux_nonneg h1] replace h3 : g n = true := h3 n h; simp [h, h3] #align cardinal.cantor_function_le Cardinal.cantorFunction_le theorem cantorFunction_succ (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : cantorFunction c f = cond (f 0) 1 0 + c * cantorFunction c fun n => f (n + 1) := by rw [cantorFunction, tsum_eq_zero_add (summable_cantor_function f h1 h2)] rw [cantorFunctionAux_succ, tsum_mul_left, cantorFunctionAux, _root_.pow_zero] rfl #align cardinal.cantor_function_succ Cardinal.cantorFunction_succ
Mathlib/Data/Real/Cardinality.lean
123
164
theorem increasing_cantorFunction (h1 : 0 < c) (h2 : c < 1 / 2) {n : β„•} {f g : β„• β†’ Bool} (hn : βˆ€ k < n, f k = g k) (fn : f n = false) (gn : g n = true) : cantorFunction c f < cantorFunction c g := by
have h3 : c < 1 := by apply h2.trans norm_num induction' n with n ih generalizing f g Β· let f_max : β„• β†’ Bool := fun n => Nat.rec false (fun _ _ => true) n have hf_max : βˆ€ n, f n β†’ f_max n := by intro n hn cases n Β· rw [fn] at hn contradiction apply rfl let g_min : β„• β†’ Bool := fun n => Nat.rec true (fun _ _ => false) n have hg_min : βˆ€ n, g_min n β†’ g n := by intro n hn cases n Β· rw [gn] simp at hn apply (cantorFunction_le (le_of_lt h1) h3 hf_max).trans_lt refine lt_of_lt_of_le ?_ (cantorFunction_le (le_of_lt h1) h3 hg_min) have : c / (1 - c) < 1 := by rw [div_lt_one, lt_sub_iff_add_lt] Β· convert _root_.add_lt_add h2 h2 norm_num rwa [sub_pos] convert this Β· rw [cantorFunction_succ _ (le_of_lt h1) h3, div_eq_mul_inv, ← tsum_geometric_of_lt_one (le_of_lt h1) h3] apply zero_add Β· refine (tsum_eq_single 0 ?_).trans ?_ Β· intro n hn cases n Β· contradiction rfl Β· exact cantorFunctionAux_zero _ rw [cantorFunction_succ f (le_of_lt h1) h3, cantorFunction_succ g (le_of_lt h1) h3] rw [hn 0 <| zero_lt_succ n] apply add_lt_add_left rw [mul_lt_mul_left h1] exact ih (fun k hk => hn _ <| Nat.succ_lt_succ hk) fn gn
2,171
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by cases h : f 0 <;> simp [h] #align cardinal.cantor_function_aux_zero Cardinal.cantorFunctionAux_zero theorem cantorFunctionAux_succ (f : β„• β†’ Bool) : (fun n => cantorFunctionAux c f (n + 1)) = fun n => c * cantorFunctionAux c (fun n => f (n + 1)) n := by ext n cases h : f (n + 1) <;> simp [h, _root_.pow_succ'] #align cardinal.cantor_function_aux_succ Cardinal.cantorFunctionAux_succ theorem summable_cantor_function (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : Summable (cantorFunctionAux c f) := by apply (summable_geometric_of_lt_one h1 h2).summable_of_eq_zero_or_self intro n; cases h : f n <;> simp [h] #align cardinal.summable_cantor_function Cardinal.summable_cantor_function def cantorFunction (c : ℝ) (f : β„• β†’ Bool) : ℝ := βˆ‘' n, cantorFunctionAux c f n #align cardinal.cantor_function Cardinal.cantorFunction theorem cantorFunction_le (h1 : 0 ≀ c) (h2 : c < 1) (h3 : βˆ€ n, f n β†’ g n) : cantorFunction c f ≀ cantorFunction c g := by apply tsum_le_tsum _ (summable_cantor_function f h1 h2) (summable_cantor_function g h1 h2) intro n; cases h : f n Β· simp [h, cantorFunctionAux_nonneg h1] replace h3 : g n = true := h3 n h; simp [h, h3] #align cardinal.cantor_function_le Cardinal.cantorFunction_le theorem cantorFunction_succ (f : β„• β†’ Bool) (h1 : 0 ≀ c) (h2 : c < 1) : cantorFunction c f = cond (f 0) 1 0 + c * cantorFunction c fun n => f (n + 1) := by rw [cantorFunction, tsum_eq_zero_add (summable_cantor_function f h1 h2)] rw [cantorFunctionAux_succ, tsum_mul_left, cantorFunctionAux, _root_.pow_zero] rfl #align cardinal.cantor_function_succ Cardinal.cantorFunction_succ theorem increasing_cantorFunction (h1 : 0 < c) (h2 : c < 1 / 2) {n : β„•} {f g : β„• β†’ Bool} (hn : βˆ€ k < n, f k = g k) (fn : f n = false) (gn : g n = true) : cantorFunction c f < cantorFunction c g := by have h3 : c < 1 := by apply h2.trans norm_num induction' n with n ih generalizing f g Β· let f_max : β„• β†’ Bool := fun n => Nat.rec false (fun _ _ => true) n have hf_max : βˆ€ n, f n β†’ f_max n := by intro n hn cases n Β· rw [fn] at hn contradiction apply rfl let g_min : β„• β†’ Bool := fun n => Nat.rec true (fun _ _ => false) n have hg_min : βˆ€ n, g_min n β†’ g n := by intro n hn cases n Β· rw [gn] simp at hn apply (cantorFunction_le (le_of_lt h1) h3 hf_max).trans_lt refine lt_of_lt_of_le ?_ (cantorFunction_le (le_of_lt h1) h3 hg_min) have : c / (1 - c) < 1 := by rw [div_lt_one, lt_sub_iff_add_lt] Β· convert _root_.add_lt_add h2 h2 norm_num rwa [sub_pos] convert this Β· rw [cantorFunction_succ _ (le_of_lt h1) h3, div_eq_mul_inv, ← tsum_geometric_of_lt_one (le_of_lt h1) h3] apply zero_add Β· refine (tsum_eq_single 0 ?_).trans ?_ Β· intro n hn cases n Β· contradiction rfl Β· exact cantorFunctionAux_zero _ rw [cantorFunction_succ f (le_of_lt h1) h3, cantorFunction_succ g (le_of_lt h1) h3] rw [hn 0 <| zero_lt_succ n] apply add_lt_add_left rw [mul_lt_mul_left h1] exact ih (fun k hk => hn _ <| Nat.succ_lt_succ hk) fn gn #align cardinal.increasing_cantor_function Cardinal.increasing_cantorFunction
Mathlib/Data/Real/Cardinality.lean
168
197
theorem cantorFunction_injective (h1 : 0 < c) (h2 : c < 1 / 2) : Function.Injective (cantorFunction c) := by
intro f g hfg classical by_contra h revert hfg have : βˆƒ n, f n β‰  g n := by rw [← not_forall] intro h' apply h ext apply h' let n := Nat.find this have hn : βˆ€ k : β„•, k < n β†’ f k = g k := by intro k hk apply of_not_not exact Nat.find_min this hk cases fn : f n Β· apply _root_.ne_of_lt refine increasing_cantorFunction h1 h2 hn fn ?_ apply Bool.eq_true_of_not_eq_false rw [← fn] apply Ne.symm exact Nat.find_spec this Β· apply _root_.ne_of_gt refine increasing_cantorFunction h1 h2 (fun k hk => (hn k hk).symm) ?_ fn apply Bool.eq_false_of_not_eq_true rw [← fn] apply Ne.symm exact Nat.find_spec this
2,171
import Mathlib.Data.Complex.Basic import Mathlib.Data.Real.Cardinality #align_import data.complex.cardinality from "leanprover-community/mathlib"@"1c4e18434eeb5546b212e830b2b39de6a83c473c" -- Porting note: the lemmas `mk_complex` and `mk_univ_complex` should be in the namespace `Cardinal` -- like their real counterparts. open Cardinal Set open Cardinal @[simp]
Mathlib/Data/Complex/Cardinality.lean
25
26
theorem mk_complex : #β„‚ = 𝔠 := by
rw [mk_congr Complex.equivRealProd, mk_prod, lift_id, mk_real, continuum_mul_self]
2,172
import Mathlib.Data.Complex.Basic import Mathlib.Data.Real.Cardinality #align_import data.complex.cardinality from "leanprover-community/mathlib"@"1c4e18434eeb5546b212e830b2b39de6a83c473c" -- Porting note: the lemmas `mk_complex` and `mk_univ_complex` should be in the namespace `Cardinal` -- like their real counterparts. open Cardinal Set open Cardinal @[simp] theorem mk_complex : #β„‚ = 𝔠 := by rw [mk_congr Complex.equivRealProd, mk_prod, lift_id, mk_real, continuum_mul_self] #align mk_complex mk_complex -- @[simp] -- Porting note (#10618): simp can prove this
Mathlib/Data/Complex/Cardinality.lean
31
31
theorem mk_univ_complex : #(Set.univ : Set β„‚) = 𝔠 := by
rw [mk_univ, mk_complex]
2,172
import Mathlib.Data.Complex.Basic import Mathlib.Data.Real.Cardinality #align_import data.complex.cardinality from "leanprover-community/mathlib"@"1c4e18434eeb5546b212e830b2b39de6a83c473c" -- Porting note: the lemmas `mk_complex` and `mk_univ_complex` should be in the namespace `Cardinal` -- like their real counterparts. open Cardinal Set open Cardinal @[simp] theorem mk_complex : #β„‚ = 𝔠 := by rw [mk_congr Complex.equivRealProd, mk_prod, lift_id, mk_real, continuum_mul_self] #align mk_complex mk_complex -- @[simp] -- Porting note (#10618): simp can prove this theorem mk_univ_complex : #(Set.univ : Set β„‚) = 𝔠 := by rw [mk_univ, mk_complex] #align mk_univ_complex mk_univ_complex
Mathlib/Data/Complex/Cardinality.lean
35
37
theorem not_countable_complex : Β¬(Set.univ : Set β„‚).Countable := by
rw [← le_aleph0_iff_set_countable, not_le, mk_univ_complex] apply cantor
2,172
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Data.Complex.Cardinality import Mathlib.Data.Fin.VecNotation import Mathlib.LinearAlgebra.FiniteDimensional #align_import data.complex.module from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" namespace Complex open ComplexConjugate open scoped SMul variable {R : Type*} {S : Type*} attribute [local ext] Complex.ext -- Test that the `SMul β„š β„‚` instance is correct. example : (Complex.SMul.instSMulRealComplex : SMul β„š β„‚) = (Algebra.toSMul : SMul β„š β„‚) := rfl -- priority manually adjusted in #11980 instance (priority := 90) [SMul R ℝ] [SMul S ℝ] [SMulCommClass R S ℝ] : SMulCommClass R S β„‚ where smul_comm r s x := by ext <;> simp [smul_re, smul_im, smul_comm] -- priority manually adjusted in #11980 instance (priority := 90) [SMul R S] [SMul R ℝ] [SMul S ℝ] [IsScalarTower R S ℝ] : IsScalarTower R S β„‚ where smul_assoc r s x := by ext <;> simp [smul_re, smul_im, smul_assoc] -- priority manually adjusted in #11980 instance (priority := 90) [SMul R ℝ] [SMul Rᡐᡒᡖ ℝ] [IsCentralScalar R ℝ] : IsCentralScalar R β„‚ where op_smul_eq_smul r x := by ext <;> simp [smul_re, smul_im, op_smul_eq_smul] -- priority manually adjusted in #11980 instance (priority := 90) mulAction [Monoid R] [MulAction R ℝ] : MulAction R β„‚ where one_smul x := by ext <;> simp [smul_re, smul_im, one_smul] mul_smul r s x := by ext <;> simp [smul_re, smul_im, mul_smul] -- priority manually adjusted in #11980 instance (priority := 90) distribSMul [DistribSMul R ℝ] : DistribSMul R β„‚ where smul_add r x y := by ext <;> simp [smul_re, smul_im, smul_add] smul_zero r := by ext <;> simp [smul_re, smul_im, smul_zero] -- priority manually adjusted in #11980 instance (priority := 90) [Semiring R] [DistribMulAction R ℝ] : DistribMulAction R β„‚ := { Complex.distribSMul, Complex.mulAction with } -- priority manually adjusted in #11980 instance (priority := 100) instModule [Semiring R] [Module R ℝ] : Module R β„‚ where add_smul r s x := by ext <;> simp [smul_re, smul_im, add_smul] zero_smul r := by ext <;> simp [smul_re, smul_im, zero_smul] -- priority manually adjusted in #11980 instance (priority := 95) instAlgebraOfReal [CommSemiring R] [Algebra R ℝ] : Algebra R β„‚ := { Complex.ofReal.comp (algebraMap R ℝ) with smul := (Β· β€’ Β·) smul_def' := fun r x => by ext <;> simp [smul_re, smul_im, Algebra.smul_def] commutes' := fun r ⟨xr, xi⟩ => by ext <;> simp [smul_re, smul_im, Algebra.commutes] } instance : StarModule ℝ β„‚ := ⟨fun r x => by simp only [star_def, star_trivial, real_smul, map_mul, conj_ofReal]⟩ @[simp] theorem coe_algebraMap : (algebraMap ℝ β„‚ : ℝ β†’ β„‚) = ((↑) : ℝ β†’ β„‚) := rfl #align complex.coe_algebra_map Complex.coe_algebraMap section variable {A : Type*} [Semiring A] [Algebra ℝ A] @[simp] theorem _root_.AlgHom.map_coe_real_complex (f : β„‚ →ₐ[ℝ] A) (x : ℝ) : f x = algebraMap ℝ A x := f.commutes x #align alg_hom.map_coe_real_complex AlgHom.map_coe_real_complex @[ext]
Mathlib/Data/Complex/Module.lean
125
127
theorem algHom_ext ⦃f g : β„‚ →ₐ[ℝ] A⦄ (h : f I = g I) : f = g := by
ext ⟨x, y⟩ simp only [mk_eq_add_mul_I, AlgHom.map_add, AlgHom.map_coe_real_complex, AlgHom.map_mul, h]
2,173
import Mathlib.Algebra.CharP.Invertible import Mathlib.Algebra.Order.Module.OrderedSMul import Mathlib.Data.Complex.Cardinality import Mathlib.Data.Fin.VecNotation import Mathlib.LinearAlgebra.FiniteDimensional #align_import data.complex.module from "leanprover-community/mathlib"@"c7bce2818663f456335892ddbdd1809f111a5b72" namespace Complex open ComplexConjugate open scoped SMul variable {R : Type*} {S : Type*} attribute [local ext] Complex.ext -- Test that the `SMul β„š β„‚` instance is correct. example : (Complex.SMul.instSMulRealComplex : SMul β„š β„‚) = (Algebra.toSMul : SMul β„š β„‚) := rfl -- priority manually adjusted in #11980 instance (priority := 90) [SMul R ℝ] [SMul S ℝ] [SMulCommClass R S ℝ] : SMulCommClass R S β„‚ where smul_comm r s x := by ext <;> simp [smul_re, smul_im, smul_comm] -- priority manually adjusted in #11980 instance (priority := 90) [SMul R S] [SMul R ℝ] [SMul S ℝ] [IsScalarTower R S ℝ] : IsScalarTower R S β„‚ where smul_assoc r s x := by ext <;> simp [smul_re, smul_im, smul_assoc] -- priority manually adjusted in #11980 instance (priority := 90) [SMul R ℝ] [SMul Rᡐᡒᡖ ℝ] [IsCentralScalar R ℝ] : IsCentralScalar R β„‚ where op_smul_eq_smul r x := by ext <;> simp [smul_re, smul_im, op_smul_eq_smul] -- priority manually adjusted in #11980 instance (priority := 90) mulAction [Monoid R] [MulAction R ℝ] : MulAction R β„‚ where one_smul x := by ext <;> simp [smul_re, smul_im, one_smul] mul_smul r s x := by ext <;> simp [smul_re, smul_im, mul_smul] -- priority manually adjusted in #11980 instance (priority := 90) distribSMul [DistribSMul R ℝ] : DistribSMul R β„‚ where smul_add r x y := by ext <;> simp [smul_re, smul_im, smul_add] smul_zero r := by ext <;> simp [smul_re, smul_im, smul_zero] -- priority manually adjusted in #11980 instance (priority := 90) [Semiring R] [DistribMulAction R ℝ] : DistribMulAction R β„‚ := { Complex.distribSMul, Complex.mulAction with } -- priority manually adjusted in #11980 instance (priority := 100) instModule [Semiring R] [Module R ℝ] : Module R β„‚ where add_smul r s x := by ext <;> simp [smul_re, smul_im, add_smul] zero_smul r := by ext <;> simp [smul_re, smul_im, zero_smul] -- priority manually adjusted in #11980 instance (priority := 95) instAlgebraOfReal [CommSemiring R] [Algebra R ℝ] : Algebra R β„‚ := { Complex.ofReal.comp (algebraMap R ℝ) with smul := (Β· β€’ Β·) smul_def' := fun r x => by ext <;> simp [smul_re, smul_im, Algebra.smul_def] commutes' := fun r ⟨xr, xi⟩ => by ext <;> simp [smul_re, smul_im, Algebra.commutes] } instance : StarModule ℝ β„‚ := ⟨fun r x => by simp only [star_def, star_trivial, real_smul, map_mul, conj_ofReal]⟩ @[simp] theorem coe_algebraMap : (algebraMap ℝ β„‚ : ℝ β†’ β„‚) = ((↑) : ℝ β†’ β„‚) := rfl #align complex.coe_algebra_map Complex.coe_algebraMap section variable {A : Type*} [Semiring A] [Algebra ℝ A] @[simp] theorem _root_.AlgHom.map_coe_real_complex (f : β„‚ →ₐ[ℝ] A) (x : ℝ) : f x = algebraMap ℝ A x := f.commutes x #align alg_hom.map_coe_real_complex AlgHom.map_coe_real_complex @[ext] theorem algHom_ext ⦃f g : β„‚ →ₐ[ℝ] A⦄ (h : f I = g I) : f = g := by ext ⟨x, y⟩ simp only [mk_eq_add_mul_I, AlgHom.map_add, AlgHom.map_coe_real_complex, AlgHom.map_mul, h] #align complex.alg_hom_ext Complex.algHom_ext end open Submodule FiniteDimensional noncomputable def basisOneI : Basis (Fin 2) ℝ β„‚ := Basis.ofEquivFun { toFun := fun z => ![z.re, z.im] invFun := fun c => c 0 + c 1 β€’ I left_inv := fun z => by simp right_inv := fun c => by ext i fin_cases i <;> simp map_add' := fun z z' => by simp map_smul' := fun c z => by simp } set_option linter.uppercaseLean3 false in #align complex.basis_one_I Complex.basisOneI @[simp] theorem coe_basisOneI_repr (z : β„‚) : ⇑(basisOneI.repr z) = ![z.re, z.im] := rfl set_option linter.uppercaseLean3 false in #align complex.coe_basis_one_I_repr Complex.coe_basisOneI_repr @[simp] theorem coe_basisOneI : ⇑basisOneI = ![1, I] := funext fun i => Basis.apply_eq_iff.mpr <| Finsupp.ext fun j => by fin_cases i <;> fin_cases j <;> -- Porting note: removed `only`, consider squeezing again simp [coe_basisOneI_repr, Finsupp.single_eq_of_ne, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Fin.one_eq_zero_iff, Ne, not_false_iff, I_re, Nat.succ_succ_ne_one, one_im, I_im, one_re, Finsupp.single_eq_same, Fin.zero_eq_one_iff] set_option linter.uppercaseLean3 false in #align complex.coe_basis_one_I Complex.coe_basisOneI instance : FiniteDimensional ℝ β„‚ := of_fintype_basis basisOneI @[simp]
Mathlib/Data/Complex/Module.lean
171
172
theorem finrank_real_complex : FiniteDimensional.finrank ℝ β„‚ = 2 := by
rw [finrank_eq_card_basis basisOneI, Fintype.card_fin]
2,173
import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.Determinant #align_import data.complex.determinant from "leanprover-community/mathlib"@"65ec59902eb17e4ab7da8d7e3d0bd9774d1b8b99" namespace Complex @[simp]
Mathlib/Data/Complex/Determinant.lean
24
26
theorem det_conjAe : LinearMap.det conjAe.toLinearMap = -1 := by
rw [← LinearMap.det_toMatrix basisOneI, toMatrix_conjAe, Matrix.det_fin_two_of] simp
2,174
import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.Determinant #align_import data.complex.determinant from "leanprover-community/mathlib"@"65ec59902eb17e4ab7da8d7e3d0bd9774d1b8b99" namespace Complex @[simp] theorem det_conjAe : LinearMap.det conjAe.toLinearMap = -1 := by rw [← LinearMap.det_toMatrix basisOneI, toMatrix_conjAe, Matrix.det_fin_two_of] simp #align complex.det_conj_ae Complex.det_conjAe @[simp]
Mathlib/Data/Complex/Determinant.lean
31
33
theorem linearEquiv_det_conjAe : LinearEquiv.det conjAe.toLinearEquiv = -1 := by
rw [← Units.eq_iff, LinearEquiv.coe_det, AlgEquiv.toLinearEquiv_toLinearMap, det_conjAe, Units.coe_neg_one]
2,174
import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Norm import Mathlib.RingTheory.Trace #align_import ring_theory.complex from "leanprover-community/mathlib"@"9015c511549dc77a0f8d6eba021d8ac4bba20c82" open Complex
Mathlib/RingTheory/Complex.lean
17
28
theorem Algebra.leftMulMatrix_complex (z : β„‚) : Algebra.leftMulMatrix Complex.basisOneI z = !![z.re, -z.im; z.im, z.re] := by
ext i j rw [Algebra.leftMulMatrix_eq_repr_mul, Complex.coe_basisOneI_repr, Complex.coe_basisOneI, mul_re, mul_im, Matrix.of_apply] fin_cases j Β· simp only [Fin.mk_zero, Matrix.cons_val_zero, one_re, mul_one, one_im, mul_zero, sub_zero, zero_add] fin_cases i <;> rfl Β· simp only [Fin.mk_one, Matrix.cons_val_one, Matrix.head_cons, I_re, mul_zero, I_im, mul_one, zero_sub, add_zero] fin_cases i <;> rfl
2,175
import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Norm import Mathlib.RingTheory.Trace #align_import ring_theory.complex from "leanprover-community/mathlib"@"9015c511549dc77a0f8d6eba021d8ac4bba20c82" open Complex theorem Algebra.leftMulMatrix_complex (z : β„‚) : Algebra.leftMulMatrix Complex.basisOneI z = !![z.re, -z.im; z.im, z.re] := by ext i j rw [Algebra.leftMulMatrix_eq_repr_mul, Complex.coe_basisOneI_repr, Complex.coe_basisOneI, mul_re, mul_im, Matrix.of_apply] fin_cases j Β· simp only [Fin.mk_zero, Matrix.cons_val_zero, one_re, mul_one, one_im, mul_zero, sub_zero, zero_add] fin_cases i <;> rfl Β· simp only [Fin.mk_one, Matrix.cons_val_one, Matrix.head_cons, I_re, mul_zero, I_im, mul_one, zero_sub, add_zero] fin_cases i <;> rfl #align algebra.left_mul_matrix_complex Algebra.leftMulMatrix_complex
Mathlib/RingTheory/Complex.lean
31
34
theorem Algebra.trace_complex_apply (z : β„‚) : Algebra.trace ℝ β„‚ z = 2 * z.re := by
rw [Algebra.trace_eq_matrix_trace Complex.basisOneI, Algebra.leftMulMatrix_complex, Matrix.trace_fin_two] exact (two_mul _).symm
2,175
import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Norm import Mathlib.RingTheory.Trace #align_import ring_theory.complex from "leanprover-community/mathlib"@"9015c511549dc77a0f8d6eba021d8ac4bba20c82" open Complex theorem Algebra.leftMulMatrix_complex (z : β„‚) : Algebra.leftMulMatrix Complex.basisOneI z = !![z.re, -z.im; z.im, z.re] := by ext i j rw [Algebra.leftMulMatrix_eq_repr_mul, Complex.coe_basisOneI_repr, Complex.coe_basisOneI, mul_re, mul_im, Matrix.of_apply] fin_cases j Β· simp only [Fin.mk_zero, Matrix.cons_val_zero, one_re, mul_one, one_im, mul_zero, sub_zero, zero_add] fin_cases i <;> rfl Β· simp only [Fin.mk_one, Matrix.cons_val_one, Matrix.head_cons, I_re, mul_zero, I_im, mul_one, zero_sub, add_zero] fin_cases i <;> rfl #align algebra.left_mul_matrix_complex Algebra.leftMulMatrix_complex theorem Algebra.trace_complex_apply (z : β„‚) : Algebra.trace ℝ β„‚ z = 2 * z.re := by rw [Algebra.trace_eq_matrix_trace Complex.basisOneI, Algebra.leftMulMatrix_complex, Matrix.trace_fin_two] exact (two_mul _).symm #align algebra.trace_complex_apply Algebra.trace_complex_apply
Mathlib/RingTheory/Complex.lean
37
40
theorem Algebra.norm_complex_apply (z : β„‚) : Algebra.norm ℝ z = Complex.normSq z := by
rw [Algebra.norm_eq_matrix_det Complex.basisOneI, Algebra.leftMulMatrix_complex, Matrix.det_fin_two, normSq_apply] simp
2,175
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraRing open scoped ComplexConjugate variable {R : Type*} [CommRing R] @[simp] theorem ΞΉ_eq_zero : ΞΉ (0 : QuadraticForm R Unit) = 0 := Subsingleton.elim _ _ #align clifford_algebra_ring.ΞΉ_eq_zero CliffordAlgebraRing.ΞΉ_eq_zero instance : CommRing (CliffordAlgebra (0 : QuadraticForm R Unit)) := { CliffordAlgebra.instRing _ with mul_comm := fun x y => by induction x using CliffordAlgebra.induction with | algebraMap r => apply Algebra.commutes | ΞΉ x => simp | add x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [mul_add, add_mul, hx₁, hxβ‚‚] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [mul_assoc, hxβ‚‚, ← mul_assoc, hx₁, ← mul_assoc] } -- Porting note: Changed `x.reverse` to `reverse (R := R) x`
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
90
96
theorem reverse_apply (x : CliffordAlgebra (0 : QuadraticForm R Unit)) : reverse (R := R) x = x := by
induction x using CliffordAlgebra.induction with | algebraMap r => exact reverse.commutes _ | ΞΉ x => rw [ΞΉ_eq_zero, LinearMap.zero_apply, reverse.map_zero] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [reverse.map_mul, mul_comm, hx₁, hxβ‚‚] | add x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [reverse.map_add, hx₁, hxβ‚‚]
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraRing open scoped ComplexConjugate variable {R : Type*} [CommRing R] @[simp] theorem ΞΉ_eq_zero : ΞΉ (0 : QuadraticForm R Unit) = 0 := Subsingleton.elim _ _ #align clifford_algebra_ring.ΞΉ_eq_zero CliffordAlgebraRing.ΞΉ_eq_zero instance : CommRing (CliffordAlgebra (0 : QuadraticForm R Unit)) := { CliffordAlgebra.instRing _ with mul_comm := fun x y => by induction x using CliffordAlgebra.induction with | algebraMap r => apply Algebra.commutes | ΞΉ x => simp | add x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [mul_add, add_mul, hx₁, hxβ‚‚] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [mul_assoc, hxβ‚‚, ← mul_assoc, hx₁, ← mul_assoc] } -- Porting note: Changed `x.reverse` to `reverse (R := R) x` theorem reverse_apply (x : CliffordAlgebra (0 : QuadraticForm R Unit)) : reverse (R := R) x = x := by induction x using CliffordAlgebra.induction with | algebraMap r => exact reverse.commutes _ | ΞΉ x => rw [ΞΉ_eq_zero, LinearMap.zero_apply, reverse.map_zero] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [reverse.map_mul, mul_comm, hx₁, hxβ‚‚] | add x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [reverse.map_add, hx₁, hxβ‚‚] #align clifford_algebra_ring.reverse_apply CliffordAlgebraRing.reverse_apply @[simp] theorem reverse_eq_id : (reverse : CliffordAlgebra (0 : QuadraticForm R Unit) β†’β‚—[R] _) = LinearMap.id := LinearMap.ext reverse_apply #align clifford_algebra_ring.reverse_eq_id CliffordAlgebraRing.reverse_eq_id @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
106
107
theorem involute_eq_id : (involute : CliffordAlgebra (0 : QuadraticForm R Unit) →ₐ[R] _) = AlgHom.id R _ := by
ext; simp
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraComplex open scoped ComplexConjugate def Q : QuadraticForm ℝ ℝ := -QuadraticForm.sq (R := ℝ) -- Porting note: Added `(R := ℝ)` set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q CliffordAlgebraComplex.Q @[simp] theorem Q_apply (r : ℝ) : Q r = -(r * r) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q_apply CliffordAlgebraComplex.Q_apply def toComplex : CliffordAlgebra Q →ₐ[ℝ] β„‚ := CliffordAlgebra.lift Q ⟨LinearMap.toSpanSingleton _ _ Complex.I, fun r => by dsimp [LinearMap.toSpanSingleton, LinearMap.id] rw [mul_mul_mul_comm] simp⟩ #align clifford_algebra_complex.to_complex CliffordAlgebraComplex.toComplex @[simp] theorem toComplex_ΞΉ (r : ℝ) : toComplex (ΞΉ Q r) = r β€’ Complex.I := CliffordAlgebra.lift_ΞΉ_apply _ _ r #align clifford_algebra_complex.to_complex_ΞΉ CliffordAlgebraComplex.toComplex_ΞΉ @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
157
164
theorem toComplex_involute (c : CliffordAlgebra Q) : toComplex (involute c) = conj (toComplex c) := by
have : toComplex (involute (ΞΉ Q 1)) = conj (toComplex (ΞΉ Q 1)) := by simp only [involute_ΞΉ, toComplex_ΞΉ, AlgHom.map_neg, one_smul, Complex.conj_I] suffices toComplex.comp involute = Complex.conjAe.toAlgHom.comp toComplex by exact AlgHom.congr_fun this c ext : 2 exact this
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraComplex open scoped ComplexConjugate def Q : QuadraticForm ℝ ℝ := -QuadraticForm.sq (R := ℝ) -- Porting note: Added `(R := ℝ)` set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q CliffordAlgebraComplex.Q @[simp] theorem Q_apply (r : ℝ) : Q r = -(r * r) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q_apply CliffordAlgebraComplex.Q_apply def toComplex : CliffordAlgebra Q →ₐ[ℝ] β„‚ := CliffordAlgebra.lift Q ⟨LinearMap.toSpanSingleton _ _ Complex.I, fun r => by dsimp [LinearMap.toSpanSingleton, LinearMap.id] rw [mul_mul_mul_comm] simp⟩ #align clifford_algebra_complex.to_complex CliffordAlgebraComplex.toComplex @[simp] theorem toComplex_ΞΉ (r : ℝ) : toComplex (ΞΉ Q r) = r β€’ Complex.I := CliffordAlgebra.lift_ΞΉ_apply _ _ r #align clifford_algebra_complex.to_complex_ΞΉ CliffordAlgebraComplex.toComplex_ΞΉ @[simp] theorem toComplex_involute (c : CliffordAlgebra Q) : toComplex (involute c) = conj (toComplex c) := by have : toComplex (involute (ΞΉ Q 1)) = conj (toComplex (ΞΉ Q 1)) := by simp only [involute_ΞΉ, toComplex_ΞΉ, AlgHom.map_neg, one_smul, Complex.conj_I] suffices toComplex.comp involute = Complex.conjAe.toAlgHom.comp toComplex by exact AlgHom.congr_fun this c ext : 2 exact this #align clifford_algebra_complex.to_complex_involute CliffordAlgebraComplex.toComplex_involute def ofComplex : β„‚ →ₐ[ℝ] CliffordAlgebra Q := Complex.lift ⟨CliffordAlgebra.ΞΉ Q 1, by rw [CliffordAlgebra.ΞΉ_sq_scalar, Q_apply, one_mul, RingHom.map_neg, RingHom.map_one]⟩ #align clifford_algebra_complex.of_complex CliffordAlgebraComplex.ofComplex @[simp] theorem ofComplex_I : ofComplex Complex.I = ΞΉ Q 1 := Complex.liftAux_apply_I _ (by simp) set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.of_complex_I CliffordAlgebraComplex.ofComplex_I @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
182
185
theorem toComplex_comp_ofComplex : toComplex.comp ofComplex = AlgHom.id ℝ β„‚ := by
ext1 dsimp only [AlgHom.comp_apply, Subtype.coe_mk, AlgHom.id_apply] rw [ofComplex_I, toComplex_ΞΉ, one_smul]
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraComplex open scoped ComplexConjugate def Q : QuadraticForm ℝ ℝ := -QuadraticForm.sq (R := ℝ) -- Porting note: Added `(R := ℝ)` set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q CliffordAlgebraComplex.Q @[simp] theorem Q_apply (r : ℝ) : Q r = -(r * r) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q_apply CliffordAlgebraComplex.Q_apply def toComplex : CliffordAlgebra Q →ₐ[ℝ] β„‚ := CliffordAlgebra.lift Q ⟨LinearMap.toSpanSingleton _ _ Complex.I, fun r => by dsimp [LinearMap.toSpanSingleton, LinearMap.id] rw [mul_mul_mul_comm] simp⟩ #align clifford_algebra_complex.to_complex CliffordAlgebraComplex.toComplex @[simp] theorem toComplex_ΞΉ (r : ℝ) : toComplex (ΞΉ Q r) = r β€’ Complex.I := CliffordAlgebra.lift_ΞΉ_apply _ _ r #align clifford_algebra_complex.to_complex_ΞΉ CliffordAlgebraComplex.toComplex_ΞΉ @[simp] theorem toComplex_involute (c : CliffordAlgebra Q) : toComplex (involute c) = conj (toComplex c) := by have : toComplex (involute (ΞΉ Q 1)) = conj (toComplex (ΞΉ Q 1)) := by simp only [involute_ΞΉ, toComplex_ΞΉ, AlgHom.map_neg, one_smul, Complex.conj_I] suffices toComplex.comp involute = Complex.conjAe.toAlgHom.comp toComplex by exact AlgHom.congr_fun this c ext : 2 exact this #align clifford_algebra_complex.to_complex_involute CliffordAlgebraComplex.toComplex_involute def ofComplex : β„‚ →ₐ[ℝ] CliffordAlgebra Q := Complex.lift ⟨CliffordAlgebra.ΞΉ Q 1, by rw [CliffordAlgebra.ΞΉ_sq_scalar, Q_apply, one_mul, RingHom.map_neg, RingHom.map_one]⟩ #align clifford_algebra_complex.of_complex CliffordAlgebraComplex.ofComplex @[simp] theorem ofComplex_I : ofComplex Complex.I = ΞΉ Q 1 := Complex.liftAux_apply_I _ (by simp) set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.of_complex_I CliffordAlgebraComplex.ofComplex_I @[simp] theorem toComplex_comp_ofComplex : toComplex.comp ofComplex = AlgHom.id ℝ β„‚ := by ext1 dsimp only [AlgHom.comp_apply, Subtype.coe_mk, AlgHom.id_apply] rw [ofComplex_I, toComplex_ΞΉ, one_smul] #align clifford_algebra_complex.to_complex_comp_of_complex CliffordAlgebraComplex.toComplex_comp_ofComplex @[simp] theorem toComplex_ofComplex (c : β„‚) : toComplex (ofComplex c) = c := AlgHom.congr_fun toComplex_comp_ofComplex c #align clifford_algebra_complex.to_complex_of_complex CliffordAlgebraComplex.toComplex_ofComplex @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
194
198
theorem ofComplex_comp_toComplex : ofComplex.comp toComplex = AlgHom.id ℝ (CliffordAlgebra Q) := by
ext dsimp only [LinearMap.comp_apply, Subtype.coe_mk, AlgHom.id_apply, AlgHom.toLinearMap_apply, AlgHom.comp_apply] rw [toComplex_ΞΉ, one_smul, ofComplex_I]
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraComplex open scoped ComplexConjugate def Q : QuadraticForm ℝ ℝ := -QuadraticForm.sq (R := ℝ) -- Porting note: Added `(R := ℝ)` set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q CliffordAlgebraComplex.Q @[simp] theorem Q_apply (r : ℝ) : Q r = -(r * r) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.Q_apply CliffordAlgebraComplex.Q_apply def toComplex : CliffordAlgebra Q →ₐ[ℝ] β„‚ := CliffordAlgebra.lift Q ⟨LinearMap.toSpanSingleton _ _ Complex.I, fun r => by dsimp [LinearMap.toSpanSingleton, LinearMap.id] rw [mul_mul_mul_comm] simp⟩ #align clifford_algebra_complex.to_complex CliffordAlgebraComplex.toComplex @[simp] theorem toComplex_ΞΉ (r : ℝ) : toComplex (ΞΉ Q r) = r β€’ Complex.I := CliffordAlgebra.lift_ΞΉ_apply _ _ r #align clifford_algebra_complex.to_complex_ΞΉ CliffordAlgebraComplex.toComplex_ΞΉ @[simp] theorem toComplex_involute (c : CliffordAlgebra Q) : toComplex (involute c) = conj (toComplex c) := by have : toComplex (involute (ΞΉ Q 1)) = conj (toComplex (ΞΉ Q 1)) := by simp only [involute_ΞΉ, toComplex_ΞΉ, AlgHom.map_neg, one_smul, Complex.conj_I] suffices toComplex.comp involute = Complex.conjAe.toAlgHom.comp toComplex by exact AlgHom.congr_fun this c ext : 2 exact this #align clifford_algebra_complex.to_complex_involute CliffordAlgebraComplex.toComplex_involute def ofComplex : β„‚ →ₐ[ℝ] CliffordAlgebra Q := Complex.lift ⟨CliffordAlgebra.ΞΉ Q 1, by rw [CliffordAlgebra.ΞΉ_sq_scalar, Q_apply, one_mul, RingHom.map_neg, RingHom.map_one]⟩ #align clifford_algebra_complex.of_complex CliffordAlgebraComplex.ofComplex @[simp] theorem ofComplex_I : ofComplex Complex.I = ΞΉ Q 1 := Complex.liftAux_apply_I _ (by simp) set_option linter.uppercaseLean3 false in #align clifford_algebra_complex.of_complex_I CliffordAlgebraComplex.ofComplex_I @[simp] theorem toComplex_comp_ofComplex : toComplex.comp ofComplex = AlgHom.id ℝ β„‚ := by ext1 dsimp only [AlgHom.comp_apply, Subtype.coe_mk, AlgHom.id_apply] rw [ofComplex_I, toComplex_ΞΉ, one_smul] #align clifford_algebra_complex.to_complex_comp_of_complex CliffordAlgebraComplex.toComplex_comp_ofComplex @[simp] theorem toComplex_ofComplex (c : β„‚) : toComplex (ofComplex c) = c := AlgHom.congr_fun toComplex_comp_ofComplex c #align clifford_algebra_complex.to_complex_of_complex CliffordAlgebraComplex.toComplex_ofComplex @[simp] theorem ofComplex_comp_toComplex : ofComplex.comp toComplex = AlgHom.id ℝ (CliffordAlgebra Q) := by ext dsimp only [LinearMap.comp_apply, Subtype.coe_mk, AlgHom.id_apply, AlgHom.toLinearMap_apply, AlgHom.comp_apply] rw [toComplex_ΞΉ, one_smul, ofComplex_I] #align clifford_algebra_complex.of_complex_comp_to_complex CliffordAlgebraComplex.ofComplex_comp_toComplex @[simp] theorem ofComplex_toComplex (c : CliffordAlgebra Q) : ofComplex (toComplex c) = c := AlgHom.congr_fun ofComplex_comp_toComplex c #align clifford_algebra_complex.of_complex_to_complex CliffordAlgebraComplex.ofComplex_toComplex @[simps!] protected def equiv : CliffordAlgebra Q ≃ₐ[ℝ] β„‚ := AlgEquiv.ofAlgHom toComplex ofComplex toComplex_comp_ofComplex ofComplex_comp_toComplex #align clifford_algebra_complex.equiv CliffordAlgebraComplex.equiv instance : CommRing (CliffordAlgebra Q) := { CliffordAlgebra.instRing _ with mul_comm := fun x y => CliffordAlgebraComplex.equiv.injective <| by rw [AlgEquiv.map_mul, mul_comm, AlgEquiv.map_mul] } -- Porting note: Changed `x.reverse` to `reverse (R := ℝ) x`
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
223
228
theorem reverse_apply (x : CliffordAlgebra Q) : reverse (R := ℝ) x = x := by
induction x using CliffordAlgebra.induction with | algebraMap r => exact reverse.commutes _ | ΞΉ x => rw [reverse_ΞΉ] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [reverse.map_mul, mul_comm, hx₁, hxβ‚‚] | add x₁ xβ‚‚ hx₁ hxβ‚‚ => rw [reverse.map_add, hx₁, hxβ‚‚]
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraQuaternion open scoped Quaternion open QuaternionAlgebra variable {R : Type*} [CommRing R] (c₁ cβ‚‚ : R) def Q : QuadraticForm R (R Γ— R) := (c₁ β€’ QuadraticForm.sq (R := R)).prod (cβ‚‚ β€’ QuadraticForm.sq) -- Porting note: Added `(R := R)` set_option linter.uppercaseLean3 false in #align clifford_algebra_quaternion.Q CliffordAlgebraQuaternion.Q @[simp] theorem Q_apply (v : R Γ— R) : Q c₁ cβ‚‚ v = c₁ * (v.1 * v.1) + cβ‚‚ * (v.2 * v.2) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_quaternion.Q_apply CliffordAlgebraQuaternion.Q_apply @[simps i j k] def quaternionBasis : QuaternionAlgebra.Basis (CliffordAlgebra (Q c₁ cβ‚‚)) c₁ cβ‚‚ where i := ΞΉ (Q c₁ cβ‚‚) (1, 0) j := ΞΉ (Q c₁ cβ‚‚) (0, 1) k := ΞΉ (Q c₁ cβ‚‚) (1, 0) * ΞΉ (Q c₁ cβ‚‚) (0, 1) i_mul_i := by rw [ΞΉ_sq_scalar, Q_apply, ← Algebra.algebraMap_eq_smul_one] simp j_mul_j := by rw [ΞΉ_sq_scalar, Q_apply, ← Algebra.algebraMap_eq_smul_one] simp i_mul_j := rfl j_mul_i := by rw [eq_neg_iff_add_eq_zero, ΞΉ_mul_ΞΉ_add_swap, QuadraticForm.polar] simp #align clifford_algebra_quaternion.quaternion_basis CliffordAlgebraQuaternion.quaternionBasis variable {c₁ cβ‚‚} def toQuaternion : CliffordAlgebra (Q c₁ cβ‚‚) →ₐ[R] ℍ[R,c₁,cβ‚‚] := CliffordAlgebra.lift (Q c₁ cβ‚‚) ⟨{ toFun := fun v => (⟨0, v.1, v.2, 0⟩ : ℍ[R,c₁,cβ‚‚]) map_add' := fun v₁ vβ‚‚ => by simp map_smul' := fun r v => by dsimp; rw [mul_zero] }, fun v => by dsimp ext all_goals dsimp; ring⟩ #align clifford_algebra_quaternion.to_quaternion CliffordAlgebraQuaternion.toQuaternion @[simp] theorem toQuaternion_ΞΉ (v : R Γ— R) : toQuaternion (ΞΉ (Q c₁ cβ‚‚) v) = (⟨0, v.1, v.2, 0⟩ : ℍ[R,c₁,cβ‚‚]) := CliffordAlgebra.lift_ΞΉ_apply _ _ v #align clifford_algebra_quaternion.to_quaternion_ΞΉ CliffordAlgebraQuaternion.toQuaternion_ΞΉ
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
311
322
theorem toQuaternion_star (c : CliffordAlgebra (Q c₁ cβ‚‚)) : toQuaternion (star c) = star (toQuaternion c) := by
simp only [CliffordAlgebra.star_def'] induction c using CliffordAlgebra.induction with | algebraMap r => simp only [reverse.commutes, AlgHom.commutes, QuaternionAlgebra.coe_algebraMap, QuaternionAlgebra.star_coe] | ΞΉ x => rw [reverse_ΞΉ, involute_ΞΉ, toQuaternion_ΞΉ, AlgHom.map_neg, toQuaternion_ΞΉ, QuaternionAlgebra.neg_mk, star_mk, neg_zero] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => simp only [reverse.map_mul, AlgHom.map_mul, hx₁, hxβ‚‚, star_mul] | add x₁ xβ‚‚ hx₁ hxβ‚‚ => simp only [reverse.map_add, AlgHom.map_add, hx₁, hxβ‚‚, star_add]
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraQuaternion open scoped Quaternion open QuaternionAlgebra variable {R : Type*} [CommRing R] (c₁ cβ‚‚ : R) def Q : QuadraticForm R (R Γ— R) := (c₁ β€’ QuadraticForm.sq (R := R)).prod (cβ‚‚ β€’ QuadraticForm.sq) -- Porting note: Added `(R := R)` set_option linter.uppercaseLean3 false in #align clifford_algebra_quaternion.Q CliffordAlgebraQuaternion.Q @[simp] theorem Q_apply (v : R Γ— R) : Q c₁ cβ‚‚ v = c₁ * (v.1 * v.1) + cβ‚‚ * (v.2 * v.2) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_quaternion.Q_apply CliffordAlgebraQuaternion.Q_apply @[simps i j k] def quaternionBasis : QuaternionAlgebra.Basis (CliffordAlgebra (Q c₁ cβ‚‚)) c₁ cβ‚‚ where i := ΞΉ (Q c₁ cβ‚‚) (1, 0) j := ΞΉ (Q c₁ cβ‚‚) (0, 1) k := ΞΉ (Q c₁ cβ‚‚) (1, 0) * ΞΉ (Q c₁ cβ‚‚) (0, 1) i_mul_i := by rw [ΞΉ_sq_scalar, Q_apply, ← Algebra.algebraMap_eq_smul_one] simp j_mul_j := by rw [ΞΉ_sq_scalar, Q_apply, ← Algebra.algebraMap_eq_smul_one] simp i_mul_j := rfl j_mul_i := by rw [eq_neg_iff_add_eq_zero, ΞΉ_mul_ΞΉ_add_swap, QuadraticForm.polar] simp #align clifford_algebra_quaternion.quaternion_basis CliffordAlgebraQuaternion.quaternionBasis variable {c₁ cβ‚‚} def toQuaternion : CliffordAlgebra (Q c₁ cβ‚‚) →ₐ[R] ℍ[R,c₁,cβ‚‚] := CliffordAlgebra.lift (Q c₁ cβ‚‚) ⟨{ toFun := fun v => (⟨0, v.1, v.2, 0⟩ : ℍ[R,c₁,cβ‚‚]) map_add' := fun v₁ vβ‚‚ => by simp map_smul' := fun r v => by dsimp; rw [mul_zero] }, fun v => by dsimp ext all_goals dsimp; ring⟩ #align clifford_algebra_quaternion.to_quaternion CliffordAlgebraQuaternion.toQuaternion @[simp] theorem toQuaternion_ΞΉ (v : R Γ— R) : toQuaternion (ΞΉ (Q c₁ cβ‚‚) v) = (⟨0, v.1, v.2, 0⟩ : ℍ[R,c₁,cβ‚‚]) := CliffordAlgebra.lift_ΞΉ_apply _ _ v #align clifford_algebra_quaternion.to_quaternion_ΞΉ CliffordAlgebraQuaternion.toQuaternion_ΞΉ theorem toQuaternion_star (c : CliffordAlgebra (Q c₁ cβ‚‚)) : toQuaternion (star c) = star (toQuaternion c) := by simp only [CliffordAlgebra.star_def'] induction c using CliffordAlgebra.induction with | algebraMap r => simp only [reverse.commutes, AlgHom.commutes, QuaternionAlgebra.coe_algebraMap, QuaternionAlgebra.star_coe] | ΞΉ x => rw [reverse_ΞΉ, involute_ΞΉ, toQuaternion_ΞΉ, AlgHom.map_neg, toQuaternion_ΞΉ, QuaternionAlgebra.neg_mk, star_mk, neg_zero] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => simp only [reverse.map_mul, AlgHom.map_mul, hx₁, hxβ‚‚, star_mul] | add x₁ xβ‚‚ hx₁ hxβ‚‚ => simp only [reverse.map_add, AlgHom.map_add, hx₁, hxβ‚‚, star_add] #align clifford_algebra_quaternion.to_quaternion_star CliffordAlgebraQuaternion.toQuaternion_star def ofQuaternion : ℍ[R,c₁,cβ‚‚] →ₐ[R] CliffordAlgebra (Q c₁ cβ‚‚) := (quaternionBasis c₁ cβ‚‚).liftHom #align clifford_algebra_quaternion.of_quaternion CliffordAlgebraQuaternion.ofQuaternion @[simp] theorem ofQuaternion_mk (a₁ aβ‚‚ a₃ aβ‚„ : R) : ofQuaternion (⟨a₁, aβ‚‚, a₃, aβ‚„βŸ© : ℍ[R,c₁,cβ‚‚]) = algebraMap R _ a₁ + aβ‚‚ β€’ ΞΉ (Q c₁ cβ‚‚) (1, 0) + a₃ β€’ ΞΉ (Q c₁ cβ‚‚) (0, 1) + aβ‚„ β€’ (ΞΉ (Q c₁ cβ‚‚) (1, 0) * ΞΉ (Q c₁ cβ‚‚) (0, 1)) := rfl #align clifford_algebra_quaternion.of_quaternion_mk CliffordAlgebraQuaternion.ofQuaternion_mk @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
339
348
theorem ofQuaternion_comp_toQuaternion : ofQuaternion.comp toQuaternion = AlgHom.id R (CliffordAlgebra (Q c₁ cβ‚‚)) := by
ext : 1 dsimp -- before we end up with two goals and have to do this twice ext all_goals dsimp rw [toQuaternion_ΞΉ] dsimp simp only [toQuaternion_ΞΉ, zero_smul, one_smul, zero_add, add_zero, RingHom.map_zero]
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraQuaternion open scoped Quaternion open QuaternionAlgebra variable {R : Type*} [CommRing R] (c₁ cβ‚‚ : R) def Q : QuadraticForm R (R Γ— R) := (c₁ β€’ QuadraticForm.sq (R := R)).prod (cβ‚‚ β€’ QuadraticForm.sq) -- Porting note: Added `(R := R)` set_option linter.uppercaseLean3 false in #align clifford_algebra_quaternion.Q CliffordAlgebraQuaternion.Q @[simp] theorem Q_apply (v : R Γ— R) : Q c₁ cβ‚‚ v = c₁ * (v.1 * v.1) + cβ‚‚ * (v.2 * v.2) := rfl set_option linter.uppercaseLean3 false in #align clifford_algebra_quaternion.Q_apply CliffordAlgebraQuaternion.Q_apply @[simps i j k] def quaternionBasis : QuaternionAlgebra.Basis (CliffordAlgebra (Q c₁ cβ‚‚)) c₁ cβ‚‚ where i := ΞΉ (Q c₁ cβ‚‚) (1, 0) j := ΞΉ (Q c₁ cβ‚‚) (0, 1) k := ΞΉ (Q c₁ cβ‚‚) (1, 0) * ΞΉ (Q c₁ cβ‚‚) (0, 1) i_mul_i := by rw [ΞΉ_sq_scalar, Q_apply, ← Algebra.algebraMap_eq_smul_one] simp j_mul_j := by rw [ΞΉ_sq_scalar, Q_apply, ← Algebra.algebraMap_eq_smul_one] simp i_mul_j := rfl j_mul_i := by rw [eq_neg_iff_add_eq_zero, ΞΉ_mul_ΞΉ_add_swap, QuadraticForm.polar] simp #align clifford_algebra_quaternion.quaternion_basis CliffordAlgebraQuaternion.quaternionBasis variable {c₁ cβ‚‚} def toQuaternion : CliffordAlgebra (Q c₁ cβ‚‚) →ₐ[R] ℍ[R,c₁,cβ‚‚] := CliffordAlgebra.lift (Q c₁ cβ‚‚) ⟨{ toFun := fun v => (⟨0, v.1, v.2, 0⟩ : ℍ[R,c₁,cβ‚‚]) map_add' := fun v₁ vβ‚‚ => by simp map_smul' := fun r v => by dsimp; rw [mul_zero] }, fun v => by dsimp ext all_goals dsimp; ring⟩ #align clifford_algebra_quaternion.to_quaternion CliffordAlgebraQuaternion.toQuaternion @[simp] theorem toQuaternion_ΞΉ (v : R Γ— R) : toQuaternion (ΞΉ (Q c₁ cβ‚‚) v) = (⟨0, v.1, v.2, 0⟩ : ℍ[R,c₁,cβ‚‚]) := CliffordAlgebra.lift_ΞΉ_apply _ _ v #align clifford_algebra_quaternion.to_quaternion_ΞΉ CliffordAlgebraQuaternion.toQuaternion_ΞΉ theorem toQuaternion_star (c : CliffordAlgebra (Q c₁ cβ‚‚)) : toQuaternion (star c) = star (toQuaternion c) := by simp only [CliffordAlgebra.star_def'] induction c using CliffordAlgebra.induction with | algebraMap r => simp only [reverse.commutes, AlgHom.commutes, QuaternionAlgebra.coe_algebraMap, QuaternionAlgebra.star_coe] | ΞΉ x => rw [reverse_ΞΉ, involute_ΞΉ, toQuaternion_ΞΉ, AlgHom.map_neg, toQuaternion_ΞΉ, QuaternionAlgebra.neg_mk, star_mk, neg_zero] | mul x₁ xβ‚‚ hx₁ hxβ‚‚ => simp only [reverse.map_mul, AlgHom.map_mul, hx₁, hxβ‚‚, star_mul] | add x₁ xβ‚‚ hx₁ hxβ‚‚ => simp only [reverse.map_add, AlgHom.map_add, hx₁, hxβ‚‚, star_add] #align clifford_algebra_quaternion.to_quaternion_star CliffordAlgebraQuaternion.toQuaternion_star def ofQuaternion : ℍ[R,c₁,cβ‚‚] →ₐ[R] CliffordAlgebra (Q c₁ cβ‚‚) := (quaternionBasis c₁ cβ‚‚).liftHom #align clifford_algebra_quaternion.of_quaternion CliffordAlgebraQuaternion.ofQuaternion @[simp] theorem ofQuaternion_mk (a₁ aβ‚‚ a₃ aβ‚„ : R) : ofQuaternion (⟨a₁, aβ‚‚, a₃, aβ‚„βŸ© : ℍ[R,c₁,cβ‚‚]) = algebraMap R _ a₁ + aβ‚‚ β€’ ΞΉ (Q c₁ cβ‚‚) (1, 0) + a₃ β€’ ΞΉ (Q c₁ cβ‚‚) (0, 1) + aβ‚„ β€’ (ΞΉ (Q c₁ cβ‚‚) (1, 0) * ΞΉ (Q c₁ cβ‚‚) (0, 1)) := rfl #align clifford_algebra_quaternion.of_quaternion_mk CliffordAlgebraQuaternion.ofQuaternion_mk @[simp] theorem ofQuaternion_comp_toQuaternion : ofQuaternion.comp toQuaternion = AlgHom.id R (CliffordAlgebra (Q c₁ cβ‚‚)) := by ext : 1 dsimp -- before we end up with two goals and have to do this twice ext all_goals dsimp rw [toQuaternion_ΞΉ] dsimp simp only [toQuaternion_ΞΉ, zero_smul, one_smul, zero_add, add_zero, RingHom.map_zero] #align clifford_algebra_quaternion.of_quaternion_comp_to_quaternion CliffordAlgebraQuaternion.ofQuaternion_comp_toQuaternion @[simp] theorem ofQuaternion_toQuaternion (c : CliffordAlgebra (Q c₁ cβ‚‚)) : ofQuaternion (toQuaternion c) = c := AlgHom.congr_fun ofQuaternion_comp_toQuaternion c #align clifford_algebra_quaternion.of_quaternion_to_quaternion CliffordAlgebraQuaternion.ofQuaternion_toQuaternion @[simp]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
358
360
theorem toQuaternion_comp_ofQuaternion : toQuaternion.comp ofQuaternion = AlgHom.id R ℍ[R,c₁,cβ‚‚] := by
ext : 1 <;> simp
2,176
import Mathlib.Algebra.DualNumber import Mathlib.Algebra.QuaternionBasis import Mathlib.Data.Complex.Module import Mathlib.LinearAlgebra.CliffordAlgebra.Conjugation import Mathlib.LinearAlgebra.CliffordAlgebra.Star import Mathlib.LinearAlgebra.QuadraticForm.Prod #align_import linear_algebra.clifford_algebra.equivs from "leanprover-community/mathlib"@"cf7a7252c1989efe5800e0b3cdfeb4228ac6b40e" open CliffordAlgebra namespace CliffordAlgebraDualNumber open scoped DualNumber open DualNumber TrivSqZeroExt variable {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M]
Mathlib/LinearAlgebra/CliffordAlgebra/Equivs.lean
400
403
theorem ΞΉ_mul_ΞΉ (r₁ rβ‚‚) : ΞΉ (0 : QuadraticForm R R) r₁ * ΞΉ (0 : QuadraticForm R R) rβ‚‚ = 0 := by
rw [← mul_one r₁, ← mul_one rβ‚‚, ← smul_eq_mul R, ← smul_eq_mul R, LinearMap.map_smul, LinearMap.map_smul, smul_mul_smul, ΞΉ_sq_scalar, QuadraticForm.zero_apply, RingHom.map_zero, smul_zero]
2,176
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Complex.Exponential import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Polynomial.Chebyshev #align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false namespace Polynomial.Chebyshev open Polynomial variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean
29
30
theorem aeval_T (x : A) (n : β„€) : aeval x (T R n) = (T A n).eval x := by
rw [aeval_def, evalβ‚‚_eq_eval_map, map_T]
2,177
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Complex.Exponential import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Polynomial.Chebyshev #align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false namespace Polynomial.Chebyshev open Polynomial variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] @[simp] theorem aeval_T (x : A) (n : β„€) : aeval x (T R n) = (T A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_T] #align polynomial.chebyshev.aeval_T Polynomial.Chebyshev.aeval_T @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean
34
35
theorem aeval_U (x : A) (n : β„€) : aeval x (U R n) = (U A n).eval x := by
rw [aeval_def, evalβ‚‚_eq_eval_map, map_U]
2,177
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Complex.Exponential import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Polynomial.Chebyshev #align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false namespace Polynomial.Chebyshev open Polynomial variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] @[simp] theorem aeval_T (x : A) (n : β„€) : aeval x (T R n) = (T A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_T] #align polynomial.chebyshev.aeval_T Polynomial.Chebyshev.aeval_T @[simp] theorem aeval_U (x : A) (n : β„€) : aeval x (U R n) = (U A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_U] #align polynomial.chebyshev.aeval_U Polynomial.Chebyshev.aeval_U @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean
39
41
theorem algebraMap_eval_T (x : R) (n : β„€) : algebraMap R A ((T R n).eval x) = (T A n).eval (algebraMap R A x) := by
rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_T]
2,177
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Complex.Exponential import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Polynomial.Chebyshev #align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false namespace Polynomial.Chebyshev open Polynomial variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] @[simp] theorem aeval_T (x : A) (n : β„€) : aeval x (T R n) = (T A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_T] #align polynomial.chebyshev.aeval_T Polynomial.Chebyshev.aeval_T @[simp] theorem aeval_U (x : A) (n : β„€) : aeval x (U R n) = (U A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_U] #align polynomial.chebyshev.aeval_U Polynomial.Chebyshev.aeval_U @[simp] theorem algebraMap_eval_T (x : R) (n : β„€) : algebraMap R A ((T R n).eval x) = (T A n).eval (algebraMap R A x) := by rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_T] #align polynomial.chebyshev.algebra_map_eval_T Polynomial.Chebyshev.algebraMap_eval_T @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean
45
47
theorem algebraMap_eval_U (x : R) (n : β„€) : algebraMap R A ((U R n).eval x) = (U A n).eval (algebraMap R A x) := by
rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_U]
2,177
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Complex.Exponential import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Polynomial.Chebyshev #align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false namespace Polynomial.Chebyshev open Polynomial variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] @[simp] theorem aeval_T (x : A) (n : β„€) : aeval x (T R n) = (T A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_T] #align polynomial.chebyshev.aeval_T Polynomial.Chebyshev.aeval_T @[simp] theorem aeval_U (x : A) (n : β„€) : aeval x (U R n) = (U A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_U] #align polynomial.chebyshev.aeval_U Polynomial.Chebyshev.aeval_U @[simp] theorem algebraMap_eval_T (x : R) (n : β„€) : algebraMap R A ((T R n).eval x) = (T A n).eval (algebraMap R A x) := by rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_T] #align polynomial.chebyshev.algebra_map_eval_T Polynomial.Chebyshev.algebraMap_eval_T @[simp] theorem algebraMap_eval_U (x : R) (n : β„€) : algebraMap R A ((U R n).eval x) = (U A n).eval (algebraMap R A x) := by rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_U] #align polynomial.chebyshev.algebra_map_eval_U Polynomial.Chebyshev.algebraMap_eval_U -- Porting note: added type ascriptions to the statement @[simp, norm_cast] theorem complex_ofReal_eval_T : βˆ€ (x : ℝ) n, (((T ℝ n).eval x : ℝ) : β„‚) = (T β„‚ n).eval (x : β„‚) := @algebraMap_eval_T ℝ β„‚ _ _ _ #align polynomial.chebyshev.complex_of_real_eval_T Polynomial.Chebyshev.complex_ofReal_eval_T -- Porting note: added type ascriptions to the statement @[simp, norm_cast] theorem complex_ofReal_eval_U : βˆ€ (x : ℝ) n, (((U ℝ n).eval x : ℝ) : β„‚) = (U β„‚ n).eval (x : β„‚) := @algebraMap_eval_U ℝ β„‚ _ _ _ #align polynomial.chebyshev.complex_of_real_eval_U Polynomial.Chebyshev.complex_ofReal_eval_U section Complex open Complex variable (ΞΈ : β„‚) @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean
73
86
theorem T_complex_cos (n : β„€) : (T β„‚ n).eval (cos ΞΈ) = cos (n * ΞΈ) := by
induction n using Polynomial.Chebyshev.induct with | zero => simp | one => simp | add_two n ih1 ih2 => simp only [T_add_two, eval_sub, eval_mul, eval_X, eval_ofNat, ih1, ih2, sub_eq_iff_eq_add, cos_add_cos] push_cast ring_nf | neg_add_one n ih1 ih2 => simp only [T_sub_one, eval_sub, eval_mul, eval_X, eval_ofNat, ih1, ih2, sub_eq_iff_eq_add', cos_add_cos] push_cast ring_nf
2,177
import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Data.Complex.Exponential import Mathlib.Data.Complex.Module import Mathlib.RingTheory.Polynomial.Chebyshev #align_import analysis.special_functions.trigonometric.chebyshev from "leanprover-community/mathlib"@"2c1d8ca2812b64f88992a5294ea3dba144755cd1" set_option linter.uppercaseLean3 false namespace Polynomial.Chebyshev open Polynomial variable {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] @[simp] theorem aeval_T (x : A) (n : β„€) : aeval x (T R n) = (T A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_T] #align polynomial.chebyshev.aeval_T Polynomial.Chebyshev.aeval_T @[simp] theorem aeval_U (x : A) (n : β„€) : aeval x (U R n) = (U A n).eval x := by rw [aeval_def, evalβ‚‚_eq_eval_map, map_U] #align polynomial.chebyshev.aeval_U Polynomial.Chebyshev.aeval_U @[simp] theorem algebraMap_eval_T (x : R) (n : β„€) : algebraMap R A ((T R n).eval x) = (T A n).eval (algebraMap R A x) := by rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_T] #align polynomial.chebyshev.algebra_map_eval_T Polynomial.Chebyshev.algebraMap_eval_T @[simp] theorem algebraMap_eval_U (x : R) (n : β„€) : algebraMap R A ((U R n).eval x) = (U A n).eval (algebraMap R A x) := by rw [← aeval_algebraMap_apply_eq_algebraMap_eval, aeval_U] #align polynomial.chebyshev.algebra_map_eval_U Polynomial.Chebyshev.algebraMap_eval_U -- Porting note: added type ascriptions to the statement @[simp, norm_cast] theorem complex_ofReal_eval_T : βˆ€ (x : ℝ) n, (((T ℝ n).eval x : ℝ) : β„‚) = (T β„‚ n).eval (x : β„‚) := @algebraMap_eval_T ℝ β„‚ _ _ _ #align polynomial.chebyshev.complex_of_real_eval_T Polynomial.Chebyshev.complex_ofReal_eval_T -- Porting note: added type ascriptions to the statement @[simp, norm_cast] theorem complex_ofReal_eval_U : βˆ€ (x : ℝ) n, (((U ℝ n).eval x : ℝ) : β„‚) = (U β„‚ n).eval (x : β„‚) := @algebraMap_eval_U ℝ β„‚ _ _ _ #align polynomial.chebyshev.complex_of_real_eval_U Polynomial.Chebyshev.complex_ofReal_eval_U section Complex open Complex variable (ΞΈ : β„‚) @[simp] theorem T_complex_cos (n : β„€) : (T β„‚ n).eval (cos ΞΈ) = cos (n * ΞΈ) := by induction n using Polynomial.Chebyshev.induct with | zero => simp | one => simp | add_two n ih1 ih2 => simp only [T_add_two, eval_sub, eval_mul, eval_X, eval_ofNat, ih1, ih2, sub_eq_iff_eq_add, cos_add_cos] push_cast ring_nf | neg_add_one n ih1 ih2 => simp only [T_sub_one, eval_sub, eval_mul, eval_X, eval_ofNat, ih1, ih2, sub_eq_iff_eq_add', cos_add_cos] push_cast ring_nf #align polynomial.chebyshev.T_complex_cos Polynomial.Chebyshev.T_complex_cos @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev.lean
92
105
theorem U_complex_cos (n : β„€) : (U β„‚ n).eval (cos ΞΈ) * sin ΞΈ = sin ((n + 1) * ΞΈ) := by
induction n using Polynomial.Chebyshev.induct with | zero => simp | one => simp [one_add_one_eq_two, sin_two_mul]; ring | add_two n ih1 ih2 => simp only [U_add_two, add_sub_cancel_right, eval_sub, eval_mul, eval_X, eval_ofNat, sub_mul, mul_assoc, ih1, ih2, sub_eq_iff_eq_add, sin_add_sin] push_cast ring_nf | neg_add_one n ih1 ih2 => simp only [U_sub_one, add_sub_cancel_right, eval_sub, eval_mul, eval_X, eval_ofNat, sub_mul, mul_assoc, ih1, ih2, sub_eq_iff_eq_add', sin_add_sin] push_cast ring_nf
2,177
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I
Mathlib/Analysis/Complex/Basic.lean
58
59
theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by
simp only [norm_eq_abs, abs_exp_ofReal_mul_I]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq
Mathlib/Analysis/Complex/Basic.lean
102
104
theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by
rw [sq, sq] rfl
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk
Mathlib/Analysis/Complex/Basic.lean
113
114
theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by
rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_re_eq Complex.dist_of_re_eq theorem nndist_of_re_eq {z w : β„‚} (h : z.re = w.re) : nndist z w = nndist z.im w.im := NNReal.eq <| dist_of_re_eq h #align complex.nndist_of_re_eq Complex.nndist_of_re_eq
Mathlib/Analysis/Complex/Basic.lean
121
122
theorem edist_of_re_eq {z w : β„‚} (h : z.re = w.re) : edist z w = edist z.im w.im := by
rw [edist_nndist, edist_nndist, nndist_of_re_eq h]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_re_eq Complex.dist_of_re_eq theorem nndist_of_re_eq {z w : β„‚} (h : z.re = w.re) : nndist z w = nndist z.im w.im := NNReal.eq <| dist_of_re_eq h #align complex.nndist_of_re_eq Complex.nndist_of_re_eq theorem edist_of_re_eq {z w : β„‚} (h : z.re = w.re) : edist z w = edist z.im w.im := by rw [edist_nndist, edist_nndist, nndist_of_re_eq h] #align complex.edist_of_re_eq Complex.edist_of_re_eq
Mathlib/Analysis/Complex/Basic.lean
125
126
theorem dist_of_im_eq {z w : β„‚} (h : z.im = w.im) : dist z w = dist z.re w.re := by
rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, add_zero, Real.sqrt_sq_eq_abs, Real.dist_eq]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_re_eq Complex.dist_of_re_eq theorem nndist_of_re_eq {z w : β„‚} (h : z.re = w.re) : nndist z w = nndist z.im w.im := NNReal.eq <| dist_of_re_eq h #align complex.nndist_of_re_eq Complex.nndist_of_re_eq theorem edist_of_re_eq {z w : β„‚} (h : z.re = w.re) : edist z w = edist z.im w.im := by rw [edist_nndist, edist_nndist, nndist_of_re_eq h] #align complex.edist_of_re_eq Complex.edist_of_re_eq theorem dist_of_im_eq {z w : β„‚} (h : z.im = w.im) : dist z w = dist z.re w.re := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, add_zero, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_im_eq Complex.dist_of_im_eq theorem nndist_of_im_eq {z w : β„‚} (h : z.im = w.im) : nndist z w = nndist z.re w.re := NNReal.eq <| dist_of_im_eq h #align complex.nndist_of_im_eq Complex.nndist_of_im_eq
Mathlib/Analysis/Complex/Basic.lean
133
134
theorem edist_of_im_eq {z w : β„‚} (h : z.im = w.im) : edist z w = edist z.re w.re := by
rw [edist_nndist, edist_nndist, nndist_of_im_eq h]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_re_eq Complex.dist_of_re_eq theorem nndist_of_re_eq {z w : β„‚} (h : z.re = w.re) : nndist z w = nndist z.im w.im := NNReal.eq <| dist_of_re_eq h #align complex.nndist_of_re_eq Complex.nndist_of_re_eq theorem edist_of_re_eq {z w : β„‚} (h : z.re = w.re) : edist z w = edist z.im w.im := by rw [edist_nndist, edist_nndist, nndist_of_re_eq h] #align complex.edist_of_re_eq Complex.edist_of_re_eq theorem dist_of_im_eq {z w : β„‚} (h : z.im = w.im) : dist z w = dist z.re w.re := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, add_zero, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_im_eq Complex.dist_of_im_eq theorem nndist_of_im_eq {z w : β„‚} (h : z.im = w.im) : nndist z w = nndist z.re w.re := NNReal.eq <| dist_of_im_eq h #align complex.nndist_of_im_eq Complex.nndist_of_im_eq theorem edist_of_im_eq {z w : β„‚} (h : z.im = w.im) : edist z w = edist z.re w.re := by rw [edist_nndist, edist_nndist, nndist_of_im_eq h] #align complex.edist_of_im_eq Complex.edist_of_im_eq
Mathlib/Analysis/Complex/Basic.lean
137
139
theorem dist_conj_self (z : β„‚) : dist (conj z) z = 2 * |z.im| := by
rw [dist_of_re_eq (conj_re z), conj_im, dist_comm, Real.dist_eq, sub_neg_eq_add, ← two_mul, _root_.abs_mul, abs_of_pos (zero_lt_two' ℝ)]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_re_eq Complex.dist_of_re_eq theorem nndist_of_re_eq {z w : β„‚} (h : z.re = w.re) : nndist z w = nndist z.im w.im := NNReal.eq <| dist_of_re_eq h #align complex.nndist_of_re_eq Complex.nndist_of_re_eq theorem edist_of_re_eq {z w : β„‚} (h : z.re = w.re) : edist z w = edist z.im w.im := by rw [edist_nndist, edist_nndist, nndist_of_re_eq h] #align complex.edist_of_re_eq Complex.edist_of_re_eq theorem dist_of_im_eq {z w : β„‚} (h : z.im = w.im) : dist z w = dist z.re w.re := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, add_zero, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_im_eq Complex.dist_of_im_eq theorem nndist_of_im_eq {z w : β„‚} (h : z.im = w.im) : nndist z w = nndist z.re w.re := NNReal.eq <| dist_of_im_eq h #align complex.nndist_of_im_eq Complex.nndist_of_im_eq theorem edist_of_im_eq {z w : β„‚} (h : z.im = w.im) : edist z w = edist z.re w.re := by rw [edist_nndist, edist_nndist, nndist_of_im_eq h] #align complex.edist_of_im_eq Complex.edist_of_im_eq theorem dist_conj_self (z : β„‚) : dist (conj z) z = 2 * |z.im| := by rw [dist_of_re_eq (conj_re z), conj_im, dist_comm, Real.dist_eq, sub_neg_eq_add, ← two_mul, _root_.abs_mul, abs_of_pos (zero_lt_two' ℝ)] #align complex.dist_conj_self Complex.dist_conj_self theorem nndist_conj_self (z : β„‚) : nndist (conj z) z = 2 * Real.nnabs z.im := NNReal.eq <| by rw [← dist_nndist, NNReal.coe_mul, NNReal.coe_two, Real.coe_nnabs, dist_conj_self] #align complex.nndist_conj_self Complex.nndist_conj_self
Mathlib/Analysis/Complex/Basic.lean
146
146
theorem dist_self_conj (z : β„‚) : dist z (conj z) = 2 * |z.im| := by
rw [dist_comm, dist_conj_self]
2,178
import Mathlib.Data.Complex.Module import Mathlib.Data.Complex.Order import Mathlib.Data.Complex.Exponential import Mathlib.Analysis.RCLike.Basic import Mathlib.Topology.Algebra.InfiniteSum.Module import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.complex.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" assert_not_exists Absorbs noncomputable section namespace Complex variable {z : β„‚} open ComplexConjugate Topology Filter instance : Norm β„‚ := ⟨abs⟩ @[simp] theorem norm_eq_abs (z : β„‚) : β€–zβ€– = abs z := rfl #align complex.norm_eq_abs Complex.norm_eq_abs lemma norm_I : β€–Iβ€– = 1 := abs_I theorem norm_exp_ofReal_mul_I (t : ℝ) : β€–exp (t * I)β€– = 1 := by simp only [norm_eq_abs, abs_exp_ofReal_mul_I] set_option linter.uppercaseLean3 false in #align complex.norm_exp_of_real_mul_I Complex.norm_exp_ofReal_mul_I instance instNormedAddCommGroup : NormedAddCommGroup β„‚ := AddGroupNorm.toNormedAddCommGroup { abs with map_zero' := map_zero abs neg' := abs.map_neg eq_zero_of_map_eq_zero' := fun _ => abs.eq_zero.1 } instance : NormedField β„‚ where dist_eq _ _ := rfl norm_mul' := map_mul abs instance : DenselyNormedField β„‚ where lt_norm_lt r₁ rβ‚‚ hβ‚€ hr := let ⟨x, h⟩ := exists_between hr ⟨x, by rwa [norm_eq_abs, abs_ofReal, abs_of_pos (hβ‚€.trans_lt h.1)]⟩ instance {R : Type*} [NormedField R] [NormedAlgebra R ℝ] : NormedAlgebra R β„‚ where norm_smul_le r x := by rw [← algebraMap_smul ℝ r x, real_smul, norm_mul, norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, norm_algebraMap'] variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace β„‚ E] -- see Note [lower instance priority] instance (priority := 900) _root_.NormedSpace.complexToReal : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ β„‚ E #align normed_space.complex_to_real NormedSpace.complexToReal -- see Note [lower instance priority] instance (priority := 900) _root_.NormedAlgebra.complexToReal {A : Type*} [SeminormedRing A] [NormedAlgebra β„‚ A] : NormedAlgebra ℝ A := NormedAlgebra.restrictScalars ℝ β„‚ A theorem dist_eq (z w : β„‚) : dist z w = abs (z - w) := rfl #align complex.dist_eq Complex.dist_eq theorem dist_eq_re_im (z w : β„‚) : dist z w = √((z.re - w.re) ^ 2 + (z.im - w.im) ^ 2) := by rw [sq, sq] rfl #align complex.dist_eq_re_im Complex.dist_eq_re_im @[simp] theorem dist_mk (x₁ y₁ xβ‚‚ yβ‚‚ : ℝ) : dist (mk x₁ y₁) (mk xβ‚‚ yβ‚‚) = √((x₁ - xβ‚‚) ^ 2 + (y₁ - yβ‚‚) ^ 2) := dist_eq_re_im _ _ #align complex.dist_mk Complex.dist_mk theorem dist_of_re_eq {z w : β„‚} (h : z.re = w.re) : dist z w = dist z.im w.im := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, zero_add, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_re_eq Complex.dist_of_re_eq theorem nndist_of_re_eq {z w : β„‚} (h : z.re = w.re) : nndist z w = nndist z.im w.im := NNReal.eq <| dist_of_re_eq h #align complex.nndist_of_re_eq Complex.nndist_of_re_eq theorem edist_of_re_eq {z w : β„‚} (h : z.re = w.re) : edist z w = edist z.im w.im := by rw [edist_nndist, edist_nndist, nndist_of_re_eq h] #align complex.edist_of_re_eq Complex.edist_of_re_eq theorem dist_of_im_eq {z w : β„‚} (h : z.im = w.im) : dist z w = dist z.re w.re := by rw [dist_eq_re_im, h, sub_self, zero_pow two_ne_zero, add_zero, Real.sqrt_sq_eq_abs, Real.dist_eq] #align complex.dist_of_im_eq Complex.dist_of_im_eq theorem nndist_of_im_eq {z w : β„‚} (h : z.im = w.im) : nndist z w = nndist z.re w.re := NNReal.eq <| dist_of_im_eq h #align complex.nndist_of_im_eq Complex.nndist_of_im_eq theorem edist_of_im_eq {z w : β„‚} (h : z.im = w.im) : edist z w = edist z.re w.re := by rw [edist_nndist, edist_nndist, nndist_of_im_eq h] #align complex.edist_of_im_eq Complex.edist_of_im_eq theorem dist_conj_self (z : β„‚) : dist (conj z) z = 2 * |z.im| := by rw [dist_of_re_eq (conj_re z), conj_im, dist_comm, Real.dist_eq, sub_neg_eq_add, ← two_mul, _root_.abs_mul, abs_of_pos (zero_lt_two' ℝ)] #align complex.dist_conj_self Complex.dist_conj_self theorem nndist_conj_self (z : β„‚) : nndist (conj z) z = 2 * Real.nnabs z.im := NNReal.eq <| by rw [← dist_nndist, NNReal.coe_mul, NNReal.coe_two, Real.coe_nnabs, dist_conj_self] #align complex.nndist_conj_self Complex.nndist_conj_self theorem dist_self_conj (z : β„‚) : dist z (conj z) = 2 * |z.im| := by rw [dist_comm, dist_conj_self] #align complex.dist_self_conj Complex.dist_self_conj
Mathlib/Analysis/Complex/Basic.lean
149
150
theorem nndist_self_conj (z : β„‚) : nndist z (conj z) = 2 * Real.nnabs z.im := by
rw [nndist_comm, nndist_conj_self]
2,178
import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.RCLike.Lemmas import Mathlib.Topology.TietzeExtension import Mathlib.Analysis.NormedSpace.HomeomorphBall import Mathlib.Analysis.NormedSpace.RCLike universe u u₁ v w -- this is not an instance because Lean cannot determine `π•œ`. theorem TietzeExtension.of_tvs (π•œ : Type v) [NontriviallyNormedField π•œ] {E : Type w} [AddCommGroup E] [Module π•œ E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousSMul π•œ E] [T2Space E] [FiniteDimensional π•œ E] [CompleteSpace π•œ] [TietzeExtension.{u, v} π•œ] : TietzeExtension.{u, w} E := Basis.ofVectorSpace π•œ E |>.equivFun.toContinuousLinearEquiv.toHomeomorph |> .of_homeo instance Complex.instTietzeExtension : TietzeExtension β„‚ := TietzeExtension.of_tvs ℝ instance (priority := 900) RCLike.instTietzeExtension {π•œ : Type*} [RCLike π•œ] : TietzeExtension π•œ := TietzeExtension.of_tvs ℝ instance RCLike.instTietzeExtensionTVS {π•œ : Type v} [RCLike π•œ] {E : Type w} [AddCommGroup E] [Module π•œ E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousSMul π•œ E] [T2Space E] [FiniteDimensional π•œ E] : TietzeExtension.{u, w} E := TietzeExtension.of_tvs π•œ instance Set.instTietzeExtensionUnitBall {π•œ : Type v} [RCLike π•œ] {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] [FiniteDimensional π•œ E] : TietzeExtension.{u, w} (Metric.ball (0 : E) 1) := have : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ π•œ E .of_homeo Homeomorph.unitBall.symm instance Set.instTietzeExtensionUnitClosedBall {π•œ : Type v} [RCLike π•œ] {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] [FiniteDimensional π•œ E] : TietzeExtension.{u, w} (Metric.closedBall (0 : E) 1) := by have : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ π•œ E have : IsScalarTower ℝ π•œ E := Real.isScalarTower -- I didn't find this retract in Mathlib. let g : E β†’ E := fun x ↦ β€–x‖⁻¹ β€’ x classical suffices this : Continuous (piecewise (Metric.closedBall 0 1) id g) by refine .of_retract ⟨Subtype.val, by continuity⟩ ⟨_, this.codRestrict fun x ↦ ?_⟩ ?_ Β· by_cases hx : x ∈ Metric.closedBall 0 1 Β· simpa [piecewise_eq_of_mem (hi := hx)] using hx Β· simp only [g, piecewise_eq_of_not_mem (hi := hx), RCLike.real_smul_eq_coe_smul (K := π•œ)] by_cases hx' : x = 0 <;> simp [hx'] Β· ext x simp [piecewise_eq_of_mem (hi := x.property)] refine continuous_piecewise (fun x hx ↦ ?_) continuousOn_id ?_ Β· replace hx : β€–xβ€– = 1 := by simpa [frontier_closedBall (0 : E) one_ne_zero] using hx simp [g, hx] Β· refine continuousOn_id.norm.invβ‚€ ?_ |>.smul continuousOn_id simp only [closure_compl, interior_closedBall (0 : E) one_ne_zero, mem_compl_iff, Metric.mem_ball, dist_zero_right, not_lt, id_eq, ne_eq, norm_eq_zero] exact fun x hx ↦ norm_pos_iff.mp <| one_pos.trans_le hx theorem Metric.instTietzeExtensionBall {π•œ : Type v} [RCLike π•œ] {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] [FiniteDimensional π•œ E] {r : ℝ} (hr : 0 < r) : TietzeExtension.{u, w} (Metric.ball (0 : E) r) := have : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ π•œ E .of_homeo <| show (Metric.ball (0 : E) r) β‰ƒβ‚œ (Metric.ball (0 : E) 1) from PartialHomeomorph.unitBallBall (0 : E) r hr |>.toHomeomorphSourceTarget.symm theorem Metric.instTietzeExtensionClosedBall (π•œ : Type v) [RCLike π•œ] {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] [FiniteDimensional π•œ E] (y : E) {r : ℝ} (hr : 0 < r) : TietzeExtension.{u, w} (Metric.closedBall y r) := .of_homeo <| by show (Metric.closedBall y r) β‰ƒβ‚œ (Metric.closedBall (0 : E) 1) symm apply (DilationEquiv.smulTorsor y (k := (r : π•œ)) <| by exact_mod_cast hr.ne').toHomeomorph.sets ext x simp only [mem_closedBall, dist_zero_right, DilationEquiv.coe_toHomeomorph, Set.mem_preimage, DilationEquiv.smulTorsor_apply, vadd_eq_add, dist_add_self_left, norm_smul, RCLike.norm_ofReal, abs_of_nonneg hr.le] exact (mul_le_iff_le_one_right hr).symm variable {X : Type u} [TopologicalSpace X] [NormalSpace X] {s : Set X} (hs : IsClosed s) variable (π•œ : Type v) [RCLike π•œ] [TietzeExtension.{u, v} π•œ] variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π•œ E] [FiniteDimensional π•œ E] namespace BoundedContinuousFunction
Mathlib/Analysis/Complex/Tietze.lean
105
118
theorem exists_norm_eq_restrict_eq (f : s →ᡇ E) : βˆƒ g : X →ᡇ E, β€–gβ€– = β€–fβ€– ∧ g.restrict s = f := by
by_cases hf : β€–fβ€– = 0; Β· exact ⟨0, by aesop⟩ have := Metric.instTietzeExtensionClosedBall.{u, v} π•œ (0 : E) (by aesop : 0 < β€–fβ€–) have hf' x : f x ∈ Metric.closedBall 0 β€–fβ€– := by simpa using f.norm_coe_le_norm x obtain ⟨g, hg_mem, hg⟩ := (f : C(s, E)).exists_forall_mem_restrict_eq hs hf' simp only [Metric.mem_closedBall, dist_zero_right] at hg_mem let g' : X →ᡇ E := .ofNormedAddCommGroup g (map_continuous g) β€–fβ€– hg_mem refine ⟨g', ?_, by ext x; congrm($(hg) x)⟩ apply le_antisymm ((g'.norm_le <| by positivity).mpr hg_mem) refine (f.norm_le <| by positivity).mpr fun x ↦ ?_ have hx : f x = g' x := by simpa using congr($(hg) x).symm rw [hx] exact g'.norm_le (norm_nonneg g') |>.mp le_rfl x
2,179