Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
num_lines
int64
1
150
complexity_score
float64
2.72
139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B
diff_level
int64
0
2
file_diff_level
float64
0
2
theorem_same_file
int64
1
32
rank_file
int64
0
2.51k
import Mathlib.Init.Function import Mathlib.Logic.Function.Basic #align_import data.sigma.basic from "leanprover-community/mathlib"@"a148d797a1094ab554ad4183a4ad6f130358ef64" open Function namespace PSigma variable {Ξ± : Sort*} {Ξ² : Ξ± β†’ Sort*} def elim {Ξ³} (f : βˆ€ a, Ξ² a β†’ Ξ³) (a : PSigma Ξ²) : Ξ³ := PSigma.casesOn a f #align psigma.elim PSigma.elim @[simp] theorem elim_val {Ξ³} (f : βˆ€ a, Ξ² a β†’ Ξ³) (a b) : PSigma.elim f ⟨a, b⟩ = f a b := rfl #align psigma.elim_val PSigma.elim_val instance [Inhabited Ξ±] [Inhabited (Ξ² default)] : Inhabited (PSigma Ξ²) := ⟨⟨default, default⟩⟩ instance decidableEq [h₁ : DecidableEq Ξ±] [hβ‚‚ : βˆ€ a, DecidableEq (Ξ² a)] : DecidableEq (PSigma Ξ²) | ⟨a₁, bβ‚βŸ©, ⟨aβ‚‚, bβ‚‚βŸ© => match a₁, b₁, aβ‚‚, bβ‚‚, h₁ a₁ aβ‚‚ with | _, b₁, _, bβ‚‚, isTrue (Eq.refl _) => match b₁, bβ‚‚, hβ‚‚ _ b₁ bβ‚‚ with | _, _, isTrue (Eq.refl _) => isTrue rfl | _, _, isFalse n => isFalse fun h ↦ PSigma.noConfusion h fun _ eβ‚‚ ↦ n <| eq_of_heq eβ‚‚ | _, _, _, _, isFalse n => isFalse fun h ↦ PSigma.noConfusion h fun e₁ _ ↦ n e₁ -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/porting.20data.2Esigma.2Ebasic/near/304855864 -- for an explanation of why this is currently needed. It generates `PSigma.mk.inj`. -- This could be done elsewhere. gen_injective_theorems% PSigma theorem mk.inj_iff {a₁ aβ‚‚ : Ξ±} {b₁ : Ξ² a₁} {bβ‚‚ : Ξ² aβ‚‚} : @PSigma.mk Ξ± Ξ² a₁ b₁ = @PSigma.mk Ξ± Ξ² aβ‚‚ bβ‚‚ ↔ a₁ = aβ‚‚ ∧ HEq b₁ bβ‚‚ := (Iff.intro PSigma.mk.inj) fun ⟨h₁, hβ‚‚βŸ© ↦ match a₁, aβ‚‚, b₁, bβ‚‚, h₁, hβ‚‚ with | _, _, _, _, Eq.refl _, HEq.refl _ => rfl #align psigma.mk.inj_iff PSigma.mk.inj_iff #align psigma.ext PSigma.ext
Mathlib/Data/Sigma/Basic.lean
273
274
theorem ext_iff {xβ‚€ x₁ : PSigma Ξ²} : xβ‚€ = x₁ ↔ xβ‚€.1 = x₁.1 ∧ HEq xβ‚€.2 x₁.2 := by
cases xβ‚€; cases x₁; exact PSigma.mk.inj_iff
1
2.718282
0
0.5
4
421
import Mathlib.Algebra.Group.Equiv.Basic import Mathlib.Algebra.Ring.Basic import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Order.Hom.Basic #align_import algebra.order.sub.basic from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" variable {Ξ± Ξ² : Type*} section Add variable [Preorder Ξ±] [Add Ξ±] [Sub Ξ±] [OrderedSub Ξ±] {a b c d : Ξ±}
Mathlib/Algebra/Order/Sub/Basic.lean
25
28
theorem AddHom.le_map_tsub [Preorder Ξ²] [Add Ξ²] [Sub Ξ²] [OrderedSub Ξ²] (f : AddHom Ξ± Ξ²) (hf : Monotone f) (a b : Ξ±) : f a - f b ≀ f (a - b) := by
rw [tsub_le_iff_right, ← f.map_add] exact hf le_tsub_add
2
7.389056
1
0.5
2
422
import Mathlib.Algebra.Group.Equiv.Basic import Mathlib.Algebra.Ring.Basic import Mathlib.Algebra.Order.Sub.Defs import Mathlib.Order.Hom.Basic #align_import algebra.order.sub.basic from "leanprover-community/mathlib"@"10b4e499f43088dd3bb7b5796184ad5216648ab1" variable {Ξ± Ξ² : Type*} section Add variable [Preorder Ξ±] [Add Ξ±] [Sub Ξ±] [OrderedSub Ξ±] {a b c d : Ξ±} theorem AddHom.le_map_tsub [Preorder Ξ²] [Add Ξ²] [Sub Ξ²] [OrderedSub Ξ²] (f : AddHom Ξ± Ξ²) (hf : Monotone f) (a b : Ξ±) : f a - f b ≀ f (a - b) := by rw [tsub_le_iff_right, ← f.map_add] exact hf le_tsub_add #align add_hom.le_map_tsub AddHom.le_map_tsub theorem le_mul_tsub {R : Type*} [Distrib R] [Preorder R] [Sub R] [OrderedSub R] [CovariantClass R R (Β· * Β·) (Β· ≀ Β·)] {a b c : R} : a * b - a * c ≀ a * (b - c) := (AddHom.mulLeft a).le_map_tsub (monotone_id.const_mul' a) _ _ #align le_mul_tsub le_mul_tsub
Mathlib/Algebra/Order/Sub/Basic.lean
36
38
theorem le_tsub_mul {R : Type*} [CommSemiring R] [Preorder R] [Sub R] [OrderedSub R] [CovariantClass R R (Β· * Β·) (Β· ≀ Β·)] {a b c : R} : a * c - b * c ≀ (a - b) * c := by
simpa only [mul_comm _ c] using le_mul_tsub
1
2.718282
0
0.5
2
422
import Mathlib.Data.Fintype.Basic import Mathlib.Data.Finset.Card import Mathlib.Data.List.NodupEquivFin import Mathlib.Data.Set.Image #align_import data.fintype.card from "leanprover-community/mathlib"@"bf2428c9486c407ca38b5b3fb10b87dad0bc99fa" assert_not_exists MonoidWithZero assert_not_exists MulAction open Function open Nat universe u v variable {Ξ± Ξ² Ξ³ : Type*} open Finset Function namespace Fintype def card (Ξ±) [Fintype Ξ±] : β„• := (@univ Ξ± _).card #align fintype.card Fintype.card def truncEquivFin (Ξ±) [DecidableEq Ξ±] [Fintype Ξ±] : Trunc (Ξ± ≃ Fin (card Ξ±)) := by unfold card Finset.card exact Quot.recOnSubsingleton' (motive := fun s : Multiset Ξ± => (βˆ€ x : Ξ±, x ∈ s) β†’ s.Nodup β†’ Trunc (Ξ± ≃ Fin (Multiset.card s))) univ.val (fun l (h : βˆ€ x : Ξ±, x ∈ l) (nd : l.Nodup) => Trunc.mk (nd.getEquivOfForallMemList _ h).symm) mem_univ_val univ.2 #align fintype.trunc_equiv_fin Fintype.truncEquivFin noncomputable def equivFin (Ξ±) [Fintype Ξ±] : Ξ± ≃ Fin (card Ξ±) := letI := Classical.decEq Ξ± (truncEquivFin Ξ±).out #align fintype.equiv_fin Fintype.equivFin def truncFinBijection (Ξ±) [Fintype Ξ±] : Trunc { f : Fin (card Ξ±) β†’ Ξ± // Bijective f } := by unfold card Finset.card refine Quot.recOnSubsingleton' (motive := fun s : Multiset Ξ± => (βˆ€ x : Ξ±, x ∈ s) β†’ s.Nodup β†’ Trunc {f : Fin (Multiset.card s) β†’ Ξ± // Bijective f}) univ.val (fun l (h : βˆ€ x : Ξ±, x ∈ l) (nd : l.Nodup) => Trunc.mk (nd.getBijectionOfForallMemList _ h)) mem_univ_val univ.2 #align fintype.trunc_fin_bijection Fintype.truncFinBijection theorem subtype_card {p : Ξ± β†’ Prop} (s : Finset Ξ±) (H : βˆ€ x : Ξ±, x ∈ s ↔ p x) : @card { x // p x } (Fintype.subtype s H) = s.card := Multiset.card_pmap _ _ _ #align fintype.subtype_card Fintype.subtype_card
Mathlib/Data/Fintype/Card.lean
126
130
theorem card_of_subtype {p : Ξ± β†’ Prop} (s : Finset Ξ±) (H : βˆ€ x : Ξ±, x ∈ s ↔ p x) [Fintype { x // p x }] : card { x // p x } = s.card := by
rw [← subtype_card s H] congr apply Subsingleton.elim
3
20.085537
1
0.5
2
423
import Mathlib.Data.Fintype.Basic import Mathlib.Data.Finset.Card import Mathlib.Data.List.NodupEquivFin import Mathlib.Data.Set.Image #align_import data.fintype.card from "leanprover-community/mathlib"@"bf2428c9486c407ca38b5b3fb10b87dad0bc99fa" assert_not_exists MonoidWithZero assert_not_exists MulAction open Function open Nat universe u v variable {Ξ± Ξ² Ξ³ : Type*} open Finset Function namespace Fintype def card (Ξ±) [Fintype Ξ±] : β„• := (@univ Ξ± _).card #align fintype.card Fintype.card def truncEquivFin (Ξ±) [DecidableEq Ξ±] [Fintype Ξ±] : Trunc (Ξ± ≃ Fin (card Ξ±)) := by unfold card Finset.card exact Quot.recOnSubsingleton' (motive := fun s : Multiset Ξ± => (βˆ€ x : Ξ±, x ∈ s) β†’ s.Nodup β†’ Trunc (Ξ± ≃ Fin (Multiset.card s))) univ.val (fun l (h : βˆ€ x : Ξ±, x ∈ l) (nd : l.Nodup) => Trunc.mk (nd.getEquivOfForallMemList _ h).symm) mem_univ_val univ.2 #align fintype.trunc_equiv_fin Fintype.truncEquivFin noncomputable def equivFin (Ξ±) [Fintype Ξ±] : Ξ± ≃ Fin (card Ξ±) := letI := Classical.decEq Ξ± (truncEquivFin Ξ±).out #align fintype.equiv_fin Fintype.equivFin def truncFinBijection (Ξ±) [Fintype Ξ±] : Trunc { f : Fin (card Ξ±) β†’ Ξ± // Bijective f } := by unfold card Finset.card refine Quot.recOnSubsingleton' (motive := fun s : Multiset Ξ± => (βˆ€ x : Ξ±, x ∈ s) β†’ s.Nodup β†’ Trunc {f : Fin (Multiset.card s) β†’ Ξ± // Bijective f}) univ.val (fun l (h : βˆ€ x : Ξ±, x ∈ l) (nd : l.Nodup) => Trunc.mk (nd.getBijectionOfForallMemList _ h)) mem_univ_val univ.2 #align fintype.trunc_fin_bijection Fintype.truncFinBijection theorem subtype_card {p : Ξ± β†’ Prop} (s : Finset Ξ±) (H : βˆ€ x : Ξ±, x ∈ s ↔ p x) : @card { x // p x } (Fintype.subtype s H) = s.card := Multiset.card_pmap _ _ _ #align fintype.subtype_card Fintype.subtype_card theorem card_of_subtype {p : Ξ± β†’ Prop} (s : Finset Ξ±) (H : βˆ€ x : Ξ±, x ∈ s ↔ p x) [Fintype { x // p x }] : card { x // p x } = s.card := by rw [← subtype_card s H] congr apply Subsingleton.elim #align fintype.card_of_subtype Fintype.card_of_subtype @[simp] theorem card_ofFinset {p : Set Ξ±} (s : Finset Ξ±) (H : βˆ€ x, x ∈ s ↔ x ∈ p) : @Fintype.card p (ofFinset s H) = s.card := Fintype.subtype_card s H #align fintype.card_of_finset Fintype.card_ofFinset
Mathlib/Data/Fintype/Card.lean
139
140
theorem card_of_finset' {p : Set Ξ±} (s : Finset Ξ±) (H : βˆ€ x, x ∈ s ↔ x ∈ p) [Fintype p] : Fintype.card p = s.card := by
rw [← card_ofFinset s H]; congr; apply Subsingleton.elim
1
2.718282
0
0.5
2
423
import Mathlib.Algebra.Group.Support import Mathlib.Data.Int.Cast.Field import Mathlib.Data.Int.Cast.Lemmas #align_import data.int.char_zero from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1" open Nat Set variable {Ξ± Ξ² : Type*} namespace Int @[simp, norm_cast]
Mathlib/Data/Int/CharZero.lean
24
28
theorem cast_div_charZero {k : Type*} [DivisionRing k] [CharZero k] {m n : β„€} (n_dvd : n ∣ m) : ((m / n : β„€) : k) = m / n := by
rcases eq_or_ne n 0 with (rfl | hn) Β· simp [Int.ediv_zero] Β· exact cast_div n_dvd (cast_ne_zero.mpr hn)
3
20.085537
1
0.5
2
424
import Mathlib.Algebra.Group.Support import Mathlib.Data.Int.Cast.Field import Mathlib.Data.Int.Cast.Lemmas #align_import data.int.char_zero from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1" open Nat Set variable {Ξ± Ξ² : Type*} namespace Int @[simp, norm_cast] theorem cast_div_charZero {k : Type*} [DivisionRing k] [CharZero k] {m n : β„€} (n_dvd : n ∣ m) : ((m / n : β„€) : k) = m / n := by rcases eq_or_ne n 0 with (rfl | hn) Β· simp [Int.ediv_zero] Β· exact cast_div n_dvd (cast_ne_zero.mpr hn) #align int.cast_div_char_zero Int.cast_div_charZero -- Necessary for confluence with `ofNat_ediv` and `cast_div_charZero`. @[simp, norm_cast]
Mathlib/Data/Int/CharZero.lean
33
35
theorem cast_div_ofNat_charZero {k : Type*} [DivisionRing k] [CharZero k] {m n : β„•} (n_dvd : n ∣ m) : (((m : β„€) / (n : β„€) : β„€) : k) = m / n := by
rw [cast_div_charZero (Int.ofNat_dvd.mpr n_dvd), cast_natCast, cast_natCast]
1
2.718282
0
0.5
2
424
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology.Instances.Sign #align_import analysis.special_functions.trigonometric.angle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" open Real noncomputable section namespace Real -- Porting note: can't derive `NormedAddCommGroup, Inhabited` def Angle : Type := AddCircle (2 * Ο€) #align real.angle Real.Angle namespace Angle -- Porting note (#10754): added due to missing instances due to no deriving instance : NormedAddCommGroup Angle := inferInstanceAs (NormedAddCommGroup (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving instance : Inhabited Angle := inferInstanceAs (Inhabited (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving -- also, without this, a plain `QuotientAddGroup.mk` -- causes coerced terms to be of type `ℝ β§Έ AddSubgroup.zmultiples (2 * Ο€)` @[coe] protected def coe (r : ℝ) : Angle := QuotientAddGroup.mk r instance : Coe ℝ Angle := ⟨Angle.coe⟩ instance : CircularOrder Real.Angle := QuotientAddGroup.circularOrder (hp' := ⟨by norm_num [pi_pos]⟩) @[continuity] theorem continuous_coe : Continuous ((↑) : ℝ β†’ Angle) := continuous_quotient_mk' #align real.angle.continuous_coe Real.Angle.continuous_coe def coeHom : ℝ β†’+ Angle := QuotientAddGroup.mk' _ #align real.angle.coe_hom Real.Angle.coeHom @[simp] theorem coe_coeHom : (coeHom : ℝ β†’ Angle) = ((↑) : ℝ β†’ Angle) := rfl #align real.angle.coe_coe_hom Real.Angle.coe_coeHom @[elab_as_elim] protected theorem induction_on {p : Angle β†’ Prop} (ΞΈ : Angle) (h : βˆ€ x : ℝ, p x) : p ΞΈ := Quotient.inductionOn' ΞΈ h #align real.angle.induction_on Real.Angle.induction_on @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := rfl #align real.angle.coe_zero Real.Angle.coe_zero @[simp] theorem coe_add (x y : ℝ) : ↑(x + y : ℝ) = (↑x + ↑y : Angle) := rfl #align real.angle.coe_add Real.Angle.coe_add @[simp] theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle) := rfl #align real.angle.coe_neg Real.Angle.coe_neg @[simp] theorem coe_sub (x y : ℝ) : ↑(x - y : ℝ) = (↑x - ↑y : Angle) := rfl #align real.angle.coe_sub Real.Angle.coe_sub theorem coe_nsmul (n : β„•) (x : ℝ) : ↑(n β€’ x : ℝ) = n β€’ (↑x : Angle) := rfl #align real.angle.coe_nsmul Real.Angle.coe_nsmul theorem coe_zsmul (z : β„€) (x : ℝ) : ↑(z β€’ x : ℝ) = z β€’ (↑x : Angle) := rfl #align real.angle.coe_zsmul Real.Angle.coe_zsmul @[simp, norm_cast]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
107
108
theorem natCast_mul_eq_nsmul (x : ℝ) (n : β„•) : ↑((n : ℝ) * x) = n β€’ (↑x : Angle) := by
simpa only [nsmul_eq_mul] using coeHom.map_nsmul x n
1
2.718282
0
0.5
6
425
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology.Instances.Sign #align_import analysis.special_functions.trigonometric.angle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" open Real noncomputable section namespace Real -- Porting note: can't derive `NormedAddCommGroup, Inhabited` def Angle : Type := AddCircle (2 * Ο€) #align real.angle Real.Angle namespace Angle -- Porting note (#10754): added due to missing instances due to no deriving instance : NormedAddCommGroup Angle := inferInstanceAs (NormedAddCommGroup (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving instance : Inhabited Angle := inferInstanceAs (Inhabited (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving -- also, without this, a plain `QuotientAddGroup.mk` -- causes coerced terms to be of type `ℝ β§Έ AddSubgroup.zmultiples (2 * Ο€)` @[coe] protected def coe (r : ℝ) : Angle := QuotientAddGroup.mk r instance : Coe ℝ Angle := ⟨Angle.coe⟩ instance : CircularOrder Real.Angle := QuotientAddGroup.circularOrder (hp' := ⟨by norm_num [pi_pos]⟩) @[continuity] theorem continuous_coe : Continuous ((↑) : ℝ β†’ Angle) := continuous_quotient_mk' #align real.angle.continuous_coe Real.Angle.continuous_coe def coeHom : ℝ β†’+ Angle := QuotientAddGroup.mk' _ #align real.angle.coe_hom Real.Angle.coeHom @[simp] theorem coe_coeHom : (coeHom : ℝ β†’ Angle) = ((↑) : ℝ β†’ Angle) := rfl #align real.angle.coe_coe_hom Real.Angle.coe_coeHom @[elab_as_elim] protected theorem induction_on {p : Angle β†’ Prop} (ΞΈ : Angle) (h : βˆ€ x : ℝ, p x) : p ΞΈ := Quotient.inductionOn' ΞΈ h #align real.angle.induction_on Real.Angle.induction_on @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := rfl #align real.angle.coe_zero Real.Angle.coe_zero @[simp] theorem coe_add (x y : ℝ) : ↑(x + y : ℝ) = (↑x + ↑y : Angle) := rfl #align real.angle.coe_add Real.Angle.coe_add @[simp] theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle) := rfl #align real.angle.coe_neg Real.Angle.coe_neg @[simp] theorem coe_sub (x y : ℝ) : ↑(x - y : ℝ) = (↑x - ↑y : Angle) := rfl #align real.angle.coe_sub Real.Angle.coe_sub theorem coe_nsmul (n : β„•) (x : ℝ) : ↑(n β€’ x : ℝ) = n β€’ (↑x : Angle) := rfl #align real.angle.coe_nsmul Real.Angle.coe_nsmul theorem coe_zsmul (z : β„€) (x : ℝ) : ↑(z β€’ x : ℝ) = z β€’ (↑x : Angle) := rfl #align real.angle.coe_zsmul Real.Angle.coe_zsmul @[simp, norm_cast] theorem natCast_mul_eq_nsmul (x : ℝ) (n : β„•) : ↑((n : ℝ) * x) = n β€’ (↑x : Angle) := by simpa only [nsmul_eq_mul] using coeHom.map_nsmul x n #align real.angle.coe_nat_mul_eq_nsmul Real.Angle.natCast_mul_eq_nsmul @[simp, norm_cast]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
112
113
theorem intCast_mul_eq_zsmul (x : ℝ) (n : β„€) : ↑((n : ℝ) * x : ℝ) = n β€’ (↑x : Angle) := by
simpa only [zsmul_eq_mul] using coeHom.map_zsmul x n
1
2.718282
0
0.5
6
425
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology.Instances.Sign #align_import analysis.special_functions.trigonometric.angle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" open Real noncomputable section namespace Real -- Porting note: can't derive `NormedAddCommGroup, Inhabited` def Angle : Type := AddCircle (2 * Ο€) #align real.angle Real.Angle namespace Angle -- Porting note (#10754): added due to missing instances due to no deriving instance : NormedAddCommGroup Angle := inferInstanceAs (NormedAddCommGroup (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving instance : Inhabited Angle := inferInstanceAs (Inhabited (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving -- also, without this, a plain `QuotientAddGroup.mk` -- causes coerced terms to be of type `ℝ β§Έ AddSubgroup.zmultiples (2 * Ο€)` @[coe] protected def coe (r : ℝ) : Angle := QuotientAddGroup.mk r instance : Coe ℝ Angle := ⟨Angle.coe⟩ instance : CircularOrder Real.Angle := QuotientAddGroup.circularOrder (hp' := ⟨by norm_num [pi_pos]⟩) @[continuity] theorem continuous_coe : Continuous ((↑) : ℝ β†’ Angle) := continuous_quotient_mk' #align real.angle.continuous_coe Real.Angle.continuous_coe def coeHom : ℝ β†’+ Angle := QuotientAddGroup.mk' _ #align real.angle.coe_hom Real.Angle.coeHom @[simp] theorem coe_coeHom : (coeHom : ℝ β†’ Angle) = ((↑) : ℝ β†’ Angle) := rfl #align real.angle.coe_coe_hom Real.Angle.coe_coeHom @[elab_as_elim] protected theorem induction_on {p : Angle β†’ Prop} (ΞΈ : Angle) (h : βˆ€ x : ℝ, p x) : p ΞΈ := Quotient.inductionOn' ΞΈ h #align real.angle.induction_on Real.Angle.induction_on @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := rfl #align real.angle.coe_zero Real.Angle.coe_zero @[simp] theorem coe_add (x y : ℝ) : ↑(x + y : ℝ) = (↑x + ↑y : Angle) := rfl #align real.angle.coe_add Real.Angle.coe_add @[simp] theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle) := rfl #align real.angle.coe_neg Real.Angle.coe_neg @[simp] theorem coe_sub (x y : ℝ) : ↑(x - y : ℝ) = (↑x - ↑y : Angle) := rfl #align real.angle.coe_sub Real.Angle.coe_sub theorem coe_nsmul (n : β„•) (x : ℝ) : ↑(n β€’ x : ℝ) = n β€’ (↑x : Angle) := rfl #align real.angle.coe_nsmul Real.Angle.coe_nsmul theorem coe_zsmul (z : β„€) (x : ℝ) : ↑(z β€’ x : ℝ) = z β€’ (↑x : Angle) := rfl #align real.angle.coe_zsmul Real.Angle.coe_zsmul @[simp, norm_cast] theorem natCast_mul_eq_nsmul (x : ℝ) (n : β„•) : ↑((n : ℝ) * x) = n β€’ (↑x : Angle) := by simpa only [nsmul_eq_mul] using coeHom.map_nsmul x n #align real.angle.coe_nat_mul_eq_nsmul Real.Angle.natCast_mul_eq_nsmul @[simp, norm_cast] theorem intCast_mul_eq_zsmul (x : ℝ) (n : β„€) : ↑((n : ℝ) * x : ℝ) = n β€’ (↑x : Angle) := by simpa only [zsmul_eq_mul] using coeHom.map_zsmul x n #align real.angle.coe_int_mul_eq_zsmul Real.Angle.intCast_mul_eq_zsmul @[deprecated (since := "2024-05-25")] alias coe_nat_mul_eq_nsmul := natCast_mul_eq_nsmul @[deprecated (since := "2024-05-25")] alias coe_int_mul_eq_zsmul := intCast_mul_eq_zsmul
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
119
125
theorem angle_eq_iff_two_pi_dvd_sub {ψ ΞΈ : ℝ} : (ΞΈ : Angle) = ψ ↔ βˆƒ k : β„€, ΞΈ - ψ = 2 * Ο€ * k := by
simp only [QuotientAddGroup.eq, AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] -- Porting note: added `rw`, `simp [Angle.coe, QuotientAddGroup.eq]` doesn't fire otherwise rw [Angle.coe, Angle.coe, QuotientAddGroup.eq] simp only [AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm]
6
403.428793
2
0.5
6
425
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology.Instances.Sign #align_import analysis.special_functions.trigonometric.angle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" open Real noncomputable section namespace Real -- Porting note: can't derive `NormedAddCommGroup, Inhabited` def Angle : Type := AddCircle (2 * Ο€) #align real.angle Real.Angle namespace Angle -- Porting note (#10754): added due to missing instances due to no deriving instance : NormedAddCommGroup Angle := inferInstanceAs (NormedAddCommGroup (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving instance : Inhabited Angle := inferInstanceAs (Inhabited (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving -- also, without this, a plain `QuotientAddGroup.mk` -- causes coerced terms to be of type `ℝ β§Έ AddSubgroup.zmultiples (2 * Ο€)` @[coe] protected def coe (r : ℝ) : Angle := QuotientAddGroup.mk r instance : Coe ℝ Angle := ⟨Angle.coe⟩ instance : CircularOrder Real.Angle := QuotientAddGroup.circularOrder (hp' := ⟨by norm_num [pi_pos]⟩) @[continuity] theorem continuous_coe : Continuous ((↑) : ℝ β†’ Angle) := continuous_quotient_mk' #align real.angle.continuous_coe Real.Angle.continuous_coe def coeHom : ℝ β†’+ Angle := QuotientAddGroup.mk' _ #align real.angle.coe_hom Real.Angle.coeHom @[simp] theorem coe_coeHom : (coeHom : ℝ β†’ Angle) = ((↑) : ℝ β†’ Angle) := rfl #align real.angle.coe_coe_hom Real.Angle.coe_coeHom @[elab_as_elim] protected theorem induction_on {p : Angle β†’ Prop} (ΞΈ : Angle) (h : βˆ€ x : ℝ, p x) : p ΞΈ := Quotient.inductionOn' ΞΈ h #align real.angle.induction_on Real.Angle.induction_on @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := rfl #align real.angle.coe_zero Real.Angle.coe_zero @[simp] theorem coe_add (x y : ℝ) : ↑(x + y : ℝ) = (↑x + ↑y : Angle) := rfl #align real.angle.coe_add Real.Angle.coe_add @[simp] theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle) := rfl #align real.angle.coe_neg Real.Angle.coe_neg @[simp] theorem coe_sub (x y : ℝ) : ↑(x - y : ℝ) = (↑x - ↑y : Angle) := rfl #align real.angle.coe_sub Real.Angle.coe_sub theorem coe_nsmul (n : β„•) (x : ℝ) : ↑(n β€’ x : ℝ) = n β€’ (↑x : Angle) := rfl #align real.angle.coe_nsmul Real.Angle.coe_nsmul theorem coe_zsmul (z : β„€) (x : ℝ) : ↑(z β€’ x : ℝ) = z β€’ (↑x : Angle) := rfl #align real.angle.coe_zsmul Real.Angle.coe_zsmul @[simp, norm_cast] theorem natCast_mul_eq_nsmul (x : ℝ) (n : β„•) : ↑((n : ℝ) * x) = n β€’ (↑x : Angle) := by simpa only [nsmul_eq_mul] using coeHom.map_nsmul x n #align real.angle.coe_nat_mul_eq_nsmul Real.Angle.natCast_mul_eq_nsmul @[simp, norm_cast] theorem intCast_mul_eq_zsmul (x : ℝ) (n : β„€) : ↑((n : ℝ) * x : ℝ) = n β€’ (↑x : Angle) := by simpa only [zsmul_eq_mul] using coeHom.map_zsmul x n #align real.angle.coe_int_mul_eq_zsmul Real.Angle.intCast_mul_eq_zsmul @[deprecated (since := "2024-05-25")] alias coe_nat_mul_eq_nsmul := natCast_mul_eq_nsmul @[deprecated (since := "2024-05-25")] alias coe_int_mul_eq_zsmul := intCast_mul_eq_zsmul theorem angle_eq_iff_two_pi_dvd_sub {ψ ΞΈ : ℝ} : (ΞΈ : Angle) = ψ ↔ βˆƒ k : β„€, ΞΈ - ψ = 2 * Ο€ * k := by simp only [QuotientAddGroup.eq, AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] -- Porting note: added `rw`, `simp [Angle.coe, QuotientAddGroup.eq]` doesn't fire otherwise rw [Angle.coe, Angle.coe, QuotientAddGroup.eq] simp only [AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] #align real.angle.angle_eq_iff_two_pi_dvd_sub Real.Angle.angle_eq_iff_two_pi_dvd_sub @[simp] theorem coe_two_pi : ↑(2 * Ο€ : ℝ) = (0 : Angle) := angle_eq_iff_two_pi_dvd_sub.2 ⟨1, by rw [sub_zero, Int.cast_one, mul_one]⟩ #align real.angle.coe_two_pi Real.Angle.coe_two_pi @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
134
137
theorem neg_coe_pi : -(Ο€ : Angle) = Ο€ := by
rw [← coe_neg, angle_eq_iff_two_pi_dvd_sub] use -1 simp [two_mul, sub_eq_add_neg]
3
20.085537
1
0.5
6
425
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology.Instances.Sign #align_import analysis.special_functions.trigonometric.angle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" open Real noncomputable section namespace Real -- Porting note: can't derive `NormedAddCommGroup, Inhabited` def Angle : Type := AddCircle (2 * Ο€) #align real.angle Real.Angle namespace Angle -- Porting note (#10754): added due to missing instances due to no deriving instance : NormedAddCommGroup Angle := inferInstanceAs (NormedAddCommGroup (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving instance : Inhabited Angle := inferInstanceAs (Inhabited (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving -- also, without this, a plain `QuotientAddGroup.mk` -- causes coerced terms to be of type `ℝ β§Έ AddSubgroup.zmultiples (2 * Ο€)` @[coe] protected def coe (r : ℝ) : Angle := QuotientAddGroup.mk r instance : Coe ℝ Angle := ⟨Angle.coe⟩ instance : CircularOrder Real.Angle := QuotientAddGroup.circularOrder (hp' := ⟨by norm_num [pi_pos]⟩) @[continuity] theorem continuous_coe : Continuous ((↑) : ℝ β†’ Angle) := continuous_quotient_mk' #align real.angle.continuous_coe Real.Angle.continuous_coe def coeHom : ℝ β†’+ Angle := QuotientAddGroup.mk' _ #align real.angle.coe_hom Real.Angle.coeHom @[simp] theorem coe_coeHom : (coeHom : ℝ β†’ Angle) = ((↑) : ℝ β†’ Angle) := rfl #align real.angle.coe_coe_hom Real.Angle.coe_coeHom @[elab_as_elim] protected theorem induction_on {p : Angle β†’ Prop} (ΞΈ : Angle) (h : βˆ€ x : ℝ, p x) : p ΞΈ := Quotient.inductionOn' ΞΈ h #align real.angle.induction_on Real.Angle.induction_on @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := rfl #align real.angle.coe_zero Real.Angle.coe_zero @[simp] theorem coe_add (x y : ℝ) : ↑(x + y : ℝ) = (↑x + ↑y : Angle) := rfl #align real.angle.coe_add Real.Angle.coe_add @[simp] theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle) := rfl #align real.angle.coe_neg Real.Angle.coe_neg @[simp] theorem coe_sub (x y : ℝ) : ↑(x - y : ℝ) = (↑x - ↑y : Angle) := rfl #align real.angle.coe_sub Real.Angle.coe_sub theorem coe_nsmul (n : β„•) (x : ℝ) : ↑(n β€’ x : ℝ) = n β€’ (↑x : Angle) := rfl #align real.angle.coe_nsmul Real.Angle.coe_nsmul theorem coe_zsmul (z : β„€) (x : ℝ) : ↑(z β€’ x : ℝ) = z β€’ (↑x : Angle) := rfl #align real.angle.coe_zsmul Real.Angle.coe_zsmul @[simp, norm_cast] theorem natCast_mul_eq_nsmul (x : ℝ) (n : β„•) : ↑((n : ℝ) * x) = n β€’ (↑x : Angle) := by simpa only [nsmul_eq_mul] using coeHom.map_nsmul x n #align real.angle.coe_nat_mul_eq_nsmul Real.Angle.natCast_mul_eq_nsmul @[simp, norm_cast] theorem intCast_mul_eq_zsmul (x : ℝ) (n : β„€) : ↑((n : ℝ) * x : ℝ) = n β€’ (↑x : Angle) := by simpa only [zsmul_eq_mul] using coeHom.map_zsmul x n #align real.angle.coe_int_mul_eq_zsmul Real.Angle.intCast_mul_eq_zsmul @[deprecated (since := "2024-05-25")] alias coe_nat_mul_eq_nsmul := natCast_mul_eq_nsmul @[deprecated (since := "2024-05-25")] alias coe_int_mul_eq_zsmul := intCast_mul_eq_zsmul theorem angle_eq_iff_two_pi_dvd_sub {ψ ΞΈ : ℝ} : (ΞΈ : Angle) = ψ ↔ βˆƒ k : β„€, ΞΈ - ψ = 2 * Ο€ * k := by simp only [QuotientAddGroup.eq, AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] -- Porting note: added `rw`, `simp [Angle.coe, QuotientAddGroup.eq]` doesn't fire otherwise rw [Angle.coe, Angle.coe, QuotientAddGroup.eq] simp only [AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] #align real.angle.angle_eq_iff_two_pi_dvd_sub Real.Angle.angle_eq_iff_two_pi_dvd_sub @[simp] theorem coe_two_pi : ↑(2 * Ο€ : ℝ) = (0 : Angle) := angle_eq_iff_two_pi_dvd_sub.2 ⟨1, by rw [sub_zero, Int.cast_one, mul_one]⟩ #align real.angle.coe_two_pi Real.Angle.coe_two_pi @[simp] theorem neg_coe_pi : -(Ο€ : Angle) = Ο€ := by rw [← coe_neg, angle_eq_iff_two_pi_dvd_sub] use -1 simp [two_mul, sub_eq_add_neg] #align real.angle.neg_coe_pi Real.Angle.neg_coe_pi @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
141
142
theorem two_nsmul_coe_div_two (ΞΈ : ℝ) : (2 : β„•) β€’ (↑(ΞΈ / 2) : Angle) = ΞΈ := by
rw [← coe_nsmul, two_nsmul, add_halves]
1
2.718282
0
0.5
6
425
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic import Mathlib.Analysis.Normed.Group.AddCircle import Mathlib.Algebra.CharZero.Quotient import Mathlib.Topology.Instances.Sign #align_import analysis.special_functions.trigonometric.angle from "leanprover-community/mathlib"@"213b0cff7bc5ab6696ee07cceec80829ce42efec" open Real noncomputable section namespace Real -- Porting note: can't derive `NormedAddCommGroup, Inhabited` def Angle : Type := AddCircle (2 * Ο€) #align real.angle Real.Angle namespace Angle -- Porting note (#10754): added due to missing instances due to no deriving instance : NormedAddCommGroup Angle := inferInstanceAs (NormedAddCommGroup (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving instance : Inhabited Angle := inferInstanceAs (Inhabited (AddCircle (2 * Ο€))) -- Porting note (#10754): added due to missing instances due to no deriving -- also, without this, a plain `QuotientAddGroup.mk` -- causes coerced terms to be of type `ℝ β§Έ AddSubgroup.zmultiples (2 * Ο€)` @[coe] protected def coe (r : ℝ) : Angle := QuotientAddGroup.mk r instance : Coe ℝ Angle := ⟨Angle.coe⟩ instance : CircularOrder Real.Angle := QuotientAddGroup.circularOrder (hp' := ⟨by norm_num [pi_pos]⟩) @[continuity] theorem continuous_coe : Continuous ((↑) : ℝ β†’ Angle) := continuous_quotient_mk' #align real.angle.continuous_coe Real.Angle.continuous_coe def coeHom : ℝ β†’+ Angle := QuotientAddGroup.mk' _ #align real.angle.coe_hom Real.Angle.coeHom @[simp] theorem coe_coeHom : (coeHom : ℝ β†’ Angle) = ((↑) : ℝ β†’ Angle) := rfl #align real.angle.coe_coe_hom Real.Angle.coe_coeHom @[elab_as_elim] protected theorem induction_on {p : Angle β†’ Prop} (ΞΈ : Angle) (h : βˆ€ x : ℝ, p x) : p ΞΈ := Quotient.inductionOn' ΞΈ h #align real.angle.induction_on Real.Angle.induction_on @[simp] theorem coe_zero : ↑(0 : ℝ) = (0 : Angle) := rfl #align real.angle.coe_zero Real.Angle.coe_zero @[simp] theorem coe_add (x y : ℝ) : ↑(x + y : ℝ) = (↑x + ↑y : Angle) := rfl #align real.angle.coe_add Real.Angle.coe_add @[simp] theorem coe_neg (x : ℝ) : ↑(-x : ℝ) = -(↑x : Angle) := rfl #align real.angle.coe_neg Real.Angle.coe_neg @[simp] theorem coe_sub (x y : ℝ) : ↑(x - y : ℝ) = (↑x - ↑y : Angle) := rfl #align real.angle.coe_sub Real.Angle.coe_sub theorem coe_nsmul (n : β„•) (x : ℝ) : ↑(n β€’ x : ℝ) = n β€’ (↑x : Angle) := rfl #align real.angle.coe_nsmul Real.Angle.coe_nsmul theorem coe_zsmul (z : β„€) (x : ℝ) : ↑(z β€’ x : ℝ) = z β€’ (↑x : Angle) := rfl #align real.angle.coe_zsmul Real.Angle.coe_zsmul @[simp, norm_cast] theorem natCast_mul_eq_nsmul (x : ℝ) (n : β„•) : ↑((n : ℝ) * x) = n β€’ (↑x : Angle) := by simpa only [nsmul_eq_mul] using coeHom.map_nsmul x n #align real.angle.coe_nat_mul_eq_nsmul Real.Angle.natCast_mul_eq_nsmul @[simp, norm_cast] theorem intCast_mul_eq_zsmul (x : ℝ) (n : β„€) : ↑((n : ℝ) * x : ℝ) = n β€’ (↑x : Angle) := by simpa only [zsmul_eq_mul] using coeHom.map_zsmul x n #align real.angle.coe_int_mul_eq_zsmul Real.Angle.intCast_mul_eq_zsmul @[deprecated (since := "2024-05-25")] alias coe_nat_mul_eq_nsmul := natCast_mul_eq_nsmul @[deprecated (since := "2024-05-25")] alias coe_int_mul_eq_zsmul := intCast_mul_eq_zsmul theorem angle_eq_iff_two_pi_dvd_sub {ψ ΞΈ : ℝ} : (ΞΈ : Angle) = ψ ↔ βˆƒ k : β„€, ΞΈ - ψ = 2 * Ο€ * k := by simp only [QuotientAddGroup.eq, AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] -- Porting note: added `rw`, `simp [Angle.coe, QuotientAddGroup.eq]` doesn't fire otherwise rw [Angle.coe, Angle.coe, QuotientAddGroup.eq] simp only [AddSubgroup.zmultiples_eq_closure, AddSubgroup.mem_closure_singleton, zsmul_eq_mul', (sub_eq_neg_add _ _).symm, eq_comm] #align real.angle.angle_eq_iff_two_pi_dvd_sub Real.Angle.angle_eq_iff_two_pi_dvd_sub @[simp] theorem coe_two_pi : ↑(2 * Ο€ : ℝ) = (0 : Angle) := angle_eq_iff_two_pi_dvd_sub.2 ⟨1, by rw [sub_zero, Int.cast_one, mul_one]⟩ #align real.angle.coe_two_pi Real.Angle.coe_two_pi @[simp] theorem neg_coe_pi : -(Ο€ : Angle) = Ο€ := by rw [← coe_neg, angle_eq_iff_two_pi_dvd_sub] use -1 simp [two_mul, sub_eq_add_neg] #align real.angle.neg_coe_pi Real.Angle.neg_coe_pi @[simp] theorem two_nsmul_coe_div_two (ΞΈ : ℝ) : (2 : β„•) β€’ (↑(ΞΈ / 2) : Angle) = ΞΈ := by rw [← coe_nsmul, two_nsmul, add_halves] #align real.angle.two_nsmul_coe_div_two Real.Angle.two_nsmul_coe_div_two @[simp]
Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean
146
147
theorem two_zsmul_coe_div_two (ΞΈ : ℝ) : (2 : β„€) β€’ (↑(ΞΈ / 2) : Angle) = ΞΈ := by
rw [← coe_zsmul, two_zsmul, add_halves]
1
2.718282
0
0.5
6
425
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set namespace Nat variable {R : Type*} [AddMonoidWithOne R] [CharZero R] @[simps] def castEmbedding : β„• β†ͺ R := ⟨Nat.cast, cast_injective⟩ #align nat.cast_embedding Nat.castEmbedding #align nat.cast_embedding_apply Nat.castEmbedding_apply @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
39
42
theorem cast_pow_eq_one {R : Type*} [Semiring R] [CharZero R] (q : β„•) (n : β„•) (hn : n β‰  0) : (q : R) ^ n = 1 ↔ q = 1 := by
rw [← cast_pow, cast_eq_one] exact pow_eq_one_iff hn
2
7.389056
1
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set namespace Nat variable {R : Type*} [AddMonoidWithOne R] [CharZero R] @[simps] def castEmbedding : β„• β†ͺ R := ⟨Nat.cast, cast_injective⟩ #align nat.cast_embedding Nat.castEmbedding #align nat.cast_embedding_apply Nat.castEmbedding_apply @[simp] theorem cast_pow_eq_one {R : Type*} [Semiring R] [CharZero R] (q : β„•) (n : β„•) (hn : n β‰  0) : (q : R) ^ n = 1 ↔ q = 1 := by rw [← cast_pow, cast_eq_one] exact pow_eq_one_iff hn #align nat.cast_pow_eq_one Nat.cast_pow_eq_one @[simp, norm_cast]
Mathlib/Algebra/CharZero/Lemmas.lean
46
50
theorem cast_div_charZero {k : Type*} [DivisionSemiring k] [CharZero k] {m n : β„•} (n_dvd : n ∣ m) : ((m / n : β„•) : k) = m / n := by
rcases eq_or_ne n 0 with (rfl | hn) Β· simp Β· exact cast_div n_dvd (cast_ne_zero.2 hn)
3
20.085537
1
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
88
89
theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by
simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff]
1
2.718282
0
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
100
102
theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by
rw [eq_comm] exact bit0_eq_zero
2
7.389056
1
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff
Mathlib/Algebra/CharZero/Lemmas.lean
127
129
theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by
rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h
2
7.389056
1
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj
Mathlib/Algebra/CharZero/Lemmas.lean
132
133
theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by
simpa [w] using nat_mul_inj h
1
2.718282
0
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by simpa [w] using nat_mul_inj h #align nat_mul_inj' nat_mul_inj' set_option linter.deprecated false theorem bit0_injective : Function.Injective (bit0 : R β†’ R) := fun a b h => by dsimp [bit0] at h simp only [(two_mul a).symm, (two_mul b).symm] at h refine nat_mul_inj' ?_ two_ne_zero exact mod_cast h #align bit0_injective bit0_injective theorem bit1_injective : Function.Injective (bit1 : R β†’ R) := fun a b h => by simp only [bit1, add_left_inj] at h exact bit0_injective h #align bit1_injective bit1_injective @[simp] theorem bit0_eq_bit0 {a b : R} : bit0 a = bit0 b ↔ a = b := bit0_injective.eq_iff #align bit0_eq_bit0 bit0_eq_bit0 @[simp] theorem bit1_eq_bit1 {a b : R} : bit1 a = bit1 b ↔ a = b := bit1_injective.eq_iff #align bit1_eq_bit1 bit1_eq_bit1 @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
161
162
theorem bit1_eq_one {a : R} : bit1 a = 1 ↔ a = 0 := by
rw [show (1 : R) = bit1 0 by simp, bit1_eq_bit1]
1
2.718282
0
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by simpa [w] using nat_mul_inj h #align nat_mul_inj' nat_mul_inj' set_option linter.deprecated false theorem bit0_injective : Function.Injective (bit0 : R β†’ R) := fun a b h => by dsimp [bit0] at h simp only [(two_mul a).symm, (two_mul b).symm] at h refine nat_mul_inj' ?_ two_ne_zero exact mod_cast h #align bit0_injective bit0_injective theorem bit1_injective : Function.Injective (bit1 : R β†’ R) := fun a b h => by simp only [bit1, add_left_inj] at h exact bit0_injective h #align bit1_injective bit1_injective @[simp] theorem bit0_eq_bit0 {a b : R} : bit0 a = bit0 b ↔ a = b := bit0_injective.eq_iff #align bit0_eq_bit0 bit0_eq_bit0 @[simp] theorem bit1_eq_bit1 {a b : R} : bit1 a = bit1 b ↔ a = b := bit1_injective.eq_iff #align bit1_eq_bit1 bit1_eq_bit1 @[simp] theorem bit1_eq_one {a : R} : bit1 a = 1 ↔ a = 0 := by rw [show (1 : R) = bit1 0 by simp, bit1_eq_bit1] #align bit1_eq_one bit1_eq_one @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
166
168
theorem one_eq_bit1 {a : R} : 1 = bit1 a ↔ a = 0 := by
rw [eq_comm] exact bit1_eq_one
2
7.389056
1
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by simpa [w] using nat_mul_inj h #align nat_mul_inj' nat_mul_inj' set_option linter.deprecated false theorem bit0_injective : Function.Injective (bit0 : R β†’ R) := fun a b h => by dsimp [bit0] at h simp only [(two_mul a).symm, (two_mul b).symm] at h refine nat_mul_inj' ?_ two_ne_zero exact mod_cast h #align bit0_injective bit0_injective theorem bit1_injective : Function.Injective (bit1 : R β†’ R) := fun a b h => by simp only [bit1, add_left_inj] at h exact bit0_injective h #align bit1_injective bit1_injective @[simp] theorem bit0_eq_bit0 {a b : R} : bit0 a = bit0 b ↔ a = b := bit0_injective.eq_iff #align bit0_eq_bit0 bit0_eq_bit0 @[simp] theorem bit1_eq_bit1 {a b : R} : bit1 a = bit1 b ↔ a = b := bit1_injective.eq_iff #align bit1_eq_bit1 bit1_eq_bit1 @[simp] theorem bit1_eq_one {a : R} : bit1 a = 1 ↔ a = 0 := by rw [show (1 : R) = bit1 0 by simp, bit1_eq_bit1] #align bit1_eq_one bit1_eq_one @[simp] theorem one_eq_bit1 {a : R} : 1 = bit1 a ↔ a = 0 := by rw [eq_comm] exact bit1_eq_one #align one_eq_bit1 one_eq_bit1 end section variable {R : Type*} [DivisionRing R] [CharZero R] @[simp] lemma half_add_self (a : R) : (a + a) / 2 = a := by rw [← mul_two, mul_div_cancel_rightβ‚€ a two_ne_zero] #align half_add_self half_add_self @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
182
182
theorem add_halves' (a : R) : a / 2 + a / 2 = a := by
rw [← add_div, half_add_self]
1
2.718282
0
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by simpa [w] using nat_mul_inj h #align nat_mul_inj' nat_mul_inj' set_option linter.deprecated false theorem bit0_injective : Function.Injective (bit0 : R β†’ R) := fun a b h => by dsimp [bit0] at h simp only [(two_mul a).symm, (two_mul b).symm] at h refine nat_mul_inj' ?_ two_ne_zero exact mod_cast h #align bit0_injective bit0_injective theorem bit1_injective : Function.Injective (bit1 : R β†’ R) := fun a b h => by simp only [bit1, add_left_inj] at h exact bit0_injective h #align bit1_injective bit1_injective @[simp] theorem bit0_eq_bit0 {a b : R} : bit0 a = bit0 b ↔ a = b := bit0_injective.eq_iff #align bit0_eq_bit0 bit0_eq_bit0 @[simp] theorem bit1_eq_bit1 {a b : R} : bit1 a = bit1 b ↔ a = b := bit1_injective.eq_iff #align bit1_eq_bit1 bit1_eq_bit1 @[simp] theorem bit1_eq_one {a : R} : bit1 a = 1 ↔ a = 0 := by rw [show (1 : R) = bit1 0 by simp, bit1_eq_bit1] #align bit1_eq_one bit1_eq_one @[simp] theorem one_eq_bit1 {a : R} : 1 = bit1 a ↔ a = 0 := by rw [eq_comm] exact bit1_eq_one #align one_eq_bit1 one_eq_bit1 end section variable {R : Type*} [DivisionRing R] [CharZero R] @[simp] lemma half_add_self (a : R) : (a + a) / 2 = a := by rw [← mul_two, mul_div_cancel_rightβ‚€ a two_ne_zero] #align half_add_self half_add_self @[simp] theorem add_halves' (a : R) : a / 2 + a / 2 = a := by rw [← add_div, half_add_self] #align add_halves' add_halves'
Mathlib/Algebra/CharZero/Lemmas.lean
185
185
theorem sub_half (a : R) : a - a / 2 = a / 2 := by
rw [sub_eq_iff_eq_add, add_halves']
1
2.718282
0
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by simpa [w] using nat_mul_inj h #align nat_mul_inj' nat_mul_inj' set_option linter.deprecated false theorem bit0_injective : Function.Injective (bit0 : R β†’ R) := fun a b h => by dsimp [bit0] at h simp only [(two_mul a).symm, (two_mul b).symm] at h refine nat_mul_inj' ?_ two_ne_zero exact mod_cast h #align bit0_injective bit0_injective theorem bit1_injective : Function.Injective (bit1 : R β†’ R) := fun a b h => by simp only [bit1, add_left_inj] at h exact bit0_injective h #align bit1_injective bit1_injective @[simp] theorem bit0_eq_bit0 {a b : R} : bit0 a = bit0 b ↔ a = b := bit0_injective.eq_iff #align bit0_eq_bit0 bit0_eq_bit0 @[simp] theorem bit1_eq_bit1 {a b : R} : bit1 a = bit1 b ↔ a = b := bit1_injective.eq_iff #align bit1_eq_bit1 bit1_eq_bit1 @[simp] theorem bit1_eq_one {a : R} : bit1 a = 1 ↔ a = 0 := by rw [show (1 : R) = bit1 0 by simp, bit1_eq_bit1] #align bit1_eq_one bit1_eq_one @[simp] theorem one_eq_bit1 {a : R} : 1 = bit1 a ↔ a = 0 := by rw [eq_comm] exact bit1_eq_one #align one_eq_bit1 one_eq_bit1 end section variable {R : Type*} [DivisionRing R] [CharZero R] @[simp] lemma half_add_self (a : R) : (a + a) / 2 = a := by rw [← mul_two, mul_div_cancel_rightβ‚€ a two_ne_zero] #align half_add_self half_add_self @[simp] theorem add_halves' (a : R) : a / 2 + a / 2 = a := by rw [← add_div, half_add_self] #align add_halves' add_halves' theorem sub_half (a : R) : a - a / 2 = a / 2 := by rw [sub_eq_iff_eq_add, add_halves'] #align sub_half sub_half
Mathlib/Algebra/CharZero/Lemmas.lean
188
188
theorem half_sub (a : R) : a / 2 - a = -(a / 2) := by
rw [← neg_sub, sub_half]
1
2.718282
0
0.5
12
426
import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Order.Monoid.WithTop import Mathlib.Data.Nat.Cast.Field #align_import algebra.char_zero.lemmas from "leanprover-community/mathlib"@"acee671f47b8e7972a1eb6f4eed74b4b3abce829" open Function Set section AddMonoidWithOne variable {Ξ± M : Type*} [AddMonoidWithOne M] [CharZero M] {n : β„•} instance CharZero.NeZero.two : NeZero (2 : M) := ⟨by have : ((2 : β„•) : M) β‰  0 := Nat.cast_ne_zero.2 (by decide) rwa [Nat.cast_two] at this⟩ #align char_zero.ne_zero.two CharZero.NeZero.two section variable {R : Type*} [NonAssocSemiring R] [NoZeroDivisors R] [CharZero R] {a : R} @[simp] theorem add_self_eq_zero {a : R} : a + a = 0 ↔ a = 0 := by simp only [(two_mul a).symm, mul_eq_zero, two_ne_zero, false_or_iff] #align add_self_eq_zero add_self_eq_zero set_option linter.deprecated false @[simp] theorem bit0_eq_zero {a : R} : bit0 a = 0 ↔ a = 0 := add_self_eq_zero #align bit0_eq_zero bit0_eq_zero @[simp] theorem zero_eq_bit0 {a : R} : 0 = bit0 a ↔ a = 0 := by rw [eq_comm] exact bit0_eq_zero #align zero_eq_bit0 zero_eq_bit0 theorem bit0_ne_zero : bit0 a β‰  0 ↔ a β‰  0 := bit0_eq_zero.not #align bit0_ne_zero bit0_ne_zero theorem zero_ne_bit0 : 0 β‰  bit0 a ↔ a β‰  0 := zero_eq_bit0.not #align zero_ne_bit0 zero_ne_bit0 end section variable {R : Type*} [NonAssocRing R] [NoZeroDivisors R] [CharZero R] @[simp] theorem neg_eq_self_iff {a : R} : -a = a ↔ a = 0 := neg_eq_iff_add_eq_zero.trans add_self_eq_zero #align neg_eq_self_iff neg_eq_self_iff @[simp] theorem eq_neg_self_iff {a : R} : a = -a ↔ a = 0 := eq_neg_iff_add_eq_zero.trans add_self_eq_zero #align eq_neg_self_iff eq_neg_self_iff theorem nat_mul_inj {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) : n = 0 ∨ a = b := by rw [← sub_eq_zero, ← mul_sub, mul_eq_zero, sub_eq_zero] at h exact mod_cast h #align nat_mul_inj nat_mul_inj theorem nat_mul_inj' {n : β„•} {a b : R} (h : (n : R) * a = (n : R) * b) (w : n β‰  0) : a = b := by simpa [w] using nat_mul_inj h #align nat_mul_inj' nat_mul_inj' set_option linter.deprecated false theorem bit0_injective : Function.Injective (bit0 : R β†’ R) := fun a b h => by dsimp [bit0] at h simp only [(two_mul a).symm, (two_mul b).symm] at h refine nat_mul_inj' ?_ two_ne_zero exact mod_cast h #align bit0_injective bit0_injective theorem bit1_injective : Function.Injective (bit1 : R β†’ R) := fun a b h => by simp only [bit1, add_left_inj] at h exact bit0_injective h #align bit1_injective bit1_injective @[simp] theorem bit0_eq_bit0 {a b : R} : bit0 a = bit0 b ↔ a = b := bit0_injective.eq_iff #align bit0_eq_bit0 bit0_eq_bit0 @[simp] theorem bit1_eq_bit1 {a b : R} : bit1 a = bit1 b ↔ a = b := bit1_injective.eq_iff #align bit1_eq_bit1 bit1_eq_bit1 @[simp] theorem bit1_eq_one {a : R} : bit1 a = 1 ↔ a = 0 := by rw [show (1 : R) = bit1 0 by simp, bit1_eq_bit1] #align bit1_eq_one bit1_eq_one @[simp] theorem one_eq_bit1 {a : R} : 1 = bit1 a ↔ a = 0 := by rw [eq_comm] exact bit1_eq_one #align one_eq_bit1 one_eq_bit1 end section variable {R : Type*} [DivisionRing R] [CharZero R] @[simp] lemma half_add_self (a : R) : (a + a) / 2 = a := by rw [← mul_two, mul_div_cancel_rightβ‚€ a two_ne_zero] #align half_add_self half_add_self @[simp] theorem add_halves' (a : R) : a / 2 + a / 2 = a := by rw [← add_div, half_add_self] #align add_halves' add_halves' theorem sub_half (a : R) : a - a / 2 = a / 2 := by rw [sub_eq_iff_eq_add, add_halves'] #align sub_half sub_half theorem half_sub (a : R) : a / 2 - a = -(a / 2) := by rw [← neg_sub, sub_half] #align half_sub half_sub end section Units variable {R : Type*} [Ring R] [CharZero R] @[simp]
Mathlib/Algebra/CharZero/Lemmas.lean
236
238
theorem units_ne_neg_self (u : RΛ£) : u β‰  -u := by
simp_rw [ne_eq, Units.ext_iff, Units.val_neg, eq_neg_iff_add_eq_zero, ← two_mul, Units.mul_left_eq_zero, two_ne_zero, not_false_iff]
2
7.389056
1
0.5
12
426
import Mathlib.Algebra.Group.Center #align_import group_theory.subsemigroup.centralizer from "leanprover-community/mathlib"@"cc67cd75b4e54191e13c2e8d722289a89e67e4fa" variable {M : Type*} {S T : Set M} namespace Set variable (S) @[to_additive addCentralizer " The centralizer of a subset of an additive magma. "] def centralizer [Mul M] : Set M := { c | βˆ€ m ∈ S, m * c = c * m } #align set.centralizer Set.centralizer #align set.add_centralizer Set.addCentralizer variable {S} @[to_additive mem_addCentralizer] theorem mem_centralizer_iff [Mul M] {c : M} : c ∈ centralizer S ↔ βˆ€ m ∈ S, m * c = c * m := Iff.rfl #align set.mem_centralizer_iff Set.mem_centralizer_iff #align set.mem_add_centralizer Set.mem_addCentralizer @[to_additive decidableMemAddCentralizer] instance decidableMemCentralizer [Mul M] [βˆ€ a : M, Decidable <| βˆ€ b ∈ S, b * a = a * b] : DecidablePred (Β· ∈ centralizer S) := fun _ => decidable_of_iff' _ mem_centralizer_iff #align set.decidable_mem_centralizer Set.decidableMemCentralizer #align set.decidable_mem_add_centralizer Set.decidableMemAddCentralizer variable (S) @[to_additive (attr := simp) zero_mem_addCentralizer]
Mathlib/Algebra/Group/Centralizer.lean
58
59
theorem one_mem_centralizer [MulOneClass M] : (1 : M) ∈ centralizer S := by
simp [mem_centralizer_iff]
1
2.718282
0
0.5
4
427
import Mathlib.Algebra.Group.Center #align_import group_theory.subsemigroup.centralizer from "leanprover-community/mathlib"@"cc67cd75b4e54191e13c2e8d722289a89e67e4fa" variable {M : Type*} {S T : Set M} namespace Set variable (S) @[to_additive addCentralizer " The centralizer of a subset of an additive magma. "] def centralizer [Mul M] : Set M := { c | βˆ€ m ∈ S, m * c = c * m } #align set.centralizer Set.centralizer #align set.add_centralizer Set.addCentralizer variable {S} @[to_additive mem_addCentralizer] theorem mem_centralizer_iff [Mul M] {c : M} : c ∈ centralizer S ↔ βˆ€ m ∈ S, m * c = c * m := Iff.rfl #align set.mem_centralizer_iff Set.mem_centralizer_iff #align set.mem_add_centralizer Set.mem_addCentralizer @[to_additive decidableMemAddCentralizer] instance decidableMemCentralizer [Mul M] [βˆ€ a : M, Decidable <| βˆ€ b ∈ S, b * a = a * b] : DecidablePred (Β· ∈ centralizer S) := fun _ => decidable_of_iff' _ mem_centralizer_iff #align set.decidable_mem_centralizer Set.decidableMemCentralizer #align set.decidable_mem_add_centralizer Set.decidableMemAddCentralizer variable (S) @[to_additive (attr := simp) zero_mem_addCentralizer] theorem one_mem_centralizer [MulOneClass M] : (1 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.one_mem_centralizer Set.one_mem_centralizer #align set.zero_mem_add_centralizer Set.zero_mem_addCentralizer @[simp]
Mathlib/Algebra/Group/Centralizer.lean
64
65
theorem zero_mem_centralizer [MulZeroClass M] : (0 : M) ∈ centralizer S := by
simp [mem_centralizer_iff]
1
2.718282
0
0.5
4
427
import Mathlib.Algebra.Group.Center #align_import group_theory.subsemigroup.centralizer from "leanprover-community/mathlib"@"cc67cd75b4e54191e13c2e8d722289a89e67e4fa" variable {M : Type*} {S T : Set M} namespace Set variable (S) @[to_additive addCentralizer " The centralizer of a subset of an additive magma. "] def centralizer [Mul M] : Set M := { c | βˆ€ m ∈ S, m * c = c * m } #align set.centralizer Set.centralizer #align set.add_centralizer Set.addCentralizer variable {S} @[to_additive mem_addCentralizer] theorem mem_centralizer_iff [Mul M] {c : M} : c ∈ centralizer S ↔ βˆ€ m ∈ S, m * c = c * m := Iff.rfl #align set.mem_centralizer_iff Set.mem_centralizer_iff #align set.mem_add_centralizer Set.mem_addCentralizer @[to_additive decidableMemAddCentralizer] instance decidableMemCentralizer [Mul M] [βˆ€ a : M, Decidable <| βˆ€ b ∈ S, b * a = a * b] : DecidablePred (Β· ∈ centralizer S) := fun _ => decidable_of_iff' _ mem_centralizer_iff #align set.decidable_mem_centralizer Set.decidableMemCentralizer #align set.decidable_mem_add_centralizer Set.decidableMemAddCentralizer variable (S) @[to_additive (attr := simp) zero_mem_addCentralizer] theorem one_mem_centralizer [MulOneClass M] : (1 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.one_mem_centralizer Set.one_mem_centralizer #align set.zero_mem_add_centralizer Set.zero_mem_addCentralizer @[simp] theorem zero_mem_centralizer [MulZeroClass M] : (0 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.zero_mem_centralizer Set.zero_mem_centralizer variable {S} {a b : M} @[to_additive (attr := simp) add_mem_addCentralizer] theorem mul_mem_centralizer [Semigroup M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a * b ∈ centralizer S := fun g hg => by rw [mul_assoc, ← hb g hg, ← mul_assoc, ha g hg, mul_assoc] #align set.mul_mem_centralizer Set.mul_mem_centralizer #align set.add_mem_add_centralizer Set.add_mem_addCentralizer @[to_additive (attr := simp) neg_mem_addCentralizer] theorem inv_mem_centralizer [Group M] (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S := fun g hg => by rw [mul_inv_eq_iff_eq_mul, mul_assoc, eq_inv_mul_iff_mul_eq, ha g hg] #align set.inv_mem_centralizer Set.inv_mem_centralizer #align set.neg_mem_add_centralizer Set.neg_mem_addCentralizer @[simp] theorem inv_mem_centralizerβ‚€ [GroupWithZero M] (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S := (eq_or_ne a 0).elim (fun h => by rw [h, inv_zero] exact zero_mem_centralizer S) fun ha0 c hc => by rw [mul_inv_eq_iff_eq_mulβ‚€ ha0, mul_assoc, eq_inv_mul_iff_mul_eqβ‚€ ha0, ha c hc] #align set.inv_mem_centralizerβ‚€ Set.inv_mem_centralizerβ‚€ @[to_additive (attr := simp) sub_mem_addCentralizer]
Mathlib/Algebra/Group/Centralizer.lean
94
97
theorem div_mem_centralizer [Group M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a / b ∈ centralizer S := by
rw [div_eq_mul_inv] exact mul_mem_centralizer ha (inv_mem_centralizer hb)
2
7.389056
1
0.5
4
427
import Mathlib.Algebra.Group.Center #align_import group_theory.subsemigroup.centralizer from "leanprover-community/mathlib"@"cc67cd75b4e54191e13c2e8d722289a89e67e4fa" variable {M : Type*} {S T : Set M} namespace Set variable (S) @[to_additive addCentralizer " The centralizer of a subset of an additive magma. "] def centralizer [Mul M] : Set M := { c | βˆ€ m ∈ S, m * c = c * m } #align set.centralizer Set.centralizer #align set.add_centralizer Set.addCentralizer variable {S} @[to_additive mem_addCentralizer] theorem mem_centralizer_iff [Mul M] {c : M} : c ∈ centralizer S ↔ βˆ€ m ∈ S, m * c = c * m := Iff.rfl #align set.mem_centralizer_iff Set.mem_centralizer_iff #align set.mem_add_centralizer Set.mem_addCentralizer @[to_additive decidableMemAddCentralizer] instance decidableMemCentralizer [Mul M] [βˆ€ a : M, Decidable <| βˆ€ b ∈ S, b * a = a * b] : DecidablePred (Β· ∈ centralizer S) := fun _ => decidable_of_iff' _ mem_centralizer_iff #align set.decidable_mem_centralizer Set.decidableMemCentralizer #align set.decidable_mem_add_centralizer Set.decidableMemAddCentralizer variable (S) @[to_additive (attr := simp) zero_mem_addCentralizer] theorem one_mem_centralizer [MulOneClass M] : (1 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.one_mem_centralizer Set.one_mem_centralizer #align set.zero_mem_add_centralizer Set.zero_mem_addCentralizer @[simp] theorem zero_mem_centralizer [MulZeroClass M] : (0 : M) ∈ centralizer S := by simp [mem_centralizer_iff] #align set.zero_mem_centralizer Set.zero_mem_centralizer variable {S} {a b : M} @[to_additive (attr := simp) add_mem_addCentralizer] theorem mul_mem_centralizer [Semigroup M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a * b ∈ centralizer S := fun g hg => by rw [mul_assoc, ← hb g hg, ← mul_assoc, ha g hg, mul_assoc] #align set.mul_mem_centralizer Set.mul_mem_centralizer #align set.add_mem_add_centralizer Set.add_mem_addCentralizer @[to_additive (attr := simp) neg_mem_addCentralizer] theorem inv_mem_centralizer [Group M] (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S := fun g hg => by rw [mul_inv_eq_iff_eq_mul, mul_assoc, eq_inv_mul_iff_mul_eq, ha g hg] #align set.inv_mem_centralizer Set.inv_mem_centralizer #align set.neg_mem_add_centralizer Set.neg_mem_addCentralizer @[simp] theorem inv_mem_centralizerβ‚€ [GroupWithZero M] (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S := (eq_or_ne a 0).elim (fun h => by rw [h, inv_zero] exact zero_mem_centralizer S) fun ha0 c hc => by rw [mul_inv_eq_iff_eq_mulβ‚€ ha0, mul_assoc, eq_inv_mul_iff_mul_eqβ‚€ ha0, ha c hc] #align set.inv_mem_centralizerβ‚€ Set.inv_mem_centralizerβ‚€ @[to_additive (attr := simp) sub_mem_addCentralizer] theorem div_mem_centralizer [Group M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a / b ∈ centralizer S := by rw [div_eq_mul_inv] exact mul_mem_centralizer ha (inv_mem_centralizer hb) #align set.div_mem_centralizer Set.div_mem_centralizer #align set.sub_mem_add_centralizer Set.sub_mem_addCentralizer @[simp]
Mathlib/Algebra/Group/Centralizer.lean
102
105
theorem div_mem_centralizerβ‚€ [GroupWithZero M] (ha : a ∈ centralizer S) (hb : b ∈ centralizer S) : a / b ∈ centralizer S := by
rw [div_eq_mul_inv] exact mul_mem_centralizer ha (inv_mem_centralizerβ‚€ hb)
2
7.389056
1
0.5
4
427
import Mathlib.MeasureTheory.MeasurableSpace.Defs open Set Function open scoped MeasureTheory namespace MeasurableSpace variable {Ξ± : Type*} def invariants [m : MeasurableSpace Ξ±] (f : Ξ± β†’ Ξ±) : MeasurableSpace Ξ± := { m βŠ“ ⟨fun s ↦ f ⁻¹' s = s, by simp, by simp, fun f hf ↦ by simp [hf]⟩ with MeasurableSet' := fun s ↦ MeasurableSet[m] s ∧ f ⁻¹' s = s } variable [MeasurableSpace Ξ±] theorem measurableSet_invariants {f : Ξ± β†’ Ξ±} {s : Set Ξ±} : MeasurableSet[invariants f] s ↔ MeasurableSet s ∧ f ⁻¹' s = s := .rfl @[simp] theorem invariants_id : invariants (id : Ξ± β†’ Ξ±) = β€ΉMeasurableSpace Ξ±β€Ί := ext fun _ ↦ ⟨And.left, fun h ↦ ⟨h, rfl⟩⟩ theorem invariants_le (f : Ξ± β†’ Ξ±) : invariants f ≀ β€ΉMeasurableSpace Ξ±β€Ί := fun _ ↦ And.left theorem inf_le_invariants_comp (f g : Ξ± β†’ Ξ±) : invariants f βŠ“ invariants g ≀ invariants (f ∘ g) := fun s hs ↦ ⟨hs.1.1, by rw [preimage_comp, hs.1.2, hs.2.2]⟩
Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean
50
54
theorem le_invariants_iterate (f : Ξ± β†’ Ξ±) (n : β„•) : invariants f ≀ invariants (f^[n]) := by
induction n with | zero => simp [invariants_le] | succ n ihn => exact le_trans (le_inf ihn le_rfl) (inf_le_invariants_comp _ _)
3
20.085537
1
0.5
2
428
import Mathlib.MeasureTheory.MeasurableSpace.Defs open Set Function open scoped MeasureTheory namespace MeasurableSpace variable {Ξ± : Type*} def invariants [m : MeasurableSpace Ξ±] (f : Ξ± β†’ Ξ±) : MeasurableSpace Ξ± := { m βŠ“ ⟨fun s ↦ f ⁻¹' s = s, by simp, by simp, fun f hf ↦ by simp [hf]⟩ with MeasurableSet' := fun s ↦ MeasurableSet[m] s ∧ f ⁻¹' s = s } variable [MeasurableSpace Ξ±] theorem measurableSet_invariants {f : Ξ± β†’ Ξ±} {s : Set Ξ±} : MeasurableSet[invariants f] s ↔ MeasurableSet s ∧ f ⁻¹' s = s := .rfl @[simp] theorem invariants_id : invariants (id : Ξ± β†’ Ξ±) = β€ΉMeasurableSpace Ξ±β€Ί := ext fun _ ↦ ⟨And.left, fun h ↦ ⟨h, rfl⟩⟩ theorem invariants_le (f : Ξ± β†’ Ξ±) : invariants f ≀ β€ΉMeasurableSpace Ξ±β€Ί := fun _ ↦ And.left theorem inf_le_invariants_comp (f g : Ξ± β†’ Ξ±) : invariants f βŠ“ invariants g ≀ invariants (f ∘ g) := fun s hs ↦ ⟨hs.1.1, by rw [preimage_comp, hs.1.2, hs.2.2]⟩ theorem le_invariants_iterate (f : Ξ± β†’ Ξ±) (n : β„•) : invariants f ≀ invariants (f^[n]) := by induction n with | zero => simp [invariants_le] | succ n ihn => exact le_trans (le_inf ihn le_rfl) (inf_le_invariants_comp _ _) variable {Ξ² : Type*} [MeasurableSpace Ξ²]
Mathlib/MeasureTheory/MeasurableSpace/Invariants.lean
58
60
theorem measurable_invariants_dom {f : Ξ± β†’ Ξ±} {g : Ξ± β†’ Ξ²} : Measurable[invariants f] g ↔ Measurable g ∧ βˆ€ s, MeasurableSet s β†’ (g ∘ f) ⁻¹' s = g ⁻¹' s := by
simp only [Measurable, ← forall_and]; rfl
1
2.718282
0
0.5
2
428
import Mathlib.Algebra.FreeMonoid.Basic #align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"a2d2e18906e2b62627646b5d5be856e6a642062f" variable {Ξ± : Type*} (p : Ξ± β†’ Prop) [DecidablePred p] namespace FreeAddMonoid def countP : FreeAddMonoid Ξ± β†’+ β„• where toFun := List.countP p map_zero' := List.countP_nil _ map_add' := List.countP_append _ #align free_add_monoid.countp FreeAddMonoid.countP
Mathlib/Algebra/FreeMonoid/Count.lean
31
32
theorem countP_of (x : Ξ±) : countP p (of x) = if p x = true then 1 else 0 := by
simp [countP, List.countP, List.countP.go]
1
2.718282
0
0.5
2
429
import Mathlib.Algebra.FreeMonoid.Basic #align_import algebra.free_monoid.count from "leanprover-community/mathlib"@"a2d2e18906e2b62627646b5d5be856e6a642062f" variable {Ξ± : Type*} (p : Ξ± β†’ Prop) [DecidablePred p] namespace FreeAddMonoid def countP : FreeAddMonoid Ξ± β†’+ β„• where toFun := List.countP p map_zero' := List.countP_nil _ map_add' := List.countP_append _ #align free_add_monoid.countp FreeAddMonoid.countP theorem countP_of (x : Ξ±) : countP p (of x) = if p x = true then 1 else 0 := by simp [countP, List.countP, List.countP.go] #align free_add_monoid.countp_of FreeAddMonoid.countP_of theorem countP_apply (l : FreeAddMonoid Ξ±) : countP p l = List.countP p l := rfl #align free_add_monoid.countp_apply FreeAddMonoid.countP_apply -- Porting note: was (x = Β·) def count [DecidableEq Ξ±] (x : Ξ±) : FreeAddMonoid Ξ± β†’+ β„• := countP (Β· = x) #align free_add_monoid.count FreeAddMonoid.count
Mathlib/Algebra/FreeMonoid/Count.lean
43
45
theorem count_of [DecidableEq Ξ±] (x y : Ξ±) : count x (of y) = (Pi.single x 1 : Ξ± β†’ β„•) y := by
simp [Pi.single, Function.update, count, countP, List.countP, List.countP.go, Bool.beq_eq_decide_eq]
2
7.389056
1
0.5
2
429
import Mathlib.Topology.Algebra.Constructions import Mathlib.Topology.Bases import Mathlib.Topology.UniformSpace.Basic #align_import topology.uniform_space.cauchy from "leanprover-community/mathlib"@"22131150f88a2d125713ffa0f4693e3355b1eb49" universe u v open scoped Classical open Filter TopologicalSpace Set UniformSpace Function open scoped Classical open Uniformity Topology Filter variable {Ξ± : Type u} {Ξ² : Type v} [uniformSpace : UniformSpace Ξ±] def Cauchy (f : Filter Ξ±) := NeBot f ∧ f Γ—Λ’ f ≀ 𝓀 Ξ± #align cauchy Cauchy def IsComplete (s : Set Ξ±) := βˆ€ f, Cauchy f β†’ f ≀ π“Ÿ s β†’ βˆƒ x ∈ s, f ≀ 𝓝 x #align is_complete IsComplete theorem Filter.HasBasis.cauchy_iff {ΞΉ} {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set (Ξ± Γ— Ξ±)} (h : (𝓀 Ξ±).HasBasis p s) {f : Filter Ξ±} : Cauchy f ↔ NeBot f ∧ βˆ€ i, p i β†’ βˆƒ t ∈ f, βˆ€ x ∈ t, βˆ€ y ∈ t, (x, y) ∈ s i := and_congr Iff.rfl <| (f.basis_sets.prod_self.le_basis_iff h).trans <| by simp only [subset_def, Prod.forall, mem_prod_eq, and_imp, id, forall_mem_comm] #align filter.has_basis.cauchy_iff Filter.HasBasis.cauchy_iff theorem cauchy_iff' {f : Filter Ξ±} : Cauchy f ↔ NeBot f ∧ βˆ€ s ∈ 𝓀 Ξ±, βˆƒ t ∈ f, βˆ€ x ∈ t, βˆ€ y ∈ t, (x, y) ∈ s := (𝓀 Ξ±).basis_sets.cauchy_iff #align cauchy_iff' cauchy_iff' theorem cauchy_iff {f : Filter Ξ±} : Cauchy f ↔ NeBot f ∧ βˆ€ s ∈ 𝓀 Ξ±, βˆƒ t ∈ f, t Γ—Λ’ t βŠ† s := cauchy_iff'.trans <| by simp only [subset_def, Prod.forall, mem_prod_eq, and_imp, id, forall_mem_comm] #align cauchy_iff cauchy_iff lemma cauchy_iff_le {l : Filter Ξ±} [hl : l.NeBot] : Cauchy l ↔ l Γ—Λ’ l ≀ 𝓀 Ξ± := by simp only [Cauchy, hl, true_and]
Mathlib/Topology/UniformSpace/Cauchy.lean
63
67
theorem Cauchy.ultrafilter_of {l : Filter Ξ±} (h : Cauchy l) : Cauchy (@Ultrafilter.of _ l h.1 : Filter Ξ±) := by
haveI := h.1 have := Ultrafilter.of_le l exact ⟨Ultrafilter.neBot _, (Filter.prod_mono this this).trans h.2⟩
3
20.085537
1
0.5
2
430
import Mathlib.Topology.Algebra.Constructions import Mathlib.Topology.Bases import Mathlib.Topology.UniformSpace.Basic #align_import topology.uniform_space.cauchy from "leanprover-community/mathlib"@"22131150f88a2d125713ffa0f4693e3355b1eb49" universe u v open scoped Classical open Filter TopologicalSpace Set UniformSpace Function open scoped Classical open Uniformity Topology Filter variable {Ξ± : Type u} {Ξ² : Type v} [uniformSpace : UniformSpace Ξ±] def Cauchy (f : Filter Ξ±) := NeBot f ∧ f Γ—Λ’ f ≀ 𝓀 Ξ± #align cauchy Cauchy def IsComplete (s : Set Ξ±) := βˆ€ f, Cauchy f β†’ f ≀ π“Ÿ s β†’ βˆƒ x ∈ s, f ≀ 𝓝 x #align is_complete IsComplete theorem Filter.HasBasis.cauchy_iff {ΞΉ} {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set (Ξ± Γ— Ξ±)} (h : (𝓀 Ξ±).HasBasis p s) {f : Filter Ξ±} : Cauchy f ↔ NeBot f ∧ βˆ€ i, p i β†’ βˆƒ t ∈ f, βˆ€ x ∈ t, βˆ€ y ∈ t, (x, y) ∈ s i := and_congr Iff.rfl <| (f.basis_sets.prod_self.le_basis_iff h).trans <| by simp only [subset_def, Prod.forall, mem_prod_eq, and_imp, id, forall_mem_comm] #align filter.has_basis.cauchy_iff Filter.HasBasis.cauchy_iff theorem cauchy_iff' {f : Filter Ξ±} : Cauchy f ↔ NeBot f ∧ βˆ€ s ∈ 𝓀 Ξ±, βˆƒ t ∈ f, βˆ€ x ∈ t, βˆ€ y ∈ t, (x, y) ∈ s := (𝓀 Ξ±).basis_sets.cauchy_iff #align cauchy_iff' cauchy_iff' theorem cauchy_iff {f : Filter Ξ±} : Cauchy f ↔ NeBot f ∧ βˆ€ s ∈ 𝓀 Ξ±, βˆƒ t ∈ f, t Γ—Λ’ t βŠ† s := cauchy_iff'.trans <| by simp only [subset_def, Prod.forall, mem_prod_eq, and_imp, id, forall_mem_comm] #align cauchy_iff cauchy_iff lemma cauchy_iff_le {l : Filter Ξ±} [hl : l.NeBot] : Cauchy l ↔ l Γ—Λ’ l ≀ 𝓀 Ξ± := by simp only [Cauchy, hl, true_and] theorem Cauchy.ultrafilter_of {l : Filter Ξ±} (h : Cauchy l) : Cauchy (@Ultrafilter.of _ l h.1 : Filter Ξ±) := by haveI := h.1 have := Ultrafilter.of_le l exact ⟨Ultrafilter.neBot _, (Filter.prod_mono this this).trans h.2⟩ #align cauchy.ultrafilter_of Cauchy.ultrafilter_of
Mathlib/Topology/UniformSpace/Cauchy.lean
70
72
theorem cauchy_map_iff {l : Filter Ξ²} {f : Ξ² β†’ Ξ±} : Cauchy (l.map f) ↔ NeBot l ∧ Tendsto (fun p : Ξ² Γ— Ξ² => (f p.1, f p.2)) (l Γ—Λ’ l) (𝓀 Ξ±) := by
rw [Cauchy, map_neBot_iff, prod_map_map_eq, Tendsto]
1
2.718282
0
0.5
2
430
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.NormedSpace.WithLp open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section variable (p : ℝβ‰₯0∞) (π•œ Ξ± Ξ² : Type*) namespace WithLp section DistNorm section EDist variable [EDist Ξ±] [EDist Ξ²] open scoped Classical in instance instProdEDist : EDist (WithLp p (Ξ± Γ— Ξ²)) where edist f g := if _hp : p = 0 then (if edist f.fst g.fst = 0 then 0 else 1) + (if edist f.snd g.snd = 0 then 0 else 1) else if p = ∞ then edist f.fst g.fst βŠ” edist f.snd g.snd else (edist f.fst g.fst ^ p.toReal + edist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal) variable {p Ξ± Ξ²} variable (x y : WithLp p (Ξ± Γ— Ξ²)) (x' : Ξ± Γ— Ξ²) @[simp]
Mathlib/Analysis/NormedSpace/ProdLp.lean
161
164
theorem prod_edist_eq_card (f g : WithLp 0 (Ξ± Γ— Ξ²)) : edist f g = (if edist f.fst g.fst = 0 then 0 else 1) + (if edist f.snd g.snd = 0 then 0 else 1) := by
convert if_pos rfl
1
2.718282
0
0.5
6
431
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.NormedSpace.WithLp open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section variable (p : ℝβ‰₯0∞) (π•œ Ξ± Ξ² : Type*) namespace WithLp section DistNorm section EDist variable [EDist Ξ±] [EDist Ξ²] open scoped Classical in instance instProdEDist : EDist (WithLp p (Ξ± Γ— Ξ²)) where edist f g := if _hp : p = 0 then (if edist f.fst g.fst = 0 then 0 else 1) + (if edist f.snd g.snd = 0 then 0 else 1) else if p = ∞ then edist f.fst g.fst βŠ” edist f.snd g.snd else (edist f.fst g.fst ^ p.toReal + edist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal) variable {p Ξ± Ξ²} variable (x y : WithLp p (Ξ± Γ— Ξ²)) (x' : Ξ± Γ— Ξ²) @[simp] theorem prod_edist_eq_card (f g : WithLp 0 (Ξ± Γ— Ξ²)) : edist f g = (if edist f.fst g.fst = 0 then 0 else 1) + (if edist f.snd g.snd = 0 then 0 else 1) := by convert if_pos rfl theorem prod_edist_eq_add (hp : 0 < p.toReal) (f g : WithLp p (Ξ± Γ— Ξ²)) : edist f g = (edist f.fst g.fst ^ p.toReal + edist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal) := let hp' := ENNReal.toReal_pos_iff.mp hp (if_neg hp'.1.ne').trans (if_neg hp'.2.ne)
Mathlib/Analysis/NormedSpace/ProdLp.lean
171
174
theorem prod_edist_eq_sup (f g : WithLp ∞ (Ξ± Γ— Ξ²)) : edist f g = edist f.fst g.fst βŠ” edist f.snd g.snd := by
dsimp [edist] exact if_neg ENNReal.top_ne_zero
2
7.389056
1
0.5
6
431
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.NormedSpace.WithLp open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section variable (p : ℝβ‰₯0∞) (π•œ Ξ± Ξ² : Type*) namespace WithLp section DistNorm section Dist variable [Dist Ξ±] [Dist Ξ²] open scoped Classical in instance instProdDist : Dist (WithLp p (Ξ± Γ— Ξ²)) where dist f g := if _hp : p = 0 then (if dist f.fst g.fst = 0 then 0 else 1) + (if dist f.snd g.snd = 0 then 0 else 1) else if p = ∞ then dist f.fst g.fst βŠ” dist f.snd g.snd else (dist f.fst g.fst ^ p.toReal + dist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal) variable {p Ξ± Ξ²}
Mathlib/Analysis/NormedSpace/ProdLp.lean
231
233
theorem prod_dist_eq_card (f g : WithLp 0 (Ξ± Γ— Ξ²)) : dist f g = (if dist f.fst g.fst = 0 then 0 else 1) + (if dist f.snd g.snd = 0 then 0 else 1) := by
convert if_pos rfl
1
2.718282
0
0.5
6
431
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.NormedSpace.WithLp open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section variable (p : ℝβ‰₯0∞) (π•œ Ξ± Ξ² : Type*) namespace WithLp section DistNorm section Dist variable [Dist Ξ±] [Dist Ξ²] open scoped Classical in instance instProdDist : Dist (WithLp p (Ξ± Γ— Ξ²)) where dist f g := if _hp : p = 0 then (if dist f.fst g.fst = 0 then 0 else 1) + (if dist f.snd g.snd = 0 then 0 else 1) else if p = ∞ then dist f.fst g.fst βŠ” dist f.snd g.snd else (dist f.fst g.fst ^ p.toReal + dist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal) variable {p Ξ± Ξ²} theorem prod_dist_eq_card (f g : WithLp 0 (Ξ± Γ— Ξ²)) : dist f g = (if dist f.fst g.fst = 0 then 0 else 1) + (if dist f.snd g.snd = 0 then 0 else 1) := by convert if_pos rfl theorem prod_dist_eq_add (hp : 0 < p.toReal) (f g : WithLp p (Ξ± Γ— Ξ²)) : dist f g = (dist f.fst g.fst ^ p.toReal + dist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal) := let hp' := ENNReal.toReal_pos_iff.mp hp (if_neg hp'.1.ne').trans (if_neg hp'.2.ne)
Mathlib/Analysis/NormedSpace/ProdLp.lean
240
243
theorem prod_dist_eq_sup (f g : WithLp ∞ (Ξ± Γ— Ξ²)) : dist f g = dist f.fst g.fst βŠ” dist f.snd g.snd := by
dsimp [dist] exact if_neg ENNReal.top_ne_zero
2
7.389056
1
0.5
6
431
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.NormedSpace.WithLp open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section variable (p : ℝβ‰₯0∞) (π•œ Ξ± Ξ² : Type*) namespace WithLp section DistNorm section Norm variable [Norm Ξ±] [Norm Ξ²] open scoped Classical in instance instProdNorm : Norm (WithLp p (Ξ± Γ— Ξ²)) where norm f := if _hp : p = 0 then (if β€–f.fstβ€– = 0 then 0 else 1) + (if β€–f.sndβ€– = 0 then 0 else 1) else if p = ∞ then β€–f.fstβ€– βŠ” β€–f.sndβ€– else (β€–f.fstβ€– ^ p.toReal + β€–f.sndβ€– ^ p.toReal) ^ (1 / p.toReal) variable {p Ξ± Ξ²} @[simp]
Mathlib/Analysis/NormedSpace/ProdLp.lean
270
272
theorem prod_norm_eq_card (f : WithLp 0 (Ξ± Γ— Ξ²)) : β€–fβ€– = (if β€–f.fstβ€– = 0 then 0 else 1) + (if β€–f.sndβ€– = 0 then 0 else 1) := by
convert if_pos rfl
1
2.718282
0
0.5
6
431
import Mathlib.Analysis.MeanInequalities import Mathlib.Analysis.NormedSpace.WithLp open Real Set Filter RCLike Bornology Uniformity Topology NNReal ENNReal noncomputable section variable (p : ℝβ‰₯0∞) (π•œ Ξ± Ξ² : Type*) namespace WithLp section DistNorm section Norm variable [Norm Ξ±] [Norm Ξ²] open scoped Classical in instance instProdNorm : Norm (WithLp p (Ξ± Γ— Ξ²)) where norm f := if _hp : p = 0 then (if β€–f.fstβ€– = 0 then 0 else 1) + (if β€–f.sndβ€– = 0 then 0 else 1) else if p = ∞ then β€–f.fstβ€– βŠ” β€–f.sndβ€– else (β€–f.fstβ€– ^ p.toReal + β€–f.sndβ€– ^ p.toReal) ^ (1 / p.toReal) variable {p Ξ± Ξ²} @[simp] theorem prod_norm_eq_card (f : WithLp 0 (Ξ± Γ— Ξ²)) : β€–fβ€– = (if β€–f.fstβ€– = 0 then 0 else 1) + (if β€–f.sndβ€– = 0 then 0 else 1) := by convert if_pos rfl
Mathlib/Analysis/NormedSpace/ProdLp.lean
274
276
theorem prod_norm_eq_sup (f : WithLp ∞ (Ξ± Γ— Ξ²)) : β€–fβ€– = β€–f.fstβ€– βŠ” β€–f.sndβ€– := by
dsimp [Norm.norm] exact if_neg ENNReal.top_ne_zero
2
7.389056
1
0.5
6
431
import Mathlib.CategoryTheory.Comma.Basic import Mathlib.CategoryTheory.PUnit import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.CategoryTheory.EssentiallySmall import Mathlib.Logic.Small.Set #align_import category_theory.structured_arrow from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b" namespace CategoryTheory -- morphism levels before object levels. See note [CategoryTheory universes]. universe v₁ vβ‚‚ v₃ vβ‚„ u₁ uβ‚‚ u₃ uβ‚„ variable {C : Type u₁} [Category.{v₁} C] {D : Type uβ‚‚} [Category.{vβ‚‚} D] -- We explicitly come from `PUnit.{1}` here to obtain the correct universe for morphisms of -- structured arrows. -- Porting note(#5171): linter not ported yet -- @[nolint has_nonempty_instance] def StructuredArrow (S : D) (T : C β₯€ D) := Comma (Functor.fromPUnit.{0} S) T #align category_theory.structured_arrow CategoryTheory.StructuredArrow -- Porting note: not found by inferInstance instance (S : D) (T : C β₯€ D) : Category (StructuredArrow S T) := commaCategory namespace StructuredArrow @[simps!] def proj (S : D) (T : C β₯€ D) : StructuredArrow S T β₯€ C := Comma.snd _ _ #align category_theory.structured_arrow.proj CategoryTheory.StructuredArrow.proj variable {S S' S'' : D} {Y Y' Y'' : C} {T T' : C β₯€ D} -- Porting note: this lemma was added because `Comma.hom_ext` -- was not triggered automatically -- See https://github.com/leanprover-community/mathlib4/issues/5229 @[ext] lemma hom_ext {X Y : StructuredArrow S T} (f g : X ⟢ Y) (h : f.right = g.right) : f = g := CommaMorphism.ext _ _ (Subsingleton.elim _ _) h @[simp] theorem hom_eq_iff {X Y : StructuredArrow S T} (f g : X ⟢ Y) : f = g ↔ f.right = g.right := ⟨fun h ↦ by rw [h], hom_ext _ _⟩ def mk (f : S ⟢ T.obj Y) : StructuredArrow S T := ⟨⟨⟨⟩⟩, Y, f⟩ #align category_theory.structured_arrow.mk CategoryTheory.StructuredArrow.mk @[simp] theorem mk_left (f : S ⟢ T.obj Y) : (mk f).left = ⟨⟨⟩⟩ := rfl #align category_theory.structured_arrow.mk_left CategoryTheory.StructuredArrow.mk_left @[simp] theorem mk_right (f : S ⟢ T.obj Y) : (mk f).right = Y := rfl #align category_theory.structured_arrow.mk_right CategoryTheory.StructuredArrow.mk_right @[simp] theorem mk_hom_eq_self (f : S ⟢ T.obj Y) : (mk f).hom = f := rfl #align category_theory.structured_arrow.mk_hom_eq_self CategoryTheory.StructuredArrow.mk_hom_eq_self @[reassoc (attr := simp)]
Mathlib/CategoryTheory/Comma/StructuredArrow.lean
90
91
theorem w {A B : StructuredArrow S T} (f : A ⟢ B) : A.hom ≫ T.map f.right = B.hom := by
have := f.w; aesop_cat
1
2.718282
0
0.5
2
432
import Mathlib.CategoryTheory.Comma.Basic import Mathlib.CategoryTheory.PUnit import Mathlib.CategoryTheory.Limits.Shapes.Terminal import Mathlib.CategoryTheory.EssentiallySmall import Mathlib.Logic.Small.Set #align_import category_theory.structured_arrow from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b" namespace CategoryTheory -- morphism levels before object levels. See note [CategoryTheory universes]. universe v₁ vβ‚‚ v₃ vβ‚„ u₁ uβ‚‚ u₃ uβ‚„ variable {C : Type u₁} [Category.{v₁} C] {D : Type uβ‚‚} [Category.{vβ‚‚} D] -- We explicitly come from `PUnit.{1}` here to obtain the correct universe for morphisms of -- structured arrows. -- Porting note(#5171): linter not ported yet -- @[nolint has_nonempty_instance] def StructuredArrow (S : D) (T : C β₯€ D) := Comma (Functor.fromPUnit.{0} S) T #align category_theory.structured_arrow CategoryTheory.StructuredArrow -- Porting note: not found by inferInstance instance (S : D) (T : C β₯€ D) : Category (StructuredArrow S T) := commaCategory namespace StructuredArrow @[simps!] def proj (S : D) (T : C β₯€ D) : StructuredArrow S T β₯€ C := Comma.snd _ _ #align category_theory.structured_arrow.proj CategoryTheory.StructuredArrow.proj variable {S S' S'' : D} {Y Y' Y'' : C} {T T' : C β₯€ D} -- Porting note: this lemma was added because `Comma.hom_ext` -- was not triggered automatically -- See https://github.com/leanprover-community/mathlib4/issues/5229 @[ext] lemma hom_ext {X Y : StructuredArrow S T} (f g : X ⟢ Y) (h : f.right = g.right) : f = g := CommaMorphism.ext _ _ (Subsingleton.elim _ _) h @[simp] theorem hom_eq_iff {X Y : StructuredArrow S T} (f g : X ⟢ Y) : f = g ↔ f.right = g.right := ⟨fun h ↦ by rw [h], hom_ext _ _⟩ def mk (f : S ⟢ T.obj Y) : StructuredArrow S T := ⟨⟨⟨⟩⟩, Y, f⟩ #align category_theory.structured_arrow.mk CategoryTheory.StructuredArrow.mk @[simp] theorem mk_left (f : S ⟢ T.obj Y) : (mk f).left = ⟨⟨⟩⟩ := rfl #align category_theory.structured_arrow.mk_left CategoryTheory.StructuredArrow.mk_left @[simp] theorem mk_right (f : S ⟢ T.obj Y) : (mk f).right = Y := rfl #align category_theory.structured_arrow.mk_right CategoryTheory.StructuredArrow.mk_right @[simp] theorem mk_hom_eq_self (f : S ⟢ T.obj Y) : (mk f).hom = f := rfl #align category_theory.structured_arrow.mk_hom_eq_self CategoryTheory.StructuredArrow.mk_hom_eq_self @[reassoc (attr := simp)] theorem w {A B : StructuredArrow S T} (f : A ⟢ B) : A.hom ≫ T.map f.right = B.hom := by have := f.w; aesop_cat #align category_theory.structured_arrow.w CategoryTheory.StructuredArrow.w @[simp] theorem comp_right {X Y Z : StructuredArrow S T} (f : X ⟢ Y) (g : Y ⟢ Z) : (f ≫ g).right = f.right ≫ g.right := rfl @[simp] theorem id_right (X : StructuredArrow S T) : (πŸ™ X : X ⟢ X).right = πŸ™ X.right := rfl @[simp]
Mathlib/CategoryTheory/Comma/StructuredArrow.lean
102
105
theorem eqToHom_right {X Y : StructuredArrow S T} (h : X = Y) : (eqToHom h).right = eqToHom (by rw [h]) := by
subst h simp only [eqToHom_refl, id_right]
2
7.389056
1
0.5
2
432
import Mathlib.Algebra.Module.Submodule.Ker #align_import linear_algebra.basic from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" variable {R : Type*} {Rβ‚‚ : Type*} variable {M : Type*} {Mβ‚‚ : Type*} namespace LinearMap section AddCommMonoid variable [Semiring R] [Semiring Rβ‚‚] variable [AddCommMonoid M] [AddCommMonoid Mβ‚‚] variable [Module R M] [Module Rβ‚‚ Mβ‚‚] open Submodule variable {τ₁₂ : R β†’+* Rβ‚‚} section variable {F : Type*} [FunLike F M Mβ‚‚] [SemilinearMapClass F τ₁₂ M Mβ‚‚] def eqLocus (f g : F) : Submodule R M := { (f : M β†’+ Mβ‚‚).eqLocusM g with carrier := { x | f x = g x } smul_mem' := fun {r} {x} (hx : _ = _) => show _ = _ by -- Note: #8386 changed `map_smulβ‚›β‚—` into `map_smulβ‚›β‚— _` simpa only [map_smulβ‚›β‚— _] using congr_arg (τ₁₂ r β€’ Β·) hx } #align linear_map.eq_locus LinearMap.eqLocus @[simp] theorem mem_eqLocus {x : M} {f g : F} : x ∈ eqLocus f g ↔ f x = g x := Iff.rfl #align linear_map.mem_eq_locus LinearMap.mem_eqLocus theorem eqLocus_toAddSubmonoid (f g : F) : (eqLocus f g).toAddSubmonoid = (f : M β†’+ Mβ‚‚).eqLocusM g := rfl #align linear_map.eq_locus_to_add_submonoid LinearMap.eqLocus_toAddSubmonoid @[simp]
Mathlib/Algebra/Module/Submodule/EqLocus.lean
64
65
theorem eqLocus_eq_top {f g : F} : eqLocus f g = ⊀ ↔ f = g := by
simp [SetLike.ext_iff, DFunLike.ext_iff]
1
2.718282
0
0.5
2
433
import Mathlib.Algebra.Module.Submodule.Ker #align_import linear_algebra.basic from "leanprover-community/mathlib"@"9d684a893c52e1d6692a504a118bfccbae04feeb" variable {R : Type*} {Rβ‚‚ : Type*} variable {M : Type*} {Mβ‚‚ : Type*} namespace LinearMap section AddCommMonoid variable [Semiring R] [Semiring Rβ‚‚] variable [AddCommMonoid M] [AddCommMonoid Mβ‚‚] variable [Module R M] [Module Rβ‚‚ Mβ‚‚] open Submodule variable {τ₁₂ : R β†’+* Rβ‚‚} section variable {F : Type*} [FunLike F M Mβ‚‚] [SemilinearMapClass F τ₁₂ M Mβ‚‚] def eqLocus (f g : F) : Submodule R M := { (f : M β†’+ Mβ‚‚).eqLocusM g with carrier := { x | f x = g x } smul_mem' := fun {r} {x} (hx : _ = _) => show _ = _ by -- Note: #8386 changed `map_smulβ‚›β‚—` into `map_smulβ‚›β‚— _` simpa only [map_smulβ‚›β‚— _] using congr_arg (τ₁₂ r β€’ Β·) hx } #align linear_map.eq_locus LinearMap.eqLocus @[simp] theorem mem_eqLocus {x : M} {f g : F} : x ∈ eqLocus f g ↔ f x = g x := Iff.rfl #align linear_map.mem_eq_locus LinearMap.mem_eqLocus theorem eqLocus_toAddSubmonoid (f g : F) : (eqLocus f g).toAddSubmonoid = (f : M β†’+ Mβ‚‚).eqLocusM g := rfl #align linear_map.eq_locus_to_add_submonoid LinearMap.eqLocus_toAddSubmonoid @[simp] theorem eqLocus_eq_top {f g : F} : eqLocus f g = ⊀ ↔ f = g := by simp [SetLike.ext_iff, DFunLike.ext_iff] @[simp] theorem eqLocus_same (f : F) : eqLocus f f = ⊀ := eqLocus_eq_top.2 rfl #align linear_map.eq_locus_same LinearMap.eqLocus_same theorem le_eqLocus {f g : F} {S : Submodule R M} : S ≀ eqLocus f g ↔ Set.EqOn f g S := Iff.rfl
Mathlib/Algebra/Module/Submodule/EqLocus.lean
73
76
theorem eqOn_sup {f g : F} {S T : Submodule R M} (hS : Set.EqOn f g S) (hT : Set.EqOn f g T) : Set.EqOn f g ↑(S βŠ” T) := by
rw [← le_eqLocus] at hS hT ⊒ exact sup_le hS hT
2
7.389056
1
0.5
2
433
import Mathlib.Analysis.Normed.Field.Basic #align_import analysis.normed_space.int from "leanprover-community/mathlib"@"5cc2dfdd3e92f340411acea4427d701dc7ed26f8" namespace Int
Mathlib/Analysis/NormedSpace/Int.lean
24
26
theorem nnnorm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€–β‚Š = 1 := by
obtain rfl | rfl := units_eq_one_or e <;> simp only [Units.coe_neg_one, Units.val_one, nnnorm_neg, nnnorm_one]
2
7.389056
1
0.5
4
434
import Mathlib.Analysis.Normed.Field.Basic #align_import analysis.normed_space.int from "leanprover-community/mathlib"@"5cc2dfdd3e92f340411acea4427d701dc7ed26f8" namespace Int theorem nnnorm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€–β‚Š = 1 := by obtain rfl | rfl := units_eq_one_or e <;> simp only [Units.coe_neg_one, Units.val_one, nnnorm_neg, nnnorm_one] #align int.nnnorm_coe_units Int.nnnorm_coe_units
Mathlib/Analysis/NormedSpace/Int.lean
29
30
theorem norm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€– = 1 := by
rw [← coe_nnnorm, nnnorm_coe_units, NNReal.coe_one]
1
2.718282
0
0.5
4
434
import Mathlib.Analysis.Normed.Field.Basic #align_import analysis.normed_space.int from "leanprover-community/mathlib"@"5cc2dfdd3e92f340411acea4427d701dc7ed26f8" namespace Int theorem nnnorm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€–β‚Š = 1 := by obtain rfl | rfl := units_eq_one_or e <;> simp only [Units.coe_neg_one, Units.val_one, nnnorm_neg, nnnorm_one] #align int.nnnorm_coe_units Int.nnnorm_coe_units theorem norm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€– = 1 := by rw [← coe_nnnorm, nnnorm_coe_units, NNReal.coe_one] #align int.norm_coe_units Int.norm_coe_units @[simp] theorem nnnorm_natCast (n : β„•) : β€–(n : β„€)β€–β‚Š = n := Real.nnnorm_natCast _ #align int.nnnorm_coe_nat Int.nnnorm_natCast @[deprecated (since := "2024-04-05")] alias nnnorm_coe_nat := nnnorm_natCast @[simp]
Mathlib/Analysis/NormedSpace/Int.lean
41
42
theorem toNat_add_toNat_neg_eq_nnnorm (n : β„€) : ↑n.toNat + ↑(-n).toNat = β€–nβ€–β‚Š := by
rw [← Nat.cast_add, toNat_add_toNat_neg_eq_natAbs, NNReal.natCast_natAbs]
1
2.718282
0
0.5
4
434
import Mathlib.Analysis.Normed.Field.Basic #align_import analysis.normed_space.int from "leanprover-community/mathlib"@"5cc2dfdd3e92f340411acea4427d701dc7ed26f8" namespace Int theorem nnnorm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€–β‚Š = 1 := by obtain rfl | rfl := units_eq_one_or e <;> simp only [Units.coe_neg_one, Units.val_one, nnnorm_neg, nnnorm_one] #align int.nnnorm_coe_units Int.nnnorm_coe_units theorem norm_coe_units (e : β„€Λ£) : β€–(e : β„€)β€– = 1 := by rw [← coe_nnnorm, nnnorm_coe_units, NNReal.coe_one] #align int.norm_coe_units Int.norm_coe_units @[simp] theorem nnnorm_natCast (n : β„•) : β€–(n : β„€)β€–β‚Š = n := Real.nnnorm_natCast _ #align int.nnnorm_coe_nat Int.nnnorm_natCast @[deprecated (since := "2024-04-05")] alias nnnorm_coe_nat := nnnorm_natCast @[simp] theorem toNat_add_toNat_neg_eq_nnnorm (n : β„€) : ↑n.toNat + ↑(-n).toNat = β€–nβ€–β‚Š := by rw [← Nat.cast_add, toNat_add_toNat_neg_eq_natAbs, NNReal.natCast_natAbs] #align int.to_nat_add_to_nat_neg_eq_nnnorm Int.toNat_add_toNat_neg_eq_nnnorm @[simp]
Mathlib/Analysis/NormedSpace/Int.lean
46
48
theorem toNat_add_toNat_neg_eq_norm (n : β„€) : ↑n.toNat + ↑(-n).toNat = β€–nβ€– := by
simpa only [NNReal.coe_natCast, NNReal.coe_add] using congrArg NNReal.toReal (toNat_add_toNat_neg_eq_nnnorm n)
2
7.389056
1
0.5
4
434
import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.SuccPred import Mathlib.Order.Interval.Set.Monotone import Mathlib.Order.OrderIsoNat #align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0" open Finset namespace Nat variable (p : β„• β†’ Prop) noncomputable def nth (p : β„• β†’ Prop) (n : β„•) : β„• := by classical exact if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· ≀ Β·)).getD n 0 else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n #align nat.nth Nat.nth variable {p}
Mathlib/Data/Nat/Nth.lean
62
63
theorem nth_of_card_le (hf : (setOf p).Finite) {n : β„•} (hn : hf.toFinset.card ≀ n) : nth p n = 0 := by
rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort]
1
2.718282
0
0.5
6
435
import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.SuccPred import Mathlib.Order.Interval.Set.Monotone import Mathlib.Order.OrderIsoNat #align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0" open Finset namespace Nat variable (p : β„• β†’ Prop) noncomputable def nth (p : β„• β†’ Prop) (n : β„•) : β„• := by classical exact if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· ≀ Β·)).getD n 0 else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n #align nat.nth Nat.nth variable {p} theorem nth_of_card_le (hf : (setOf p).Finite) {n : β„•} (hn : hf.toFinset.card ≀ n) : nth p n = 0 := by rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort] #align nat.nth_of_card_le Nat.nth_of_card_le theorem nth_eq_getD_sort (h : (setOf p).Finite) (n : β„•) : nth p n = (h.toFinset.sort (Β· ≀ Β·)).getD n 0 := dif_pos h #align nat.nth_eq_nthd_sort Nat.nth_eq_getD_sort
Mathlib/Data/Nat/Nth.lean
71
73
theorem nth_eq_orderEmbOfFin (hf : (setOf p).Finite) {n : β„•} (hn : n < hf.toFinset.card) : nth p n = hf.toFinset.orderEmbOfFin rfl ⟨n, hn⟩ := by
rw [nth_eq_getD_sort hf, Finset.orderEmbOfFin_apply, List.getD_eq_get]
1
2.718282
0
0.5
6
435
import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.SuccPred import Mathlib.Order.Interval.Set.Monotone import Mathlib.Order.OrderIsoNat #align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0" open Finset namespace Nat variable (p : β„• β†’ Prop) noncomputable def nth (p : β„• β†’ Prop) (n : β„•) : β„• := by classical exact if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· ≀ Β·)).getD n 0 else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n #align nat.nth Nat.nth variable {p} theorem nth_of_card_le (hf : (setOf p).Finite) {n : β„•} (hn : hf.toFinset.card ≀ n) : nth p n = 0 := by rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort] #align nat.nth_of_card_le Nat.nth_of_card_le theorem nth_eq_getD_sort (h : (setOf p).Finite) (n : β„•) : nth p n = (h.toFinset.sort (Β· ≀ Β·)).getD n 0 := dif_pos h #align nat.nth_eq_nthd_sort Nat.nth_eq_getD_sort theorem nth_eq_orderEmbOfFin (hf : (setOf p).Finite) {n : β„•} (hn : n < hf.toFinset.card) : nth p n = hf.toFinset.orderEmbOfFin rfl ⟨n, hn⟩ := by rw [nth_eq_getD_sort hf, Finset.orderEmbOfFin_apply, List.getD_eq_get] #align nat.nth_eq_order_emb_of_fin Nat.nth_eq_orderEmbOfFin
Mathlib/Data/Nat/Nth.lean
76
80
theorem nth_strictMonoOn (hf : (setOf p).Finite) : StrictMonoOn (nth p) (Set.Iio hf.toFinset.card) := by
rintro m (hm : m < _) n (hn : n < _) h simp only [nth_eq_orderEmbOfFin, *] exact OrderEmbedding.strictMono _ h
3
20.085537
1
0.5
6
435
import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.SuccPred import Mathlib.Order.Interval.Set.Monotone import Mathlib.Order.OrderIsoNat #align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0" open Finset namespace Nat variable (p : β„• β†’ Prop) noncomputable def nth (p : β„• β†’ Prop) (n : β„•) : β„• := by classical exact if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· ≀ Β·)).getD n 0 else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n #align nat.nth Nat.nth variable {p} theorem nth_of_card_le (hf : (setOf p).Finite) {n : β„•} (hn : hf.toFinset.card ≀ n) : nth p n = 0 := by rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort] #align nat.nth_of_card_le Nat.nth_of_card_le theorem nth_eq_getD_sort (h : (setOf p).Finite) (n : β„•) : nth p n = (h.toFinset.sort (Β· ≀ Β·)).getD n 0 := dif_pos h #align nat.nth_eq_nthd_sort Nat.nth_eq_getD_sort theorem nth_eq_orderEmbOfFin (hf : (setOf p).Finite) {n : β„•} (hn : n < hf.toFinset.card) : nth p n = hf.toFinset.orderEmbOfFin rfl ⟨n, hn⟩ := by rw [nth_eq_getD_sort hf, Finset.orderEmbOfFin_apply, List.getD_eq_get] #align nat.nth_eq_order_emb_of_fin Nat.nth_eq_orderEmbOfFin theorem nth_strictMonoOn (hf : (setOf p).Finite) : StrictMonoOn (nth p) (Set.Iio hf.toFinset.card) := by rintro m (hm : m < _) n (hn : n < _) h simp only [nth_eq_orderEmbOfFin, *] exact OrderEmbedding.strictMono _ h #align nat.nth_strict_mono_on Nat.nth_strictMonoOn theorem nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : m < n) (hn : n < hf.toFinset.card) : nth p m < nth p n := nth_strictMonoOn hf (h.trans hn) hn h #align nat.nth_lt_nth_of_lt_card Nat.nth_lt_nth_of_lt_card theorem nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : m ≀ n) (hn : n < hf.toFinset.card) : nth p m ≀ nth p n := (nth_strictMonoOn hf).monotoneOn (h.trans_lt hn) hn h #align nat.nth_le_nth_of_lt_card Nat.nth_le_nth_of_lt_card theorem lt_of_nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : nth p m < nth p n) (hm : m < hf.toFinset.card) : m < n := not_le.1 fun hle => h.not_le <| nth_le_nth_of_lt_card hf hle hm #align nat.lt_of_nth_lt_nth_of_lt_card Nat.lt_of_nth_lt_nth_of_lt_card theorem le_of_nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : nth p m ≀ nth p n) (hm : m < hf.toFinset.card) : m ≀ n := not_lt.1 fun hlt => h.not_lt <| nth_lt_nth_of_lt_card hf hlt hm #align nat.le_of_nth_le_nth_of_lt_card Nat.le_of_nth_le_nth_of_lt_card theorem nth_injOn (hf : (setOf p).Finite) : (Set.Iio hf.toFinset.card).InjOn (nth p) := (nth_strictMonoOn hf).injOn #align nat.nth_inj_on Nat.nth_injOn theorem range_nth_of_finite (hf : (setOf p).Finite) : Set.range (nth p) = insert 0 (setOf p) := by simpa only [← nth_eq_getD_sort hf, mem_sort, Set.Finite.mem_toFinset] using Set.range_list_getD (hf.toFinset.sort (Β· ≀ Β·)) 0 #align nat.range_nth_of_finite Nat.range_nth_of_finite @[simp]
Mathlib/Data/Nat/Nth.lean
113
119
theorem image_nth_Iio_card (hf : (setOf p).Finite) : nth p '' Set.Iio hf.toFinset.card = setOf p := calc nth p '' Set.Iio hf.toFinset.card = Set.range (hf.toFinset.orderEmbOfFin rfl) := by
ext x simp only [Set.mem_image, Set.mem_range, Fin.exists_iff, ← nth_eq_orderEmbOfFin hf, Set.mem_Iio, exists_prop] _ = setOf p := by rw [range_orderEmbOfFin, Set.Finite.coe_toFinset]
4
54.59815
2
0.5
6
435
import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.SuccPred import Mathlib.Order.Interval.Set.Monotone import Mathlib.Order.OrderIsoNat #align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0" open Finset namespace Nat variable (p : β„• β†’ Prop) noncomputable def nth (p : β„• β†’ Prop) (n : β„•) : β„• := by classical exact if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· ≀ Β·)).getD n 0 else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n #align nat.nth Nat.nth variable {p} theorem nth_of_card_le (hf : (setOf p).Finite) {n : β„•} (hn : hf.toFinset.card ≀ n) : nth p n = 0 := by rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort] #align nat.nth_of_card_le Nat.nth_of_card_le theorem nth_eq_getD_sort (h : (setOf p).Finite) (n : β„•) : nth p n = (h.toFinset.sort (Β· ≀ Β·)).getD n 0 := dif_pos h #align nat.nth_eq_nthd_sort Nat.nth_eq_getD_sort theorem nth_eq_orderEmbOfFin (hf : (setOf p).Finite) {n : β„•} (hn : n < hf.toFinset.card) : nth p n = hf.toFinset.orderEmbOfFin rfl ⟨n, hn⟩ := by rw [nth_eq_getD_sort hf, Finset.orderEmbOfFin_apply, List.getD_eq_get] #align nat.nth_eq_order_emb_of_fin Nat.nth_eq_orderEmbOfFin theorem nth_strictMonoOn (hf : (setOf p).Finite) : StrictMonoOn (nth p) (Set.Iio hf.toFinset.card) := by rintro m (hm : m < _) n (hn : n < _) h simp only [nth_eq_orderEmbOfFin, *] exact OrderEmbedding.strictMono _ h #align nat.nth_strict_mono_on Nat.nth_strictMonoOn theorem nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : m < n) (hn : n < hf.toFinset.card) : nth p m < nth p n := nth_strictMonoOn hf (h.trans hn) hn h #align nat.nth_lt_nth_of_lt_card Nat.nth_lt_nth_of_lt_card theorem nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : m ≀ n) (hn : n < hf.toFinset.card) : nth p m ≀ nth p n := (nth_strictMonoOn hf).monotoneOn (h.trans_lt hn) hn h #align nat.nth_le_nth_of_lt_card Nat.nth_le_nth_of_lt_card theorem lt_of_nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : nth p m < nth p n) (hm : m < hf.toFinset.card) : m < n := not_le.1 fun hle => h.not_le <| nth_le_nth_of_lt_card hf hle hm #align nat.lt_of_nth_lt_nth_of_lt_card Nat.lt_of_nth_lt_nth_of_lt_card theorem le_of_nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : nth p m ≀ nth p n) (hm : m < hf.toFinset.card) : m ≀ n := not_lt.1 fun hlt => h.not_lt <| nth_lt_nth_of_lt_card hf hlt hm #align nat.le_of_nth_le_nth_of_lt_card Nat.le_of_nth_le_nth_of_lt_card theorem nth_injOn (hf : (setOf p).Finite) : (Set.Iio hf.toFinset.card).InjOn (nth p) := (nth_strictMonoOn hf).injOn #align nat.nth_inj_on Nat.nth_injOn theorem range_nth_of_finite (hf : (setOf p).Finite) : Set.range (nth p) = insert 0 (setOf p) := by simpa only [← nth_eq_getD_sort hf, mem_sort, Set.Finite.mem_toFinset] using Set.range_list_getD (hf.toFinset.sort (Β· ≀ Β·)) 0 #align nat.range_nth_of_finite Nat.range_nth_of_finite @[simp] theorem image_nth_Iio_card (hf : (setOf p).Finite) : nth p '' Set.Iio hf.toFinset.card = setOf p := calc nth p '' Set.Iio hf.toFinset.card = Set.range (hf.toFinset.orderEmbOfFin rfl) := by ext x simp only [Set.mem_image, Set.mem_range, Fin.exists_iff, ← nth_eq_orderEmbOfFin hf, Set.mem_Iio, exists_prop] _ = setOf p := by rw [range_orderEmbOfFin, Set.Finite.coe_toFinset] #align nat.image_nth_Iio_card Nat.image_nth_Iio_card theorem nth_mem_of_lt_card {n : β„•} (hf : (setOf p).Finite) (hlt : n < hf.toFinset.card) : p (nth p n) := (image_nth_Iio_card hf).subset <| Set.mem_image_of_mem _ hlt #align nat.nth_mem_of_lt_card Nat.nth_mem_of_lt_card
Mathlib/Data/Nat/Nth.lean
127
129
theorem exists_lt_card_finite_nth_eq (hf : (setOf p).Finite) {x} (h : p x) : βˆƒ n, n < hf.toFinset.card ∧ nth p n = x := by
rwa [← @Set.mem_setOf_eq _ _ p, ← image_nth_Iio_card hf] at h
1
2.718282
0
0.5
6
435
import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.SuccPred import Mathlib.Order.Interval.Set.Monotone import Mathlib.Order.OrderIsoNat #align_import data.nat.nth from "leanprover-community/mathlib"@"7fdd4f3746cb059edfdb5d52cba98f66fce418c0" open Finset namespace Nat variable (p : β„• β†’ Prop) noncomputable def nth (p : β„• β†’ Prop) (n : β„•) : β„• := by classical exact if h : Set.Finite (setOf p) then (h.toFinset.sort (Β· ≀ Β·)).getD n 0 else @Nat.Subtype.orderIsoOfNat (setOf p) (Set.Infinite.to_subtype h) n #align nat.nth Nat.nth variable {p} theorem nth_of_card_le (hf : (setOf p).Finite) {n : β„•} (hn : hf.toFinset.card ≀ n) : nth p n = 0 := by rw [nth, dif_pos hf, List.getD_eq_default]; rwa [Finset.length_sort] #align nat.nth_of_card_le Nat.nth_of_card_le theorem nth_eq_getD_sort (h : (setOf p).Finite) (n : β„•) : nth p n = (h.toFinset.sort (Β· ≀ Β·)).getD n 0 := dif_pos h #align nat.nth_eq_nthd_sort Nat.nth_eq_getD_sort theorem nth_eq_orderEmbOfFin (hf : (setOf p).Finite) {n : β„•} (hn : n < hf.toFinset.card) : nth p n = hf.toFinset.orderEmbOfFin rfl ⟨n, hn⟩ := by rw [nth_eq_getD_sort hf, Finset.orderEmbOfFin_apply, List.getD_eq_get] #align nat.nth_eq_order_emb_of_fin Nat.nth_eq_orderEmbOfFin theorem nth_strictMonoOn (hf : (setOf p).Finite) : StrictMonoOn (nth p) (Set.Iio hf.toFinset.card) := by rintro m (hm : m < _) n (hn : n < _) h simp only [nth_eq_orderEmbOfFin, *] exact OrderEmbedding.strictMono _ h #align nat.nth_strict_mono_on Nat.nth_strictMonoOn theorem nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : m < n) (hn : n < hf.toFinset.card) : nth p m < nth p n := nth_strictMonoOn hf (h.trans hn) hn h #align nat.nth_lt_nth_of_lt_card Nat.nth_lt_nth_of_lt_card theorem nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : m ≀ n) (hn : n < hf.toFinset.card) : nth p m ≀ nth p n := (nth_strictMonoOn hf).monotoneOn (h.trans_lt hn) hn h #align nat.nth_le_nth_of_lt_card Nat.nth_le_nth_of_lt_card theorem lt_of_nth_lt_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : nth p m < nth p n) (hm : m < hf.toFinset.card) : m < n := not_le.1 fun hle => h.not_le <| nth_le_nth_of_lt_card hf hle hm #align nat.lt_of_nth_lt_nth_of_lt_card Nat.lt_of_nth_lt_nth_of_lt_card theorem le_of_nth_le_nth_of_lt_card (hf : (setOf p).Finite) {m n : β„•} (h : nth p m ≀ nth p n) (hm : m < hf.toFinset.card) : m ≀ n := not_lt.1 fun hlt => h.not_lt <| nth_lt_nth_of_lt_card hf hlt hm #align nat.le_of_nth_le_nth_of_lt_card Nat.le_of_nth_le_nth_of_lt_card theorem nth_injOn (hf : (setOf p).Finite) : (Set.Iio hf.toFinset.card).InjOn (nth p) := (nth_strictMonoOn hf).injOn #align nat.nth_inj_on Nat.nth_injOn theorem range_nth_of_finite (hf : (setOf p).Finite) : Set.range (nth p) = insert 0 (setOf p) := by simpa only [← nth_eq_getD_sort hf, mem_sort, Set.Finite.mem_toFinset] using Set.range_list_getD (hf.toFinset.sort (Β· ≀ Β·)) 0 #align nat.range_nth_of_finite Nat.range_nth_of_finite @[simp] theorem image_nth_Iio_card (hf : (setOf p).Finite) : nth p '' Set.Iio hf.toFinset.card = setOf p := calc nth p '' Set.Iio hf.toFinset.card = Set.range (hf.toFinset.orderEmbOfFin rfl) := by ext x simp only [Set.mem_image, Set.mem_range, Fin.exists_iff, ← nth_eq_orderEmbOfFin hf, Set.mem_Iio, exists_prop] _ = setOf p := by rw [range_orderEmbOfFin, Set.Finite.coe_toFinset] #align nat.image_nth_Iio_card Nat.image_nth_Iio_card theorem nth_mem_of_lt_card {n : β„•} (hf : (setOf p).Finite) (hlt : n < hf.toFinset.card) : p (nth p n) := (image_nth_Iio_card hf).subset <| Set.mem_image_of_mem _ hlt #align nat.nth_mem_of_lt_card Nat.nth_mem_of_lt_card theorem exists_lt_card_finite_nth_eq (hf : (setOf p).Finite) {x} (h : p x) : βˆƒ n, n < hf.toFinset.card ∧ nth p n = x := by rwa [← @Set.mem_setOf_eq _ _ p, ← image_nth_Iio_card hf] at h #align nat.exists_lt_card_finite_nth_eq Nat.exists_lt_card_finite_nth_eq
Mathlib/Data/Nat/Nth.lean
137
138
theorem nth_apply_eq_orderIsoOfNat (hf : (setOf p).Infinite) (n : β„•) : nth p n = @Nat.Subtype.orderIsoOfNat (setOf p) hf.to_subtype n := by
rw [nth, dif_neg hf]
1
2.718282
0
0.5
6
435
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.ZMod.Basic #align_import data.zmod.parity from "leanprover-community/mathlib"@"048240e809f04e2bde02482ab44bc230744cc6c9" namespace ZMod theorem eq_zero_iff_even {n : β„•} : (n : ZMod 2) = 0 ↔ Even n := (CharP.cast_eq_zero_iff (ZMod 2) 2 n).trans even_iff_two_dvd.symm #align zmod.eq_zero_iff_even ZMod.eq_zero_iff_even
Mathlib/Data/ZMod/Parity.lean
28
29
theorem eq_one_iff_odd {n : β„•} : (n : ZMod 2) = 1 ↔ Odd n := by
rw [← @Nat.cast_one (ZMod 2), ZMod.eq_iff_modEq_nat, Nat.odd_iff, Nat.ModEq]
1
2.718282
0
0.5
2
436
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Data.ZMod.Basic #align_import data.zmod.parity from "leanprover-community/mathlib"@"048240e809f04e2bde02482ab44bc230744cc6c9" namespace ZMod theorem eq_zero_iff_even {n : β„•} : (n : ZMod 2) = 0 ↔ Even n := (CharP.cast_eq_zero_iff (ZMod 2) 2 n).trans even_iff_two_dvd.symm #align zmod.eq_zero_iff_even ZMod.eq_zero_iff_even theorem eq_one_iff_odd {n : β„•} : (n : ZMod 2) = 1 ↔ Odd n := by rw [← @Nat.cast_one (ZMod 2), ZMod.eq_iff_modEq_nat, Nat.odd_iff, Nat.ModEq] #align zmod.eq_one_iff_odd ZMod.eq_one_iff_odd
Mathlib/Data/ZMod/Parity.lean
32
35
theorem ne_zero_iff_odd {n : β„•} : (n : ZMod 2) β‰  0 ↔ Odd n := by
constructor <;> Β· contrapose simp [eq_zero_iff_even]
3
20.085537
1
0.5
2
436
import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Init.Data.Ordering.Lemmas import Mathlib.SetTheory.Ordinal.Principal import Mathlib.Tactic.NormNum #align_import set_theory.ordinal.notation from "leanprover-community/mathlib"@"b67044ba53af18680e1dd246861d9584e968495d" set_option linter.uppercaseLean3 false open Ordinal Order -- Porting note: the generated theorem is warned by `simpNF`. set_option genSizeOfSpec false in inductive ONote : Type | zero : ONote | oadd : ONote β†’ β„•+ β†’ ONote β†’ ONote deriving DecidableEq #align onote ONote compile_inductive% ONote namespace ONote instance : Zero ONote := ⟨zero⟩ @[simp] theorem zero_def : zero = 0 := rfl #align onote.zero_def ONote.zero_def instance : Inhabited ONote := ⟨0⟩ instance : One ONote := ⟨oadd 0 1 0⟩ def omega : ONote := oadd 1 1 0 #align onote.omega ONote.omega @[simp] noncomputable def repr : ONote β†’ Ordinal.{0} | 0 => 0 | oadd e n a => Ο‰ ^ repr e * n + repr a #align onote.repr ONote.repr def toStringAux1 (e : ONote) (n : β„•) (s : String) : String := if e = 0 then toString n else (if e = 1 then "Ο‰" else "Ο‰^(" ++ s ++ ")") ++ if n = 1 then "" else "*" ++ toString n #align onote.to_string_aux1 ONote.toStringAux1 def toString : ONote β†’ String | zero => "0" | oadd e n 0 => toStringAux1 e n (toString e) | oadd e n a => toStringAux1 e n (toString e) ++ " + " ++ toString a #align onote.to_string ONote.toString open Lean in def repr' (prec : β„•) : ONote β†’ Format | zero => "0" | oadd e n a => Repr.addAppParen ("oadd " ++ (repr' max_prec e) ++ " " ++ Nat.repr (n : β„•) ++ " " ++ (repr' max_prec a)) prec #align onote.repr' ONote.repr instance : ToString ONote := ⟨toString⟩ instance : Repr ONote where reprPrec o prec := repr' prec o instance : Preorder ONote where le x y := repr x ≀ repr y lt x y := repr x < repr y le_refl _ := @le_refl Ordinal _ _ le_trans _ _ _ := @le_trans Ordinal _ _ _ _ lt_iff_le_not_le _ _ := @lt_iff_le_not_le Ordinal _ _ _ theorem lt_def {x y : ONote} : x < y ↔ repr x < repr y := Iff.rfl #align onote.lt_def ONote.lt_def theorem le_def {x y : ONote} : x ≀ y ↔ repr x ≀ repr y := Iff.rfl #align onote.le_def ONote.le_def instance : WellFoundedRelation ONote := ⟨(Β· < Β·), InvImage.wf repr Ordinal.lt_wf⟩ @[coe] def ofNat : β„• β†’ ONote | 0 => 0 | Nat.succ n => oadd 0 n.succPNat 0 #align onote.of_nat ONote.ofNat -- Porting note (#11467): during the port we marked these lemmas with `@[eqns]` -- to emulate the old Lean 3 behaviour. @[simp] theorem ofNat_zero : ofNat 0 = 0 := rfl @[simp] theorem ofNat_succ (n) : ofNat (Nat.succ n) = oadd 0 n.succPNat 0 := rfl instance nat (n : β„•) : OfNat ONote n where ofNat := ofNat n @[simp 1200] theorem ofNat_one : ofNat 1 = 1 := rfl #align onote.of_nat_one ONote.ofNat_one @[simp]
Mathlib/SetTheory/Ordinal/Notation.lean
150
150
theorem repr_ofNat (n : β„•) : repr (ofNat n) = n := by
cases n <;> simp
1
2.718282
0
0.5
2
437
import Mathlib.Algebra.Ring.Divisibility.Basic import Mathlib.Init.Data.Ordering.Lemmas import Mathlib.SetTheory.Ordinal.Principal import Mathlib.Tactic.NormNum #align_import set_theory.ordinal.notation from "leanprover-community/mathlib"@"b67044ba53af18680e1dd246861d9584e968495d" set_option linter.uppercaseLean3 false open Ordinal Order -- Porting note: the generated theorem is warned by `simpNF`. set_option genSizeOfSpec false in inductive ONote : Type | zero : ONote | oadd : ONote β†’ β„•+ β†’ ONote β†’ ONote deriving DecidableEq #align onote ONote compile_inductive% ONote namespace ONote instance : Zero ONote := ⟨zero⟩ @[simp] theorem zero_def : zero = 0 := rfl #align onote.zero_def ONote.zero_def instance : Inhabited ONote := ⟨0⟩ instance : One ONote := ⟨oadd 0 1 0⟩ def omega : ONote := oadd 1 1 0 #align onote.omega ONote.omega @[simp] noncomputable def repr : ONote β†’ Ordinal.{0} | 0 => 0 | oadd e n a => Ο‰ ^ repr e * n + repr a #align onote.repr ONote.repr def toStringAux1 (e : ONote) (n : β„•) (s : String) : String := if e = 0 then toString n else (if e = 1 then "Ο‰" else "Ο‰^(" ++ s ++ ")") ++ if n = 1 then "" else "*" ++ toString n #align onote.to_string_aux1 ONote.toStringAux1 def toString : ONote β†’ String | zero => "0" | oadd e n 0 => toStringAux1 e n (toString e) | oadd e n a => toStringAux1 e n (toString e) ++ " + " ++ toString a #align onote.to_string ONote.toString open Lean in def repr' (prec : β„•) : ONote β†’ Format | zero => "0" | oadd e n a => Repr.addAppParen ("oadd " ++ (repr' max_prec e) ++ " " ++ Nat.repr (n : β„•) ++ " " ++ (repr' max_prec a)) prec #align onote.repr' ONote.repr instance : ToString ONote := ⟨toString⟩ instance : Repr ONote where reprPrec o prec := repr' prec o instance : Preorder ONote where le x y := repr x ≀ repr y lt x y := repr x < repr y le_refl _ := @le_refl Ordinal _ _ le_trans _ _ _ := @le_trans Ordinal _ _ _ _ lt_iff_le_not_le _ _ := @lt_iff_le_not_le Ordinal _ _ _ theorem lt_def {x y : ONote} : x < y ↔ repr x < repr y := Iff.rfl #align onote.lt_def ONote.lt_def theorem le_def {x y : ONote} : x ≀ y ↔ repr x ≀ repr y := Iff.rfl #align onote.le_def ONote.le_def instance : WellFoundedRelation ONote := ⟨(Β· < Β·), InvImage.wf repr Ordinal.lt_wf⟩ @[coe] def ofNat : β„• β†’ ONote | 0 => 0 | Nat.succ n => oadd 0 n.succPNat 0 #align onote.of_nat ONote.ofNat -- Porting note (#11467): during the port we marked these lemmas with `@[eqns]` -- to emulate the old Lean 3 behaviour. @[simp] theorem ofNat_zero : ofNat 0 = 0 := rfl @[simp] theorem ofNat_succ (n) : ofNat (Nat.succ n) = oadd 0 n.succPNat 0 := rfl instance nat (n : β„•) : OfNat ONote n where ofNat := ofNat n @[simp 1200] theorem ofNat_one : ofNat 1 = 1 := rfl #align onote.of_nat_one ONote.ofNat_one @[simp] theorem repr_ofNat (n : β„•) : repr (ofNat n) = n := by cases n <;> simp #align onote.repr_of_nat ONote.repr_ofNat -- @[simp] -- Porting note (#10618): simp can prove this theorem repr_one : repr (ofNat 1) = (1 : β„•) := repr_ofNat 1 #align onote.repr_one ONote.repr_one
Mathlib/SetTheory/Ordinal/Notation.lean
157
159
theorem omega_le_oadd (e n a) : Ο‰ ^ repr e ≀ repr (oadd e n a) := by
refine le_trans ?_ (le_add_right _ _) simpa using (Ordinal.mul_le_mul_iff_left <| opow_pos (repr e) omega_pos).2 (natCast_le.2 n.2)
2
7.389056
1
0.5
2
437
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ]
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
35
43
theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by
refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _)
7
1,096.633158
2
0.5
4
438
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ] theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _) #align cont_diff_on_clm_apply contDiffOn_clm_apply
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
46
48
theorem contDiff_clm_apply_iff {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} [FiniteDimensional π•œ F] : ContDiff π•œ n f ↔ βˆ€ y, ContDiff π•œ n fun x => f x y := by
simp_rw [← contDiffOn_univ, contDiffOn_clm_apply]
1
2.718282
0
0.5
4
438
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ] theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _) #align cont_diff_on_clm_apply contDiffOn_clm_apply theorem contDiff_clm_apply_iff {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} [FiniteDimensional π•œ F] : ContDiff π•œ n f ↔ βˆ€ y, ContDiff π•œ n fun x => f x y := by simp_rw [← contDiffOn_univ, contDiffOn_clm_apply] #align cont_diff_clm_apply_iff contDiff_clm_apply_iff
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
60
62
theorem contDiff_succ_iff_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} : ContDiff π•œ (n + 1 : β„•) f ↔ Differentiable π•œ f ∧ βˆ€ y, ContDiff π•œ n fun x => fderiv π•œ f x y := by
rw [contDiff_succ_iff_fderiv, contDiff_clm_apply_iff]
1
2.718282
0
0.5
4
438
import Mathlib.Analysis.Calculus.ContDiff.Basic import Mathlib.Analysis.NormedSpace.FiniteDimension #align_import analysis.calculus.cont_diff from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" noncomputable section universe uD uE uF uG variable {π•œ : Type*} [NontriviallyNormedField π•œ] {D : Type uD} [NormedAddCommGroup D] [NormedSpace π•œ D] {E : Type uE} [NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type uF} [NormedAddCommGroup F] [NormedSpace π•œ F] {G : Type uG} [NormedAddCommGroup G] [NormedSpace π•œ G] section FiniteDimensional open Function FiniteDimensional variable [CompleteSpace π•œ] theorem contDiffOn_clm_apply {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} {s : Set E} [FiniteDimensional π•œ F] : ContDiffOn π•œ n f s ↔ βˆ€ y, ContDiffOn π•œ n (fun x => f x y) s := by refine ⟨fun h y => h.clm_apply contDiffOn_const, fun h => ?_⟩ let d := finrank π•œ F have hd : d = finrank π•œ (Fin d β†’ π•œ) := (finrank_fin_fun π•œ).symm let e₁ := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[π•œ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.comp_contDiffOn (contDiffOn_pi.mpr fun i => h _) #align cont_diff_on_clm_apply contDiffOn_clm_apply theorem contDiff_clm_apply_iff {n : β„•βˆž} {f : E β†’ F β†’L[π•œ] G} [FiniteDimensional π•œ F] : ContDiff π•œ n f ↔ βˆ€ y, ContDiff π•œ n fun x => f x y := by simp_rw [← contDiffOn_univ, contDiffOn_clm_apply] #align cont_diff_clm_apply_iff contDiff_clm_apply_iff theorem contDiff_succ_iff_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} : ContDiff π•œ (n + 1 : β„•) f ↔ Differentiable π•œ f ∧ βˆ€ y, ContDiff π•œ n fun x => fderiv π•œ f x y := by rw [contDiff_succ_iff_fderiv, contDiff_clm_apply_iff] #align cont_diff_succ_iff_fderiv_apply contDiff_succ_iff_fderiv_apply theorem contDiffOn_succ_of_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} {s : Set E} (hf : DifferentiableOn π•œ f s) (h : βˆ€ y, ContDiffOn π•œ n (fun x => fderivWithin π•œ f s x y) s) : ContDiffOn π•œ (n + 1 : β„•) f s := contDiffOn_succ_of_fderivWithin hf <| contDiffOn_clm_apply.mpr h #align cont_diff_on_succ_of_fderiv_apply contDiffOn_succ_of_fderiv_apply
Mathlib/Analysis/Calculus/ContDiff/FiniteDimension.lean
71
75
theorem contDiffOn_succ_iff_fderiv_apply [FiniteDimensional π•œ E] {n : β„•} {f : E β†’ F} {s : Set E} (hs : UniqueDiffOn π•œ s) : ContDiffOn π•œ (n + 1 : β„•) f s ↔ DifferentiableOn π•œ f s ∧ βˆ€ y, ContDiffOn π•œ n (fun x => fderivWithin π•œ f s x y) s := by
rw [contDiffOn_succ_iff_fderivWithin hs, contDiffOn_clm_apply]
1
2.718282
0
0.5
4
438
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
7.389056
1
0.5
2
439
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]
1
2.718282
0
0.5
2
439
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.LinearAlgebra.Matrix.ZPow #align_import linear_algebra.matrix.hermitian from "leanprover-community/mathlib"@"caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c" namespace Matrix variable {Ξ± Ξ² : Type*} {m n : Type*} {A : Matrix n n Ξ±} open scoped Matrix local notation "βŸͺ" x ", " y "⟫" => @inner Ξ± _ _ x y section Star variable [Star Ξ±] [Star Ξ²] def IsHermitian (A : Matrix n n Ξ±) : Prop := Aα΄΄ = A #align matrix.is_hermitian Matrix.IsHermitian instance (A : Matrix n n Ξ±) [Decidable (Aα΄΄ = A)] : Decidable (IsHermitian A) := inferInstanceAs <| Decidable (_ = _) theorem IsHermitian.eq {A : Matrix n n Ξ±} (h : A.IsHermitian) : Aα΄΄ = A := h #align matrix.is_hermitian.eq Matrix.IsHermitian.eq protected theorem IsHermitian.isSelfAdjoint {A : Matrix n n Ξ±} (h : A.IsHermitian) : IsSelfAdjoint A := h #align matrix.is_hermitian.is_self_adjoint Matrix.IsHermitian.isSelfAdjoint -- @[ext] -- Porting note: incorrect ext, not a structure or a lemma proving x = y
Mathlib/LinearAlgebra/Matrix/Hermitian.lean
56
57
theorem IsHermitian.ext {A : Matrix n n Ξ±} : (βˆ€ i j, star (A j i) = A i j) β†’ A.IsHermitian := by
intro h; ext i j; exact h i j
1
2.718282
0
0.5
2
440
import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.LinearAlgebra.Matrix.ZPow #align_import linear_algebra.matrix.hermitian from "leanprover-community/mathlib"@"caa58cbf5bfb7f81ccbaca4e8b8ac4bc2b39cc1c" namespace Matrix variable {Ξ± Ξ² : Type*} {m n : Type*} {A : Matrix n n Ξ±} open scoped Matrix local notation "βŸͺ" x ", " y "⟫" => @inner Ξ± _ _ x y section Star variable [Star Ξ±] [Star Ξ²] def IsHermitian (A : Matrix n n Ξ±) : Prop := Aα΄΄ = A #align matrix.is_hermitian Matrix.IsHermitian instance (A : Matrix n n Ξ±) [Decidable (Aα΄΄ = A)] : Decidable (IsHermitian A) := inferInstanceAs <| Decidable (_ = _) theorem IsHermitian.eq {A : Matrix n n Ξ±} (h : A.IsHermitian) : Aα΄΄ = A := h #align matrix.is_hermitian.eq Matrix.IsHermitian.eq protected theorem IsHermitian.isSelfAdjoint {A : Matrix n n Ξ±} (h : A.IsHermitian) : IsSelfAdjoint A := h #align matrix.is_hermitian.is_self_adjoint Matrix.IsHermitian.isSelfAdjoint -- @[ext] -- Porting note: incorrect ext, not a structure or a lemma proving x = y theorem IsHermitian.ext {A : Matrix n n Ξ±} : (βˆ€ i j, star (A j i) = A i j) β†’ A.IsHermitian := by intro h; ext i j; exact h i j #align matrix.is_hermitian.ext Matrix.IsHermitian.ext theorem IsHermitian.apply {A : Matrix n n Ξ±} (h : A.IsHermitian) (i j : n) : star (A j i) = A i j := congr_fun (congr_fun h _) _ #align matrix.is_hermitian.apply Matrix.IsHermitian.apply theorem IsHermitian.ext_iff {A : Matrix n n Ξ±} : A.IsHermitian ↔ βˆ€ i j, star (A j i) = A i j := ⟨IsHermitian.apply, IsHermitian.ext⟩ #align matrix.is_hermitian.ext_iff Matrix.IsHermitian.ext_iff @[simp] theorem IsHermitian.map {A : Matrix n n Ξ±} (h : A.IsHermitian) (f : Ξ± β†’ Ξ²) (hf : Function.Semiconj f star star) : (A.map f).IsHermitian := (conjTranspose_map f hf).symm.trans <| h.eq.symm β–Έ rfl #align matrix.is_hermitian.map Matrix.IsHermitian.map
Mathlib/LinearAlgebra/Matrix/Hermitian.lean
74
76
theorem IsHermitian.transpose {A : Matrix n n Ξ±} (h : A.IsHermitian) : Aα΅€.IsHermitian := by
rw [IsHermitian, conjTranspose, transpose_map] exact congr_arg Matrix.transpose h
2
7.389056
1
0.5
2
440
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Algebra.Ring.Invertible import Mathlib.Data.Nat.Cast.Order #align_import algebra.order.invertible from "leanprover-community/mathlib"@"ee0c179cd3c8a45aa5bffbf1b41d8dbede452865" variable {Ξ± : Type*} [LinearOrderedSemiring Ξ±] {a : Ξ±} @[simp]
Mathlib/Algebra/Order/Invertible.lean
19
21
theorem invOf_pos [Invertible a] : 0 < β…Ÿ a ↔ 0 < a := haveI : 0 < a * β…Ÿ a := by
simp only [mul_invOf_self, zero_lt_one] ⟨fun h => pos_of_mul_pos_left this h.le, fun h => pos_of_mul_pos_right this h.le⟩
2
7.389056
1
0.5
4
441
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Algebra.Ring.Invertible import Mathlib.Data.Nat.Cast.Order #align_import algebra.order.invertible from "leanprover-community/mathlib"@"ee0c179cd3c8a45aa5bffbf1b41d8dbede452865" variable {Ξ± : Type*} [LinearOrderedSemiring Ξ±] {a : Ξ±} @[simp] theorem invOf_pos [Invertible a] : 0 < β…Ÿ a ↔ 0 < a := haveI : 0 < a * β…Ÿ a := by simp only [mul_invOf_self, zero_lt_one] ⟨fun h => pos_of_mul_pos_left this h.le, fun h => pos_of_mul_pos_right this h.le⟩ #align inv_of_pos invOf_pos @[simp]
Mathlib/Algebra/Order/Invertible.lean
25
25
theorem invOf_nonpos [Invertible a] : β…Ÿ a ≀ 0 ↔ a ≀ 0 := by
simp only [← not_lt, invOf_pos]
1
2.718282
0
0.5
4
441
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Algebra.Ring.Invertible import Mathlib.Data.Nat.Cast.Order #align_import algebra.order.invertible from "leanprover-community/mathlib"@"ee0c179cd3c8a45aa5bffbf1b41d8dbede452865" variable {Ξ± : Type*} [LinearOrderedSemiring Ξ±] {a : Ξ±} @[simp] theorem invOf_pos [Invertible a] : 0 < β…Ÿ a ↔ 0 < a := haveI : 0 < a * β…Ÿ a := by simp only [mul_invOf_self, zero_lt_one] ⟨fun h => pos_of_mul_pos_left this h.le, fun h => pos_of_mul_pos_right this h.le⟩ #align inv_of_pos invOf_pos @[simp] theorem invOf_nonpos [Invertible a] : β…Ÿ a ≀ 0 ↔ a ≀ 0 := by simp only [← not_lt, invOf_pos] #align inv_of_nonpos invOf_nonpos @[simp]
Mathlib/Algebra/Order/Invertible.lean
29
31
theorem invOf_nonneg [Invertible a] : 0 ≀ β…Ÿ a ↔ 0 ≀ a := haveI : 0 < a * β…Ÿ a := by
simp only [mul_invOf_self, zero_lt_one] ⟨fun h => (pos_of_mul_pos_left this h).le, fun h => (pos_of_mul_pos_right this h).le⟩
2
7.389056
1
0.5
4
441
import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Algebra.Ring.Invertible import Mathlib.Data.Nat.Cast.Order #align_import algebra.order.invertible from "leanprover-community/mathlib"@"ee0c179cd3c8a45aa5bffbf1b41d8dbede452865" variable {Ξ± : Type*} [LinearOrderedSemiring Ξ±] {a : Ξ±} @[simp] theorem invOf_pos [Invertible a] : 0 < β…Ÿ a ↔ 0 < a := haveI : 0 < a * β…Ÿ a := by simp only [mul_invOf_self, zero_lt_one] ⟨fun h => pos_of_mul_pos_left this h.le, fun h => pos_of_mul_pos_right this h.le⟩ #align inv_of_pos invOf_pos @[simp] theorem invOf_nonpos [Invertible a] : β…Ÿ a ≀ 0 ↔ a ≀ 0 := by simp only [← not_lt, invOf_pos] #align inv_of_nonpos invOf_nonpos @[simp] theorem invOf_nonneg [Invertible a] : 0 ≀ β…Ÿ a ↔ 0 ≀ a := haveI : 0 < a * β…Ÿ a := by simp only [mul_invOf_self, zero_lt_one] ⟨fun h => (pos_of_mul_pos_left this h).le, fun h => (pos_of_mul_pos_right this h).le⟩ #align inv_of_nonneg invOf_nonneg @[simp]
Mathlib/Algebra/Order/Invertible.lean
35
35
theorem invOf_lt_zero [Invertible a] : β…Ÿ a < 0 ↔ a < 0 := by
simp only [← not_le, invOf_nonneg]
1
2.718282
0
0.5
4
441
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp
Mathlib/Topology/Maps.lean
69
72
theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by
refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced]
2
7.389056
1
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f
Mathlib/Topology/Maps.lean
97
99
theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by
simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image]
1
2.718282
0
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma
Mathlib/Topology/Maps.lean
112
115
theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by
delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff]
2
7.389056
1
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x β–Έ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin
Mathlib/Topology/Maps.lean
122
124
theorem tendsto_nhds_iff {f : ΞΉ β†’ Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by
rw [hg.nhds_eq_comap, tendsto_comap_iff]
1
2.718282
0
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x β–Έ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin theorem tendsto_nhds_iff {f : ΞΉ β†’ Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by rw [hg.nhds_eq_comap, tendsto_comap_iff] #align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff theorem continuousAt_iff (hg : Inducing g) {x : X} : ContinuousAt f x ↔ ContinuousAt (g ∘ f) x := hg.tendsto_nhds_iff #align inducing.continuous_at_iff Inducing.continuousAt_iff
Mathlib/Topology/Maps.lean
132
134
theorem continuous_iff (hg : Inducing g) : Continuous f ↔ Continuous (g ∘ f) := by
simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff]
1
2.718282
0
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x β–Έ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin theorem tendsto_nhds_iff {f : ΞΉ β†’ Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by rw [hg.nhds_eq_comap, tendsto_comap_iff] #align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff theorem continuousAt_iff (hg : Inducing g) {x : X} : ContinuousAt f x ↔ ContinuousAt (g ∘ f) x := hg.tendsto_nhds_iff #align inducing.continuous_at_iff Inducing.continuousAt_iff theorem continuous_iff (hg : Inducing g) : Continuous f ↔ Continuous (g ∘ f) := by simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff] #align inducing.continuous_iff Inducing.continuous_iff
Mathlib/Topology/Maps.lean
137
139
theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f ∈ 𝓝 (f x)) : ContinuousAt (g ∘ f) x ↔ ContinuousAt g (f x) := by
simp_rw [ContinuousAt, Filter.Tendsto, ← hf.map_nhds_of_mem _ h, Filter.map_map, comp]
1
2.718282
0
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x β–Έ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin theorem tendsto_nhds_iff {f : ΞΉ β†’ Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by rw [hg.nhds_eq_comap, tendsto_comap_iff] #align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff theorem continuousAt_iff (hg : Inducing g) {x : X} : ContinuousAt f x ↔ ContinuousAt (g ∘ f) x := hg.tendsto_nhds_iff #align inducing.continuous_at_iff Inducing.continuousAt_iff theorem continuous_iff (hg : Inducing g) : Continuous f ↔ Continuous (g ∘ f) := by simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff] #align inducing.continuous_iff Inducing.continuous_iff theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f ∈ 𝓝 (f x)) : ContinuousAt (g ∘ f) x ↔ ContinuousAt g (f x) := by simp_rw [ContinuousAt, Filter.Tendsto, ← hf.map_nhds_of_mem _ h, Filter.map_map, comp] #align inducing.continuous_at_iff' Inducing.continuousAt_iff' protected theorem continuous (hf : Inducing f) : Continuous f := hf.continuous_iff.mp continuous_id #align inducing.continuous Inducing.continuous
Mathlib/Topology/Maps.lean
146
149
theorem closure_eq_preimage_closure_image (hf : Inducing f) (s : Set X) : closure s = f ⁻¹' closure (f '' s) := by
ext x rw [Set.mem_preimage, ← closure_induced, hf.induced]
2
7.389056
1
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x β–Έ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin theorem tendsto_nhds_iff {f : ΞΉ β†’ Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by rw [hg.nhds_eq_comap, tendsto_comap_iff] #align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff theorem continuousAt_iff (hg : Inducing g) {x : X} : ContinuousAt f x ↔ ContinuousAt (g ∘ f) x := hg.tendsto_nhds_iff #align inducing.continuous_at_iff Inducing.continuousAt_iff theorem continuous_iff (hg : Inducing g) : Continuous f ↔ Continuous (g ∘ f) := by simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff] #align inducing.continuous_iff Inducing.continuous_iff theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f ∈ 𝓝 (f x)) : ContinuousAt (g ∘ f) x ↔ ContinuousAt g (f x) := by simp_rw [ContinuousAt, Filter.Tendsto, ← hf.map_nhds_of_mem _ h, Filter.map_map, comp] #align inducing.continuous_at_iff' Inducing.continuousAt_iff' protected theorem continuous (hf : Inducing f) : Continuous f := hf.continuous_iff.mp continuous_id #align inducing.continuous Inducing.continuous theorem closure_eq_preimage_closure_image (hf : Inducing f) (s : Set X) : closure s = f ⁻¹' closure (f '' s) := by ext x rw [Set.mem_preimage, ← closure_induced, hf.induced] #align inducing.closure_eq_preimage_closure_image Inducing.closure_eq_preimage_closure_image
Mathlib/Topology/Maps.lean
152
153
theorem isClosed_iff (hf : Inducing f) {s : Set X} : IsClosed s ↔ βˆƒ t, IsClosed t ∧ f ⁻¹' t = s := by
rw [hf.induced, isClosed_induced_iff]
1
2.718282
0
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section Inducing variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] theorem inducing_induced (f : X β†’ Y) : @Inducing X Y (TopologicalSpace.induced f β€Ή_β€Ί) _ f := @Inducing.mk _ _ (TopologicalSpace.induced f β€Ή_β€Ί) _ _ rfl theorem inducing_id : Inducing (@id X) := ⟨induced_id.symm⟩ #align inducing_id inducing_id protected theorem Inducing.comp (hg : Inducing g) (hf : Inducing f) : Inducing (g ∘ f) := ⟨by rw [hf.induced, hg.induced, induced_compose]⟩ #align inducing.comp Inducing.comp theorem Inducing.of_comp_iff (hg : Inducing g) : Inducing (g ∘ f) ↔ Inducing f := by refine ⟨fun h ↦ ?_, hg.comp⟩ rw [inducing_iff, hg.induced, induced_compose, h.induced] #align inducing.inducing_iff Inducing.of_comp_iff theorem inducing_of_inducing_compose (hf : Continuous f) (hg : Continuous g) (hgf : Inducing (g ∘ f)) : Inducing f := ⟨le_antisymm (by rwa [← continuous_iff_le_induced]) (by rw [hgf.induced, ← induced_compose] exact induced_mono hg.le_induced)⟩ #align inducing_of_inducing_compose inducing_of_inducing_compose theorem inducing_iff_nhds : Inducing f ↔ βˆ€ x, 𝓝 x = comap f (𝓝 (f x)) := (inducing_iff _).trans (induced_iff_nhds_eq f) #align inducing_iff_nhds inducing_iff_nhds namespace Inducing theorem nhds_eq_comap (hf : Inducing f) : βˆ€ x : X, 𝓝 x = comap f (𝓝 <| f x) := inducing_iff_nhds.1 hf #align inducing.nhds_eq_comap Inducing.nhds_eq_comap theorem basis_nhds {p : ΞΉ β†’ Prop} {s : ΞΉ β†’ Set Y} (hf : Inducing f) {x : X} (h_basis : (𝓝 (f x)).HasBasis p s) : (𝓝 x).HasBasis p (preimage f ∘ s) := hf.nhds_eq_comap x β–Έ h_basis.comap f theorem nhdsSet_eq_comap (hf : Inducing f) (s : Set X) : 𝓝˒ s = comap f (𝓝˒ (f '' s)) := by simp only [nhdsSet, sSup_image, comap_iSup, hf.nhds_eq_comap, iSup_image] #align inducing.nhds_set_eq_comap Inducing.nhdsSet_eq_comap theorem map_nhds_eq (hf : Inducing f) (x : X) : (𝓝 x).map f = 𝓝[range f] f x := hf.induced.symm β–Έ map_nhds_induced_eq x #align inducing.map_nhds_eq Inducing.map_nhds_eq theorem map_nhds_of_mem (hf : Inducing f) (x : X) (h : range f ∈ 𝓝 (f x)) : (𝓝 x).map f = 𝓝 (f x) := hf.induced.symm β–Έ map_nhds_induced_of_mem h #align inducing.map_nhds_of_mem Inducing.map_nhds_of_mem -- Porting note (#10756): new lemma theorem mapClusterPt_iff (hf : Inducing f) {x : X} {l : Filter X} : MapClusterPt (f x) l f ↔ ClusterPt x l := by delta MapClusterPt ClusterPt rw [← Filter.push_pull', ← hf.nhds_eq_comap, map_neBot_iff] theorem image_mem_nhdsWithin (hf : Inducing f) {x : X} {s : Set X} (hs : s ∈ 𝓝 x) : f '' s ∈ 𝓝[range f] f x := hf.map_nhds_eq x β–Έ image_mem_map hs #align inducing.image_mem_nhds_within Inducing.image_mem_nhdsWithin theorem tendsto_nhds_iff {f : ΞΉ β†’ Y} {l : Filter ΞΉ} {y : Y} (hg : Inducing g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y)) := by rw [hg.nhds_eq_comap, tendsto_comap_iff] #align inducing.tendsto_nhds_iff Inducing.tendsto_nhds_iff theorem continuousAt_iff (hg : Inducing g) {x : X} : ContinuousAt f x ↔ ContinuousAt (g ∘ f) x := hg.tendsto_nhds_iff #align inducing.continuous_at_iff Inducing.continuousAt_iff theorem continuous_iff (hg : Inducing g) : Continuous f ↔ Continuous (g ∘ f) := by simp_rw [continuous_iff_continuousAt, hg.continuousAt_iff] #align inducing.continuous_iff Inducing.continuous_iff theorem continuousAt_iff' (hf : Inducing f) {x : X} (h : range f ∈ 𝓝 (f x)) : ContinuousAt (g ∘ f) x ↔ ContinuousAt g (f x) := by simp_rw [ContinuousAt, Filter.Tendsto, ← hf.map_nhds_of_mem _ h, Filter.map_map, comp] #align inducing.continuous_at_iff' Inducing.continuousAt_iff' protected theorem continuous (hf : Inducing f) : Continuous f := hf.continuous_iff.mp continuous_id #align inducing.continuous Inducing.continuous theorem closure_eq_preimage_closure_image (hf : Inducing f) (s : Set X) : closure s = f ⁻¹' closure (f '' s) := by ext x rw [Set.mem_preimage, ← closure_induced, hf.induced] #align inducing.closure_eq_preimage_closure_image Inducing.closure_eq_preimage_closure_image theorem isClosed_iff (hf : Inducing f) {s : Set X} : IsClosed s ↔ βˆƒ t, IsClosed t ∧ f ⁻¹' t = s := by rw [hf.induced, isClosed_induced_iff] #align inducing.is_closed_iff Inducing.isClosed_iff
Mathlib/Topology/Maps.lean
156
157
theorem isClosed_iff' (hf : Inducing f) {s : Set X} : IsClosed s ↔ βˆ€ x, f x ∈ closure (f '' s) β†’ x ∈ s := by
rw [hf.induced, isClosed_induced_iff']
1
2.718282
0
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section OpenMap variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] namespace IsOpenMap protected theorem id : IsOpenMap (@id X) := fun s hs => by rwa [image_id] #align is_open_map.id IsOpenMap.id protected theorem comp (hg : IsOpenMap g) (hf : IsOpenMap f) : IsOpenMap (g ∘ f) := fun s hs => by rw [image_comp]; exact hg _ (hf _ hs) #align is_open_map.comp IsOpenMap.comp
Mathlib/Topology/Maps.lean
338
340
theorem isOpen_range (hf : IsOpenMap f) : IsOpen (range f) := by
rw [← image_univ] exact hf _ isOpen_univ
2
7.389056
1
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section OpenMap variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] namespace IsOpenMap protected theorem id : IsOpenMap (@id X) := fun s hs => by rwa [image_id] #align is_open_map.id IsOpenMap.id protected theorem comp (hg : IsOpenMap g) (hf : IsOpenMap f) : IsOpenMap (g ∘ f) := fun s hs => by rw [image_comp]; exact hg _ (hf _ hs) #align is_open_map.comp IsOpenMap.comp theorem isOpen_range (hf : IsOpenMap f) : IsOpen (range f) := by rw [← image_univ] exact hf _ isOpen_univ #align is_open_map.is_open_range IsOpenMap.isOpen_range theorem image_mem_nhds (hf : IsOpenMap f) {x : X} {s : Set X} (hx : s ∈ 𝓝 x) : f '' s ∈ 𝓝 (f x) := let ⟨t, hts, ht, hxt⟩ := mem_nhds_iff.1 hx mem_of_superset (IsOpen.mem_nhds (hf t ht) (mem_image_of_mem _ hxt)) (image_subset _ hts) #align is_open_map.image_mem_nhds IsOpenMap.image_mem_nhds theorem range_mem_nhds (hf : IsOpenMap f) (x : X) : range f ∈ 𝓝 (f x) := hf.isOpen_range.mem_nhds <| mem_range_self _ #align is_open_map.range_mem_nhds IsOpenMap.range_mem_nhds theorem mapsTo_interior (hf : IsOpenMap f) {s : Set X} {t : Set Y} (h : MapsTo f s t) : MapsTo f (interior s) (interior t) := mapsTo'.2 <| interior_maximal (h.mono interior_subset Subset.rfl).image_subset (hf _ isOpen_interior) #align is_open_map.maps_to_interior IsOpenMap.mapsTo_interior theorem image_interior_subset (hf : IsOpenMap f) (s : Set X) : f '' interior s βŠ† interior (f '' s) := (hf.mapsTo_interior (mapsTo_image f s)).image_subset #align is_open_map.image_interior_subset IsOpenMap.image_interior_subset theorem nhds_le (hf : IsOpenMap f) (x : X) : 𝓝 (f x) ≀ (𝓝 x).map f := le_map fun _ => hf.image_mem_nhds #align is_open_map.nhds_le IsOpenMap.nhds_le theorem of_nhds_le (hf : βˆ€ x, 𝓝 (f x) ≀ map f (𝓝 x)) : IsOpenMap f := fun _s hs => isOpen_iff_mem_nhds.2 fun _y ⟨_x, hxs, hxy⟩ => hxy β–Έ hf _ (image_mem_map <| hs.mem_nhds hxs) #align is_open_map.of_nhds_le IsOpenMap.of_nhds_le
Mathlib/Topology/Maps.lean
371
378
theorem of_sections (h : βˆ€ x, βˆƒ g : Y β†’ X, ContinuousAt g (f x) ∧ g (f x) = x ∧ RightInverse g f) : IsOpenMap f := of_nhds_le fun x => let ⟨g, hgc, hgx, hgf⟩ := h x calc 𝓝 (f x) = map f (map g (𝓝 (f x))) := by
rw [map_map, hgf.comp_eq_id, map_id] _ ≀ map f (𝓝 (g (f x))) := map_mono hgc _ = map f (𝓝 x) := by rw [hgx]
3
20.085537
1
0.5
12
442
import Mathlib.Topology.Order #align_import topology.maps from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Set Filter Function open TopologicalSpace Topology Filter variable {X : Type*} {Y : Type*} {Z : Type*} {ΞΉ : Type*} {f : X β†’ Y} {g : Y β†’ Z} section OpenMap variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] section IsClosedMap variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] namespace IsClosedMap open Function protected theorem id : IsClosedMap (@id X) := fun s hs => by rwa [image_id] #align is_closed_map.id IsClosedMap.id protected theorem comp (hg : IsClosedMap g) (hf : IsClosedMap f) : IsClosedMap (g ∘ f) := by intro s hs rw [image_comp] exact hg _ (hf _ hs) #align is_closed_map.comp IsClosedMap.comp theorem closure_image_subset (hf : IsClosedMap f) (s : Set X) : closure (f '' s) βŠ† f '' closure s := closure_minimal (image_subset _ subset_closure) (hf _ isClosed_closure) #align is_closed_map.closure_image_subset IsClosedMap.closure_image_subset theorem of_inverse {f' : Y β†’ X} (h : Continuous f') (l_inv : LeftInverse f f') (r_inv : RightInverse f f') : IsClosedMap f := fun s hs => by rw [image_eq_preimage_of_inverse r_inv l_inv] exact hs.preimage h #align is_closed_map.of_inverse IsClosedMap.of_inverse
Mathlib/Topology/Maps.lean
478
482
theorem of_nonempty (h : βˆ€ s, IsClosed s β†’ s.Nonempty β†’ IsClosed (f '' s)) : IsClosedMap f := by
intro s hs; rcases eq_empty_or_nonempty s with h2s | h2s Β· simp_rw [h2s, image_empty, isClosed_empty] Β· exact h s hs h2s
3
20.085537
1
0.5
12
442
import Mathlib.Topology.Algebra.Module.WeakDual import Mathlib.Analysis.Normed.Field.Basic import Mathlib.Analysis.LocallyConvex.WithSeminorms #align_import analysis.locally_convex.weak_dual from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" variable {π•œ E F ΞΉ : Type*} open Topology section BilinForm namespace LinearMap variable [NormedField π•œ] [AddCommGroup E] [Module π•œ E] [AddCommGroup F] [Module π•œ F] def toSeminorm (f : E β†’β‚—[π•œ] π•œ) : Seminorm π•œ E := (normSeminorm π•œ π•œ).comp f #align linear_map.to_seminorm LinearMap.toSeminorm theorem coe_toSeminorm {f : E β†’β‚—[π•œ] π•œ} : ⇑f.toSeminorm = fun x => β€–f xβ€– := rfl #align linear_map.coe_to_seminorm LinearMap.coe_toSeminorm @[simp] theorem toSeminorm_apply {f : E β†’β‚—[π•œ] π•œ} {x : E} : f.toSeminorm x = β€–f xβ€– := rfl #align linear_map.to_seminorm_apply LinearMap.toSeminorm_apply
Mathlib/Analysis/LocallyConvex/WeakDual.lean
68
70
theorem toSeminorm_ball_zero {f : E β†’β‚—[π•œ] π•œ} {r : ℝ} : Seminorm.ball f.toSeminorm 0 r = { x : E | β€–f xβ€– < r } := by
simp only [Seminorm.ball_zero_eq, toSeminorm_apply]
1
2.718282
0
0.5
2
443
import Mathlib.Topology.Algebra.Module.WeakDual import Mathlib.Analysis.Normed.Field.Basic import Mathlib.Analysis.LocallyConvex.WithSeminorms #align_import analysis.locally_convex.weak_dual from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" variable {π•œ E F ΞΉ : Type*} open Topology section BilinForm namespace LinearMap variable [NormedField π•œ] [AddCommGroup E] [Module π•œ E] [AddCommGroup F] [Module π•œ F] def toSeminorm (f : E β†’β‚—[π•œ] π•œ) : Seminorm π•œ E := (normSeminorm π•œ π•œ).comp f #align linear_map.to_seminorm LinearMap.toSeminorm theorem coe_toSeminorm {f : E β†’β‚—[π•œ] π•œ} : ⇑f.toSeminorm = fun x => β€–f xβ€– := rfl #align linear_map.coe_to_seminorm LinearMap.coe_toSeminorm @[simp] theorem toSeminorm_apply {f : E β†’β‚—[π•œ] π•œ} {x : E} : f.toSeminorm x = β€–f xβ€– := rfl #align linear_map.to_seminorm_apply LinearMap.toSeminorm_apply theorem toSeminorm_ball_zero {f : E β†’β‚—[π•œ] π•œ} {r : ℝ} : Seminorm.ball f.toSeminorm 0 r = { x : E | β€–f xβ€– < r } := by simp only [Seminorm.ball_zero_eq, toSeminorm_apply] #align linear_map.to_seminorm_ball_zero LinearMap.toSeminorm_ball_zero
Mathlib/Analysis/LocallyConvex/WeakDual.lean
73
76
theorem toSeminorm_comp (f : F β†’β‚—[π•œ] π•œ) (g : E β†’β‚—[π•œ] F) : f.toSeminorm.comp g = (f.comp g).toSeminorm := by
ext simp only [Seminorm.comp_apply, toSeminorm_apply, coe_comp, Function.comp_apply]
2
7.389056
1
0.5
2
443
import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.Algebra.InfiniteSum.Ring import Mathlib.Topology.Instances.Real import Mathlib.Topology.MetricSpace.Isometry #align_import topology.instances.nnreal from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" noncomputable section open Set TopologicalSpace Metric Filter open Topology namespace NNReal open NNReal Filter instance : TopologicalSpace ℝβ‰₯0 := inferInstance -- short-circuit type class inference instance : TopologicalSemiring ℝβ‰₯0 where toContinuousAdd := continuousAdd_induced toRealHom toContinuousMul := continuousMul_induced toRealHom instance : SecondCountableTopology ℝβ‰₯0 := inferInstanceAs (SecondCountableTopology { x : ℝ | 0 ≀ x }) instance : OrderTopology ℝβ‰₯0 := orderTopology_of_ordConnected (t := Ici 0) instance : CompleteSpace ℝβ‰₯0 := isClosed_Ici.completeSpace_coe instance : ContinuousStar ℝβ‰₯0 where continuous_star := continuous_id section coe variable {Ξ± : Type*} open Filter Finset theorem _root_.continuous_real_toNNReal : Continuous Real.toNNReal := (continuous_id.max continuous_const).subtype_mk _ #align continuous_real_to_nnreal continuous_real_toNNReal @[simps (config := .asFn)] noncomputable def _root_.ContinuousMap.realToNNReal : C(ℝ, ℝβ‰₯0) := .mk Real.toNNReal continuous_real_toNNReal theorem continuous_coe : Continuous ((↑) : ℝβ‰₯0 β†’ ℝ) := continuous_subtype_val #align nnreal.continuous_coe NNReal.continuous_coe @[simps (config := .asFn)] def _root_.ContinuousMap.coeNNRealReal : C(ℝβ‰₯0, ℝ) := ⟨(↑), continuous_coe⟩ #align continuous_map.coe_nnreal_real ContinuousMap.coeNNRealReal #align continuous_map.coe_nnreal_real_apply ContinuousMap.coeNNRealReal_apply instance ContinuousMap.canLift {X : Type*} [TopologicalSpace X] : CanLift C(X, ℝ) C(X, ℝβ‰₯0) ContinuousMap.coeNNRealReal.comp fun f => βˆ€ x, 0 ≀ f x where prf f hf := ⟨⟨fun x => ⟨f x, hf x⟩, f.2.subtype_mk _⟩, DFunLike.ext' rfl⟩ #align nnreal.continuous_map.can_lift NNReal.ContinuousMap.canLift @[simp, norm_cast] theorem tendsto_coe {f : Filter Ξ±} {m : Ξ± β†’ ℝβ‰₯0} {x : ℝβ‰₯0} : Tendsto (fun a => (m a : ℝ)) f (𝓝 (x : ℝ)) ↔ Tendsto m f (𝓝 x) := tendsto_subtype_rng.symm #align nnreal.tendsto_coe NNReal.tendsto_coe theorem tendsto_coe' {f : Filter Ξ±} [NeBot f] {m : Ξ± β†’ ℝβ‰₯0} {x : ℝ} : Tendsto (fun a => m a : Ξ± β†’ ℝ) f (𝓝 x) ↔ βˆƒ hx : 0 ≀ x, Tendsto m f (𝓝 ⟨x, hx⟩) := ⟨fun h => ⟨ge_of_tendsto' h fun c => (m c).2, tendsto_coe.1 h⟩, fun ⟨_, hm⟩ => tendsto_coe.2 hm⟩ #align nnreal.tendsto_coe' NNReal.tendsto_coe' @[simp] theorem map_coe_atTop : map toReal atTop = atTop := map_val_Ici_atTop 0 #align nnreal.map_coe_at_top NNReal.map_coe_atTop theorem comap_coe_atTop : comap toReal atTop = atTop := (atTop_Ici_eq 0).symm #align nnreal.comap_coe_at_top NNReal.comap_coe_atTop @[simp, norm_cast] theorem tendsto_coe_atTop {f : Filter Ξ±} {m : Ξ± β†’ ℝβ‰₯0} : Tendsto (fun a => (m a : ℝ)) f atTop ↔ Tendsto m f atTop := tendsto_Ici_atTop.symm #align nnreal.tendsto_coe_at_top NNReal.tendsto_coe_atTop theorem _root_.tendsto_real_toNNReal {f : Filter Ξ±} {m : Ξ± β†’ ℝ} {x : ℝ} (h : Tendsto m f (𝓝 x)) : Tendsto (fun a => Real.toNNReal (m a)) f (𝓝 (Real.toNNReal x)) := (continuous_real_toNNReal.tendsto _).comp h #align tendsto_real_to_nnreal tendsto_real_toNNReal
Mathlib/Topology/Instances/NNReal.lean
140
142
theorem _root_.tendsto_real_toNNReal_atTop : Tendsto Real.toNNReal atTop atTop := by
rw [← tendsto_coe_atTop] exact tendsto_atTop_mono Real.le_coe_toNNReal tendsto_id
2
7.389056
1
0.5
2
444
import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.Algebra.InfiniteSum.Ring import Mathlib.Topology.Instances.Real import Mathlib.Topology.MetricSpace.Isometry #align_import topology.instances.nnreal from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" noncomputable section open Set TopologicalSpace Metric Filter open Topology namespace NNReal open NNReal Filter instance : TopologicalSpace ℝβ‰₯0 := inferInstance -- short-circuit type class inference instance : TopologicalSemiring ℝβ‰₯0 where toContinuousAdd := continuousAdd_induced toRealHom toContinuousMul := continuousMul_induced toRealHom instance : SecondCountableTopology ℝβ‰₯0 := inferInstanceAs (SecondCountableTopology { x : ℝ | 0 ≀ x }) instance : OrderTopology ℝβ‰₯0 := orderTopology_of_ordConnected (t := Ici 0) instance : CompleteSpace ℝβ‰₯0 := isClosed_Ici.completeSpace_coe instance : ContinuousStar ℝβ‰₯0 where continuous_star := continuous_id section coe variable {Ξ± : Type*} open Filter Finset theorem _root_.continuous_real_toNNReal : Continuous Real.toNNReal := (continuous_id.max continuous_const).subtype_mk _ #align continuous_real_to_nnreal continuous_real_toNNReal @[simps (config := .asFn)] noncomputable def _root_.ContinuousMap.realToNNReal : C(ℝ, ℝβ‰₯0) := .mk Real.toNNReal continuous_real_toNNReal theorem continuous_coe : Continuous ((↑) : ℝβ‰₯0 β†’ ℝ) := continuous_subtype_val #align nnreal.continuous_coe NNReal.continuous_coe @[simps (config := .asFn)] def _root_.ContinuousMap.coeNNRealReal : C(ℝβ‰₯0, ℝ) := ⟨(↑), continuous_coe⟩ #align continuous_map.coe_nnreal_real ContinuousMap.coeNNRealReal #align continuous_map.coe_nnreal_real_apply ContinuousMap.coeNNRealReal_apply instance ContinuousMap.canLift {X : Type*} [TopologicalSpace X] : CanLift C(X, ℝ) C(X, ℝβ‰₯0) ContinuousMap.coeNNRealReal.comp fun f => βˆ€ x, 0 ≀ f x where prf f hf := ⟨⟨fun x => ⟨f x, hf x⟩, f.2.subtype_mk _⟩, DFunLike.ext' rfl⟩ #align nnreal.continuous_map.can_lift NNReal.ContinuousMap.canLift @[simp, norm_cast] theorem tendsto_coe {f : Filter Ξ±} {m : Ξ± β†’ ℝβ‰₯0} {x : ℝβ‰₯0} : Tendsto (fun a => (m a : ℝ)) f (𝓝 (x : ℝ)) ↔ Tendsto m f (𝓝 x) := tendsto_subtype_rng.symm #align nnreal.tendsto_coe NNReal.tendsto_coe theorem tendsto_coe' {f : Filter Ξ±} [NeBot f] {m : Ξ± β†’ ℝβ‰₯0} {x : ℝ} : Tendsto (fun a => m a : Ξ± β†’ ℝ) f (𝓝 x) ↔ βˆƒ hx : 0 ≀ x, Tendsto m f (𝓝 ⟨x, hx⟩) := ⟨fun h => ⟨ge_of_tendsto' h fun c => (m c).2, tendsto_coe.1 h⟩, fun ⟨_, hm⟩ => tendsto_coe.2 hm⟩ #align nnreal.tendsto_coe' NNReal.tendsto_coe' @[simp] theorem map_coe_atTop : map toReal atTop = atTop := map_val_Ici_atTop 0 #align nnreal.map_coe_at_top NNReal.map_coe_atTop theorem comap_coe_atTop : comap toReal atTop = atTop := (atTop_Ici_eq 0).symm #align nnreal.comap_coe_at_top NNReal.comap_coe_atTop @[simp, norm_cast] theorem tendsto_coe_atTop {f : Filter Ξ±} {m : Ξ± β†’ ℝβ‰₯0} : Tendsto (fun a => (m a : ℝ)) f atTop ↔ Tendsto m f atTop := tendsto_Ici_atTop.symm #align nnreal.tendsto_coe_at_top NNReal.tendsto_coe_atTop theorem _root_.tendsto_real_toNNReal {f : Filter Ξ±} {m : Ξ± β†’ ℝ} {x : ℝ} (h : Tendsto m f (𝓝 x)) : Tendsto (fun a => Real.toNNReal (m a)) f (𝓝 (Real.toNNReal x)) := (continuous_real_toNNReal.tendsto _).comp h #align tendsto_real_to_nnreal tendsto_real_toNNReal theorem _root_.tendsto_real_toNNReal_atTop : Tendsto Real.toNNReal atTop atTop := by rw [← tendsto_coe_atTop] exact tendsto_atTop_mono Real.le_coe_toNNReal tendsto_id #align tendsto_real_to_nnreal_at_top tendsto_real_toNNReal_atTop theorem nhds_zero : 𝓝 (0 : ℝβ‰₯0) = β¨… (a : ℝβ‰₯0) (_ : a β‰  0), π“Ÿ (Iio a) := nhds_bot_order.trans <| by simp only [bot_lt_iff_ne_bot]; rfl #align nnreal.nhds_zero NNReal.nhds_zero theorem nhds_zero_basis : (𝓝 (0 : ℝβ‰₯0)).HasBasis (fun a : ℝβ‰₯0 => 0 < a) fun a => Iio a := nhds_bot_basis #align nnreal.nhds_zero_basis NNReal.nhds_zero_basis instance : ContinuousSub ℝβ‰₯0 := ⟨((continuous_coe.fst'.sub continuous_coe.snd').max continuous_const).subtype_mk _⟩ instance : HasContinuousInvβ‚€ ℝβ‰₯0 := inferInstance instance [TopologicalSpace Ξ±] [MulAction ℝ Ξ±] [ContinuousSMul ℝ Ξ±] : ContinuousSMul ℝβ‰₯0 Ξ± where continuous_smul := continuous_induced_dom.fst'.smul continuous_snd @[norm_cast]
Mathlib/Topology/Instances/NNReal.lean
163
164
theorem hasSum_coe {f : Ξ± β†’ ℝβ‰₯0} {r : ℝβ‰₯0} : HasSum (fun a => (f a : ℝ)) (r : ℝ) ↔ HasSum f r := by
simp only [HasSum, ← coe_sum, tendsto_coe]
1
2.718282
0
0.5
2
444
import Mathlib.LinearAlgebra.LinearIndependent #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe w w' u u' v v' variable {R : Type u} {R' : Type u'} {M M₁ : Type v} {M' : Type v'} open Cardinal Submodule Function Set section Module section variable [Semiring R] [AddCommMonoid M] [Module R M] variable (R M) protected irreducible_def Module.rank : Cardinal := ⨆ ΞΉ : { s : Set M // LinearIndependent R ((↑) : s β†’ M) }, (#ΞΉ.1) #align module.rank Module.rank theorem rank_le_card : Module.rank R M ≀ #M := (Module.rank_def _ _).trans_le (ciSup_le' fun _ ↦ mk_set_le _) lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((↑) : s β†’ M)} := βŸ¨βŸ¨βˆ…, linearIndependent_empty _ _⟩⟩ end variable [Ring R] [Ring R'] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] [Module R' M'] [Module R' M₁] namespace LinearIndependent variable [Nontrivial R]
Mathlib/LinearAlgebra/Dimension/Basic.lean
79
84
theorem cardinal_lift_le_rank {ΞΉ : Type w} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : Cardinal.lift.{v} #ΞΉ ≀ Cardinal.lift.{w} (Module.rank R M) := by
rw [Module.rank] refine le_trans ?_ (lift_le.mpr <| le_ciSup (bddAbove_range.{v, v} _) ⟨_, hv.coe_range⟩) exact lift_mk_le'.mpr ⟨(Equiv.ofInjective _ hv.injective).toEmbedding⟩
3
20.085537
1
0.5
2
445
import Mathlib.LinearAlgebra.LinearIndependent #align_import linear_algebra.dimension from "leanprover-community/mathlib"@"47a5f8186becdbc826190ced4312f8199f9db6a5" noncomputable section universe w w' u u' v v' variable {R : Type u} {R' : Type u'} {M M₁ : Type v} {M' : Type v'} open Cardinal Submodule Function Set section Module section variable [Semiring R] [AddCommMonoid M] [Module R M] variable (R M) protected irreducible_def Module.rank : Cardinal := ⨆ ΞΉ : { s : Set M // LinearIndependent R ((↑) : s β†’ M) }, (#ΞΉ.1) #align module.rank Module.rank theorem rank_le_card : Module.rank R M ≀ #M := (Module.rank_def _ _).trans_le (ciSup_le' fun _ ↦ mk_set_le _) lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((↑) : s β†’ M)} := βŸ¨βŸ¨βˆ…, linearIndependent_empty _ _⟩⟩ end variable [Ring R] [Ring R'] [AddCommGroup M] [AddCommGroup M'] [AddCommGroup M₁] variable [Module R M] [Module R M'] [Module R M₁] [Module R' M'] [Module R' M₁] namespace LinearIndependent variable [Nontrivial R] theorem cardinal_lift_le_rank {ΞΉ : Type w} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : Cardinal.lift.{v} #ΞΉ ≀ Cardinal.lift.{w} (Module.rank R M) := by rw [Module.rank] refine le_trans ?_ (lift_le.mpr <| le_ciSup (bddAbove_range.{v, v} _) ⟨_, hv.coe_range⟩) exact lift_mk_le'.mpr ⟨(Equiv.ofInjective _ hv.injective).toEmbedding⟩ #align cardinal_lift_le_rank_of_linear_independent LinearIndependent.cardinal_lift_le_rank #align cardinal_lift_le_rank_of_linear_independent' LinearIndependent.cardinal_lift_le_rank lemma aleph0_le_rank {ΞΉ : Type w} [Infinite ΞΉ] {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : β„΅β‚€ ≀ Module.rank R M := aleph0_le_lift.mp <| (aleph0_le_lift.mpr <| aleph0_le_mk ΞΉ).trans hv.cardinal_lift_le_rank
Mathlib/LinearAlgebra/Dimension/Basic.lean
92
94
theorem cardinal_le_rank {ΞΉ : Type v} {v : ΞΉ β†’ M} (hv : LinearIndependent R v) : #ΞΉ ≀ Module.rank R M := by
simpa using hv.cardinal_lift_le_rank
1
2.718282
0
0.5
2
445
import Mathlib.Topology.Compactness.SigmaCompact import Mathlib.Topology.Connected.TotallyDisconnected import Mathlib.Topology.Inseparable #align_import topology.separation from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Function Set Filter Topology TopologicalSpace open scoped Classical universe u v variable {X : Type*} {Y : Type*} [TopologicalSpace X] section Separation def SeparatedNhds : Set X β†’ Set X β†’ Prop := fun s t : Set X => βˆƒ U V : Set X, IsOpen U ∧ IsOpen V ∧ s βŠ† U ∧ t βŠ† V ∧ Disjoint U V #align separated_nhds SeparatedNhds
Mathlib/Topology/Separation.lean
125
127
theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t ↔ Disjoint (𝓝˒ s) (𝓝˒ t) := by
simp only [(hasBasis_nhdsSet s).disjoint_iff (hasBasis_nhdsSet t), SeparatedNhds, exists_prop, ← exists_and_left, and_assoc, and_comm, and_left_comm]
2
7.389056
1
0.5
4
446
import Mathlib.Topology.Compactness.SigmaCompact import Mathlib.Topology.Connected.TotallyDisconnected import Mathlib.Topology.Inseparable #align_import topology.separation from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Function Set Filter Topology TopologicalSpace open scoped Classical universe u v variable {X : Type*} {Y : Type*} [TopologicalSpace X] section Separation def SeparatedNhds : Set X β†’ Set X β†’ Prop := fun s t : Set X => βˆƒ U V : Set X, IsOpen U ∧ IsOpen V ∧ s βŠ† U ∧ t βŠ† V ∧ Disjoint U V #align separated_nhds SeparatedNhds theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t ↔ Disjoint (𝓝˒ s) (𝓝˒ t) := by simp only [(hasBasis_nhdsSet s).disjoint_iff (hasBasis_nhdsSet t), SeparatedNhds, exists_prop, ← exists_and_left, and_assoc, and_comm, and_left_comm] #align separated_nhds_iff_disjoint separatedNhds_iff_disjoint alias ⟨SeparatedNhds.disjoint_nhdsSet, _⟩ := separatedNhds_iff_disjoint namespace SeparatedNhds variable {s s₁ sβ‚‚ t t₁ tβ‚‚ u : Set X} @[symm] theorem symm : SeparatedNhds s t β†’ SeparatedNhds t s := fun ⟨U, V, oU, oV, aU, bV, UV⟩ => ⟨V, U, oV, oU, bV, aU, Disjoint.symm UV⟩ #align separated_nhds.symm SeparatedNhds.symm theorem comm (s t : Set X) : SeparatedNhds s t ↔ SeparatedNhds t s := ⟨symm, symm⟩ #align separated_nhds.comm SeparatedNhds.comm theorem preimage [TopologicalSpace Y] {f : X β†’ Y} {s t : Set Y} (h : SeparatedNhds s t) (hf : Continuous f) : SeparatedNhds (f ⁻¹' s) (f ⁻¹' t) := let ⟨U, V, oU, oV, sU, tV, UV⟩ := h ⟨f ⁻¹' U, f ⁻¹' V, oU.preimage hf, oV.preimage hf, preimage_mono sU, preimage_mono tV, UV.preimage f⟩ #align separated_nhds.preimage SeparatedNhds.preimage protected theorem disjoint (h : SeparatedNhds s t) : Disjoint s t := let ⟨_, _, _, _, hsU, htV, hd⟩ := h; hd.mono hsU htV #align separated_nhds.disjoint SeparatedNhds.disjoint theorem disjoint_closure_left (h : SeparatedNhds s t) : Disjoint (closure s) t := let ⟨_U, _V, _, hV, hsU, htV, hd⟩ := h (hd.closure_left hV).mono (closure_mono hsU) htV #align separated_nhds.disjoint_closure_left SeparatedNhds.disjoint_closure_left theorem disjoint_closure_right (h : SeparatedNhds s t) : Disjoint s (closure t) := h.symm.disjoint_closure_left.symm #align separated_nhds.disjoint_closure_right SeparatedNhds.disjoint_closure_right @[simp] theorem empty_right (s : Set X) : SeparatedNhds s βˆ… := ⟨_, _, isOpen_univ, isOpen_empty, fun a _ => mem_univ a, Subset.rfl, disjoint_empty _⟩ #align separated_nhds.empty_right SeparatedNhds.empty_right @[simp] theorem empty_left (s : Set X) : SeparatedNhds βˆ… s := (empty_right _).symm #align separated_nhds.empty_left SeparatedNhds.empty_left theorem mono (h : SeparatedNhds sβ‚‚ tβ‚‚) (hs : s₁ βŠ† sβ‚‚) (ht : t₁ βŠ† tβ‚‚) : SeparatedNhds s₁ t₁ := let ⟨U, V, hU, hV, hsU, htV, hd⟩ := h ⟨U, V, hU, hV, hs.trans hsU, ht.trans htV, hd⟩ #align separated_nhds.mono SeparatedNhds.mono
Mathlib/Topology/Separation.lean
178
179
theorem union_left : SeparatedNhds s u β†’ SeparatedNhds t u β†’ SeparatedNhds (s βˆͺ t) u := by
simpa only [separatedNhds_iff_disjoint, nhdsSet_union, disjoint_sup_left] using And.intro
1
2.718282
0
0.5
4
446
import Mathlib.Topology.Compactness.SigmaCompact import Mathlib.Topology.Connected.TotallyDisconnected import Mathlib.Topology.Inseparable #align_import topology.separation from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Function Set Filter Topology TopologicalSpace open scoped Classical universe u v variable {X : Type*} {Y : Type*} [TopologicalSpace X] section Separation def SeparatedNhds : Set X β†’ Set X β†’ Prop := fun s t : Set X => βˆƒ U V : Set X, IsOpen U ∧ IsOpen V ∧ s βŠ† U ∧ t βŠ† V ∧ Disjoint U V #align separated_nhds SeparatedNhds theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t ↔ Disjoint (𝓝˒ s) (𝓝˒ t) := by simp only [(hasBasis_nhdsSet s).disjoint_iff (hasBasis_nhdsSet t), SeparatedNhds, exists_prop, ← exists_and_left, and_assoc, and_comm, and_left_comm] #align separated_nhds_iff_disjoint separatedNhds_iff_disjoint alias ⟨SeparatedNhds.disjoint_nhdsSet, _⟩ := separatedNhds_iff_disjoint class T0Space (X : Type u) [TopologicalSpace X] : Prop where t0 : βˆ€ ⦃x y : X⦄, Inseparable x y β†’ x = y #align t0_space T0Space theorem t0Space_iff_inseparable (X : Type u) [TopologicalSpace X] : T0Space X ↔ βˆ€ x y : X, Inseparable x y β†’ x = y := ⟨fun ⟨h⟩ => h, fun h => ⟨h⟩⟩ #align t0_space_iff_inseparable t0Space_iff_inseparable
Mathlib/Topology/Separation.lean
201
203
theorem t0Space_iff_not_inseparable (X : Type u) [TopologicalSpace X] : T0Space X ↔ Pairwise fun x y : X => Β¬Inseparable x y := by
simp only [t0Space_iff_inseparable, Ne, not_imp_not, Pairwise]
1
2.718282
0
0.5
4
446
import Mathlib.Topology.Compactness.SigmaCompact import Mathlib.Topology.Connected.TotallyDisconnected import Mathlib.Topology.Inseparable #align_import topology.separation from "leanprover-community/mathlib"@"d91e7f7a7f1c7e9f0e18fdb6bde4f652004c735d" open Function Set Filter Topology TopologicalSpace open scoped Classical universe u v variable {X : Type*} {Y : Type*} [TopologicalSpace X] section Separation def SeparatedNhds : Set X β†’ Set X β†’ Prop := fun s t : Set X => βˆƒ U V : Set X, IsOpen U ∧ IsOpen V ∧ s βŠ† U ∧ t βŠ† V ∧ Disjoint U V #align separated_nhds SeparatedNhds theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t ↔ Disjoint (𝓝˒ s) (𝓝˒ t) := by simp only [(hasBasis_nhdsSet s).disjoint_iff (hasBasis_nhdsSet t), SeparatedNhds, exists_prop, ← exists_and_left, and_assoc, and_comm, and_left_comm] #align separated_nhds_iff_disjoint separatedNhds_iff_disjoint alias ⟨SeparatedNhds.disjoint_nhdsSet, _⟩ := separatedNhds_iff_disjoint class T0Space (X : Type u) [TopologicalSpace X] : Prop where t0 : βˆ€ ⦃x y : X⦄, Inseparable x y β†’ x = y #align t0_space T0Space theorem t0Space_iff_inseparable (X : Type u) [TopologicalSpace X] : T0Space X ↔ βˆ€ x y : X, Inseparable x y β†’ x = y := ⟨fun ⟨h⟩ => h, fun h => ⟨h⟩⟩ #align t0_space_iff_inseparable t0Space_iff_inseparable theorem t0Space_iff_not_inseparable (X : Type u) [TopologicalSpace X] : T0Space X ↔ Pairwise fun x y : X => Β¬Inseparable x y := by simp only [t0Space_iff_inseparable, Ne, not_imp_not, Pairwise] #align t0_space_iff_not_inseparable t0Space_iff_not_inseparable theorem Inseparable.eq [T0Space X] {x y : X} (h : Inseparable x y) : x = y := T0Space.t0 h #align inseparable.eq Inseparable.eq protected theorem Inducing.injective [TopologicalSpace Y] [T0Space X] {f : X β†’ Y} (hf : Inducing f) : Injective f := fun _ _ h => (hf.inseparable_iff.1 <| .of_eq h).eq #align inducing.injective Inducing.injective protected theorem Inducing.embedding [TopologicalSpace Y] [T0Space X] {f : X β†’ Y} (hf : Inducing f) : Embedding f := ⟨hf, hf.injective⟩ #align inducing.embedding Inducing.embedding lemma embedding_iff_inducing [TopologicalSpace Y] [T0Space X] {f : X β†’ Y} : Embedding f ↔ Inducing f := ⟨Embedding.toInducing, Inducing.embedding⟩ #align embedding_iff_inducing embedding_iff_inducing theorem t0Space_iff_nhds_injective (X : Type u) [TopologicalSpace X] : T0Space X ↔ Injective (𝓝 : X β†’ Filter X) := t0Space_iff_inseparable X #align t0_space_iff_nhds_injective t0Space_iff_nhds_injective theorem nhds_injective [T0Space X] : Injective (𝓝 : X β†’ Filter X) := (t0Space_iff_nhds_injective X).1 β€Ή_β€Ί #align nhds_injective nhds_injective theorem inseparable_iff_eq [T0Space X] {x y : X} : Inseparable x y ↔ x = y := nhds_injective.eq_iff #align inseparable_iff_eq inseparable_iff_eq @[simp] theorem nhds_eq_nhds_iff [T0Space X] {a b : X} : 𝓝 a = 𝓝 b ↔ a = b := nhds_injective.eq_iff #align nhds_eq_nhds_iff nhds_eq_nhds_iff @[simp] theorem inseparable_eq_eq [T0Space X] : Inseparable = @Eq X := funextβ‚‚ fun _ _ => propext inseparable_iff_eq #align inseparable_eq_eq inseparable_eq_eq theorem TopologicalSpace.IsTopologicalBasis.inseparable_iff {b : Set (Set X)} (hb : IsTopologicalBasis b) {x y : X} : Inseparable x y ↔ βˆ€ s ∈ b, (x ∈ s ↔ y ∈ s) := ⟨fun h s hs ↦ inseparable_iff_forall_open.1 h _ (hb.isOpen hs), fun h ↦ hb.nhds_hasBasis.eq_of_same_basis <| by convert hb.nhds_hasBasis using 2 exact and_congr_right (h _)⟩ theorem TopologicalSpace.IsTopologicalBasis.eq_iff [T0Space X] {b : Set (Set X)} (hb : IsTopologicalBasis b) {x y : X} : x = y ↔ βˆ€ s ∈ b, (x ∈ s ↔ y ∈ s) := inseparable_iff_eq.symm.trans hb.inseparable_iff
Mathlib/Topology/Separation.lean
261
264
theorem t0Space_iff_exists_isOpen_xor'_mem (X : Type u) [TopologicalSpace X] : T0Space X ↔ Pairwise fun x y => βˆƒ U : Set X, IsOpen U ∧ Xor' (x ∈ U) (y ∈ U) := by
simp only [t0Space_iff_not_inseparable, xor_iff_not_iff, not_forall, exists_prop, inseparable_iff_forall_open, Pairwise]
2
7.389056
1
0.5
4
446
import Mathlib.Algebra.Divisibility.Basic import Mathlib.Algebra.Group.Prod import Mathlib.Tactic.Common variable {ΞΉ G₁ Gβ‚‚ : Type*} {G : ΞΉ β†’ Type*} [Semigroup G₁] [Semigroup Gβ‚‚] [βˆ€ i, Semigroup (G i)]
Mathlib/Algebra/Divisibility/Prod.lean
16
20
theorem prod_dvd_iff {x y : G₁ Γ— Gβ‚‚} : x ∣ y ↔ x.1 ∣ y.1 ∧ x.2 ∣ y.2 := by
cases x; cases y simp only [dvd_def, Prod.exists, Prod.mk_mul_mk, Prod.mk.injEq, exists_and_left, exists_and_right, and_self, true_and]
3
20.085537
1
0.5
2
447
import Mathlib.Algebra.Divisibility.Basic import Mathlib.Algebra.Group.Prod import Mathlib.Tactic.Common variable {ΞΉ G₁ Gβ‚‚ : Type*} {G : ΞΉ β†’ Type*} [Semigroup G₁] [Semigroup Gβ‚‚] [βˆ€ i, Semigroup (G i)] theorem prod_dvd_iff {x y : G₁ Γ— Gβ‚‚} : x ∣ y ↔ x.1 ∣ y.1 ∧ x.2 ∣ y.2 := by cases x; cases y simp only [dvd_def, Prod.exists, Prod.mk_mul_mk, Prod.mk.injEq, exists_and_left, exists_and_right, and_self, true_and] @[simp] theorem Prod.mk_dvd_mk {x₁ y₁ : G₁} {xβ‚‚ yβ‚‚ : Gβ‚‚} : (x₁, xβ‚‚) ∣ (y₁, yβ‚‚) ↔ x₁ ∣ y₁ ∧ xβ‚‚ ∣ yβ‚‚ := prod_dvd_iff instance [DecompositionMonoid G₁] [DecompositionMonoid Gβ‚‚] : DecompositionMonoid (G₁ Γ— Gβ‚‚) where primal a b c h := by simp_rw [prod_dvd_iff] at h ⊒ obtain ⟨a₁, a₁', h₁, h₁', eqβ‚βŸ© := DecompositionMonoid.primal a.1 h.1 obtain ⟨aβ‚‚, aβ‚‚', hβ‚‚, hβ‚‚', eqβ‚‚βŸ© := DecompositionMonoid.primal a.2 h.2 -- aesop works here exact ⟨(a₁, aβ‚‚), (a₁', aβ‚‚'), ⟨h₁, hβ‚‚βŸ©, ⟨h₁', hβ‚‚'⟩, Prod.ext eq₁ eqβ‚‚βŸ©
Mathlib/Algebra/Divisibility/Prod.lean
35
36
theorem pi_dvd_iff {x y : βˆ€ i, G i} : x ∣ y ↔ βˆ€ i, x i ∣ y i := by
simp_rw [dvd_def, Function.funext_iff, Classical.skolem]; rfl
1
2.718282
0
0.5
2
447
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Order.Antichain import Mathlib.Order.Interval.Finset.Nat #align_import data.finset.slice from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" open Finset Nat variable {Ξ± : Type*} {ΞΉ : Sort*} {ΞΊ : ΞΉ β†’ Sort*} namespace Set variable {A B : Set (Finset Ξ±)} {s : Finset Ξ±} {r : β„•} def Sized (r : β„•) (A : Set (Finset Ξ±)) : Prop := βˆ€ ⦃x⦄, x ∈ A β†’ card x = r #align set.sized Set.Sized theorem Sized.mono (h : A βŠ† B) (hB : B.Sized r) : A.Sized r := fun _x hx => hB <| h hx #align set.sized.mono Set.Sized.mono @[simp] lemma sized_empty : (βˆ… : Set (Finset Ξ±)).Sized r := by simp [Sized] @[simp] lemma sized_singleton : ({s} : Set (Finset Ξ±)).Sized r ↔ s.card = r := by simp [Sized] theorem sized_union : (A βˆͺ B).Sized r ↔ A.Sized r ∧ B.Sized r := ⟨fun hA => ⟨hA.mono subset_union_left, hA.mono subset_union_right⟩, fun hA _x hx => hx.elim (fun h => hA.1 h) fun h => hA.2 h⟩ #align set.sized_union Set.sized_union alias ⟨_, sized.union⟩ := sized_union #align set.sized.union Set.sized.union --TODO: A `forall_iUnion` lemma would be handy here. @[simp]
Mathlib/Data/Finset/Slice.lean
64
66
theorem sized_iUnion {f : ΞΉ β†’ Set (Finset Ξ±)} : (⋃ i, f i).Sized r ↔ βˆ€ i, (f i).Sized r := by
simp_rw [Set.Sized, Set.mem_iUnion, forall_exists_index] exact forall_swap
2
7.389056
1
0.5
2
448
import Mathlib.Algebra.BigOperators.Group.Finset import Mathlib.Order.Antichain import Mathlib.Order.Interval.Finset.Nat #align_import data.finset.slice from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" open Finset Nat variable {Ξ± : Type*} {ΞΉ : Sort*} {ΞΊ : ΞΉ β†’ Sort*} namespace Set variable {A B : Set (Finset Ξ±)} {s : Finset Ξ±} {r : β„•} def Sized (r : β„•) (A : Set (Finset Ξ±)) : Prop := βˆ€ ⦃x⦄, x ∈ A β†’ card x = r #align set.sized Set.Sized theorem Sized.mono (h : A βŠ† B) (hB : B.Sized r) : A.Sized r := fun _x hx => hB <| h hx #align set.sized.mono Set.Sized.mono @[simp] lemma sized_empty : (βˆ… : Set (Finset Ξ±)).Sized r := by simp [Sized] @[simp] lemma sized_singleton : ({s} : Set (Finset Ξ±)).Sized r ↔ s.card = r := by simp [Sized] theorem sized_union : (A βˆͺ B).Sized r ↔ A.Sized r ∧ B.Sized r := ⟨fun hA => ⟨hA.mono subset_union_left, hA.mono subset_union_right⟩, fun hA _x hx => hx.elim (fun h => hA.1 h) fun h => hA.2 h⟩ #align set.sized_union Set.sized_union alias ⟨_, sized.union⟩ := sized_union #align set.sized.union Set.sized.union --TODO: A `forall_iUnion` lemma would be handy here. @[simp] theorem sized_iUnion {f : ΞΉ β†’ Set (Finset Ξ±)} : (⋃ i, f i).Sized r ↔ βˆ€ i, (f i).Sized r := by simp_rw [Set.Sized, Set.mem_iUnion, forall_exists_index] exact forall_swap #align set.sized_Union Set.sized_iUnion -- @[simp] -- Porting note: left hand side is not simp-normal form.
Mathlib/Data/Finset/Slice.lean
70
72
theorem sized_iUnionβ‚‚ {f : βˆ€ i, ΞΊ i β†’ Set (Finset Ξ±)} : (⋃ (i) (j), f i j).Sized r ↔ βˆ€ i j, (f i j).Sized r := by
simp only [Set.sized_iUnion]
1
2.718282
0
0.5
2
448
import Mathlib.Algebra.DirectSum.Module import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Convex.Uniform import Mathlib.Analysis.NormedSpace.Completion import Mathlib.Analysis.NormedSpace.BoundedLinearMaps #align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" noncomputable section open RCLike Real Filter open Topology ComplexConjugate open LinearMap (BilinForm) variable {π•œ E F : Type*} [RCLike π•œ] class Inner (π•œ E : Type*) where inner : E β†’ E β†’ π•œ #align has_inner Inner export Inner (inner) notation3:max "βŸͺ" x ", " y "⟫_" π•œ:max => @inner π•œ _ _ x y class InnerProductSpace (π•œ : Type*) (E : Type*) [RCLike π•œ] [NormedAddCommGroup E] extends NormedSpace π•œ E, Inner π•œ E where norm_sq_eq_inner : βˆ€ x : E, β€–xβ€– ^ 2 = re (inner x x) conj_symm : βˆ€ x y, conj (inner y x) = inner x y add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space InnerProductSpace -- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore structure InnerProductSpace.Core (π•œ : Type*) (F : Type*) [RCLike π•œ] [AddCommGroup F] [Module π•œ F] extends Inner π•œ F where conj_symm : βˆ€ x y, conj (inner y x) = inner x y nonneg_re : βˆ€ x, 0 ≀ re (inner x x) definite : βˆ€ x, inner x x = 0 β†’ x = 0 add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space.core InnerProductSpace.Core attribute [class] InnerProductSpace.Core def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π•œ E] : InnerProductSpace.Core π•œ E := { c with nonneg_re := fun x => by rw [← InnerProductSpace.norm_sq_eq_inner] apply sq_nonneg definite := fun x hx => norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by rw [InnerProductSpace.norm_sq_eq_inner (π•œ := π•œ) x, hx, map_zero] } #align inner_product_space.to_core InnerProductSpace.toCore namespace InnerProductSpace.Core variable [AddCommGroup F] [Module π•œ F] [c : InnerProductSpace.Core π•œ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ F _ x y local notation "normSqK" => @RCLike.normSq π•œ _ local notation "reK" => @RCLike.re π•œ _ local notation "ext_iff" => @RCLike.ext_iff π•œ _ local postfix:90 "†" => starRingEnd _ def toInner' : Inner π•œ F := c.toInner #align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner' attribute [local instance] toInner' def normSq (x : F) := reK βŸͺx, x⟫ #align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq local notation "normSqF" => @normSq π•œ F _ _ _ _ theorem inner_conj_symm (x y : F) : βŸͺy, xβŸ«β€  = βŸͺx, y⟫ := c.conj_symm x y #align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm theorem inner_self_nonneg {x : F} : 0 ≀ re βŸͺx, x⟫ := c.nonneg_re _ #align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg
Mathlib/Analysis/InnerProductSpace/Basic.lean
211
213
theorem inner_self_im (x : F) : im βŸͺx, x⟫ = 0 := by
rw [← @ofReal_inj π•œ, im_eq_conj_sub] simp [inner_conj_symm]
2
7.389056
1
0.5
6
449
import Mathlib.Algebra.DirectSum.Module import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Convex.Uniform import Mathlib.Analysis.NormedSpace.Completion import Mathlib.Analysis.NormedSpace.BoundedLinearMaps #align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" noncomputable section open RCLike Real Filter open Topology ComplexConjugate open LinearMap (BilinForm) variable {π•œ E F : Type*} [RCLike π•œ] class Inner (π•œ E : Type*) where inner : E β†’ E β†’ π•œ #align has_inner Inner export Inner (inner) notation3:max "βŸͺ" x ", " y "⟫_" π•œ:max => @inner π•œ _ _ x y class InnerProductSpace (π•œ : Type*) (E : Type*) [RCLike π•œ] [NormedAddCommGroup E] extends NormedSpace π•œ E, Inner π•œ E where norm_sq_eq_inner : βˆ€ x : E, β€–xβ€– ^ 2 = re (inner x x) conj_symm : βˆ€ x y, conj (inner y x) = inner x y add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space InnerProductSpace -- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore structure InnerProductSpace.Core (π•œ : Type*) (F : Type*) [RCLike π•œ] [AddCommGroup F] [Module π•œ F] extends Inner π•œ F where conj_symm : βˆ€ x y, conj (inner y x) = inner x y nonneg_re : βˆ€ x, 0 ≀ re (inner x x) definite : βˆ€ x, inner x x = 0 β†’ x = 0 add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space.core InnerProductSpace.Core attribute [class] InnerProductSpace.Core def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π•œ E] : InnerProductSpace.Core π•œ E := { c with nonneg_re := fun x => by rw [← InnerProductSpace.norm_sq_eq_inner] apply sq_nonneg definite := fun x hx => norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by rw [InnerProductSpace.norm_sq_eq_inner (π•œ := π•œ) x, hx, map_zero] } #align inner_product_space.to_core InnerProductSpace.toCore namespace InnerProductSpace.Core variable [AddCommGroup F] [Module π•œ F] [c : InnerProductSpace.Core π•œ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ F _ x y local notation "normSqK" => @RCLike.normSq π•œ _ local notation "reK" => @RCLike.re π•œ _ local notation "ext_iff" => @RCLike.ext_iff π•œ _ local postfix:90 "†" => starRingEnd _ def toInner' : Inner π•œ F := c.toInner #align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner' attribute [local instance] toInner' def normSq (x : F) := reK βŸͺx, x⟫ #align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq local notation "normSqF" => @normSq π•œ F _ _ _ _ theorem inner_conj_symm (x y : F) : βŸͺy, xβŸ«β€  = βŸͺx, y⟫ := c.conj_symm x y #align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm theorem inner_self_nonneg {x : F} : 0 ≀ re βŸͺx, x⟫ := c.nonneg_re _ #align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg theorem inner_self_im (x : F) : im βŸͺx, x⟫ = 0 := by rw [← @ofReal_inj π•œ, im_eq_conj_sub] simp [inner_conj_symm] #align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im theorem inner_add_left (x y z : F) : βŸͺx + y, z⟫ = βŸͺx, z⟫ + βŸͺy, z⟫ := c.add_left _ _ _ #align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left
Mathlib/Analysis/InnerProductSpace/Basic.lean
220
221
theorem inner_add_right (x y z : F) : βŸͺx, y + z⟫ = βŸͺx, y⟫ + βŸͺx, z⟫ := by
rw [← inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm]
1
2.718282
0
0.5
6
449
import Mathlib.Algebra.DirectSum.Module import Mathlib.Analysis.Complex.Basic import Mathlib.Analysis.Convex.Uniform import Mathlib.Analysis.NormedSpace.Completion import Mathlib.Analysis.NormedSpace.BoundedLinearMaps #align_import analysis.inner_product_space.basic from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" noncomputable section open RCLike Real Filter open Topology ComplexConjugate open LinearMap (BilinForm) variable {π•œ E F : Type*} [RCLike π•œ] class Inner (π•œ E : Type*) where inner : E β†’ E β†’ π•œ #align has_inner Inner export Inner (inner) notation3:max "βŸͺ" x ", " y "⟫_" π•œ:max => @inner π•œ _ _ x y class InnerProductSpace (π•œ : Type*) (E : Type*) [RCLike π•œ] [NormedAddCommGroup E] extends NormedSpace π•œ E, Inner π•œ E where norm_sq_eq_inner : βˆ€ x : E, β€–xβ€– ^ 2 = re (inner x x) conj_symm : βˆ€ x y, conj (inner y x) = inner x y add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space InnerProductSpace -- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore structure InnerProductSpace.Core (π•œ : Type*) (F : Type*) [RCLike π•œ] [AddCommGroup F] [Module π•œ F] extends Inner π•œ F where conj_symm : βˆ€ x y, conj (inner y x) = inner x y nonneg_re : βˆ€ x, 0 ≀ re (inner x x) definite : βˆ€ x, inner x x = 0 β†’ x = 0 add_left : βˆ€ x y z, inner (x + y) z = inner x z + inner y z smul_left : βˆ€ x y r, inner (r β€’ x) y = conj r * inner x y #align inner_product_space.core InnerProductSpace.Core attribute [class] InnerProductSpace.Core def InnerProductSpace.toCore [NormedAddCommGroup E] [c : InnerProductSpace π•œ E] : InnerProductSpace.Core π•œ E := { c with nonneg_re := fun x => by rw [← InnerProductSpace.norm_sq_eq_inner] apply sq_nonneg definite := fun x hx => norm_eq_zero.1 <| pow_eq_zero (n := 2) <| by rw [InnerProductSpace.norm_sq_eq_inner (π•œ := π•œ) x, hx, map_zero] } #align inner_product_space.to_core InnerProductSpace.toCore namespace InnerProductSpace.Core variable [AddCommGroup F] [Module π•œ F] [c : InnerProductSpace.Core π•œ F] local notation "βŸͺ" x ", " y "⟫" => @inner π•œ F _ x y local notation "normSqK" => @RCLike.normSq π•œ _ local notation "reK" => @RCLike.re π•œ _ local notation "ext_iff" => @RCLike.ext_iff π•œ _ local postfix:90 "†" => starRingEnd _ def toInner' : Inner π•œ F := c.toInner #align inner_product_space.core.to_has_inner' InnerProductSpace.Core.toInner' attribute [local instance] toInner' def normSq (x : F) := reK βŸͺx, x⟫ #align inner_product_space.core.norm_sq InnerProductSpace.Core.normSq local notation "normSqF" => @normSq π•œ F _ _ _ _ theorem inner_conj_symm (x y : F) : βŸͺy, xβŸ«β€  = βŸͺx, y⟫ := c.conj_symm x y #align inner_product_space.core.inner_conj_symm InnerProductSpace.Core.inner_conj_symm theorem inner_self_nonneg {x : F} : 0 ≀ re βŸͺx, x⟫ := c.nonneg_re _ #align inner_product_space.core.inner_self_nonneg InnerProductSpace.Core.inner_self_nonneg theorem inner_self_im (x : F) : im βŸͺx, x⟫ = 0 := by rw [← @ofReal_inj π•œ, im_eq_conj_sub] simp [inner_conj_symm] #align inner_product_space.core.inner_self_im InnerProductSpace.Core.inner_self_im theorem inner_add_left (x y z : F) : βŸͺx + y, z⟫ = βŸͺx, z⟫ + βŸͺy, z⟫ := c.add_left _ _ _ #align inner_product_space.core.inner_add_left InnerProductSpace.Core.inner_add_left theorem inner_add_right (x y z : F) : βŸͺx, y + z⟫ = βŸͺx, y⟫ + βŸͺx, z⟫ := by rw [← inner_conj_symm, inner_add_left, RingHom.map_add]; simp only [inner_conj_symm] #align inner_product_space.core.inner_add_right InnerProductSpace.Core.inner_add_right
Mathlib/Analysis/InnerProductSpace/Basic.lean
224
226
theorem ofReal_normSq_eq_inner_self (x : F) : (normSqF x : π•œ) = βŸͺx, x⟫ := by
rw [ext_iff] exact ⟨by simp only [ofReal_re]; rfl, by simp only [inner_self_im, ofReal_im]⟩
2
7.389056
1
0.5
6
449