sensitivity
⟷
Archive.Sensitivity
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -436,7 +436,7 @@ theorem exists_eigenvalue (H : Set (Q (m + 1))) (hH : Card H ≥ 2 ^ m + 1) :
rw [← finrank_eq_rank ℝ] at dim_le dim_add dimW ⊢
rw [← finrank_eq_rank ℝ, ← finrank_eq_rank ℝ] at dim_add
norm_cast at dim_le dim_add dimW ⊢
- rw [pow_succ'] at dim_le
+ rw [pow_succ] at dim_le
rw [Set.toFinset_card] at hH
linarith
#align sensitivity.exists_eigenvalue Sensitivity.exists_eigenvalue
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -143,7 +143,7 @@ theorem adj_iff_proj_adj {p q : Q (n + 1)} (h₀ : p 0 = q 0) : p.adjacent q ↔
by
constructor
· rintro ⟨i, h_eq, h_uni⟩
- have h_i : i ≠ 0 := fun h_i => absurd h₀ (by rwa [h_i] at h_eq )
+ have h_i : i ≠ 0 := fun h_i => absurd h₀ (by rwa [h_i] at h_eq)
use i.pred h_i,
show p (Fin.succ (Fin.pred i _)) ≠ q (Fin.succ (Fin.pred i _)) by rwa [Fin.succ_pred]
intro y hy
@@ -225,7 +225,7 @@ theorem duality (p q : Q n) : ε p (e q) = if p = q then 1 else 0 :=
try congr 1; rw [Q.succ_n_eq]; finish
try
erw [(ε _).map_zero]
- have : p ≠ q := by intro h; rw [p.succ_n_eq q] at h ; finish
+ have : p ≠ q := by intro h; rw [p.succ_n_eq q] at h; finish
simp [this]
#align sensitivity.duality Sensitivity.duality
@@ -233,7 +233,7 @@ theorem duality (p q : Q n) : ε p (e q) = if p = q then 1 else 0 :=
theorem epsilon_total {v : V n} (h : ∀ p : Q n, (ε p) v = 0) : v = 0 :=
by
induction' n with n ih
- · dsimp [ε] at h ; exact h fun _ => tt
+ · dsimp [ε] at h; exact h fun _ => tt
· cases' v with v₁ v₂
ext <;> change _ = (0 : V n) <;> simp only <;> apply ih <;> intro p <;>
[let q : Q (n + 1) := fun i => if h : i = 0 then tt else p (i.pred h);
@@ -241,8 +241,8 @@ theorem epsilon_total {v : V n} (h : ∀ p : Q n, (ε p) v = 0) : v = 0 :=
all_goals
specialize h q
first
- | rw [ε, show q 0 = tt from rfl, cond_tt] at h
- | rw [ε, show q 0 = ff from rfl, cond_ff] at h
+ | rw [ε, show q 0 = tt from rfl, cond_tt] at h
+ | rw [ε, show q 0 = ff from rfl, cond_ff] at h
rwa [show p = π q by ext; simp [q, Fin.succ_ne_zero, π]]
#align sensitivity.epsilon_total Sensitivity.epsilon_total
@@ -273,7 +273,7 @@ instance : FiniteDimensional ℝ (V n) :=
theorem finrank_v : finrank ℝ (V n) = 2 ^ n :=
by
have := @dim_v n
- rw [← finrank_eq_rank] at this <;> assumption_mod_cast
+ rw [← finrank_eq_rank] at this <;> assumption_mod_cast
#align sensitivity.finrank_V Sensitivity.finrank_v
/-! ### The linear map -/
@@ -357,7 +357,7 @@ theorem g_apply : ∀ v, g m v = (f m v + √ (m + 1) • v, v) := by delta g <;
theorem g_injective : Injective (g m) := by
rw [g]
intro x₁ x₂ h
- simp only [LinearMap.prod_apply, LinearMap.id_apply, Prod.mk.inj_iff, Pi.prod] at h
+ simp only [LinearMap.prod_apply, LinearMap.id_apply, Prod.mk.inj_iff, Pi.prod] at h
exact h.right
#align sensitivity.g_injective Sensitivity.g_injective
@@ -429,15 +429,15 @@ theorem exists_eigenvalue (H : Set (Q (m + 1))) (hH : Card H ≥ 2 ^ m + 1) :
convert (dual_bases_e_ε _).Basis.LinearIndependent.comp _ Subtype.val_injective
rw [(dual_bases_e_ε _).coe_basis]
have hdW := rank_span li
- rw [Set.range_restrict] at hdW
+ rw [Set.range_restrict] at hdW
convert hdW
rw [← (dual_bases_e_ε _).coe_basis, Cardinal.mk_image_eq (dual_bases_e_ε _).Basis.Injective,
Cardinal.mk_fintype]
rw [← finrank_eq_rank ℝ] at dim_le dim_add dimW ⊢
- rw [← finrank_eq_rank ℝ, ← finrank_eq_rank ℝ] at dim_add
+ rw [← finrank_eq_rank ℝ, ← finrank_eq_rank ℝ] at dim_add
norm_cast at dim_le dim_add dimW ⊢
- rw [pow_succ'] at dim_le
- rw [Set.toFinset_card] at hH
+ rw [pow_succ'] at dim_le
+ rw [Set.toFinset_card] at hH
linarith
#align sensitivity.exists_eigenvalue Sensitivity.exists_eigenvalue
@@ -449,7 +449,7 @@ theorem huang_degree_theorem (H : Set (Q (m + 1))) (hH : Card H ≥ 2 ^ m + 1) :
have coeffs_support : ((dual_bases_e_ε (m + 1)).coeffs y).support ⊆ H.to_finset :=
by
intro p p_in
- rw [Finsupp.mem_support_iff] at p_in
+ rw [Finsupp.mem_support_iff] at p_in
rw [Set.mem_toFinset]
exact (dual_bases_e_ε _).mem_of_mem_span y_mem_H p p_in
obtain ⟨q, H_max⟩ : ∃ q : Q (m + 1), ∀ q' : Q (m + 1), |(ε q' : _) y| ≤ |ε q y|
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -487,7 +487,7 @@ theorem huang_degree_theorem (H : Set (Q (m + 1))) (hH : Card H ≥ 2 ^ m + 1) :
by
refine' (mul_le_mul_right H_q_pos).2 _
norm_cast
- apply Finset.card_le_of_subset
+ apply Finset.card_le_card
rw [Set.toFinset_inter]
convert Finset.inter_subset_inter_right coeffs_support
#align sensitivity.huang_degree_theorem Sensitivity.huang_degree_theorem
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -4,12 +4,12 @@ Patrick Massot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Reid Barton, Johan Commelin, Jesse Han, Chris Hughes, Robert Y. Lewis, Patrick Massot
-/
-import Mathbin.Tactic.FinCases
-import Mathbin.Tactic.ApplyFun
-import Mathbin.LinearAlgebra.FiniteDimensional
-import Mathbin.LinearAlgebra.Dual
-import Mathbin.Analysis.NormedSpace.Basic
-import Mathbin.Data.Real.Sqrt
+import Tactic.FinCases
+import Tactic.ApplyFun
+import LinearAlgebra.FiniteDimensional
+import LinearAlgebra.Dual
+import Analysis.NormedSpace.Basic
+import Data.Real.Sqrt
#align_import sensitivity from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
mathlib commit https://github.com/leanprover-community/mathlib/commit/48a058d7e39a80ed56858505719a0b2197900999
@@ -420,7 +420,7 @@ theorem exists_eigenvalue (H : Set (Q (m + 1))) (hH : Card H ≥ 2 ^ m + 1) :
have dim_add : dim (W ⊔ img) + dim (W ⊓ img) = dim W + 2 ^ m :=
by
convert ← Submodule.rank_sup_add_rank_inf_eq W img
- rw [← rank_eq_of_injective (g m) g_injective]
+ rw [← rank_range_of_injective (g m) g_injective]
apply dim_V
have dimW : dim W = card H :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -3,11 +3,6 @@ Copyright (c) 2019 Reid Barton, Johan Commelin, Jesse Han, Chris Hughes, Robert
Patrick Massot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Reid Barton, Johan Commelin, Jesse Han, Chris Hughes, Robert Y. Lewis, Patrick Massot
-
-! This file was ported from Lean 3 source module sensitivity
-! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Tactic.FinCases
import Mathbin.Tactic.ApplyFun
@@ -16,6 +11,8 @@ import Mathbin.LinearAlgebra.Dual
import Mathbin.Analysis.NormedSpace.Basic
import Mathbin.Data.Real.Sqrt
+#align_import sensitivity from "leanprover-community/mathlib"@"08b081ea92d80e3a41f899eea36ef6d56e0f1db0"
+
/-!
# Huang's sensitivity theorem
mathlib commit https://github.com/leanprover-community/mathlib/commit/bf2428c9486c407ca38b5b3fb10b87dad0bc99fa
@@ -5,7 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Reid Barton, Johan Commelin, Jesse Han, Chris Hughes, Robert Y. Lewis, Patrick Massot
! This file was ported from Lean 3 source module sensitivity
-! leanprover-community/mathlib commit 328375597f2c0dd00522d9c2e5a33b6a6128feeb
+! leanprover-community/mathlib commit 08b081ea92d80e3a41f899eea36ef6d56e0f1db0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -19,6 +19,9 @@ import Mathbin.Data.Real.Sqrt
/-!
# Huang's sensitivity theorem
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
A formalization of Hao Huang's sensitivity theorem: in the hypercube of
dimension n ≥ 1, if one colors more than half the vertices then at least one
vertex has at least √n colored neighbors.
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -53,7 +53,6 @@ open scoped Classical
open scoped BigOperators
--- mathport name: «expr√»
notation "√" => Real.sqrt
open Function Bool LinearMap Fintype FiniteDimensional Module.DualBases
@@ -380,26 +379,22 @@ In this section, in order to enforce that `n` is positive, we write it as
/-! `dim X` will denote the dimension of a subspace `X` as a cardinal. -/
--- mathport name: «exprdim »
notation "dim " X:70 => Module.rank ℝ ↥X
/-! `fdim X` will denote the (finite) dimension of a subspace `X` as a natural number. -/
--- mathport name: exprfdim
notation "fdim" => finrank ℝ
/-! `Span S` will denote the ℝ-subspace spanned by `S`. -/
--- mathport name: exprSpan
notation "Span" => Submodule.span ℝ
/-! `Card X` will denote the cardinal of a subset of a finite type, as a
natural number. -/
--- mathport name: «exprCard »
notation "Card " X:70 => X.toFinset.card
/-! In the following, `⊓` and `⊔` will denote intersection and sums of ℝ-subspaces,
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -495,7 +495,6 @@ theorem huang_degree_theorem (H : Set (Q (m + 1))) (hH : Card H ≥ 2 ^ m + 1) :
apply Finset.card_le_of_subset
rw [Set.toFinset_inter]
convert Finset.inter_subset_inter_right coeffs_support
-
#align sensitivity.huang_degree_theorem Sensitivity.huang_degree_theorem
end Sensitivity
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3209ddf94136d36e5e5c624b10b2a347cc9d090
The termination checker has been getting more capable, and many of the termination_by
or decreasing_by
clauses in Mathlib are no longer needed.
(Note that termination_by?
will show the automatically derived termination expression, so no information is being lost by removing these.)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -183,11 +183,11 @@ variable (n : ℕ)
/-! `V n` is a real vector space whose equality relation is computable. -/
-instance : DecidableEq (V n) := by induction n <;> · dsimp only [V]; skip; infer_instance
+instance : DecidableEq (V n) := by induction n <;> · dsimp only [V]; infer_instance
-instance : AddCommGroup (V n) := by induction n <;> · dsimp only [V]; skip; infer_instance
+instance : AddCommGroup (V n) := by induction n <;> · dsimp only [V]; infer_instance
-instance : Module ℝ (V n) := by induction n <;> · dsimp only [V]; skip; infer_instance
+instance : Module ℝ (V n) := by induction n <;> · dsimp only [V]; infer_instance
end V
@@ -436,8 +436,8 @@ theorem huang_degree_theorem (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
rw [Finsupp.mem_support_iff] at p_in
rw [Set.mem_toFinset]
exact (dualBases_e_ε _).mem_of_mem_span y_mem_H p p_in
- obtain ⟨q, H_max⟩ : ∃ q : Q m.succ, ∀ q' : Q m.succ, |(ε q' : _) y| ≤ |ε q y|
- exact Finite.exists_max _
+ obtain ⟨q, H_max⟩ : ∃ q : Q m.succ, ∀ q' : Q m.succ, |(ε q' : _) y| ≤ |ε q y| :=
+ Finite.exists_max _
have H_q_pos : 0 < |ε q y| := by
contrapose! y_ne
exact epsilon_total fun p => abs_nonpos_iff.mp (le_trans (H_max p) y_ne)
@@ -239,7 +239,7 @@ theorem epsilon_total {v : V n} (h : ∀ p : Q n, (ε p) v = 0) : v = 0 := by
first
| rw [ε, show q 0 = true from rfl, Bool.cond_true] at h
| rw [ε, show q 0 = false from rfl, Bool.cond_false] at h
- rwa [show p = π q by ext; simp [Fin.succ_ne_zero, π]]
+ rwa [show p = π q by ext; simp [q, Fin.succ_ne_zero, π]]
#align sensitivity.epsilon_total Sensitivity.epsilon_total
open Module
have
, replace
and suffices
(#10640)
No changes to tactic file, it's just boring fixes throughout the library.
This follows on from #6964.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -443,8 +443,7 @@ theorem huang_degree_theorem (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
exact epsilon_total fun p => abs_nonpos_iff.mp (le_trans (H_max p) y_ne)
refine' ⟨q, (dualBases_e_ε _).mem_of_mem_span y_mem_H q (abs_pos.mp H_q_pos), _⟩
let s := √ (m + 1)
- suffices : s * |ε q y| ≤ _ * |ε q y|
- exact (mul_le_mul_right H_q_pos).mp ‹_›
+ suffices s * |ε q y| ≤ _ * |ε q y| from (mul_le_mul_right H_q_pos).mp ‹_›
let coeffs := (dualBases_e_ε m.succ).coeffs
calc
s * |ε q y| = |ε q (s • y)| := by
Also use lowercase for DualBases
axioms.
@@ -248,7 +248,7 @@ open Module
and `ε` computes coefficients of decompositions of vectors on that basis. -/
theorem dualBases_e_ε (n : ℕ) : DualBases (@e n) (@ε n) where
eval := duality
- Total := @epsilon_total _
+ total := @epsilon_total _
#align sensitivity.dual_bases_e_ε Sensitivity.dualBases_e_ε
/-! We will now derive the dimension of `V`, first as a cardinal in `dim_V` and,
Finset
lemma names (#8894)
Change a few lemma names that have historically bothered me.
Finset.card_le_of_subset
→ Finset.card_le_card
Multiset.card_le_of_le
→ Multiset.card_le_card
Multiset.card_lt_of_lt
→ Multiset.card_lt_card
Set.ncard_le_of_subset
→ Set.ncard_le_ncard
Finset.image_filter
→ Finset.filter_image
CompleteLattice.finset_sup_compact_of_compact
→ CompleteLattice.isCompactElement_finset_sup
@@ -470,7 +470,7 @@ theorem huang_degree_theorem (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
_ ≤ Finset.card (H ∩ q.adjacent).toFinset * |ε q y| := by
refine' (mul_le_mul_right H_q_pos).2 _
norm_cast
- apply Finset.card_le_of_subset
+ apply Finset.card_le_card
rw [Set.toFinset_inter]
convert Finset.inter_subset_inter_right coeffs_support
#align sensitivity.huang_degree_theorem Sensitivity.huang_degree_theorem
exact_mod_cast
tactic with mod_cast
elaborator where possible (#8404)
We still have the exact_mod_cast
tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast
are the ones that don't work using the term elaborator by itself.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -353,7 +353,7 @@ theorem g_injective : Injective (g m) := by
theorem f_image_g (w : V m.succ) (hv : ∃ v, g m v = w) : f m.succ w = √ (m + 1) • w := by
rcases hv with ⟨v, rfl⟩
- have : √ (m + 1) * √ (m + 1) = m + 1 := Real.mul_self_sqrt (by exact_mod_cast zero_le _)
+ have : √ (m + 1) * √ (m + 1) = m + 1 := Real.mul_self_sqrt (mod_cast zero_le _)
rw [f_succ_apply, g_apply]
simp [this, f_squared, smul_add, add_smul, smul_smul, V]
abel
@@ -400,7 +400,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
let W := Span (e '' H)
let img := range (g m)
suffices 0 < dim (W ⊓ img) by
- exact_mod_cast exists_mem_ne_zero_of_rank_pos this
+ exact mod_cast exists_mem_ne_zero_of_rank_pos this
have dim_le : dim (W ⊔ img) ≤ 2 ^ (m + 1 : Cardinal) := by
convert ← rank_submodule_le (W ⊔ img)
rw [← Nat.cast_succ]
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -401,7 +401,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
let img := range (g m)
suffices 0 < dim (W ⊓ img) by
exact_mod_cast exists_mem_ne_zero_of_rank_pos this
- have dim_le : dim (W ⊔ img) ≤ 2 ^ (m + 1) := by
+ have dim_le : dim (W ⊔ img) ≤ 2 ^ (m + 1 : Cardinal) := by
convert ← rank_submodule_le (W ⊔ img)
rw [← Nat.cast_succ]
apply dim_V
@@ -455,7 +455,6 @@ theorem huang_degree_theorem (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
|(coeffs y).sum fun (i : Q m.succ) (a : ℝ) =>
a • (ε q ∘ f m.succ ∘ fun i : Q m.succ => e i) i| := by
erw [(f m.succ).map_finsupp_total, (ε q).map_finsupp_total, Finsupp.total_apply]
- rfl
_ ≤ ∑ p in (coeffs y).support, |coeffs y p * (ε q <| f m.succ <| e p)| :=
(norm_sum_le _ fun p => coeffs y p * _)
_ = ∑ p in (coeffs y).support, |coeffs y p| * ite (p ∈ q.adjacent) 1 0 := by
@@ -216,6 +216,7 @@ theorem duality (p q : Q n) : ε p (e q) = if p = q then 1 else 0 := by
· rw [show p = q from Subsingleton.elim (α := Q 0) p q]
dsimp [ε, e]
simp
+ rfl
· dsimp [ε, e]
cases hp : p 0 <;> cases hq : q 0
all_goals
@@ -216,7 +216,6 @@ theorem duality (p q : Q n) : ε p (e q) = if p = q then 1 else 0 := by
· rw [show p = q from Subsingleton.elim (α := Q 0) p q]
dsimp [ε, e]
simp
- rfl
· dsimp [ε, e]
cases hp : p 0 <;> cases hq : q 0
all_goals
@@ -216,6 +216,7 @@ theorem duality (p q : Q n) : ε p (e q) = if p = q then 1 else 0 := by
· rw [show p = q from Subsingleton.elim (α := Q 0) p q]
dsimp [ε, e]
simp
+ rfl
· dsimp [ε, e]
cases hp : p 0 <;> cases hq : q 0
all_goals
@@ -138,7 +138,7 @@ theorem adj_iff_proj_adj {p q : Q n.succ} (h₀ : p 0 = q 0) :
q ∈ p.adjacent ↔ π q ∈ (π p).adjacent := by
constructor
· rintro ⟨i, h_eq, h_uni⟩
- have h_i : i ≠ 0 := fun h_i => absurd h₀ (by rwa [h_i] at h_eq )
+ have h_i : i ≠ 0 := fun h_i => absurd h₀ (by rwa [h_i] at h_eq)
use i.pred h_i,
show p (Fin.succ (Fin.pred i _)) ≠ q (Fin.succ (Fin.pred i _)) by rwa [Fin.succ_pred]
intro y hy
@@ -327,7 +327,7 @@ theorem f_matrix : ∀ p q : Q n, |ε q (f n (e p))| = if p ∈ q.adjacent then
#align sensitivity.f_matrix Sensitivity.f_matrix
/-- The linear operator $g_m$ corresponding to Knuth's matrix $B_m$. -/
-noncomputable def g (m : ℕ) : V m →ₗ[ℝ] V m.succ:=
+noncomputable def g (m : ℕ) : V m →ₗ[ℝ] V m.succ :=
LinearMap.prod (f m + √ (m + 1) • LinearMap.id) LinearMap.id
#align sensitivity.g Sensitivity.g
@@ -399,7 +399,6 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
let W := Span (e '' H)
let img := range (g m)
suffices 0 < dim (W ⊓ img) by
- simp only [exists_prop]
exact_mod_cast exists_mem_ne_zero_of_rank_pos this
have dim_le : dim (W ⊔ img) ≤ 2 ^ (m + 1) := by
convert ← rank_submodule_le (W ⊔ img)
The new definition is conceptually more satisfactory.
By also changing the definition of the Zero
and One
instances, we get ((0 : ℕ) : Cardinal) = 0
and ((1 : ℕ) : Cardinal) = 1
definitionally (which wasn't true before), which is in practice more convenient than definitional equality with PEmpty
or PUnit
.
@@ -403,6 +403,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
exact_mod_cast exists_mem_ne_zero_of_rank_pos this
have dim_le : dim (W ⊔ img) ≤ 2 ^ (m + 1) := by
convert ← rank_submodule_le (W ⊔ img)
+ rw [← Nat.cast_succ]
apply dim_V
have dim_add : dim (W ⊔ img) + dim (W ⊓ img) = dim W + 2 ^ m := by
convert ← Submodule.rank_sup_add_rank_inf_eq W img
@@ -406,7 +406,7 @@ theorem exists_eigenvalue (H : Set (Q m.succ)) (hH : Card H ≥ 2 ^ m + 1) :
apply dim_V
have dim_add : dim (W ⊔ img) + dim (W ⊓ img) = dim W + 2 ^ m := by
convert ← Submodule.rank_sup_add_rank_inf_eq W img
- rw [← rank_eq_of_injective (g m) g_injective]
+ rw [rank_range_of_injective (g m) g_injective]
apply dim_V
have dimW : dim W = card H := by
have li : LinearIndependent ℝ (H.restrict e) := by
Various adaptations to changes when Fin
API was moved to Std. One notable change is that many lemmas are now stated in terms of i ≠ 0
(for i : Fin n
) rather then i.1 ≠ 0
, and as a consequence many Fin.vne_of_ne
applications have been added or removed, mostly removed.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Wojciech Nawrocki <wjnawrocki@protonmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -103,8 +103,8 @@ theorem succ_n_eq (p q : Q n.succ) : p = q ↔ p 0 = q 0 ∧ π p = π q := by
ext x
by_cases hx : x = 0
· rwa [hx]
- · rw [← Fin.succ_pred x <| Fin.vne_of_ne hx]
- convert congr_fun h (Fin.pred x <| Fin.vne_of_ne hx)
+ · rw [← Fin.succ_pred x hx]
+ convert congr_fun h (Fin.pred x hx)
#align sensitivity.Q.succ_n_eq Sensitivity.Q.succ_n_eq
/-- The adjacency relation defining the graph structure on `Q n`:
@@ -128,7 +128,7 @@ theorem adj_iff_proj_eq {p q : Q n.succ} (h₀ : p 0 ≠ q 0) : q ∈ p.adjacent
use 0, h₀
intro y hy
contrapose! hy
- rw [← Fin.succ_pred _ <| Fin.vne_of_ne hy]
+ rw [← Fin.succ_pred _ hy]
apply congr_fun heq
#align sensitivity.Q.adj_iff_proj_eq Sensitivity.Q.adj_iff_proj_eq
@@ -139,14 +139,14 @@ theorem adj_iff_proj_adj {p q : Q n.succ} (h₀ : p 0 = q 0) :
constructor
· rintro ⟨i, h_eq, h_uni⟩
have h_i : i ≠ 0 := fun h_i => absurd h₀ (by rwa [h_i] at h_eq )
- use i.pred <| Fin.vne_of_ne h_i,
+ use i.pred h_i,
show p (Fin.succ (Fin.pred i _)) ≠ q (Fin.succ (Fin.pred i _)) by rwa [Fin.succ_pred]
intro y hy
simp [Eq.symm (h_uni _ hy)]
· rintro ⟨i, h_eq, h_uni⟩
use i.succ, h_eq
intro y hy
- rw [← Fin.pred_inj (ha := Fin.vne_of_ne (?ha : y ≠ 0)) (hb := Fin.vne_of_ne (?hb : i.succ ≠ 0)),
+ rw [← Fin.pred_inj (ha := (?ha : y ≠ 0)) (hb := (?hb : i.succ ≠ 0)),
Fin.pred_succ]
case ha =>
contrapose! hy
@@ -231,8 +231,8 @@ theorem epsilon_total {v : V n} (h : ∀ p : Q n, (ε p) v = 0) : v = 0 := by
· dsimp [ε] at h; exact h fun _ => true
· cases' v with v₁ v₂
ext <;> change _ = (0 : V n) <;> simp only <;> apply ih <;> intro p <;>
- [let q : Q n.succ := fun i => if h : i = 0 then true else p (i.pred <| Fin.vne_of_ne h);
- let q : Q n.succ := fun i => if h : i = 0 then false else p (i.pred <| Fin.vne_of_ne h)]
+ [let q : Q n.succ := fun i => if h : i = 0 then true else p (i.pred h);
+ let q : Q n.succ := fun i => if h : i = 0 then false else p (i.pred h)]
all_goals
specialize h q
first
@@ -3,11 +3,6 @@ Copyright (c) 2019 Reid Barton, Johan Commelin, Jesse Han, Chris Hughes, Robert
Patrick Massot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Reid Barton, Johan Commelin, Jesse Han, Chris Hughes, Robert Y. Lewis, Patrick Massot
-
-! This file was ported from Lean 3 source module sensitivity
-! leanprover-community/mathlib commit 328375597f2c0dd00522d9c2e5a33b6a6128feeb
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.ApplyFun
@@ -16,6 +11,8 @@ import Mathlib.LinearAlgebra.Dual
import Mathlib.Analysis.NormedSpace.Basic
import Mathlib.Data.Real.Sqrt
+#align_import sensitivity from "leanprover-community/mathlib"@"328375597f2c0dd00522d9c2e5a33b6a6128feeb"
+
/-!
# Huang's sensitivity theorem
Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -106,8 +106,8 @@ theorem succ_n_eq (p q : Q n.succ) : p = q ↔ p 0 = q 0 ∧ π p = π q := by
ext x
by_cases hx : x = 0
· rwa [hx]
- · rw [← Fin.succ_pred x hx]
- convert congr_fun h (Fin.pred x hx)
+ · rw [← Fin.succ_pred x <| Fin.vne_of_ne hx]
+ convert congr_fun h (Fin.pred x <| Fin.vne_of_ne hx)
#align sensitivity.Q.succ_n_eq Sensitivity.Q.succ_n_eq
/-- The adjacency relation defining the graph structure on `Q n`:
@@ -131,7 +131,7 @@ theorem adj_iff_proj_eq {p q : Q n.succ} (h₀ : p 0 ≠ q 0) : q ∈ p.adjacent
use 0, h₀
intro y hy
contrapose! hy
- rw [← Fin.succ_pred _ hy]
+ rw [← Fin.succ_pred _ <| Fin.vne_of_ne hy]
apply congr_fun heq
#align sensitivity.Q.adj_iff_proj_eq Sensitivity.Q.adj_iff_proj_eq
@@ -142,14 +142,15 @@ theorem adj_iff_proj_adj {p q : Q n.succ} (h₀ : p 0 = q 0) :
constructor
· rintro ⟨i, h_eq, h_uni⟩
have h_i : i ≠ 0 := fun h_i => absurd h₀ (by rwa [h_i] at h_eq )
- use i.pred h_i,
+ use i.pred <| Fin.vne_of_ne h_i,
show p (Fin.succ (Fin.pred i _)) ≠ q (Fin.succ (Fin.pred i _)) by rwa [Fin.succ_pred]
intro y hy
simp [Eq.symm (h_uni _ hy)]
· rintro ⟨i, h_eq, h_uni⟩
use i.succ, h_eq
intro y hy
- rw [← Fin.pred_inj (ha := ?ha) (hb := ?hb), Fin.pred_succ]
+ rw [← Fin.pred_inj (ha := Fin.vne_of_ne (?ha : y ≠ 0)) (hb := Fin.vne_of_ne (?hb : i.succ ≠ 0)),
+ Fin.pred_succ]
case ha =>
contrapose! hy
rw [hy, h₀]
@@ -233,8 +234,8 @@ theorem epsilon_total {v : V n} (h : ∀ p : Q n, (ε p) v = 0) : v = 0 := by
· dsimp [ε] at h; exact h fun _ => true
· cases' v with v₁ v₂
ext <;> change _ = (0 : V n) <;> simp only <;> apply ih <;> intro p <;>
- [let q : Q n.succ := fun i => if h : i = 0 then true else p (i.pred h);
- let q : Q n.succ := fun i => if h : i = 0 then false else p (i.pred h)]
+ [let q : Q n.succ := fun i => if h : i = 0 then true else p (i.pred <| Fin.vne_of_ne h);
+ let q : Q n.succ := fun i => if h : i = 0 then false else p (i.pred <| Fin.vne_of_ne h)]
all_goals
specialize h q
first
This is the second half of the changes originally in #5699, removing all occurrences of ;
after a space and implementing a linter rule to enforce it.
In most cases this 2-character substring has a space after it, so the following command was run first:
find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;
The remaining cases were few enough in number that they were done manually.
@@ -230,7 +230,7 @@ theorem duality (p q : Q n) : ε p (e q) = if p = q then 1 else 0 := by
/-- Any vector in `V n` annihilated by all `ε p`'s is zero. -/
theorem epsilon_total {v : V n} (h : ∀ p : Q n, (ε p) v = 0) : v = 0 := by
induction' n with n ih
- · dsimp [ε] at h ; exact h fun _ => true
+ · dsimp [ε] at h; exact h fun _ => true
· cases' v with v₁ v₂
ext <;> change _ = (0 : V n) <;> simp only <;> apply ih <;> intro p <;>
[let q : Q n.succ := fun i => if h : i = 0 then true else p (i.pred h);
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file