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