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.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp] theorem gold_add_goldConj : Ο† + ψ = 1 := by rw [goldenRatio, goldenConj] ring #align gold_add_gold_conj gold_add_goldConj theorem one_sub_goldConj : 1 - Ο† = ψ := by linarith [gold_add_goldConj] #align one_sub_gold_conj one_sub_goldConj theorem one_sub_gold : 1 - ψ = Ο† := by linarith [gold_add_goldConj] #align one_sub_gold one_sub_gold @[simp] theorem gold_sub_goldConj : Ο† - ψ = √5 := by ring #align gold_sub_gold_conj gold_sub_goldConj theorem gold_pow_sub_gold_pow (n : β„•) : Ο† ^ (n + 2) - Ο† ^ (n + 1) = Ο† ^ n := by rw [goldenRatio]; ring_nf; norm_num; ring @[simp 1200] theorem gold_sq : Ο† ^ 2 = Ο† + 1 := by rw [goldenRatio, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_sq gold_sq @[simp 1200] theorem goldConj_sq : ψ ^ 2 = ψ + 1 := by rw [goldenConj, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_conj_sq goldConj_sq theorem gold_pos : 0 < Ο† := mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two #align gold_pos gold_pos theorem gold_ne_zero : Ο† β‰  0 := ne_of_gt gold_pos #align gold_ne_zero gold_ne_zero theorem one_lt_gold : 1 < Ο† := by refine lt_of_mul_lt_mul_left ?_ (le_of_lt gold_pos) simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow` #align one_lt_gold one_lt_gold theorem gold_lt_two : Ο† < 2 := by calc (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num _ = 2 := by norm_num theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold] #align gold_conj_neg goldConj_neg theorem goldConj_ne_zero : ψ β‰  0 := ne_of_lt goldConj_neg #align gold_conj_ne_zero goldConj_ne_zero
Mathlib/Data/Real/GoldenRatio.lean
129
131
theorem neg_one_lt_goldConj : -1 < ψ := by
rw [neg_lt, ← inv_gold] exact inv_lt_one one_lt_gold
2
7.389056
1
0.894737
19
776
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp] theorem gold_add_goldConj : Ο† + ψ = 1 := by rw [goldenRatio, goldenConj] ring #align gold_add_gold_conj gold_add_goldConj theorem one_sub_goldConj : 1 - Ο† = ψ := by linarith [gold_add_goldConj] #align one_sub_gold_conj one_sub_goldConj theorem one_sub_gold : 1 - ψ = Ο† := by linarith [gold_add_goldConj] #align one_sub_gold one_sub_gold @[simp] theorem gold_sub_goldConj : Ο† - ψ = √5 := by ring #align gold_sub_gold_conj gold_sub_goldConj theorem gold_pow_sub_gold_pow (n : β„•) : Ο† ^ (n + 2) - Ο† ^ (n + 1) = Ο† ^ n := by rw [goldenRatio]; ring_nf; norm_num; ring @[simp 1200] theorem gold_sq : Ο† ^ 2 = Ο† + 1 := by rw [goldenRatio, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_sq gold_sq @[simp 1200] theorem goldConj_sq : ψ ^ 2 = ψ + 1 := by rw [goldenConj, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_conj_sq goldConj_sq theorem gold_pos : 0 < Ο† := mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two #align gold_pos gold_pos theorem gold_ne_zero : Ο† β‰  0 := ne_of_gt gold_pos #align gold_ne_zero gold_ne_zero theorem one_lt_gold : 1 < Ο† := by refine lt_of_mul_lt_mul_left ?_ (le_of_lt gold_pos) simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow` #align one_lt_gold one_lt_gold theorem gold_lt_two : Ο† < 2 := by calc (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num _ = 2 := by norm_num theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold] #align gold_conj_neg goldConj_neg theorem goldConj_ne_zero : ψ β‰  0 := ne_of_lt goldConj_neg #align gold_conj_ne_zero goldConj_ne_zero theorem neg_one_lt_goldConj : -1 < ψ := by rw [neg_lt, ← inv_gold] exact inv_lt_one one_lt_gold #align neg_one_lt_gold_conj neg_one_lt_goldConj
Mathlib/Data/Real/GoldenRatio.lean
140
146
theorem gold_irrational : Irrational Ο† := by
have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_add 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp
6
403.428793
2
0.894737
19
776
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp] theorem gold_add_goldConj : Ο† + ψ = 1 := by rw [goldenRatio, goldenConj] ring #align gold_add_gold_conj gold_add_goldConj theorem one_sub_goldConj : 1 - Ο† = ψ := by linarith [gold_add_goldConj] #align one_sub_gold_conj one_sub_goldConj theorem one_sub_gold : 1 - ψ = Ο† := by linarith [gold_add_goldConj] #align one_sub_gold one_sub_gold @[simp] theorem gold_sub_goldConj : Ο† - ψ = √5 := by ring #align gold_sub_gold_conj gold_sub_goldConj theorem gold_pow_sub_gold_pow (n : β„•) : Ο† ^ (n + 2) - Ο† ^ (n + 1) = Ο† ^ n := by rw [goldenRatio]; ring_nf; norm_num; ring @[simp 1200] theorem gold_sq : Ο† ^ 2 = Ο† + 1 := by rw [goldenRatio, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_sq gold_sq @[simp 1200] theorem goldConj_sq : ψ ^ 2 = ψ + 1 := by rw [goldenConj, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_conj_sq goldConj_sq theorem gold_pos : 0 < Ο† := mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two #align gold_pos gold_pos theorem gold_ne_zero : Ο† β‰  0 := ne_of_gt gold_pos #align gold_ne_zero gold_ne_zero theorem one_lt_gold : 1 < Ο† := by refine lt_of_mul_lt_mul_left ?_ (le_of_lt gold_pos) simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow` #align one_lt_gold one_lt_gold theorem gold_lt_two : Ο† < 2 := by calc (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num _ = 2 := by norm_num theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold] #align gold_conj_neg goldConj_neg theorem goldConj_ne_zero : ψ β‰  0 := ne_of_lt goldConj_neg #align gold_conj_ne_zero goldConj_ne_zero theorem neg_one_lt_goldConj : -1 < ψ := by rw [neg_lt, ← inv_gold] exact inv_lt_one one_lt_gold #align neg_one_lt_gold_conj neg_one_lt_goldConj theorem gold_irrational : Irrational Ο† := by have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_add 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp #align gold_irrational gold_irrational
Mathlib/Data/Real/GoldenRatio.lean
150
156
theorem goldConj_irrational : Irrational ψ := by
have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_sub 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp
6
403.428793
2
0.894737
19
776
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp] theorem gold_add_goldConj : Ο† + ψ = 1 := by rw [goldenRatio, goldenConj] ring #align gold_add_gold_conj gold_add_goldConj theorem one_sub_goldConj : 1 - Ο† = ψ := by linarith [gold_add_goldConj] #align one_sub_gold_conj one_sub_goldConj theorem one_sub_gold : 1 - ψ = Ο† := by linarith [gold_add_goldConj] #align one_sub_gold one_sub_gold @[simp] theorem gold_sub_goldConj : Ο† - ψ = √5 := by ring #align gold_sub_gold_conj gold_sub_goldConj theorem gold_pow_sub_gold_pow (n : β„•) : Ο† ^ (n + 2) - Ο† ^ (n + 1) = Ο† ^ n := by rw [goldenRatio]; ring_nf; norm_num; ring @[simp 1200] theorem gold_sq : Ο† ^ 2 = Ο† + 1 := by rw [goldenRatio, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_sq gold_sq @[simp 1200] theorem goldConj_sq : ψ ^ 2 = ψ + 1 := by rw [goldenConj, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_conj_sq goldConj_sq theorem gold_pos : 0 < Ο† := mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two #align gold_pos gold_pos theorem gold_ne_zero : Ο† β‰  0 := ne_of_gt gold_pos #align gold_ne_zero gold_ne_zero theorem one_lt_gold : 1 < Ο† := by refine lt_of_mul_lt_mul_left ?_ (le_of_lt gold_pos) simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow` #align one_lt_gold one_lt_gold theorem gold_lt_two : Ο† < 2 := by calc (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num _ = 2 := by norm_num theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold] #align gold_conj_neg goldConj_neg theorem goldConj_ne_zero : ψ β‰  0 := ne_of_lt goldConj_neg #align gold_conj_ne_zero goldConj_ne_zero theorem neg_one_lt_goldConj : -1 < ψ := by rw [neg_lt, ← inv_gold] exact inv_lt_one one_lt_gold #align neg_one_lt_gold_conj neg_one_lt_goldConj theorem gold_irrational : Irrational Ο† := by have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_add 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp #align gold_irrational gold_irrational theorem goldConj_irrational : Irrational ψ := by have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_sub 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp #align gold_conj_irrational goldConj_irrational section Fibrec variable {Ξ± : Type*} [CommSemiring Ξ±] def fibRec : LinearRecurrence Ξ± where order := 2 coeffs := ![1, 1] #align fib_rec fibRec section Poly open Polynomial
Mathlib/Data/Real/GoldenRatio.lean
178
181
theorem fibRec_charPoly_eq {Ξ² : Type*} [CommRing Ξ²] : fibRec.charPoly = X ^ 2 - (X + (1 : Ξ²[X])) := by
rw [fibRec, LinearRecurrence.charPoly] simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ', ← smul_X_eq_monomial]
2
7.389056
1
0.894737
19
776
import Mathlib.Data.Real.Irrational import Mathlib.Data.Nat.Fib.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.LinearRecurrence import Mathlib.Tactic.NormNum.NatFib import Mathlib.Tactic.NormNum.Prime #align_import data.real.golden_ratio from "leanprover-community/mathlib"@"2196ab363eb097c008d4497125e0dde23fb36db2" noncomputable section open Polynomial abbrev goldenRatio : ℝ := (1 + √5) / 2 #align golden_ratio goldenRatio abbrev goldenConj : ℝ := (1 - √5) / 2 #align golden_conj goldenConj @[inherit_doc goldenRatio] scoped[goldenRatio] notation "Ο†" => goldenRatio @[inherit_doc goldenConj] scoped[goldenRatio] notation "ψ" => goldenConj open Real goldenRatio theorem inv_gold : φ⁻¹ = -ψ := by have : 1 + √5 β‰  0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num)) field_simp [sub_mul, mul_add] norm_num #align inv_gold inv_gold theorem inv_goldConj : ψ⁻¹ = -Ο† := by rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg] exact inv_gold.symm #align inv_gold_conj inv_goldConj @[simp] theorem gold_mul_goldConj : Ο† * ψ = -1 := by field_simp rw [← sq_sub_sq] norm_num #align gold_mul_gold_conj gold_mul_goldConj @[simp] theorem goldConj_mul_gold : ψ * Ο† = -1 := by rw [mul_comm] exact gold_mul_goldConj #align gold_conj_mul_gold goldConj_mul_gold @[simp] theorem gold_add_goldConj : Ο† + ψ = 1 := by rw [goldenRatio, goldenConj] ring #align gold_add_gold_conj gold_add_goldConj theorem one_sub_goldConj : 1 - Ο† = ψ := by linarith [gold_add_goldConj] #align one_sub_gold_conj one_sub_goldConj theorem one_sub_gold : 1 - ψ = Ο† := by linarith [gold_add_goldConj] #align one_sub_gold one_sub_gold @[simp] theorem gold_sub_goldConj : Ο† - ψ = √5 := by ring #align gold_sub_gold_conj gold_sub_goldConj theorem gold_pow_sub_gold_pow (n : β„•) : Ο† ^ (n + 2) - Ο† ^ (n + 1) = Ο† ^ n := by rw [goldenRatio]; ring_nf; norm_num; ring @[simp 1200] theorem gold_sq : Ο† ^ 2 = Ο† + 1 := by rw [goldenRatio, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_sq gold_sq @[simp 1200] theorem goldConj_sq : ψ ^ 2 = ψ + 1 := by rw [goldenConj, ← sub_eq_zero] ring_nf rw [Real.sq_sqrt] <;> norm_num #align gold_conj_sq goldConj_sq theorem gold_pos : 0 < Ο† := mul_pos (by apply add_pos <;> norm_num) <| inv_pos.2 zero_lt_two #align gold_pos gold_pos theorem gold_ne_zero : Ο† β‰  0 := ne_of_gt gold_pos #align gold_ne_zero gold_ne_zero theorem one_lt_gold : 1 < Ο† := by refine lt_of_mul_lt_mul_left ?_ (le_of_lt gold_pos) simp [← sq, gold_pos, zero_lt_one, - div_pow] -- Porting note: Added `- div_pow` #align one_lt_gold one_lt_gold theorem gold_lt_two : Ο† < 2 := by calc (1 + sqrt 5) / 2 < (1 + 3) / 2 := by gcongr; rw [sqrt_lt'] <;> norm_num _ = 2 := by norm_num theorem goldConj_neg : ψ < 0 := by linarith [one_sub_goldConj, one_lt_gold] #align gold_conj_neg goldConj_neg theorem goldConj_ne_zero : ψ β‰  0 := ne_of_lt goldConj_neg #align gold_conj_ne_zero goldConj_ne_zero theorem neg_one_lt_goldConj : -1 < ψ := by rw [neg_lt, ← inv_gold] exact inv_lt_one one_lt_gold #align neg_one_lt_gold_conj neg_one_lt_goldConj theorem gold_irrational : Irrational Ο† := by have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_add 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp #align gold_irrational gold_irrational theorem goldConj_irrational : Irrational ψ := by have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num) have := this.rat_sub 1 have := this.rat_mul (show (0.5 : β„š) β‰  0 by norm_num) convert this norm_num field_simp #align gold_conj_irrational goldConj_irrational section Fibrec variable {Ξ± : Type*} [CommSemiring Ξ±] def fibRec : LinearRecurrence Ξ± where order := 2 coeffs := ![1, 1] #align fib_rec fibRec
Mathlib/Data/Real/GoldenRatio.lean
187
192
theorem fib_isSol_fibRec : fibRec.IsSolution (fun x => x.fib : β„• β†’ Ξ±) := by
rw [fibRec] intro n simp only rw [Nat.fib_add_two, add_comm] simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ']
5
148.413159
2
0.894737
19
776
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)]
Mathlib/CategoryTheory/EqToHom.lean
52
56
theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by
cases p cases q simp
3
20.085537
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)]
Mathlib/CategoryTheory/EqToHom.lean
77
80
theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by
cases w simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)]
Mathlib/CategoryTheory/EqToHom.lean
86
89
theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by
cases w simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)]
Mathlib/CategoryTheory/EqToHom.lean
95
98
theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by
cases w simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF]
Mathlib/CategoryTheory/EqToHom.lean
104
107
theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : cast (congrArg (fun W : C => W ⟢ Z) p.symm) q = eqToHom p ≫ q := by
cases p simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF] theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : cast (congrArg (fun W : C => W ⟢ Z) p.symm) q = eqToHom p ≫ q := by cases p simp
Mathlib/CategoryTheory/EqToHom.lean
116
119
theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : (congrArg (fun W : C => W ⟢ Z) p).mpr q = eqToHom p ≫ q := by
cases p simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF] theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : cast (congrArg (fun W : C => W ⟢ Z) p.symm) q = eqToHom p ≫ q := by cases p simp theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : (congrArg (fun W : C => W ⟢ Z) p).mpr q = eqToHom p ≫ q := by cases p simp #align category_theory.congr_arg_mpr_hom_left CategoryTheory.congrArg_mpr_hom_left @[simp, nolint simpNF]
Mathlib/CategoryTheory/EqToHom.lean
126
129
theorem congrArg_cast_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : cast (congrArg (fun W : C => X ⟢ W) q.symm) p = p ≫ eqToHom q.symm := by
cases q simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF] theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : cast (congrArg (fun W : C => W ⟢ Z) p.symm) q = eqToHom p ≫ q := by cases p simp theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : (congrArg (fun W : C => W ⟢ Z) p).mpr q = eqToHom p ≫ q := by cases p simp #align category_theory.congr_arg_mpr_hom_left CategoryTheory.congrArg_mpr_hom_left @[simp, nolint simpNF] theorem congrArg_cast_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : cast (congrArg (fun W : C => X ⟢ W) q.symm) p = p ≫ eqToHom q.symm := by cases q simp
Mathlib/CategoryTheory/EqToHom.lean
138
141
theorem congrArg_mpr_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : (congrArg (fun W : C => X ⟢ W) q).mpr p = p ≫ eqToHom q.symm := by
cases q simp
2
7.389056
1
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF] theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : cast (congrArg (fun W : C => W ⟢ Z) p.symm) q = eqToHom p ≫ q := by cases p simp theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : (congrArg (fun W : C => W ⟢ Z) p).mpr q = eqToHom p ≫ q := by cases p simp #align category_theory.congr_arg_mpr_hom_left CategoryTheory.congrArg_mpr_hom_left @[simp, nolint simpNF] theorem congrArg_cast_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : cast (congrArg (fun W : C => X ⟢ W) q.symm) p = p ≫ eqToHom q.symm := by cases q simp theorem congrArg_mpr_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : (congrArg (fun W : C => X ⟢ W) q).mpr p = p ≫ eqToHom q.symm := by cases q simp #align category_theory.congr_arg_mpr_hom_right CategoryTheory.congrArg_mpr_hom_right def eqToIso {X Y : C} (p : X = Y) : X β‰… Y := ⟨eqToHom p, eqToHom p.symm, by simp, by simp⟩ #align category_theory.eq_to_iso CategoryTheory.eqToIso @[simp] theorem eqToIso.hom {X Y : C} (p : X = Y) : (eqToIso p).hom = eqToHom p := rfl #align category_theory.eq_to_iso.hom CategoryTheory.eqToIso.hom @[simp] theorem eqToIso.inv {X Y : C} (p : X = Y) : (eqToIso p).inv = eqToHom p.symm := rfl #align category_theory.eq_to_iso.inv CategoryTheory.eqToIso.inv @[simp] theorem eqToIso_refl {X : C} (p : X = X) : eqToIso p = Iso.refl X := rfl #align category_theory.eq_to_iso_refl CategoryTheory.eqToIso_refl @[simp]
Mathlib/CategoryTheory/EqToHom.lean
169
170
theorem eqToIso_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToIso p β‰ͺ≫ eqToIso q = eqToIso (p.trans q) := by
ext; simp
1
2.718282
0
0.9
10
777
import Mathlib.CategoryTheory.Opposites #align_import category_theory.eq_to_hom from "leanprover-community/mathlib"@"dc6c365e751e34d100e80fe6e314c3c3e0fd2988" universe v₁ vβ‚‚ v₃ u₁ uβ‚‚ u₃ -- morphism levels before object levels. See note [CategoryTheory universes]. namespace CategoryTheory open Opposite variable {C : Type u₁} [Category.{v₁} C] def eqToHom {X Y : C} (p : X = Y) : X ⟢ Y := by rw [p]; exact πŸ™ _ #align category_theory.eq_to_hom CategoryTheory.eqToHom @[simp] theorem eqToHom_refl (X : C) (p : X = X) : eqToHom p = πŸ™ X := rfl #align category_theory.eq_to_hom_refl CategoryTheory.eqToHom_refl @[reassoc (attr := simp)] theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToHom p ≫ eqToHom q = eqToHom (p.trans q) := by cases p cases q simp #align category_theory.eq_to_hom_trans CategoryTheory.eqToHom_trans theorem comp_eqToHom_iff {X Y Y' : C} (p : Y = Y') (f : X ⟢ Y) (g : X ⟢ Y') : f ≫ eqToHom p = g ↔ f = g ≫ eqToHom p.symm := { mp := fun h => h β–Έ by simp mpr := fun h => by simp [eq_whisker h (eqToHom p)] } #align category_theory.comp_eq_to_hom_iff CategoryTheory.comp_eqToHom_iff theorem eqToHom_comp_iff {X X' Y : C} (p : X = X') (f : X ⟢ Y) (g : X' ⟢ Y) : eqToHom p ≫ g = f ↔ g = eqToHom p.symm ≫ f := { mp := fun h => h β–Έ by simp mpr := fun h => h β–Έ by simp [whisker_eq _ h] } #align category_theory.eq_to_hom_comp_iff CategoryTheory.eqToHom_comp_iff variable {Ξ² : Sort*} -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b ⟢ g b) {j j' : Ξ²} (w : j = j') : z j ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ z j' := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_hom_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).hom ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').hom := by cases w simp -- The simpNF linter incorrectly claims that this will never apply. -- https://github.com/leanprover-community/mathlib4/issues/5049 @[reassoc (attr := simp, nolint simpNF)] theorem eqToHom_iso_inv_naturality {f g : Ξ² β†’ C} (z : βˆ€ b, f b β‰… g b) {j j' : Ξ²} (w : j = j') : (z j).inv ≫ eqToHom (by simp [w]) = eqToHom (by simp [w]) ≫ (z j').inv := by cases w simp @[simp, nolint simpNF] theorem congrArg_cast_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : cast (congrArg (fun W : C => W ⟢ Z) p.symm) q = eqToHom p ≫ q := by cases p simp theorem congrArg_mpr_hom_left {X Y Z : C} (p : X = Y) (q : Y ⟢ Z) : (congrArg (fun W : C => W ⟢ Z) p).mpr q = eqToHom p ≫ q := by cases p simp #align category_theory.congr_arg_mpr_hom_left CategoryTheory.congrArg_mpr_hom_left @[simp, nolint simpNF] theorem congrArg_cast_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : cast (congrArg (fun W : C => X ⟢ W) q.symm) p = p ≫ eqToHom q.symm := by cases q simp theorem congrArg_mpr_hom_right {X Y Z : C} (p : X ⟢ Y) (q : Z = Y) : (congrArg (fun W : C => X ⟢ W) q).mpr p = p ≫ eqToHom q.symm := by cases q simp #align category_theory.congr_arg_mpr_hom_right CategoryTheory.congrArg_mpr_hom_right def eqToIso {X Y : C} (p : X = Y) : X β‰… Y := ⟨eqToHom p, eqToHom p.symm, by simp, by simp⟩ #align category_theory.eq_to_iso CategoryTheory.eqToIso @[simp] theorem eqToIso.hom {X Y : C} (p : X = Y) : (eqToIso p).hom = eqToHom p := rfl #align category_theory.eq_to_iso.hom CategoryTheory.eqToIso.hom @[simp] theorem eqToIso.inv {X Y : C} (p : X = Y) : (eqToIso p).inv = eqToHom p.symm := rfl #align category_theory.eq_to_iso.inv CategoryTheory.eqToIso.inv @[simp] theorem eqToIso_refl {X : C} (p : X = X) : eqToIso p = Iso.refl X := rfl #align category_theory.eq_to_iso_refl CategoryTheory.eqToIso_refl @[simp] theorem eqToIso_trans {X Y Z : C} (p : X = Y) (q : Y = Z) : eqToIso p β‰ͺ≫ eqToIso q = eqToIso (p.trans q) := by ext; simp #align category_theory.eq_to_iso_trans CategoryTheory.eqToIso_trans @[simp]
Mathlib/CategoryTheory/EqToHom.lean
174
176
theorem eqToHom_op {X Y : C} (h : X = Y) : (eqToHom h).op = eqToHom (congr_arg op h.symm) := by
cases h rfl
2
7.389056
1
0.9
10
777
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars
Mathlib/Algebra/MvPolynomial/Variables.lean
71
73
theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by
rw [vars] convert rfl
2
7.389056
1
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp]
Mathlib/Algebra/MvPolynomial/Variables.lean
77
78
theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by
classical rw [vars_def, degrees_zero, Multiset.toFinset_zero]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp]
Mathlib/Algebra/MvPolynomial/Variables.lean
82
83
theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by
classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp]
Mathlib/Algebra/MvPolynomial/Variables.lean
87
88
theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by
classical rw [vars_def, degrees_C, Multiset.toFinset_zero]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp]
Mathlib/Algebra/MvPolynomial/Variables.lean
93
94
theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by
rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X
Mathlib/Algebra/MvPolynomial/Variables.lean
98
99
theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by
classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars
Mathlib/Algebra/MvPolynomial/Variables.lean
102
105
theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by
contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩
2
7.389056
1
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero
Mathlib/Algebra/MvPolynomial/Variables.lean
108
112
theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by
intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx
3
20.085537
1
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset
Mathlib/Algebra/MvPolynomial/Variables.lean
115
119
theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by
refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union]
3
20.085537
1
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul
Mathlib/Algebra/MvPolynomial/Variables.lean
124
126
theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by
simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ)
2
7.389056
1
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one
Mathlib/Algebra/MvPolynomial/Variables.lean
134
140
theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by
classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih
6
403.428793
2
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow
Mathlib/Algebra/MvPolynomial/Variables.lean
146
154
theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by
classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub
7
1,096.633158
2
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section IsDomain variable {A : Type*} [CommRing A] [IsDomain A]
Mathlib/Algebra/MvPolynomial/Variables.lean
161
168
theorem vars_C_mul (a : A) (ha : a β‰  0) (Ο† : MvPolynomial Οƒ A) : (C a * Ο† : MvPolynomial Οƒ A).vars = Ο†.vars := by
ext1 i simp only [mem_vars, exists_prop, mem_support_iff] apply exists_congr intro d apply and_congr _ Iff.rfl rw [coeff_C_mul, mul_ne_zero_iff, eq_true ha, true_and_iff]
6
403.428793
2
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Sum variable {ΞΉ : Type*} (t : Finset ΞΉ) (Ο† : ΞΉ β†’ MvPolynomial Οƒ R)
Mathlib/Algebra/MvPolynomial/Variables.lean
180
189
theorem vars_sum_subset [DecidableEq Οƒ] : (βˆ‘ i ∈ t, Ο† i).vars βŠ† Finset.biUnion t fun i => (Ο† i).vars := by
classical induction t using Finset.induction_on with | empty => simp | insert has hsum => rw [Finset.biUnion_insert, Finset.sum_insert has] refine Finset.Subset.trans (vars_add_subset _ _) (Finset.union_subset_union (Finset.Subset.refl _) ?_) assumption
8
2,980.957987
2
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Sum variable {ΞΉ : Type*} (t : Finset ΞΉ) (Ο† : ΞΉ β†’ MvPolynomial Οƒ R) theorem vars_sum_subset [DecidableEq Οƒ] : (βˆ‘ i ∈ t, Ο† i).vars βŠ† Finset.biUnion t fun i => (Ο† i).vars := by classical induction t using Finset.induction_on with | empty => simp | insert has hsum => rw [Finset.biUnion_insert, Finset.sum_insert has] refine Finset.Subset.trans (vars_add_subset _ _) (Finset.union_subset_union (Finset.Subset.refl _) ?_) assumption #align mv_polynomial.vars_sum_subset MvPolynomial.vars_sum_subset
Mathlib/Algebra/MvPolynomial/Variables.lean
192
207
theorem vars_sum_of_disjoint [DecidableEq Οƒ] (h : Pairwise <| (Disjoint on fun i => (Ο† i).vars)) : (βˆ‘ i ∈ t, Ο† i).vars = Finset.biUnion t fun i => (Ο† i).vars := by
classical induction t using Finset.induction_on with | empty => simp | insert has hsum => rw [Finset.biUnion_insert, Finset.sum_insert has, vars_add_of_disjoint, hsum] unfold Pairwise onFun at h rw [hsum] simp only [Finset.disjoint_iff_ne] at h ⊒ intro v hv v2 hv2 rw [Finset.mem_biUnion] at hv2 rcases hv2 with ⟨i, his, hi⟩ refine h ?_ _ hv _ hi rintro rfl contradiction
14
1,202,604.284165
2
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Map variable [CommSemiring S] (f : R β†’+* S) variable (p)
Mathlib/Algebra/MvPolynomial/Variables.lean
217
217
theorem vars_map : (map f p).vars βŠ† p.vars := by
classical simp [vars_def, degrees_map]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Map variable [CommSemiring S] (f : R β†’+* S) variable (p) theorem vars_map : (map f p).vars βŠ† p.vars := by classical simp [vars_def, degrees_map] #align mv_polynomial.vars_map MvPolynomial.vars_map variable {f}
Mathlib/Algebra/MvPolynomial/Variables.lean
222
223
theorem vars_map_of_injective (hf : Injective f) : (map f p).vars = p.vars := by
simp [vars, degrees_map_of_injective _ hf]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Map variable [CommSemiring S] (f : R β†’+* S) variable (p) theorem vars_map : (map f p).vars βŠ† p.vars := by classical simp [vars_def, degrees_map] #align mv_polynomial.vars_map MvPolynomial.vars_map variable {f} theorem vars_map_of_injective (hf : Injective f) : (map f p).vars = p.vars := by simp [vars, degrees_map_of_injective _ hf] #align mv_polynomial.vars_map_of_injective MvPolynomial.vars_map_of_injective
Mathlib/Algebra/MvPolynomial/Variables.lean
226
228
theorem vars_monomial_single (i : Οƒ) {e : β„•} {r : R} (he : e β‰  0) (hr : r β‰  0) : (monomial (Finsupp.single i e) r).vars = {i} := by
rw [vars_monomial hr, Finsupp.support_single_ne_zero _ he]
1
2.718282
0
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section Map variable [CommSemiring S] (f : R β†’+* S) variable (p) theorem vars_map : (map f p).vars βŠ† p.vars := by classical simp [vars_def, degrees_map] #align mv_polynomial.vars_map MvPolynomial.vars_map variable {f} theorem vars_map_of_injective (hf : Injective f) : (map f p).vars = p.vars := by simp [vars, degrees_map_of_injective _ hf] #align mv_polynomial.vars_map_of_injective MvPolynomial.vars_map_of_injective theorem vars_monomial_single (i : Οƒ) {e : β„•} {r : R} (he : e β‰  0) (hr : r β‰  0) : (monomial (Finsupp.single i e) r).vars = {i} := by rw [vars_monomial hr, Finsupp.support_single_ne_zero _ he] #align mv_polynomial.vars_monomial_single MvPolynomial.vars_monomial_single
Mathlib/Algebra/MvPolynomial/Variables.lean
231
234
theorem vars_eq_support_biUnion_support [DecidableEq Οƒ] : p.vars = p.support.biUnion Finsupp.support := by
ext i rw [mem_vars, Finset.mem_biUnion]
2
7.389056
1
0.9
20
778
import Mathlib.Algebra.MvPolynomial.Degrees #align_import data.mv_polynomial.variables from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4" noncomputable section open Set Function Finsupp AddMonoidAlgebra universe u v w variable {R : Type u} {S : Type v} namespace MvPolynomial variable {Οƒ Ο„ : Type*} {r : R} {e : β„•} {n m : Οƒ} {s : Οƒ β†’β‚€ β„•} section CommSemiring variable [CommSemiring R] {p q : MvPolynomial Οƒ R} section Vars def vars (p : MvPolynomial Οƒ R) : Finset Οƒ := letI := Classical.decEq Οƒ p.degrees.toFinset #align mv_polynomial.vars MvPolynomial.vars theorem vars_def [DecidableEq Οƒ] (p : MvPolynomial Οƒ R) : p.vars = p.degrees.toFinset := by rw [vars] convert rfl #align mv_polynomial.vars_def MvPolynomial.vars_def @[simp] theorem vars_0 : (0 : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_zero, Multiset.toFinset_zero] #align mv_polynomial.vars_0 MvPolynomial.vars_0 @[simp] theorem vars_monomial (h : r β‰  0) : (monomial s r).vars = s.support := by classical rw [vars_def, degrees_monomial_eq _ _ h, Finsupp.toFinset_toMultiset] #align mv_polynomial.vars_monomial MvPolynomial.vars_monomial @[simp] theorem vars_C : (C r : MvPolynomial Οƒ R).vars = βˆ… := by classical rw [vars_def, degrees_C, Multiset.toFinset_zero] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_C MvPolynomial.vars_C @[simp] theorem vars_X [Nontrivial R] : (X n : MvPolynomial Οƒ R).vars = {n} := by rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' β„•)] set_option linter.uppercaseLean3 false in #align mv_polynomial.vars_X MvPolynomial.vars_X theorem mem_vars (i : Οƒ) : i ∈ p.vars ↔ βˆƒ d ∈ p.support, i ∈ d.support := by classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff, exists_prop] #align mv_polynomial.mem_vars MvPolynomial.mem_vars theorem mem_support_not_mem_vars_zero {f : MvPolynomial Οƒ R} {x : Οƒ β†’β‚€ β„•} (H : x ∈ f.support) {v : Οƒ} (h : v βˆ‰ vars f) : x v = 0 := by contrapose! h exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩ #align mv_polynomial.mem_support_not_mem_vars_zero MvPolynomial.mem_support_not_mem_vars_zero theorem vars_add_subset [DecidableEq Οƒ] (p q : MvPolynomial Οƒ R) : (p + q).vars βŠ† p.vars βˆͺ q.vars := by intro x hx simp only [vars_def, Finset.mem_union, Multiset.mem_toFinset] at hx ⊒ simpa using Multiset.mem_of_le (degrees_add _ _) hx #align mv_polynomial.vars_add_subset MvPolynomial.vars_add_subset theorem vars_add_of_disjoint [DecidableEq Οƒ] (h : Disjoint p.vars q.vars) : (p + q).vars = p.vars βˆͺ q.vars := by refine (vars_add_subset p q).antisymm fun x hx => ?_ simp only [vars_def, Multiset.disjoint_toFinset] at h hx ⊒ rwa [degrees_add_of_disjoint h, Multiset.toFinset_union] #align mv_polynomial.vars_add_of_disjoint MvPolynomial.vars_add_of_disjoint section Mul theorem vars_mul [DecidableEq Οƒ] (Ο† ψ : MvPolynomial Οƒ R) : (Ο† * ψ).vars βŠ† Ο†.vars βˆͺ ψ.vars := by simp_rw [vars_def, ← Multiset.toFinset_add, Multiset.toFinset_subset] exact Multiset.subset_of_le (degrees_mul Ο† ψ) #align mv_polynomial.vars_mul MvPolynomial.vars_mul @[simp] theorem vars_one : (1 : MvPolynomial Οƒ R).vars = βˆ… := vars_C #align mv_polynomial.vars_one MvPolynomial.vars_one theorem vars_pow (Ο† : MvPolynomial Οƒ R) (n : β„•) : (Ο† ^ n).vars βŠ† Ο†.vars := by classical induction' n with n ih Β· simp Β· rw [pow_succ'] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset (Finset.Subset.refl _) ih #align mv_polynomial.vars_pow MvPolynomial.vars_pow theorem vars_prod {ΞΉ : Type*} [DecidableEq Οƒ] {s : Finset ΞΉ} (f : ΞΉ β†’ MvPolynomial Οƒ R) : (∏ i ∈ s, f i).vars βŠ† s.biUnion fun i => (f i).vars := by classical induction s using Finset.induction_on with | empty => simp | insert hs hsub => simp only [hs, Finset.biUnion_insert, Finset.prod_insert, not_false_iff] apply Finset.Subset.trans (vars_mul _ _) exact Finset.union_subset_union (Finset.Subset.refl _) hsub #align mv_polynomial.vars_prod MvPolynomial.vars_prod section EvalVars variable [CommSemiring S]
Mathlib/Algebra/MvPolynomial/Variables.lean
248
274
theorem evalβ‚‚Hom_eq_constantCoeff_of_vars (f : R β†’+* S) {g : Οƒ β†’ S} {p : MvPolynomial Οƒ R} (hp : βˆ€ i ∈ p.vars, g i = 0) : evalβ‚‚Hom f g p = f (constantCoeff p) := by
conv_lhs => rw [p.as_sum] simp only [map_sum, evalβ‚‚Hom_monomial] by_cases h0 : constantCoeff p = 0 on_goal 1 => rw [h0, f.map_zero, Finset.sum_eq_zero] intro d hd on_goal 2 => rw [Finset.sum_eq_single (0 : Οƒ β†’β‚€ β„•)] Β· rw [Finsupp.prod_zero_index, mul_one] rfl on_goal 1 => intro d hd hd0 on_goal 3 => rw [constantCoeff_eq, coeff, ← Ne, ← Finsupp.mem_support_iff] at h0 intro contradiction repeat' obtain ⟨i, hi⟩ : Finset.Nonempty (Finsupp.support d) := by rw [constantCoeff_eq, coeff, ← Finsupp.not_mem_support_iff] at h0 rw [Finset.nonempty_iff_ne_empty, Ne, Finsupp.support_eq_empty] rintro rfl contradiction rw [Finsupp.prod, Finset.prod_eq_zero hi, mul_zero] rw [hp, zero_pow (Finsupp.mem_support_iff.1 hi)] rw [mem_vars] exact ⟨d, hd, hi⟩
25
72,004,899,337.38586
2
0.9
20
778
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one
Mathlib/LinearAlgebra/Basis.lean
137
141
theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by
{ rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one]
2
7.389056
1
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self
Mathlib/LinearAlgebra/Basis.lean
149
150
theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by
rw [repr_self, Finsupp.single_apply]
1
2.718282
0
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by rw [repr_self, Finsupp.single_apply] #align basis.repr_self_apply Basis.repr_self_apply @[simp]
Mathlib/LinearAlgebra/Basis.lean
154
158
theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ΞΉ M R b v := calc b.repr.symm v = b.repr.symm (v.sum Finsupp.single) := by
simp _ = v.sum fun i vi => b.repr.symm (Finsupp.single i vi) := map_finsupp_sum .. _ = Finsupp.total ΞΉ M R b v := by simp only [repr_symm_single, Finsupp.total_apply]
3
20.085537
1
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by rw [repr_self, Finsupp.single_apply] #align basis.repr_self_apply Basis.repr_self_apply @[simp] theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ΞΉ M R b v := calc b.repr.symm v = b.repr.symm (v.sum Finsupp.single) := by simp _ = v.sum fun i vi => b.repr.symm (Finsupp.single i vi) := map_finsupp_sum .. _ = Finsupp.total ΞΉ M R b v := by simp only [repr_symm_single, Finsupp.total_apply] #align basis.repr_symm_apply Basis.repr_symm_apply @[simp] theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ΞΉ M R b := LinearMap.ext fun v => b.repr_symm_apply v #align basis.coe_repr_symm Basis.coe_repr_symm @[simp]
Mathlib/LinearAlgebra/Basis.lean
167
169
theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v := by
rw [← b.coe_repr_symm] exact b.repr.apply_symm_apply v
2
7.389056
1
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by rw [repr_self, Finsupp.single_apply] #align basis.repr_self_apply Basis.repr_self_apply @[simp] theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ΞΉ M R b v := calc b.repr.symm v = b.repr.symm (v.sum Finsupp.single) := by simp _ = v.sum fun i vi => b.repr.symm (Finsupp.single i vi) := map_finsupp_sum .. _ = Finsupp.total ΞΉ M R b v := by simp only [repr_symm_single, Finsupp.total_apply] #align basis.repr_symm_apply Basis.repr_symm_apply @[simp] theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ΞΉ M R b := LinearMap.ext fun v => b.repr_symm_apply v #align basis.coe_repr_symm Basis.coe_repr_symm @[simp] theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v := by rw [← b.coe_repr_symm] exact b.repr.apply_symm_apply v #align basis.repr_total Basis.repr_total @[simp]
Mathlib/LinearAlgebra/Basis.lean
173
175
theorem total_repr : Finsupp.total _ _ _ b (b.repr x) = x := by
rw [← b.coe_repr_symm] exact b.repr.symm_apply_apply x
2
7.389056
1
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by rw [repr_self, Finsupp.single_apply] #align basis.repr_self_apply Basis.repr_self_apply @[simp] theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ΞΉ M R b v := calc b.repr.symm v = b.repr.symm (v.sum Finsupp.single) := by simp _ = v.sum fun i vi => b.repr.symm (Finsupp.single i vi) := map_finsupp_sum .. _ = Finsupp.total ΞΉ M R b v := by simp only [repr_symm_single, Finsupp.total_apply] #align basis.repr_symm_apply Basis.repr_symm_apply @[simp] theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ΞΉ M R b := LinearMap.ext fun v => b.repr_symm_apply v #align basis.coe_repr_symm Basis.coe_repr_symm @[simp] theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v := by rw [← b.coe_repr_symm] exact b.repr.apply_symm_apply v #align basis.repr_total Basis.repr_total @[simp] theorem total_repr : Finsupp.total _ _ _ b (b.repr x) = x := by rw [← b.coe_repr_symm] exact b.repr.symm_apply_apply x #align basis.total_repr Basis.total_repr
Mathlib/LinearAlgebra/Basis.lean
178
179
theorem repr_range : LinearMap.range (b.repr : M β†’β‚—[R] ΞΉ β†’β‚€ R) = Finsupp.supported R R univ := by
rw [LinearEquiv.range, Finsupp.supported_univ]
1
2.718282
0
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by rw [repr_self, Finsupp.single_apply] #align basis.repr_self_apply Basis.repr_self_apply @[simp] theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ΞΉ M R b v := calc b.repr.symm v = b.repr.symm (v.sum Finsupp.single) := by simp _ = v.sum fun i vi => b.repr.symm (Finsupp.single i vi) := map_finsupp_sum .. _ = Finsupp.total ΞΉ M R b v := by simp only [repr_symm_single, Finsupp.total_apply] #align basis.repr_symm_apply Basis.repr_symm_apply @[simp] theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ΞΉ M R b := LinearMap.ext fun v => b.repr_symm_apply v #align basis.coe_repr_symm Basis.coe_repr_symm @[simp] theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v := by rw [← b.coe_repr_symm] exact b.repr.apply_symm_apply v #align basis.repr_total Basis.repr_total @[simp] theorem total_repr : Finsupp.total _ _ _ b (b.repr x) = x := by rw [← b.coe_repr_symm] exact b.repr.symm_apply_apply x #align basis.total_repr Basis.total_repr theorem repr_range : LinearMap.range (b.repr : M β†’β‚—[R] ΞΉ β†’β‚€ R) = Finsupp.supported R R univ := by rw [LinearEquiv.range, Finsupp.supported_univ] #align basis.repr_range Basis.repr_range theorem mem_span_repr_support (m : M) : m ∈ span R (b '' (b.repr m).support) := (Finsupp.mem_span_image_iff_total _).2 ⟨b.repr m, by simp [Finsupp.mem_supported_support]⟩ #align basis.mem_span_repr_support Basis.mem_span_repr_support
Mathlib/LinearAlgebra/Basis.lean
186
189
theorem repr_support_subset_of_mem_span (s : Set ΞΉ) {m : M} (hm : m ∈ span R (b '' s)) : ↑(b.repr m).support βŠ† s := by
rcases (Finsupp.mem_span_image_iff_total _).1 hm with ⟨l, hl, rfl⟩ rwa [repr_total, ← Finsupp.mem_supported R l]
2
7.389056
1
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section repr theorem repr_injective : Injective (repr : Basis ΞΉ R M β†’ M ≃ₗ[R] ΞΉ β†’β‚€ R) := fun f g h => by cases f; cases g; congr #align basis.repr_injective Basis.repr_injective instance instFunLike : FunLike (Basis ΞΉ R M) ΞΉ M where coe b i := b.repr.symm (Finsupp.single i 1) coe_injective' f g h := repr_injective <| LinearEquiv.symm_bijective.injective <| LinearEquiv.toLinearMap_injective <| by ext; exact congr_fun h _ #align basis.fun_like Basis.instFunLike @[simp] theorem coe_ofRepr (e : M ≃ₗ[R] ΞΉ β†’β‚€ R) : ⇑(ofRepr e) = fun i => e.symm (Finsupp.single i 1) := rfl #align basis.coe_of_repr Basis.coe_ofRepr protected theorem injective [Nontrivial R] : Injective b := b.repr.symm.injective.comp fun _ _ => (Finsupp.single_left_inj (one_ne_zero : (1 : R) β‰  0)).mp #align basis.injective Basis.injective theorem repr_symm_single_one : b.repr.symm (Finsupp.single i 1) = b i := rfl #align basis.repr_symm_single_one Basis.repr_symm_single_one theorem repr_symm_single : b.repr.symm (Finsupp.single i c) = c β€’ b i := calc b.repr.symm (Finsupp.single i c) = b.repr.symm (c β€’ Finsupp.single i (1 : R)) := by { rw [Finsupp.smul_single', mul_one] } _ = c β€’ b i := by rw [LinearEquiv.map_smul, repr_symm_single_one] #align basis.repr_symm_single Basis.repr_symm_single @[simp] theorem repr_self : b.repr (b i) = Finsupp.single i 1 := LinearEquiv.apply_symm_apply _ _ #align basis.repr_self Basis.repr_self theorem repr_self_apply (j) [Decidable (i = j)] : b.repr (b i) j = if i = j then 1 else 0 := by rw [repr_self, Finsupp.single_apply] #align basis.repr_self_apply Basis.repr_self_apply @[simp] theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ΞΉ M R b v := calc b.repr.symm v = b.repr.symm (v.sum Finsupp.single) := by simp _ = v.sum fun i vi => b.repr.symm (Finsupp.single i vi) := map_finsupp_sum .. _ = Finsupp.total ΞΉ M R b v := by simp only [repr_symm_single, Finsupp.total_apply] #align basis.repr_symm_apply Basis.repr_symm_apply @[simp] theorem coe_repr_symm : ↑b.repr.symm = Finsupp.total ΞΉ M R b := LinearMap.ext fun v => b.repr_symm_apply v #align basis.coe_repr_symm Basis.coe_repr_symm @[simp] theorem repr_total (v) : b.repr (Finsupp.total _ _ _ b v) = v := by rw [← b.coe_repr_symm] exact b.repr.apply_symm_apply v #align basis.repr_total Basis.repr_total @[simp] theorem total_repr : Finsupp.total _ _ _ b (b.repr x) = x := by rw [← b.coe_repr_symm] exact b.repr.symm_apply_apply x #align basis.total_repr Basis.total_repr theorem repr_range : LinearMap.range (b.repr : M β†’β‚—[R] ΞΉ β†’β‚€ R) = Finsupp.supported R R univ := by rw [LinearEquiv.range, Finsupp.supported_univ] #align basis.repr_range Basis.repr_range theorem mem_span_repr_support (m : M) : m ∈ span R (b '' (b.repr m).support) := (Finsupp.mem_span_image_iff_total _).2 ⟨b.repr m, by simp [Finsupp.mem_supported_support]⟩ #align basis.mem_span_repr_support Basis.mem_span_repr_support theorem repr_support_subset_of_mem_span (s : Set ΞΉ) {m : M} (hm : m ∈ span R (b '' s)) : ↑(b.repr m).support βŠ† s := by rcases (Finsupp.mem_span_image_iff_total _).1 hm with ⟨l, hl, rfl⟩ rwa [repr_total, ← Finsupp.mem_supported R l] #align basis.repr_support_subset_of_mem_span Basis.repr_support_subset_of_mem_span theorem mem_span_image {m : M} {s : Set ΞΉ} : m ∈ span R (b '' s) ↔ ↑(b.repr m).support βŠ† s := ⟨repr_support_subset_of_mem_span _ _, fun h ↦ span_mono (image_subset _ h) (mem_span_repr_support b _)⟩ @[simp]
Mathlib/LinearAlgebra/Basis.lean
197
199
theorem self_mem_span_image [Nontrivial R] {i : ΞΉ} {s : Set ΞΉ} : b i ∈ span R (b '' s) ↔ i ∈ s := by
simp [mem_span_image, Finsupp.support_single_ne_zero]
1
2.718282
0
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section Coord @[simps!] def coord : M β†’β‚—[R] R := Finsupp.lapply i βˆ˜β‚— ↑b.repr #align basis.coord Basis.coord theorem forall_coord_eq_zero_iff {x : M} : (βˆ€ i, b.coord i x = 0) ↔ x = 0 := Iff.trans (by simp only [b.coord_apply, DFunLike.ext_iff, Finsupp.zero_apply]) b.repr.map_eq_zero_iff #align basis.forall_coord_eq_zero_iff Basis.forall_coord_eq_zero_iff noncomputable def sumCoords : M β†’β‚—[R] R := (Finsupp.lsum β„• fun _ => LinearMap.id) βˆ˜β‚— (b.repr : M β†’β‚—[R] ΞΉ β†’β‚€ R) #align basis.sum_coords Basis.sumCoords @[simp] theorem coe_sumCoords : (b.sumCoords : M β†’ R) = fun m => (b.repr m).sum fun _ => id := rfl #align basis.coe_sum_coords Basis.coe_sumCoords
Mathlib/LinearAlgebra/Basis.lean
231
236
theorem coe_sumCoords_eq_finsum : (b.sumCoords : M β†’ R) = fun m => βˆ‘αΆ  i, b.coord i m := by
ext m simp only [Basis.sumCoords, Basis.coord, Finsupp.lapply_apply, LinearMap.id_coe, LinearEquiv.coe_coe, Function.comp_apply, Finsupp.coe_lsum, LinearMap.coe_comp, finsum_eq_sum _ (b.repr m).finite_support, Finsupp.sum, Finset.finite_toSet_toFinset, id, Finsupp.fun_support_eq]
5
148.413159
2
0.9
10
779
import Mathlib.Algebra.BigOperators.Finsupp import Mathlib.Algebra.BigOperators.Finprod import Mathlib.Data.Fintype.BigOperators import Mathlib.LinearAlgebra.Finsupp import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.SetTheory.Cardinal.Cofinality #align_import linear_algebra.basis from "leanprover-community/mathlib"@"13bce9a6b6c44f6b4c91ac1c1d2a816e2533d395" noncomputable section universe u open Function Set Submodule variable {ΞΉ : Type*} {ΞΉ' : Type*} {R : Type*} {Rβ‚‚ : Type*} {K : Type*} variable {M : Type*} {M' M'' : Type*} {V : Type u} {V' : Type*} section Module variable [Semiring R] variable [AddCommMonoid M] [Module R M] [AddCommMonoid M'] [Module R M'] section variable (ΞΉ R M) structure Basis where ofRepr :: repr : M ≃ₗ[R] ΞΉ β†’β‚€ R #align basis Basis #align basis.repr Basis.repr #align basis.of_repr Basis.ofRepr end instance uniqueBasis [Subsingleton R] : Unique (Basis ΞΉ R M) := ⟨⟨⟨default⟩⟩, fun ⟨b⟩ => by rw [Subsingleton.elim b]⟩ #align unique_basis uniqueBasis namespace Basis instance : Inhabited (Basis ΞΉ R (ΞΉ β†’β‚€ R)) := ⟨.ofRepr (LinearEquiv.refl _ _)⟩ variable (b b₁ : Basis ΞΉ R M) (i : ΞΉ) (c : R) (x : M) section Coord @[simps!] def coord : M β†’β‚—[R] R := Finsupp.lapply i βˆ˜β‚— ↑b.repr #align basis.coord Basis.coord theorem forall_coord_eq_zero_iff {x : M} : (βˆ€ i, b.coord i x = 0) ↔ x = 0 := Iff.trans (by simp only [b.coord_apply, DFunLike.ext_iff, Finsupp.zero_apply]) b.repr.map_eq_zero_iff #align basis.forall_coord_eq_zero_iff Basis.forall_coord_eq_zero_iff noncomputable def sumCoords : M β†’β‚—[R] R := (Finsupp.lsum β„• fun _ => LinearMap.id) βˆ˜β‚— (b.repr : M β†’β‚—[R] ΞΉ β†’β‚€ R) #align basis.sum_coords Basis.sumCoords @[simp] theorem coe_sumCoords : (b.sumCoords : M β†’ R) = fun m => (b.repr m).sum fun _ => id := rfl #align basis.coe_sum_coords Basis.coe_sumCoords theorem coe_sumCoords_eq_finsum : (b.sumCoords : M β†’ R) = fun m => βˆ‘αΆ  i, b.coord i m := by ext m simp only [Basis.sumCoords, Basis.coord, Finsupp.lapply_apply, LinearMap.id_coe, LinearEquiv.coe_coe, Function.comp_apply, Finsupp.coe_lsum, LinearMap.coe_comp, finsum_eq_sum _ (b.repr m).finite_support, Finsupp.sum, Finset.finite_toSet_toFinset, id, Finsupp.fun_support_eq] #align basis.coe_sum_coords_eq_finsum Basis.coe_sumCoords_eq_finsum @[simp high]
Mathlib/LinearAlgebra/Basis.lean
240
246
theorem coe_sumCoords_of_fintype [Fintype ΞΉ] : (b.sumCoords : M β†’ R) = βˆ‘ i, b.coord i := by
ext m -- Porting note: - `eq_self_iff_true` -- + `comp_apply` `LinearMap.coeFn_sum` simp only [sumCoords, Finsupp.sum_fintype, LinearMap.id_coe, LinearEquiv.coe_coe, coord_apply, id, Fintype.sum_apply, imp_true_iff, Finsupp.coe_lsum, LinearMap.coe_comp, comp_apply, LinearMap.coeFn_sum]
6
403.428793
2
0.9
10
779
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial
Mathlib/RingTheory/Polynomial/Bernstein.lean
61
62
theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by
simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h]
1
2.718282
0
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp]
Mathlib/RingTheory/Polynomial/Bernstein.lean
70
71
theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by
simp [bernsteinPolynomial]
1
2.718282
0
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end
Mathlib/RingTheory/Polynomial/Bernstein.lean
76
78
theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by
simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm]
1
2.718282
0
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip
Mathlib/RingTheory/Polynomial/Bernstein.lean
81
83
theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by
simp [← flip _ _ _ h, Polynomial.comp_assoc]
1
2.718282
0
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by simp [← flip _ _ _ h, Polynomial.comp_assoc] #align bernstein_polynomial.flip' bernsteinPolynomial.flip'
Mathlib/RingTheory/Polynomial/Bernstein.lean
86
90
theorem eval_at_0 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 0 = if Ξ½ = 0 then 1 else 0 := by
rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· simp [zero_pow h]
4
54.59815
2
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by simp [← flip _ _ _ h, Polynomial.comp_assoc] #align bernstein_polynomial.flip' bernsteinPolynomial.flip' theorem eval_at_0 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 0 = if Ξ½ = 0 then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· simp [zero_pow h] #align bernstein_polynomial.eval_at_0 bernsteinPolynomial.eval_at_0
Mathlib/RingTheory/Polynomial/Bernstein.lean
93
99
theorem eval_at_1 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 1 = if Ξ½ = n then 1 else 0 := by
rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· obtain hΞ½n | hnΞ½ := Ne.lt_or_lt h Β· simp [zero_pow $ Nat.sub_ne_zero_of_lt hΞ½n] Β· simp [Nat.choose_eq_zero_of_lt hnΞ½]
6
403.428793
2
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by simp [← flip _ _ _ h, Polynomial.comp_assoc] #align bernstein_polynomial.flip' bernsteinPolynomial.flip' theorem eval_at_0 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 0 = if Ξ½ = 0 then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· simp [zero_pow h] #align bernstein_polynomial.eval_at_0 bernsteinPolynomial.eval_at_0 theorem eval_at_1 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 1 = if Ξ½ = n then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· obtain hΞ½n | hnΞ½ := Ne.lt_or_lt h Β· simp [zero_pow $ Nat.sub_ne_zero_of_lt hΞ½n] Β· simp [Nat.choose_eq_zero_of_lt hnΞ½] #align bernstein_polynomial.eval_at_1 bernsteinPolynomial.eval_at_1
Mathlib/RingTheory/Polynomial/Bernstein.lean
102
131
theorem derivative_succ_aux (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R (n + 1) (Ξ½ + 1)) = (n + 1) * (bernsteinPolynomial R n Ξ½ - bernsteinPolynomial R n (Ξ½ + 1)) := by
rw [bernsteinPolynomial] suffices ((n + 1).choose (Ξ½ + 1) : R[X]) * ((↑(Ξ½ + 1 : β„•) : R[X]) * X ^ Ξ½) * (1 - X) ^ (n - Ξ½) - ((n + 1).choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * ((↑(n - Ξ½) : R[X]) * (1 - X) ^ (n - Ξ½ - 1)) = (↑(n + 1) : R[X]) * ((n.choose Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) - (n.choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * (1 - X) ^ (n - (Ξ½ + 1))) by simpa [Polynomial.derivative_pow, ← sub_eq_add_neg, Nat.succ_sub_succ_eq_sub, Polynomial.derivative_mul, Polynomial.derivative_natCast, zero_mul, Nat.cast_add, algebraMap.coe_one, Polynomial.derivative_X, mul_one, zero_add, Polynomial.derivative_sub, Polynomial.derivative_one, zero_sub, mul_neg, Nat.sub_zero, bernsteinPolynomial, map_add, map_natCast, Nat.cast_one] conv_rhs => rw [mul_sub] -- We'll prove the two terms match up separately. refine congr (congr_arg Sub.sub ?_) ?_ Β· simp only [← mul_assoc] apply congr (congr_arg (Β· * Β·) (congr (congr_arg (Β· * Β·) _) rfl)) rfl -- Now it's just about binomial coefficients exact mod_cast congr_arg (fun m : β„• => (m : R[X])) (Nat.succ_mul_choose_eq n Ξ½).symm Β· rw [← tsub_add_eq_tsub_tsub, ← mul_assoc, ← mul_assoc]; congr 1 rw [mul_comm, ← mul_assoc, ← mul_assoc]; congr 1 norm_cast congr 1 convert (Nat.choose_mul_succ_eq n (Ξ½ + 1)).symm using 1 Β· -- Porting note: was -- convert mul_comm _ _ using 2 -- simp rw [mul_comm, Nat.succ_sub_succ_eq_sub] Β· apply mul_comm
27
532,048,240,601.79865
2
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by simp [← flip _ _ _ h, Polynomial.comp_assoc] #align bernstein_polynomial.flip' bernsteinPolynomial.flip' theorem eval_at_0 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 0 = if Ξ½ = 0 then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· simp [zero_pow h] #align bernstein_polynomial.eval_at_0 bernsteinPolynomial.eval_at_0 theorem eval_at_1 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 1 = if Ξ½ = n then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· obtain hΞ½n | hnΞ½ := Ne.lt_or_lt h Β· simp [zero_pow $ Nat.sub_ne_zero_of_lt hΞ½n] Β· simp [Nat.choose_eq_zero_of_lt hnΞ½] #align bernstein_polynomial.eval_at_1 bernsteinPolynomial.eval_at_1 theorem derivative_succ_aux (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R (n + 1) (Ξ½ + 1)) = (n + 1) * (bernsteinPolynomial R n Ξ½ - bernsteinPolynomial R n (Ξ½ + 1)) := by rw [bernsteinPolynomial] suffices ((n + 1).choose (Ξ½ + 1) : R[X]) * ((↑(Ξ½ + 1 : β„•) : R[X]) * X ^ Ξ½) * (1 - X) ^ (n - Ξ½) - ((n + 1).choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * ((↑(n - Ξ½) : R[X]) * (1 - X) ^ (n - Ξ½ - 1)) = (↑(n + 1) : R[X]) * ((n.choose Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) - (n.choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * (1 - X) ^ (n - (Ξ½ + 1))) by simpa [Polynomial.derivative_pow, ← sub_eq_add_neg, Nat.succ_sub_succ_eq_sub, Polynomial.derivative_mul, Polynomial.derivative_natCast, zero_mul, Nat.cast_add, algebraMap.coe_one, Polynomial.derivative_X, mul_one, zero_add, Polynomial.derivative_sub, Polynomial.derivative_one, zero_sub, mul_neg, Nat.sub_zero, bernsteinPolynomial, map_add, map_natCast, Nat.cast_one] conv_rhs => rw [mul_sub] -- We'll prove the two terms match up separately. refine congr (congr_arg Sub.sub ?_) ?_ Β· simp only [← mul_assoc] apply congr (congr_arg (Β· * Β·) (congr (congr_arg (Β· * Β·) _) rfl)) rfl -- Now it's just about binomial coefficients exact mod_cast congr_arg (fun m : β„• => (m : R[X])) (Nat.succ_mul_choose_eq n Ξ½).symm Β· rw [← tsub_add_eq_tsub_tsub, ← mul_assoc, ← mul_assoc]; congr 1 rw [mul_comm, ← mul_assoc, ← mul_assoc]; congr 1 norm_cast congr 1 convert (Nat.choose_mul_succ_eq n (Ξ½ + 1)).symm using 1 Β· -- Porting note: was -- convert mul_comm _ _ using 2 -- simp rw [mul_comm, Nat.succ_sub_succ_eq_sub] Β· apply mul_comm #align bernstein_polynomial.derivative_succ_aux bernsteinPolynomial.derivative_succ_aux
Mathlib/RingTheory/Polynomial/Bernstein.lean
134
138
theorem derivative_succ (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R n (Ξ½ + 1)) = n * (bernsteinPolynomial R (n - 1) Ξ½ - bernsteinPolynomial R (n - 1) (Ξ½ + 1)) := by
cases n Β· simp [bernsteinPolynomial] Β· rw [Nat.cast_succ]; apply derivative_succ_aux
3
20.085537
1
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by simp [← flip _ _ _ h, Polynomial.comp_assoc] #align bernstein_polynomial.flip' bernsteinPolynomial.flip' theorem eval_at_0 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 0 = if Ξ½ = 0 then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· simp [zero_pow h] #align bernstein_polynomial.eval_at_0 bernsteinPolynomial.eval_at_0 theorem eval_at_1 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 1 = if Ξ½ = n then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· obtain hΞ½n | hnΞ½ := Ne.lt_or_lt h Β· simp [zero_pow $ Nat.sub_ne_zero_of_lt hΞ½n] Β· simp [Nat.choose_eq_zero_of_lt hnΞ½] #align bernstein_polynomial.eval_at_1 bernsteinPolynomial.eval_at_1 theorem derivative_succ_aux (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R (n + 1) (Ξ½ + 1)) = (n + 1) * (bernsteinPolynomial R n Ξ½ - bernsteinPolynomial R n (Ξ½ + 1)) := by rw [bernsteinPolynomial] suffices ((n + 1).choose (Ξ½ + 1) : R[X]) * ((↑(Ξ½ + 1 : β„•) : R[X]) * X ^ Ξ½) * (1 - X) ^ (n - Ξ½) - ((n + 1).choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * ((↑(n - Ξ½) : R[X]) * (1 - X) ^ (n - Ξ½ - 1)) = (↑(n + 1) : R[X]) * ((n.choose Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) - (n.choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * (1 - X) ^ (n - (Ξ½ + 1))) by simpa [Polynomial.derivative_pow, ← sub_eq_add_neg, Nat.succ_sub_succ_eq_sub, Polynomial.derivative_mul, Polynomial.derivative_natCast, zero_mul, Nat.cast_add, algebraMap.coe_one, Polynomial.derivative_X, mul_one, zero_add, Polynomial.derivative_sub, Polynomial.derivative_one, zero_sub, mul_neg, Nat.sub_zero, bernsteinPolynomial, map_add, map_natCast, Nat.cast_one] conv_rhs => rw [mul_sub] -- We'll prove the two terms match up separately. refine congr (congr_arg Sub.sub ?_) ?_ Β· simp only [← mul_assoc] apply congr (congr_arg (Β· * Β·) (congr (congr_arg (Β· * Β·) _) rfl)) rfl -- Now it's just about binomial coefficients exact mod_cast congr_arg (fun m : β„• => (m : R[X])) (Nat.succ_mul_choose_eq n Ξ½).symm Β· rw [← tsub_add_eq_tsub_tsub, ← mul_assoc, ← mul_assoc]; congr 1 rw [mul_comm, ← mul_assoc, ← mul_assoc]; congr 1 norm_cast congr 1 convert (Nat.choose_mul_succ_eq n (Ξ½ + 1)).symm using 1 Β· -- Porting note: was -- convert mul_comm _ _ using 2 -- simp rw [mul_comm, Nat.succ_sub_succ_eq_sub] Β· apply mul_comm #align bernstein_polynomial.derivative_succ_aux bernsteinPolynomial.derivative_succ_aux theorem derivative_succ (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R n (Ξ½ + 1)) = n * (bernsteinPolynomial R (n - 1) Ξ½ - bernsteinPolynomial R (n - 1) (Ξ½ + 1)) := by cases n Β· simp [bernsteinPolynomial] Β· rw [Nat.cast_succ]; apply derivative_succ_aux #align bernstein_polynomial.derivative_succ bernsteinPolynomial.derivative_succ
Mathlib/RingTheory/Polynomial/Bernstein.lean
141
143
theorem derivative_zero (n : β„•) : Polynomial.derivative (bernsteinPolynomial R n 0) = -n * bernsteinPolynomial R (n - 1) 0 := by
simp [bernsteinPolynomial, Polynomial.derivative_pow]
1
2.718282
0
0.9
10
780
import Mathlib.Algebra.MvPolynomial.PDeriv import Mathlib.Algebra.Polynomial.AlgebraMap import Mathlib.Algebra.Polynomial.Derivative import Mathlib.Data.Nat.Choose.Sum import Mathlib.LinearAlgebra.LinearIndependent import Mathlib.RingTheory.Polynomial.Pochhammer #align_import ring_theory.polynomial.bernstein from "leanprover-community/mathlib"@"bbeb185db4ccee8ed07dc48449414ebfa39cb821" noncomputable section open Nat (choose) open Polynomial (X) open scoped Polynomial variable (R : Type*) [CommRing R] def bernsteinPolynomial (n Ξ½ : β„•) : R[X] := (choose n Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) #align bernstein_polynomial bernsteinPolynomial example : bernsteinPolynomial β„€ 3 2 = 3 * X ^ 2 - 3 * X ^ 3 := by norm_num [bernsteinPolynomial, choose] ring namespace bernsteinPolynomial theorem eq_zero_of_lt {n Ξ½ : β„•} (h : n < Ξ½) : bernsteinPolynomial R n Ξ½ = 0 := by simp [bernsteinPolynomial, Nat.choose_eq_zero_of_lt h] #align bernstein_polynomial.eq_zero_of_lt bernsteinPolynomial.eq_zero_of_lt section variable {R} {S : Type*} [CommRing S] @[simp] theorem map (f : R β†’+* S) (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).map f = bernsteinPolynomial S n Ξ½ := by simp [bernsteinPolynomial] #align bernstein_polynomial.map bernsteinPolynomial.map end theorem flip (n Ξ½ : β„•) (h : Ξ½ ≀ n) : (bernsteinPolynomial R n Ξ½).comp (1 - X) = bernsteinPolynomial R n (n - Ξ½) := by simp [bernsteinPolynomial, h, tsub_tsub_assoc, mul_right_comm] #align bernstein_polynomial.flip bernsteinPolynomial.flip theorem flip' (n Ξ½ : β„•) (h : Ξ½ ≀ n) : bernsteinPolynomial R n Ξ½ = (bernsteinPolynomial R n (n - Ξ½)).comp (1 - X) := by simp [← flip _ _ _ h, Polynomial.comp_assoc] #align bernstein_polynomial.flip' bernsteinPolynomial.flip' theorem eval_at_0 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 0 = if Ξ½ = 0 then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· simp [zero_pow h] #align bernstein_polynomial.eval_at_0 bernsteinPolynomial.eval_at_0 theorem eval_at_1 (n Ξ½ : β„•) : (bernsteinPolynomial R n Ξ½).eval 1 = if Ξ½ = n then 1 else 0 := by rw [bernsteinPolynomial] split_ifs with h Β· subst h; simp Β· obtain hΞ½n | hnΞ½ := Ne.lt_or_lt h Β· simp [zero_pow $ Nat.sub_ne_zero_of_lt hΞ½n] Β· simp [Nat.choose_eq_zero_of_lt hnΞ½] #align bernstein_polynomial.eval_at_1 bernsteinPolynomial.eval_at_1 theorem derivative_succ_aux (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R (n + 1) (Ξ½ + 1)) = (n + 1) * (bernsteinPolynomial R n Ξ½ - bernsteinPolynomial R n (Ξ½ + 1)) := by rw [bernsteinPolynomial] suffices ((n + 1).choose (Ξ½ + 1) : R[X]) * ((↑(Ξ½ + 1 : β„•) : R[X]) * X ^ Ξ½) * (1 - X) ^ (n - Ξ½) - ((n + 1).choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * ((↑(n - Ξ½) : R[X]) * (1 - X) ^ (n - Ξ½ - 1)) = (↑(n + 1) : R[X]) * ((n.choose Ξ½ : R[X]) * X ^ Ξ½ * (1 - X) ^ (n - Ξ½) - (n.choose (Ξ½ + 1) : R[X]) * X ^ (Ξ½ + 1) * (1 - X) ^ (n - (Ξ½ + 1))) by simpa [Polynomial.derivative_pow, ← sub_eq_add_neg, Nat.succ_sub_succ_eq_sub, Polynomial.derivative_mul, Polynomial.derivative_natCast, zero_mul, Nat.cast_add, algebraMap.coe_one, Polynomial.derivative_X, mul_one, zero_add, Polynomial.derivative_sub, Polynomial.derivative_one, zero_sub, mul_neg, Nat.sub_zero, bernsteinPolynomial, map_add, map_natCast, Nat.cast_one] conv_rhs => rw [mul_sub] -- We'll prove the two terms match up separately. refine congr (congr_arg Sub.sub ?_) ?_ Β· simp only [← mul_assoc] apply congr (congr_arg (Β· * Β·) (congr (congr_arg (Β· * Β·) _) rfl)) rfl -- Now it's just about binomial coefficients exact mod_cast congr_arg (fun m : β„• => (m : R[X])) (Nat.succ_mul_choose_eq n Ξ½).symm Β· rw [← tsub_add_eq_tsub_tsub, ← mul_assoc, ← mul_assoc]; congr 1 rw [mul_comm, ← mul_assoc, ← mul_assoc]; congr 1 norm_cast congr 1 convert (Nat.choose_mul_succ_eq n (Ξ½ + 1)).symm using 1 Β· -- Porting note: was -- convert mul_comm _ _ using 2 -- simp rw [mul_comm, Nat.succ_sub_succ_eq_sub] Β· apply mul_comm #align bernstein_polynomial.derivative_succ_aux bernsteinPolynomial.derivative_succ_aux theorem derivative_succ (n Ξ½ : β„•) : Polynomial.derivative (bernsteinPolynomial R n (Ξ½ + 1)) = n * (bernsteinPolynomial R (n - 1) Ξ½ - bernsteinPolynomial R (n - 1) (Ξ½ + 1)) := by cases n Β· simp [bernsteinPolynomial] Β· rw [Nat.cast_succ]; apply derivative_succ_aux #align bernstein_polynomial.derivative_succ bernsteinPolynomial.derivative_succ theorem derivative_zero (n : β„•) : Polynomial.derivative (bernsteinPolynomial R n 0) = -n * bernsteinPolynomial R (n - 1) 0 := by simp [bernsteinPolynomial, Polynomial.derivative_pow] #align bernstein_polynomial.derivative_zero bernsteinPolynomial.derivative_zero
Mathlib/RingTheory/Polynomial/Bernstein.lean
146
161
theorem iterate_derivative_at_0_eq_zero_of_lt (n : β„•) {Ξ½ k : β„•} : k < Ξ½ β†’ (Polynomial.derivative^[k] (bernsteinPolynomial R n Ξ½)).eval 0 = 0 := by
cases' ν with ν · rintro ⟨⟩ · rw [Nat.lt_succ_iff] induction' k with k ih generalizing n ν · simp [eval_at_0] · simp only [derivative_succ, Int.natCast_eq_zero, mul_eq_zero, Function.comp_apply, Function.iterate_succ, Polynomial.iterate_derivative_sub, Polynomial.iterate_derivative_natCast_mul, Polynomial.eval_mul, Polynomial.eval_natCast, Polynomial.eval_sub] intro h apply mul_eq_zero_of_right rw [ih _ _ (Nat.le_of_succ_le h), sub_zero] convert ih _ _ (Nat.pred_le_pred h) exact (Nat.succ_pred_eq_of_pos (k.succ_pos.trans_le h)).symm
14
1,202,604.284165
2
0.9
10
780
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def'
Mathlib/FieldTheory/Separable.lean
52
54
theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by
rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality]
Mathlib/FieldTheory/Separable.lean
66
67
theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by
simp [Separable, IsCoprime, eq_iff_true_of_subsingleton]
1
2.718282
0
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton
Mathlib/FieldTheory/Separable.lean
70
72
theorem separable_X_add_C (a : R) : (X + C a).Separable := by
rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C
Mathlib/FieldTheory/Separable.lean
76
78
theorem separable_X : (X : R[X]).Separable := by
rw [separable_def, derivative_X] exact isCoprime_one_right
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C theorem separable_X : (X : R[X]).Separable := by rw [separable_def, derivative_X] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X Polynomial.separable_X
Mathlib/FieldTheory/Separable.lean
82
83
theorem separable_C (r : R) : (C r).Separable ↔ IsUnit r := by
rw [separable_def, derivative_C, isCoprime_zero_right, isUnit_C]
1
2.718282
0
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C theorem separable_X : (X : R[X]).Separable := by rw [separable_def, derivative_X] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X Polynomial.separable_X theorem separable_C (r : R) : (C r).Separable ↔ IsUnit r := by rw [separable_def, derivative_C, isCoprime_zero_right, isUnit_C] set_option linter.uppercaseLean3 false in #align polynomial.separable_C Polynomial.separable_C
Mathlib/FieldTheory/Separable.lean
87
89
theorem Separable.of_mul_left {f g : R[X]} (h : (f * g).Separable) : f.Separable := by
have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_left (IsCoprime.of_add_mul_left_right this)
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C theorem separable_X : (X : R[X]).Separable := by rw [separable_def, derivative_X] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X Polynomial.separable_X theorem separable_C (r : R) : (C r).Separable ↔ IsUnit r := by rw [separable_def, derivative_C, isCoprime_zero_right, isUnit_C] set_option linter.uppercaseLean3 false in #align polynomial.separable_C Polynomial.separable_C theorem Separable.of_mul_left {f g : R[X]} (h : (f * g).Separable) : f.Separable := by have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_left (IsCoprime.of_add_mul_left_right this) #align polynomial.separable.of_mul_left Polynomial.Separable.of_mul_left
Mathlib/FieldTheory/Separable.lean
92
94
theorem Separable.of_mul_right {f g : R[X]} (h : (f * g).Separable) : g.Separable := by
rw [mul_comm] at h exact h.of_mul_left
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C theorem separable_X : (X : R[X]).Separable := by rw [separable_def, derivative_X] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X Polynomial.separable_X theorem separable_C (r : R) : (C r).Separable ↔ IsUnit r := by rw [separable_def, derivative_C, isCoprime_zero_right, isUnit_C] set_option linter.uppercaseLean3 false in #align polynomial.separable_C Polynomial.separable_C theorem Separable.of_mul_left {f g : R[X]} (h : (f * g).Separable) : f.Separable := by have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_left (IsCoprime.of_add_mul_left_right this) #align polynomial.separable.of_mul_left Polynomial.Separable.of_mul_left theorem Separable.of_mul_right {f g : R[X]} (h : (f * g).Separable) : g.Separable := by rw [mul_comm] at h exact h.of_mul_left #align polynomial.separable.of_mul_right Polynomial.Separable.of_mul_right
Mathlib/FieldTheory/Separable.lean
97
99
theorem Separable.of_dvd {f g : R[X]} (hf : f.Separable) (hfg : g ∣ f) : g.Separable := by
rcases hfg with ⟨f', rfl⟩ exact Separable.of_mul_left hf
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C theorem separable_X : (X : R[X]).Separable := by rw [separable_def, derivative_X] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X Polynomial.separable_X theorem separable_C (r : R) : (C r).Separable ↔ IsUnit r := by rw [separable_def, derivative_C, isCoprime_zero_right, isUnit_C] set_option linter.uppercaseLean3 false in #align polynomial.separable_C Polynomial.separable_C theorem Separable.of_mul_left {f g : R[X]} (h : (f * g).Separable) : f.Separable := by have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_left (IsCoprime.of_add_mul_left_right this) #align polynomial.separable.of_mul_left Polynomial.Separable.of_mul_left theorem Separable.of_mul_right {f g : R[X]} (h : (f * g).Separable) : g.Separable := by rw [mul_comm] at h exact h.of_mul_left #align polynomial.separable.of_mul_right Polynomial.Separable.of_mul_right theorem Separable.of_dvd {f g : R[X]} (hf : f.Separable) (hfg : g ∣ f) : g.Separable := by rcases hfg with ⟨f', rfl⟩ exact Separable.of_mul_left hf #align polynomial.separable.of_dvd Polynomial.Separable.of_dvd theorem separable_gcd_left {F : Type*} [Field F] {f : F[X]} (hf : f.Separable) (g : F[X]) : (EuclideanDomain.gcd f g).Separable := Separable.of_dvd hf (EuclideanDomain.gcd_dvd_left f g) #align polynomial.separable_gcd_left Polynomial.separable_gcd_left theorem separable_gcd_right {F : Type*} [Field F] {g : F[X]} (f : F[X]) (hg : g.Separable) : (EuclideanDomain.gcd f g).Separable := Separable.of_dvd hg (EuclideanDomain.gcd_dvd_right f g) #align polynomial.separable_gcd_right Polynomial.separable_gcd_right
Mathlib/FieldTheory/Separable.lean
112
114
theorem Separable.isCoprime {f g : R[X]} (h : (f * g).Separable) : IsCoprime f g := by
have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_right (IsCoprime.of_add_mul_left_right this)
2
7.389056
1
0.9
10
781
import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Splits import Mathlib.Algebra.Squarefree.Basic import Mathlib.FieldTheory.Minpoly.Field import Mathlib.RingTheory.PowerBasis #align_import field_theory.separable from "leanprover-community/mathlib"@"92ca63f0fb391a9ca5f22d2409a6080e786d99f7" universe u v w open scoped Classical open Polynomial Finset namespace Polynomial section CommSemiring variable {R : Type u} [CommSemiring R] {S : Type v} [CommSemiring S] def Separable (f : R[X]) : Prop := IsCoprime f (derivative f) #align polynomial.separable Polynomial.Separable theorem separable_def (f : R[X]) : f.Separable ↔ IsCoprime f (derivative f) := Iff.rfl #align polynomial.separable_def Polynomial.separable_def theorem separable_def' (f : R[X]) : f.Separable ↔ βˆƒ a b : R[X], a * f + b * (derivative f) = 1 := Iff.rfl #align polynomial.separable_def' Polynomial.separable_def' theorem not_separable_zero [Nontrivial R] : Β¬Separable (0 : R[X]) := by rintro ⟨x, y, h⟩ simp only [derivative_zero, mul_zero, add_zero, zero_ne_one] at h #align polynomial.not_separable_zero Polynomial.not_separable_zero theorem Separable.ne_zero [Nontrivial R] {f : R[X]} (h : f.Separable) : f β‰  0 := (not_separable_zero <| Β· β–Έ h) @[simp] theorem separable_one : (1 : R[X]).Separable := isCoprime_one_left #align polynomial.separable_one Polynomial.separable_one @[nontriviality] theorem separable_of_subsingleton [Subsingleton R] (f : R[X]) : f.Separable := by simp [Separable, IsCoprime, eq_iff_true_of_subsingleton] #align polynomial.separable_of_subsingleton Polynomial.separable_of_subsingleton theorem separable_X_add_C (a : R) : (X + C a).Separable := by rw [separable_def, derivative_add, derivative_X, derivative_C, add_zero] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X_add_C Polynomial.separable_X_add_C theorem separable_X : (X : R[X]).Separable := by rw [separable_def, derivative_X] exact isCoprime_one_right set_option linter.uppercaseLean3 false in #align polynomial.separable_X Polynomial.separable_X theorem separable_C (r : R) : (C r).Separable ↔ IsUnit r := by rw [separable_def, derivative_C, isCoprime_zero_right, isUnit_C] set_option linter.uppercaseLean3 false in #align polynomial.separable_C Polynomial.separable_C theorem Separable.of_mul_left {f g : R[X]} (h : (f * g).Separable) : f.Separable := by have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_left (IsCoprime.of_add_mul_left_right this) #align polynomial.separable.of_mul_left Polynomial.Separable.of_mul_left theorem Separable.of_mul_right {f g : R[X]} (h : (f * g).Separable) : g.Separable := by rw [mul_comm] at h exact h.of_mul_left #align polynomial.separable.of_mul_right Polynomial.Separable.of_mul_right theorem Separable.of_dvd {f g : R[X]} (hf : f.Separable) (hfg : g ∣ f) : g.Separable := by rcases hfg with ⟨f', rfl⟩ exact Separable.of_mul_left hf #align polynomial.separable.of_dvd Polynomial.Separable.of_dvd theorem separable_gcd_left {F : Type*} [Field F] {f : F[X]} (hf : f.Separable) (g : F[X]) : (EuclideanDomain.gcd f g).Separable := Separable.of_dvd hf (EuclideanDomain.gcd_dvd_left f g) #align polynomial.separable_gcd_left Polynomial.separable_gcd_left theorem separable_gcd_right {F : Type*} [Field F] {g : F[X]} (f : F[X]) (hg : g.Separable) : (EuclideanDomain.gcd f g).Separable := Separable.of_dvd hg (EuclideanDomain.gcd_dvd_right f g) #align polynomial.separable_gcd_right Polynomial.separable_gcd_right theorem Separable.isCoprime {f g : R[X]} (h : (f * g).Separable) : IsCoprime f g := by have := h.of_mul_left_left; rw [derivative_mul] at this exact IsCoprime.of_mul_right_right (IsCoprime.of_add_mul_left_right this) #align polynomial.separable.is_coprime Polynomial.Separable.isCoprime theorem Separable.of_pow' {f : R[X]} : βˆ€ {n : β„•} (_h : (f ^ n).Separable), IsUnit f ∨ f.Separable ∧ n = 1 ∨ n = 0 | 0 => fun _h => Or.inr <| Or.inr rfl | 1 => fun h => Or.inr <| Or.inl ⟨pow_one f β–Έ h, rfl⟩ | n + 2 => fun h => by rw [pow_succ, pow_succ] at h exact Or.inl (isCoprime_self.1 h.isCoprime.of_mul_left_right) #align polynomial.separable.of_pow' Polynomial.Separable.of_pow' theorem Separable.of_pow {f : R[X]} (hf : Β¬IsUnit f) {n : β„•} (hn : n β‰  0) (hfs : (f ^ n).Separable) : f.Separable ∧ n = 1 := (hfs.of_pow'.resolve_left hf).resolve_right hn #align polynomial.separable.of_pow Polynomial.Separable.of_pow theorem Separable.map {p : R[X]} (h : p.Separable) {f : R β†’+* S} : (p.map f).Separable := let ⟨a, b, H⟩ := h ⟨a.map f, b.map f, by rw [derivative_map, ← Polynomial.map_mul, ← Polynomial.map_mul, ← Polynomial.map_add, H, Polynomial.map_one]⟩ #align polynomial.separable.map Polynomial.Separable.map
Mathlib/FieldTheory/Separable.lean
138
149
theorem _root_.Associated.separable {f g : R[X]} (ha : Associated f g) (h : f.Separable) : g.Separable := by
obtain ⟨⟨u, v, h1, h2⟩, ha⟩ := ha obtain ⟨a, b, h⟩ := h refine ⟨a * v + b * derivative v, b * v, ?_⟩ replace h := congr($h * $(h1)) have h3 := congr(derivative $(h1)) simp only [← ha, derivative_mul, derivative_one] at h3 ⊒ calc _ = (a * f + b * derivative f) * (u * v) + (b * f) * (derivative u * v + u * derivative v) := by ring1 _ = 1 := by rw [h, h3]; ring1
10
22,026.465795
2
0.9
10
781
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp]
Mathlib/Data/List/Join.lean
28
28
theorem join_singleton (l : List Ξ±) : [l].join = l := by
rw [join, join, append_nil]
1
2.718282
0
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp]
Mathlib/Data/List/Join.lean
38
41
theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by
induction L₁ Β· rfl Β· simp [*]
3
20.085537
1
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append
Mathlib/Data/List/Join.lean
44
44
theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by
simp
1
2.718282
0
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp]
Mathlib/Data/List/Join.lean
60
62
theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by
simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil]
1
2.718282
0
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil
Mathlib/Data/List/Join.lean
65
66
theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by
induction l <;> simp [*]
1
2.718282
0
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by induction l <;> simp [*] #align list.join_join List.join_join lemma length_join' (L : List (List Ξ±)) : length (join L) = Nat.sum (map length L) := by induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]] lemma countP_join' (p : Ξ± β†’ Bool) : βˆ€ L : List (List Ξ±), countP p L.join = Nat.sum (L.map (countP p)) | [] => rfl | a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l] lemma count_join' [BEq Ξ±] (L : List (List Ξ±)) (a : Ξ±) : L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _ lemma length_bind' (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map] lemma countP_bind' (p : Ξ² β†’ Bool) (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map] lemma count_bind' [BEq Ξ²] (l : List Ξ±) (f : Ξ± β†’ List Ξ²) (x : Ξ²) : count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _ @[simp] theorem bind_eq_nil {l : List Ξ±} {f : Ξ± β†’ List Ξ²} : List.bind l f = [] ↔ βˆ€ x ∈ l, f x = [] := join_eq_nil.trans <| by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] #align list.bind_eq_nil List.bind_eq_nil
Mathlib/Data/List/Join.lean
105
109
theorem take_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by
induction L generalizing i Β· simp Β· cases i <;> simp [take_append, *]
3
20.085537
1
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by induction l <;> simp [*] #align list.join_join List.join_join lemma length_join' (L : List (List Ξ±)) : length (join L) = Nat.sum (map length L) := by induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]] lemma countP_join' (p : Ξ± β†’ Bool) : βˆ€ L : List (List Ξ±), countP p L.join = Nat.sum (L.map (countP p)) | [] => rfl | a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l] lemma count_join' [BEq Ξ±] (L : List (List Ξ±)) (a : Ξ±) : L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _ lemma length_bind' (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map] lemma countP_bind' (p : Ξ² β†’ Bool) (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map] lemma count_bind' [BEq Ξ²] (l : List Ξ±) (f : Ξ± β†’ List Ξ²) (x : Ξ²) : count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _ @[simp] theorem bind_eq_nil {l : List Ξ±} {f : Ξ± β†’ List Ξ²} : List.bind l f = [] ↔ βˆ€ x ∈ l, f x = [] := join_eq_nil.trans <| by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] #align list.bind_eq_nil List.bind_eq_nil theorem take_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [take_append, *]
Mathlib/Data/List/Join.lean
115
119
theorem drop_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.drop (Nat.sum ((L.map length).take i)) = (L.drop i).join := by
induction L generalizing i Β· simp Β· cases i <;> simp [drop_append, *]
3
20.085537
1
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by induction l <;> simp [*] #align list.join_join List.join_join lemma length_join' (L : List (List Ξ±)) : length (join L) = Nat.sum (map length L) := by induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]] lemma countP_join' (p : Ξ± β†’ Bool) : βˆ€ L : List (List Ξ±), countP p L.join = Nat.sum (L.map (countP p)) | [] => rfl | a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l] lemma count_join' [BEq Ξ±] (L : List (List Ξ±)) (a : Ξ±) : L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _ lemma length_bind' (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map] lemma countP_bind' (p : Ξ² β†’ Bool) (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map] lemma count_bind' [BEq Ξ²] (l : List Ξ±) (f : Ξ± β†’ List Ξ²) (x : Ξ²) : count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _ @[simp] theorem bind_eq_nil {l : List Ξ±} {f : Ξ± β†’ List Ξ²} : List.bind l f = [] ↔ βˆ€ x ∈ l, f x = [] := join_eq_nil.trans <| by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] #align list.bind_eq_nil List.bind_eq_nil theorem take_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [take_append, *] theorem drop_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.drop (Nat.sum ((L.map length).take i)) = (L.drop i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [drop_append, *]
Mathlib/Data/List/Join.lean
123
129
theorem drop_take_succ_eq_cons_get (L : List Ξ±) (i : Fin L.length) : (L.take (i + 1)).drop i = [get L i] := by
induction' L with head tail ih · exact (Nat.not_succ_le_zero i i.isLt).elim rcases i with ⟨_ | i, hi⟩ · simp · simpa using ih ⟨i, Nat.lt_of_succ_lt_succ hi⟩
5
148.413159
2
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by induction l <;> simp [*] #align list.join_join List.join_join lemma length_join' (L : List (List Ξ±)) : length (join L) = Nat.sum (map length L) := by induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]] lemma countP_join' (p : Ξ± β†’ Bool) : βˆ€ L : List (List Ξ±), countP p L.join = Nat.sum (L.map (countP p)) | [] => rfl | a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l] lemma count_join' [BEq Ξ±] (L : List (List Ξ±)) (a : Ξ±) : L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _ lemma length_bind' (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map] lemma countP_bind' (p : Ξ² β†’ Bool) (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map] lemma count_bind' [BEq Ξ²] (l : List Ξ±) (f : Ξ± β†’ List Ξ²) (x : Ξ²) : count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _ @[simp] theorem bind_eq_nil {l : List Ξ±} {f : Ξ± β†’ List Ξ²} : List.bind l f = [] ↔ βˆ€ x ∈ l, f x = [] := join_eq_nil.trans <| by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] #align list.bind_eq_nil List.bind_eq_nil theorem take_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [take_append, *] theorem drop_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.drop (Nat.sum ((L.map length).take i)) = (L.drop i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [drop_append, *] theorem drop_take_succ_eq_cons_get (L : List Ξ±) (i : Fin L.length) : (L.take (i + 1)).drop i = [get L i] := by induction' L with head tail ih Β· exact (Nat.not_succ_le_zero i i.isLt).elim rcases i with ⟨_ | i, hi⟩ Β· simp Β· simpa using ih ⟨i, Nat.lt_of_succ_lt_succ hi⟩ set_option linter.deprecated false in @[deprecated drop_take_succ_eq_cons_get (since := "2023-01-10")]
Mathlib/Data/List/Join.lean
135
145
theorem drop_take_succ_eq_cons_nthLe (L : List Ξ±) {i : β„•} (hi : i < L.length) : (L.take (i + 1)).drop i = [nthLe L i hi] := by
induction' L with head tail generalizing i Β· simp only [length] at hi exact (Nat.not_succ_le_zero i hi).elim cases' i with i hi Β· simp rfl have : i < tail.length := by simpa using hi simp [*] rfl
9
8,103.083928
2
0.9
10
782
import Mathlib.Data.List.Basic #align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607" -- Make sure we don't import algebra assert_not_exists Monoid variable {Ξ± Ξ² : Type*} namespace List attribute [simp] join -- Porting note (#10618): simp can prove this -- @[simp] theorem join_singleton (l : List Ξ±) : [l].join = l := by rw [join, join, append_nil] #align list.join_singleton List.join_singleton @[simp] theorem join_eq_nil : βˆ€ {L : List (List Ξ±)}, join L = [] ↔ βˆ€ l ∈ L, l = [] | [] => iff_of_true rfl (forall_mem_nil _) | l :: L => by simp only [join, append_eq_nil, join_eq_nil, forall_mem_cons] #align list.join_eq_nil List.join_eq_nil @[simp] theorem join_append (L₁ Lβ‚‚ : List (List Ξ±)) : join (L₁ ++ Lβ‚‚) = join L₁ ++ join Lβ‚‚ := by induction L₁ Β· rfl Β· simp [*] #align list.join_append List.join_append theorem join_concat (L : List (List Ξ±)) (l : List Ξ±) : join (L.concat l) = join L ++ l := by simp #align list.join_concat List.join_concat @[simp] theorem join_filter_not_isEmpty : βˆ€ {L : List (List Ξ±)}, join (L.filter fun l => !l.isEmpty) = L.join | [] => rfl | [] :: L => by simp [join_filter_not_isEmpty (L := L), isEmpty_iff_eq_nil] | (a :: l) :: L => by simp [join_filter_not_isEmpty (L := L)] #align list.join_filter_empty_eq_ff List.join_filter_not_isEmpty @[deprecated (since := "2024-02-25")] alias join_filter_isEmpty_eq_false := join_filter_not_isEmpty @[simp] theorem join_filter_ne_nil [DecidablePred fun l : List Ξ± => l β‰  []] {L : List (List Ξ±)} : join (L.filter fun l => l β‰  []) = L.join := by simp [join_filter_not_isEmpty, ← isEmpty_iff_eq_nil] #align list.join_filter_ne_nil List.join_filter_ne_nil theorem join_join (l : List (List (List Ξ±))) : l.join.join = (l.map join).join := by induction l <;> simp [*] #align list.join_join List.join_join lemma length_join' (L : List (List Ξ±)) : length (join L) = Nat.sum (map length L) := by induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]] lemma countP_join' (p : Ξ± β†’ Bool) : βˆ€ L : List (List Ξ±), countP p L.join = Nat.sum (L.map (countP p)) | [] => rfl | a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l] lemma count_join' [BEq Ξ±] (L : List (List Ξ±)) (a : Ξ±) : L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _ lemma length_bind' (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map] lemma countP_bind' (p : Ξ² β†’ Bool) (l : List Ξ±) (f : Ξ± β†’ List Ξ²) : countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map] lemma count_bind' [BEq Ξ²] (l : List Ξ±) (f : Ξ± β†’ List Ξ²) (x : Ξ²) : count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _ @[simp] theorem bind_eq_nil {l : List Ξ±} {f : Ξ± β†’ List Ξ²} : List.bind l f = [] ↔ βˆ€ x ∈ l, f x = [] := join_eq_nil.trans <| by simp only [mem_map, forall_exists_index, and_imp, forall_apply_eq_imp_iffβ‚‚] #align list.bind_eq_nil List.bind_eq_nil theorem take_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [take_append, *] theorem drop_sum_join' (L : List (List Ξ±)) (i : β„•) : L.join.drop (Nat.sum ((L.map length).take i)) = (L.drop i).join := by induction L generalizing i Β· simp Β· cases i <;> simp [drop_append, *] theorem drop_take_succ_eq_cons_get (L : List Ξ±) (i : Fin L.length) : (L.take (i + 1)).drop i = [get L i] := by induction' L with head tail ih Β· exact (Nat.not_succ_le_zero i i.isLt).elim rcases i with ⟨_ | i, hi⟩ Β· simp Β· simpa using ih ⟨i, Nat.lt_of_succ_lt_succ hi⟩ set_option linter.deprecated false in @[deprecated drop_take_succ_eq_cons_get (since := "2023-01-10")] theorem drop_take_succ_eq_cons_nthLe (L : List Ξ±) {i : β„•} (hi : i < L.length) : (L.take (i + 1)).drop i = [nthLe L i hi] := by induction' L with head tail generalizing i Β· simp only [length] at hi exact (Nat.not_succ_le_zero i hi).elim cases' i with i hi Β· simp rfl have : i < tail.length := by simpa using hi simp [*] rfl #align list.drop_take_succ_eq_cons_nth_le List.drop_take_succ_eq_cons_nthLe
Mathlib/Data/List/Join.lean
153
159
theorem drop_take_succ_join_eq_get' (L : List (List Ξ±)) (i : Fin L.length) : (L.join.take (Nat.sum ((L.map length).take (i + 1)))).drop (Nat.sum ((L.map length).take i)) = get L i := by
have : (L.map length).take i = ((L.take (i + 1)).map length).take i := by simp [map_take, take_take, Nat.min_eq_left] simp only [this, length_map, take_sum_join', drop_sum_join', drop_take_succ_eq_cons_get, join, append_nil]
4
54.59815
2
0.9
10
782
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E]
Mathlib/Analysis/NormedSpace/Real.lean
40
43
theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by
simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one]
2
7.389056
1
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball
Mathlib/Analysis/NormedSpace/Real.lean
46
47
theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by
rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht]
1
2.718282
0
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg
Mathlib/Analysis/NormedSpace/Real.lean
50
59
theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by
simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul]
6
403.428793
2
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul]
Mathlib/Analysis/NormedSpace/Real.lean
61
73
theorem closure_ball (x : E) {r : ℝ} (hr : r β‰  0) : closure (ball x r) = closedBall x r := by
refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c β€’ (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ Β· rw [one_smul, sub_add_cancel] Β· simp [closure_Ico zero_ne_one, zero_le_one] Β· rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption
12
162,754.791419
2
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul] theorem closure_ball (x : E) {r : ℝ} (hr : r β‰  0) : closure (ball x r) = closedBall x r := by refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c β€’ (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ Β· rw [one_smul, sub_add_cancel] Β· simp [closure_Ico zero_ne_one, zero_le_one] Β· rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption #align closure_ball closure_ball
Mathlib/Analysis/NormedSpace/Real.lean
76
78
theorem frontier_ball (x : E) {r : ℝ} (hr : r β‰  0) : frontier (ball x r) = sphere x r := by
rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball]
1
2.718282
0
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul] theorem closure_ball (x : E) {r : ℝ} (hr : r β‰  0) : closure (ball x r) = closedBall x r := by refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c β€’ (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ Β· rw [one_smul, sub_add_cancel] Β· simp [closure_Ico zero_ne_one, zero_le_one] Β· rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption #align closure_ball closure_ball theorem frontier_ball (x : E) {r : ℝ} (hr : r β‰  0) : frontier (ball x r) = sphere x r := by rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball] #align frontier_ball frontier_ball
Mathlib/Analysis/NormedSpace/Real.lean
81
98
theorem interior_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : interior (closedBall x r) = ball x r := by
cases' hr.lt_or_lt with hr hr Β· rw [closedBall_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty] refine Subset.antisymm ?_ ball_subset_interior_closedBall intro y hy rcases (mem_closedBall.1 <| interior_subset hy).lt_or_eq with (hr | rfl) Β· exact hr set f : ℝ β†’ E := fun c : ℝ => c β€’ (y - x) + x suffices f ⁻¹' closedBall x (dist y x) βŠ† Icc (-1) 1 by have hfc : Continuous f := (continuous_id.smul continuous_const).add continuous_const have hf1 : (1 : ℝ) ∈ f ⁻¹' interior (closedBall x <| dist y x) := by simpa [f] have h1 : (1 : ℝ) ∈ interior (Icc (-1 : ℝ) 1) := interior_mono this (preimage_interior_subset_interior_preimage hfc hf1) simp at h1 intro c hc rw [mem_Icc, ← abs_le, ← Real.norm_eq_abs, ← mul_le_mul_right hr] simpa [f, dist_eq_norm, norm_smul] using hc
16
8,886,110.520508
2
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul] theorem closure_ball (x : E) {r : ℝ} (hr : r β‰  0) : closure (ball x r) = closedBall x r := by refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c β€’ (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ Β· rw [one_smul, sub_add_cancel] Β· simp [closure_Ico zero_ne_one, zero_le_one] Β· rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption #align closure_ball closure_ball theorem frontier_ball (x : E) {r : ℝ} (hr : r β‰  0) : frontier (ball x r) = sphere x r := by rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball] #align frontier_ball frontier_ball theorem interior_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : interior (closedBall x r) = ball x r := by cases' hr.lt_or_lt with hr hr Β· rw [closedBall_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty] refine Subset.antisymm ?_ ball_subset_interior_closedBall intro y hy rcases (mem_closedBall.1 <| interior_subset hy).lt_or_eq with (hr | rfl) Β· exact hr set f : ℝ β†’ E := fun c : ℝ => c β€’ (y - x) + x suffices f ⁻¹' closedBall x (dist y x) βŠ† Icc (-1) 1 by have hfc : Continuous f := (continuous_id.smul continuous_const).add continuous_const have hf1 : (1 : ℝ) ∈ f ⁻¹' interior (closedBall x <| dist y x) := by simpa [f] have h1 : (1 : ℝ) ∈ interior (Icc (-1 : ℝ) 1) := interior_mono this (preimage_interior_subset_interior_preimage hfc hf1) simp at h1 intro c hc rw [mem_Icc, ← abs_le, ← Real.norm_eq_abs, ← mul_le_mul_right hr] simpa [f, dist_eq_norm, norm_smul] using hc #align interior_closed_ball interior_closedBall
Mathlib/Analysis/NormedSpace/Real.lean
101
103
theorem frontier_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : frontier (closedBall x r) = sphere x r := by
rw [frontier, closure_closedBall, interior_closedBall x hr, closedBall_diff_ball]
1
2.718282
0
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul] theorem closure_ball (x : E) {r : ℝ} (hr : r β‰  0) : closure (ball x r) = closedBall x r := by refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c β€’ (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ Β· rw [one_smul, sub_add_cancel] Β· simp [closure_Ico zero_ne_one, zero_le_one] Β· rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption #align closure_ball closure_ball theorem frontier_ball (x : E) {r : ℝ} (hr : r β‰  0) : frontier (ball x r) = sphere x r := by rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball] #align frontier_ball frontier_ball theorem interior_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : interior (closedBall x r) = ball x r := by cases' hr.lt_or_lt with hr hr Β· rw [closedBall_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty] refine Subset.antisymm ?_ ball_subset_interior_closedBall intro y hy rcases (mem_closedBall.1 <| interior_subset hy).lt_or_eq with (hr | rfl) Β· exact hr set f : ℝ β†’ E := fun c : ℝ => c β€’ (y - x) + x suffices f ⁻¹' closedBall x (dist y x) βŠ† Icc (-1) 1 by have hfc : Continuous f := (continuous_id.smul continuous_const).add continuous_const have hf1 : (1 : ℝ) ∈ f ⁻¹' interior (closedBall x <| dist y x) := by simpa [f] have h1 : (1 : ℝ) ∈ interior (Icc (-1 : ℝ) 1) := interior_mono this (preimage_interior_subset_interior_preimage hfc hf1) simp at h1 intro c hc rw [mem_Icc, ← abs_le, ← Real.norm_eq_abs, ← mul_le_mul_right hr] simpa [f, dist_eq_norm, norm_smul] using hc #align interior_closed_ball interior_closedBall theorem frontier_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : frontier (closedBall x r) = sphere x r := by rw [frontier, closure_closedBall, interior_closedBall x hr, closedBall_diff_ball] #align frontier_closed_ball frontier_closedBall
Mathlib/Analysis/NormedSpace/Real.lean
106
107
theorem interior_sphere (x : E) {r : ℝ} (hr : r β‰  0) : interior (sphere x r) = βˆ… := by
rw [← frontier_closedBall x hr, interior_frontier isClosed_ball]
1
2.718282
0
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Seminormed variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] theorem inv_norm_smul_mem_closed_unit_ball (x : E) : β€–x‖⁻¹ β€’ x ∈ closedBall (0 : E) 1 := by simp only [mem_closedBall_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul, div_self_le_one] #align inv_norm_smul_mem_closed_unit_ball inv_norm_smul_mem_closed_unit_ball theorem norm_smul_of_nonneg {t : ℝ} (ht : 0 ≀ t) (x : E) : β€–t β€’ xβ€– = t * β€–xβ€– := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht] #align norm_smul_of_nonneg norm_smul_of_nonneg theorem dist_smul_add_one_sub_smul_le {r : ℝ} {x y : E} (h : r ∈ Icc 0 1) : dist (r β€’ x + (1 - r) β€’ y) x ≀ dist y x := calc dist (r β€’ x + (1 - r) β€’ y) x = β€–1 - rβ€– * β€–x - yβ€– := by simp_rw [dist_eq_norm', ← norm_smul, sub_smul, one_smul, smul_sub, ← sub_sub, ← sub_add, sub_right_comm] _ = (1 - r) * dist y x := by rw [Real.norm_eq_abs, abs_eq_self.mpr (sub_nonneg.mpr h.2), dist_eq_norm'] _ ≀ (1 - 0) * dist y x := by gcongr; exact h.1 _ = dist y x := by rw [sub_zero, one_mul] theorem closure_ball (x : E) {r : ℝ} (hr : r β‰  0) : closure (ball x r) = closedBall x r := by refine Subset.antisymm closure_ball_subset_closedBall fun y hy => ?_ have : ContinuousWithinAt (fun c : ℝ => c β€’ (y - x) + x) (Ico 0 1) 1 := ((continuous_id.smul continuous_const).add continuous_const).continuousWithinAt convert this.mem_closure _ _ Β· rw [one_smul, sub_add_cancel] Β· simp [closure_Ico zero_ne_one, zero_le_one] Β· rintro c ⟨hc0, hc1⟩ rw [mem_ball, dist_eq_norm, add_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_nonneg hc0, mul_comm, ← mul_one r] rw [mem_closedBall, dist_eq_norm] at hy replace hr : 0 < r := ((norm_nonneg _).trans hy).lt_of_ne hr.symm apply mul_lt_mul' <;> assumption #align closure_ball closure_ball theorem frontier_ball (x : E) {r : ℝ} (hr : r β‰  0) : frontier (ball x r) = sphere x r := by rw [frontier, closure_ball x hr, isOpen_ball.interior_eq, closedBall_diff_ball] #align frontier_ball frontier_ball theorem interior_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : interior (closedBall x r) = ball x r := by cases' hr.lt_or_lt with hr hr Β· rw [closedBall_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty] refine Subset.antisymm ?_ ball_subset_interior_closedBall intro y hy rcases (mem_closedBall.1 <| interior_subset hy).lt_or_eq with (hr | rfl) Β· exact hr set f : ℝ β†’ E := fun c : ℝ => c β€’ (y - x) + x suffices f ⁻¹' closedBall x (dist y x) βŠ† Icc (-1) 1 by have hfc : Continuous f := (continuous_id.smul continuous_const).add continuous_const have hf1 : (1 : ℝ) ∈ f ⁻¹' interior (closedBall x <| dist y x) := by simpa [f] have h1 : (1 : ℝ) ∈ interior (Icc (-1 : ℝ) 1) := interior_mono this (preimage_interior_subset_interior_preimage hfc hf1) simp at h1 intro c hc rw [mem_Icc, ← abs_le, ← Real.norm_eq_abs, ← mul_le_mul_right hr] simpa [f, dist_eq_norm, norm_smul] using hc #align interior_closed_ball interior_closedBall theorem frontier_closedBall (x : E) {r : ℝ} (hr : r β‰  0) : frontier (closedBall x r) = sphere x r := by rw [frontier, closure_closedBall, interior_closedBall x hr, closedBall_diff_ball] #align frontier_closed_ball frontier_closedBall theorem interior_sphere (x : E) {r : ℝ} (hr : r β‰  0) : interior (sphere x r) = βˆ… := by rw [← frontier_closedBall x hr, interior_frontier isClosed_ball] #align interior_sphere interior_sphere
Mathlib/Analysis/NormedSpace/Real.lean
110
111
theorem frontier_sphere (x : E) {r : ℝ} (hr : r β‰  0) : frontier (sphere x r) = sphere x r := by
rw [isClosed_sphere.frontier_eq, interior_sphere x hr, diff_empty]
1
2.718282
0
0.9
10
783
import Mathlib.Analysis.NormedSpace.Basic import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.normed_space.basic from "leanprover-community/mathlib"@"bc91ed7093bf098d253401e69df601fc33dde156" open Metric Set Function Filter open scoped NNReal Topology instance Real.punctured_nhds_module_neBot {E : Type*} [AddCommGroup E] [TopologicalSpace E] [ContinuousAdd E] [Nontrivial E] [Module ℝ E] [ContinuousSMul ℝ E] (x : E) : NeBot (𝓝[β‰ ] x) := Module.punctured_nhds_neBot ℝ E x #align real.punctured_nhds_module_ne_bot Real.punctured_nhds_module_neBot section Normed variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [Nontrivial E] section Surj variable (E)
Mathlib/Analysis/NormedSpace/Real.lean
124
128
theorem exists_norm_eq {c : ℝ} (hc : 0 ≀ c) : βˆƒ x : E, β€–xβ€– = c := by
rcases exists_ne (0 : E) with ⟨x, hx⟩ rw [← norm_ne_zero_iff] at hx use c β€’ β€–x‖⁻¹ β€’ x simp [norm_smul, Real.norm_of_nonneg hc, abs_of_nonneg hc, inv_mul_cancel hx]
4
54.59815
2
0.9
10
783
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
69
72
theorem incMatrix_apply' [Zero R] [One R] [DecidableEq α] [DecidableRel G.Adj] {a : α} {e : Sym2 α} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by
unfold incMatrix Set.indicator convert rfl
2
7.389056
1
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {α : Type*} (G : SimpleGraph α) noncomputable def incMatrix [Zero R] [One R] : Matrix α (Sym2 α) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq α] [DecidableRel G.Adj] {a : α} {e : Sym2 α} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section MulZeroOneClass variable [MulZeroOneClass R] {a b : α} {e : Sym2 α}
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
79
82
theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e := by
classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one, Set.mem_inter_iff]
2
7.389056
1
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {α : Type*} (G : SimpleGraph α) noncomputable def incMatrix [Zero R] [One R] : Matrix α (Sym2 α) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq α] [DecidableRel G.Adj] {a : α} {e : Sym2 α} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section MulZeroOneClass variable [MulZeroOneClass R] {a b : α} {e : Sym2 α} theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e := by classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one, Set.mem_inter_iff] #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
85
89
theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a β‰  b) (h : Β¬G.Adj a b) : G.incMatrix R a e * G.incMatrix R b e = 0 := by
rw [incMatrix_apply_mul_incMatrix_apply, Set.indicator_of_not_mem] rw [G.incidenceSet_inter_incidenceSet_of_not_adj h hab] exact Set.not_mem_empty e
3
20.085537
1
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq Ξ±] [DecidableRel G.Adj] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section MulZeroOneClass variable [MulZeroOneClass R] {a b : Ξ±} {e : Sym2 Ξ±} theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e := by classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one, Set.mem_inter_iff] #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a β‰  b) (h : Β¬G.Adj a b) : G.incMatrix R a e * G.incMatrix R b e = 0 := by rw [incMatrix_apply_mul_incMatrix_apply, Set.indicator_of_not_mem] rw [G.incidenceSet_inter_incidenceSet_of_not_adj h hab] exact Set.not_mem_empty e #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
92
93
theorem incMatrix_of_not_mem_incidenceSet (h : e βˆ‰ G.incidenceSet a) : G.incMatrix R a e = 0 := by
rw [incMatrix_apply, Set.indicator_of_not_mem h]
1
2.718282
0
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq Ξ±] [DecidableRel G.Adj] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section MulZeroOneClass variable [MulZeroOneClass R] {a b : Ξ±} {e : Sym2 Ξ±} theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e := by classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one, Set.mem_inter_iff] #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a β‰  b) (h : Β¬G.Adj a b) : G.incMatrix R a e * G.incMatrix R b e = 0 := by rw [incMatrix_apply_mul_incMatrix_apply, Set.indicator_of_not_mem] rw [G.incidenceSet_inter_incidenceSet_of_not_adj h hab] exact Set.not_mem_empty e #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj theorem incMatrix_of_not_mem_incidenceSet (h : e βˆ‰ G.incidenceSet a) : G.incMatrix R a e = 0 := by rw [incMatrix_apply, Set.indicator_of_not_mem h] #align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSet
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
96
97
theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 := by
rw [incMatrix_apply, Set.indicator_of_mem h, Pi.one_apply]
1
2.718282
0
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq Ξ±] [DecidableRel G.Adj] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section MulZeroOneClass variable [MulZeroOneClass R] {a b : Ξ±} {e : Sym2 Ξ±} theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e := by classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one, Set.mem_inter_iff] #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a β‰  b) (h : Β¬G.Adj a b) : G.incMatrix R a e * G.incMatrix R b e = 0 := by rw [incMatrix_apply_mul_incMatrix_apply, Set.indicator_of_not_mem] rw [G.incidenceSet_inter_incidenceSet_of_not_adj h hab] exact Set.not_mem_empty e #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj theorem incMatrix_of_not_mem_incidenceSet (h : e βˆ‰ G.incidenceSet a) : G.incMatrix R a e = 0 := by rw [incMatrix_apply, Set.indicator_of_not_mem h] #align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSet theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 := by rw [incMatrix_apply, Set.indicator_of_mem h, Pi.one_apply] #align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSet variable [Nontrivial R]
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
102
103
theorem incMatrix_apply_eq_zero_iff : G.incMatrix R a e = 0 ↔ e βˆ‰ G.incidenceSet a := by
simp only [incMatrix_apply, Set.indicator_apply_eq_zero, Pi.one_apply, one_ne_zero]
1
2.718282
0
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq Ξ±] [DecidableRel G.Adj] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section MulZeroOneClass variable [MulZeroOneClass R] {a b : Ξ±} {e : Sym2 Ξ±} theorem incMatrix_apply_mul_incMatrix_apply : G.incMatrix R a e * G.incMatrix R b e = (G.incidenceSet a ∩ G.incidenceSet b).indicator 1 e := by classical simp only [incMatrix, Set.indicator_apply, ite_zero_mul_ite_zero, Pi.one_apply, mul_one, Set.mem_inter_iff] #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply SimpleGraph.incMatrix_apply_mul_incMatrix_apply theorem incMatrix_apply_mul_incMatrix_apply_of_not_adj (hab : a β‰  b) (h : Β¬G.Adj a b) : G.incMatrix R a e * G.incMatrix R b e = 0 := by rw [incMatrix_apply_mul_incMatrix_apply, Set.indicator_of_not_mem] rw [G.incidenceSet_inter_incidenceSet_of_not_adj h hab] exact Set.not_mem_empty e #align simple_graph.inc_matrix_apply_mul_inc_matrix_apply_of_not_adj SimpleGraph.incMatrix_apply_mul_incMatrix_apply_of_not_adj theorem incMatrix_of_not_mem_incidenceSet (h : e βˆ‰ G.incidenceSet a) : G.incMatrix R a e = 0 := by rw [incMatrix_apply, Set.indicator_of_not_mem h] #align simple_graph.inc_matrix_of_not_mem_incidence_set SimpleGraph.incMatrix_of_not_mem_incidenceSet theorem incMatrix_of_mem_incidenceSet (h : e ∈ G.incidenceSet a) : G.incMatrix R a e = 1 := by rw [incMatrix_apply, Set.indicator_of_mem h, Pi.one_apply] #align simple_graph.inc_matrix_of_mem_incidence_set SimpleGraph.incMatrix_of_mem_incidenceSet variable [Nontrivial R] theorem incMatrix_apply_eq_zero_iff : G.incMatrix R a e = 0 ↔ e βˆ‰ G.incidenceSet a := by simp only [incMatrix_apply, Set.indicator_apply_eq_zero, Pi.one_apply, one_ne_zero] #align simple_graph.inc_matrix_apply_eq_zero_iff SimpleGraph.incMatrix_apply_eq_zero_iff
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
106
112
theorem incMatrix_apply_eq_one_iff : G.incMatrix R a e = 1 ↔ e ∈ G.incidenceSet a := by
-- Porting note: was `convert one_ne_zero.ite_eq_left_iff; infer_instance` unfold incMatrix Set.indicator simp only [Pi.one_apply] apply Iff.intro <;> intro h Β· split at h <;> simp_all only [zero_ne_one] Β· simp_all only [ite_true]
6
403.428793
2
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {α : Type*} (G : SimpleGraph α) noncomputable def incMatrix [Zero R] [One R] : Matrix α (Sym2 α) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : α} {e : Sym2 α} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq α] [DecidableRel G.Adj] {a : α} {e : Sym2 α} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section NonAssocSemiring variable [Fintype (Sym2 α)] [NonAssocSemiring R] {a b : α} {e : Sym2 α}
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
121
123
theorem sum_incMatrix_apply [Fintype (neighborSet G a)] : βˆ‘ e, G.incMatrix R a e = G.degree a := by
classical simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset]
1
2.718282
0
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq Ξ±] [DecidableRel G.Adj] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section NonAssocSemiring variable [Fintype (Sym2 Ξ±)] [NonAssocSemiring R] {a b : Ξ±} {e : Sym2 Ξ±} theorem sum_incMatrix_apply [Fintype (neighborSet G a)] : βˆ‘ e, G.incMatrix R a e = G.degree a := by classical simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset] #align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
126
131
theorem incMatrix_mul_transpose_diag [Fintype (neighborSet G a)] : (G.incMatrix R * (G.incMatrix R)α΅€) a a = G.degree a := by
classical rw [← sum_incMatrix_apply] simp only [mul_apply, incMatrix_apply', transpose_apply, mul_ite, mul_one, mul_zero] simp_all only [ite_true, sum_boole]
4
54.59815
2
0.9
10
784
import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Data.Finset.Sym import Mathlib.Data.Matrix.Basic #align_import combinatorics.simple_graph.inc_matrix from "leanprover-community/mathlib"@"bb168510ef455e9280a152e7f31673cabd3d7496" open Finset Matrix SimpleGraph Sym2 open Matrix namespace SimpleGraph variable (R : Type*) {Ξ± : Type*} (G : SimpleGraph Ξ±) noncomputable def incMatrix [Zero R] [One R] : Matrix Ξ± (Sym2 Ξ±) R := fun a => (G.incidenceSet a).indicator 1 #align simple_graph.inc_matrix SimpleGraph.incMatrix variable {R} theorem incMatrix_apply [Zero R] [One R] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = (G.incidenceSet a).indicator 1 e := rfl #align simple_graph.inc_matrix_apply SimpleGraph.incMatrix_apply theorem incMatrix_apply' [Zero R] [One R] [DecidableEq Ξ±] [DecidableRel G.Adj] {a : Ξ±} {e : Sym2 Ξ±} : G.incMatrix R a e = if e ∈ G.incidenceSet a then 1 else 0 := by unfold incMatrix Set.indicator convert rfl #align simple_graph.inc_matrix_apply' SimpleGraph.incMatrix_apply' section NonAssocSemiring variable [Fintype (Sym2 Ξ±)] [NonAssocSemiring R] {a b : Ξ±} {e : Sym2 Ξ±} theorem sum_incMatrix_apply [Fintype (neighborSet G a)] : βˆ‘ e, G.incMatrix R a e = G.degree a := by classical simp [incMatrix_apply', sum_boole, Set.filter_mem_univ_eq_toFinset] #align simple_graph.sum_inc_matrix_apply SimpleGraph.sum_incMatrix_apply theorem incMatrix_mul_transpose_diag [Fintype (neighborSet G a)] : (G.incMatrix R * (G.incMatrix R)α΅€) a a = G.degree a := by classical rw [← sum_incMatrix_apply] simp only [mul_apply, incMatrix_apply', transpose_apply, mul_ite, mul_one, mul_zero] simp_all only [ite_true, sum_boole] #align simple_graph.inc_matrix_mul_transpose_diag SimpleGraph.incMatrix_mul_transpose_diag
Mathlib/Combinatorics/SimpleGraph/IncMatrix.lean
134
144
theorem sum_incMatrix_apply_of_mem_edgeSet [Fintype Ξ±] : e ∈ G.edgeSet β†’ βˆ‘ a, G.incMatrix R a e = 2 := by
classical refine e.ind ?_ intro a b h rw [mem_edgeSet] at h rw [← Nat.cast_two, ← card_pair h.ne] simp only [incMatrix_apply', sum_boole, mk'_mem_incidenceSet_iff, h, true_and_iff] congr 2 ext e simp only [mem_filter, mem_univ, true_and_iff, mem_insert, mem_singleton]
9
8,103.083928
2
0.9
10
784
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp]
Mathlib/Data/Real/Cardinality.lean
64
65
theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by
simp [cantorFunctionAux, h]
1
2.718282
0
0.909091
11
786
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp]
Mathlib/Data/Real/Cardinality.lean
69
70
theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by
simp [cantorFunctionAux, h]
1
2.718282
0
0.909091
11
786
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false
Mathlib/Data/Real/Cardinality.lean
73
75
theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by
cases h' : f n <;> simp [h'] apply pow_nonneg h
2
7.389056
1
0.909091
11
786
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg
Mathlib/Data/Real/Cardinality.lean
78
79
theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by
simp [cantorFunctionAux, h]
1
2.718282
0
0.909091
11
786
import Mathlib.Analysis.SpecificLimits.Basic import Mathlib.Data.Rat.Denumerable import Mathlib.Data.Set.Pointwise.Interval import Mathlib.SetTheory.Cardinal.Continuum #align_import data.real.cardinality from "leanprover-community/mathlib"@"7e7aaccf9b0182576cabdde36cf1b5ad3585b70d" open Nat Set open Cardinal noncomputable section namespace Cardinal variable {c : ℝ} {f g : β„• β†’ Bool} {n : β„•} def cantorFunctionAux (c : ℝ) (f : β„• β†’ Bool) (n : β„•) : ℝ := cond (f n) (c ^ n) 0 #align cardinal.cantor_function_aux Cardinal.cantorFunctionAux @[simp] theorem cantorFunctionAux_true (h : f n = true) : cantorFunctionAux c f n = c ^ n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_tt Cardinal.cantorFunctionAux_true @[simp] theorem cantorFunctionAux_false (h : f n = false) : cantorFunctionAux c f n = 0 := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_ff Cardinal.cantorFunctionAux_false theorem cantorFunctionAux_nonneg (h : 0 ≀ c) : 0 ≀ cantorFunctionAux c f n := by cases h' : f n <;> simp [h'] apply pow_nonneg h #align cardinal.cantor_function_aux_nonneg Cardinal.cantorFunctionAux_nonneg theorem cantorFunctionAux_eq (h : f n = g n) : cantorFunctionAux c f n = cantorFunctionAux c g n := by simp [cantorFunctionAux, h] #align cardinal.cantor_function_aux_eq Cardinal.cantorFunctionAux_eq
Mathlib/Data/Real/Cardinality.lean
82
83
theorem cantorFunctionAux_zero (f : β„• β†’ Bool) : cantorFunctionAux c f 0 = cond (f 0) 1 0 := by
cases h : f 0 <;> simp [h]
1
2.718282
0
0.909091
11
786