Download data/lean/OAI/Combinatorics/GotsmanLinial/Statement.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.76 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GotsmanLinial/Statement.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GotsmanLinial/Statement.lean
-
curl -L -o Statement.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GotsmanLinial/Statement.lean
3.76 kB
| import OAI.Combinatorics.GotsmanLinial.Model | |
| namespace OAI | |
| open scoped BigOperators | |
| namespace LeanBlast.GotsmanLinial | |
| theorem flip_apply_same {n : β} (i : Fin n) (x : Cube n) : | |
| flip i x i = !(x i) := by | |
| simp [flip] | |
| theorem flip_apply_ne {n : β} (i : Fin n) (x : Cube n) (j : Fin n) (h : j β i) : | |
| flip i x j = x j := by | |
| simp [flip, h] | |
| theorem flip_flip {n : β} (i : Fin n) (x : Cube n) : | |
| flip i (flip i x) = x := by | |
| funext j | |
| by_cases h : j = i | |
| Β· subst j | |
| simp [flip] | |
| Β· simp [flip, h] | |
| theorem flip_ne_self {n : β} (i : Fin n) (x : Cube n) : flip i x β x := by | |
| intro h | |
| have hi := congrFun h i | |
| cases hxi : x i <;> simp [flip, hxi] at hi | |
| theorem flip_injective_direction {n : β} (x : Cube n) : | |
| Function.Injective (fun i : Fin n => flip i x) := by | |
| intro i j h | |
| by_contra hij | |
| have hi := congrFun h i | |
| cases hxi : x i <;> simp [flip, hij, hxi] at hi | |
| theorem flip_involutive {n : β} (i : Fin n) : Function.Involutive (flip i) := | |
| flip_flip i | |
| theorem flip_bijective {n : β} (i : Fin n) : Function.Bijective (flip i) := | |
| (flip_involutive i).bijective | |
| theorem cubeCoord_flip_same {n : β} (x : Cube n) (i : Fin n) : | |
| cubeCoord (flip i x) i = -cubeCoord x i := by | |
| cases hxi : x i <;> simp [cubeCoord, flip, hxi] | |
| theorem cubeCoord_flip_ne {n : β} (x : Cube n) (i j : Fin n) (h : j β i) : | |
| cubeCoord (flip i x) j = cubeCoord x j := by | |
| simp [cubeCoord, flip, h] | |
| theorem cubeCoord_cases {n : β} (x : Cube n) (i : Fin n) : | |
| cubeCoord x i = 1 β¨ cubeCoord x i = -1 := by | |
| cases hxi : x i <;> simp [cubeCoord, hxi] | |
| theorem cubeCoord_sq {n : β} (x : Cube n) (i : Fin n) : | |
| (cubeCoord x i) ^ 2 = 1 := by | |
| cases hxi : x i <;> simp [cubeCoord, hxi] | |
| theorem thresholdSign_zero : thresholdSign 0 = 1 := by | |
| simp [thresholdSign] | |
| theorem thresholdSign_eq_one_iff (t : β) : thresholdSign t = 1 β 0 β€ t := by | |
| by_cases h : 0 β€ t | |
| Β· simp [thresholdSign, h] | |
| Β· simp [thresholdSign, h, show (-1 : β) β 1 by norm_num] | |
| theorem thresholdSign_eq_neg_one_iff (t : β) : thresholdSign t = -1 β t < 0 := by | |
| by_cases h : 0 β€ t | |
| Β· simp [thresholdSign, h, not_lt.mpr h, show (1 : β) β -1 by norm_num] | |
| Β· simp [thresholdSign, h, lt_of_not_ge h] | |
| theorem thresholdSign_cases (t : β) : thresholdSign t = 1 β¨ thresholdSign t = -1 := by | |
| unfold thresholdSign | |
| split <;> simp | |
| theorem thresholdSign_sq (t : β) : thresholdSign t ^ 2 = 1 := by | |
| rcases thresholdSign_cases t with h | h <;> simp [h] | |
| theorem card_cube (n : β) : Fintype.card (Cube n) = 2 ^ n := by | |
| simp [Cube] | |
| /-- The Boolean encoding represents every sign vector exactly once. -/ | |
| noncomputable def cubeEquivSignVectors (n : β) : | |
| Cube n β {x : Fin n β β // β i, x i = 1 β¨ x i = -1} := by | |
| classical | |
| exact | |
| { toFun := fun x => β¨cubeCoord x, cubeCoord_cases xβ© | |
| invFun := fun x i => decide (x.1 i = 1) | |
| left_inv := by | |
| intro x | |
| funext i | |
| cases hxi : x i <;> simp [cubeCoord, hxi, show (-1 : β) β 1 by norm_num] | |
| right_inv := by | |
| intro x | |
| apply Subtype.ext | |
| funext i | |
| rcases x.2 i with hxi | hxi <;> | |
| simp [cubeCoord, hxi, show (-1 : β) β 1 by norm_num] } | |
| theorem averageSensitivity_eq_count {n : β} (f : Cube n β β) : | |
| averageSensitivity f = (sensitiveEdgeCount f : β) / (2 : β) ^ n := by | |
| simp [averageSensitivity, sensitiveEdgeCount, Finset.sum_div] | |
| theorem averageSensitivity_eq_uniform {n : β} (f : Cube n β β) : | |
| averageSensitivity f = | |
| β i : Fin n, ((sensitiveVertices f i).card : β) / (Fintype.card (Cube n) : β) := by | |
| simp [averageSensitivity] | |
| end LeanBlast.GotsmanLinial | |
| end OAI | |