Download data/lean/OAI/NumberTheory/TwoPoint/Circuits/CircuitIsolationEvent.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.63 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/TwoPoint/Circuits/CircuitIsolationEvent.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/TwoPoint/Circuits/CircuitIsolationEvent.lean
-
curl -L -o CircuitIsolationEvent.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/TwoPoint/Circuits/CircuitIsolationEvent.lean
4.63 kB
| import OAI.NumberTheory.TwoPoint.Circuits.CircuitBooleanOps | |
| import OAI.NumberTheory.TwoPoint.Circuits.CircuitGateApproximation | |
| namespace OAI | |
| /-! The single-hit test used by the random polynomial is itself a small | |
| constant-depth circuit on the original child outputs. -/ | |
| namespace TwoPointCorrelations | |
| open Finset | |
| open scoped Classical | |
| namespace AC0Circuit | |
| noncomputable def certificateDisjunction {ΞΉ : Type*} [Fintype ΞΉ] {n : β} | |
| (c : ΞΉ β AC0Circuit n) : AC0Circuit n := | |
| (conjunction (fun i => (c i).negate)).negate | |
| lemma certificateDisjunction_eval {ΞΉ : Type*} [Fintype ΞΉ] {n : β} | |
| (c : ΞΉ β AC0Circuit n) (x : BooleanCube n) : | |
| (certificateDisjunction c).eval x = true β β i, (c i).eval x = true := by | |
| rw [certificateDisjunction, negate_eval] | |
| simp only [ne_eq, conjunction_eval, negate_eval, not_forall, not_not] | |
| lemma certificateDisjunction_depth {ΞΉ : Type*} [Fintype ΞΉ] {n d : β} | |
| (c : ΞΉ β AC0Circuit n) (hc : β i, (c i).depth β€ d) : | |
| (certificateDisjunction c).depth β€ d + 1 := by | |
| simp only [certificateDisjunction, negate_depth] | |
| exact conjunction_depth _ (fun i => by simpa only [negate_depth] using hc i) | |
| lemma certificateDisjunction_size {ΞΉ : Type*} [Fintype ΞΉ] {n : β} | |
| (c : ΞΉ β AC0Circuit n) : (certificateDisjunction c).size = 1 + β i, (c i).size := by | |
| simp only [certificateDisjunction, negate_size, conjunction_size] | |
| noncomputable def uniqueFalseTerm {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) (i : S) : AC0Circuit n := | |
| conjunction (fun j : S => if j = i then (c j).negate else c j) | |
| lemma uniqueFalseTerm_eval {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) (i : S) (x : BooleanCube n) : | |
| (uniqueFalseTerm c S i).eval x = true β | |
| (c i).eval x = false β§ β j : S, j β i β (c j).eval x = true := by | |
| rw [uniqueFalseTerm, conjunction_eval] | |
| constructor | |
| Β· intro h | |
| refine β¨?_, fun j hj => ?_β© | |
| Β· have hi := h i | |
| apply Bool.eq_false_iff.mpr | |
| simpa only [ite_true, negate_eval] using hi | |
| Β· simpa only [ite_eq_right hj] using h j | |
| Β· rintro β¨hi, hβ© j | |
| by_cases hj : j = i | |
| Β· subst j | |
| rw [ite_eq_left rfl, negate_eval, hi] | |
| decide | |
| Β· simpa only [ite_eq_right hj] using h j hj | |
| noncomputable def uniqueFalseCircuit {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) : AC0Circuit n := | |
| certificateDisjunction (fun i : S => uniqueFalseTerm c S i) | |
| lemma uniqueFalseCircuit_eval {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) (x : BooleanCube n) : | |
| (uniqueFalseCircuit c S).eval x = true β | |
| β i : S, (c i).eval x = false β§ β j : S, j β i β (c j).eval x = true := by | |
| simp only [uniqueFalseCircuit, certificateDisjunction_eval, uniqueFalseTerm_eval] | |
| lemma uniqueFalseTerm_depth {n k d : β} (c : Fin k β AC0Circuit n) | |
| (hc : β i, (c i).depth β€ d) (S : Finset (Fin k)) (i : S) : | |
| (uniqueFalseTerm c S i).depth β€ d + 1 := by | |
| apply conjunction_depth | |
| intro j | |
| split_ifs <;> simpa only [negate_depth] using hc j | |
| lemma uniqueFalseCircuit_depth {n k d : β} (c : Fin k β AC0Circuit n) | |
| (hc : β i, (c i).depth β€ d) (S : Finset (Fin k)) : | |
| (uniqueFalseCircuit c S).depth β€ d + 2 := by | |
| exact certificateDisjunction_depth _ (uniqueFalseTerm_depth c hc S) | |
| lemma uniqueFalseTerm_size {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) (i : S) : | |
| (uniqueFalseTerm c S i).size = 1 + β j : S, (c j).size := by | |
| rw [uniqueFalseTerm, conjunction_size] | |
| congr 1 | |
| apply sum_congr rfl | |
| intro j _ | |
| split_ifs <;> simp only [negate_size] | |
| lemma uniqueFalseCircuit_size {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) : | |
| (uniqueFalseCircuit c S).size = 1 + S.card * (1 + β j : S, (c j).size) := by | |
| simp only [uniqueFalseCircuit, certificateDisjunction_size, uniqueFalseTerm_size, sum_const, | |
| card_univ, Fintype.card_coe, nsmul_eq_mul, Nat.cast_id] | |
| lemma uniqueFalseCircuit_size_le {n k : β} (c : Fin k β AC0Circuit n) | |
| (S : Finset (Fin k)) : | |
| (uniqueFalseCircuit c S).size β€ 1 + k * (1 + β j, (c j).size) := by | |
| rw [uniqueFalseCircuit_size] | |
| have hcard : S.card β€ k := (card_le_card (subset_univ S)).trans_eq (card_fin k) | |
| have hsum : β j : S, (c j).size β€ β j, (c j).size := by | |
| calc | |
| _ = β j β S, (c j).size := sum_coe_sort S (fun j => (c j).size) | |
| _ β€ _ := sum_le_sum_of_subset_of_nonneg (subset_univ S) (fun _ _ _ => Nat.zero_le _) | |
| exact Nat.add_le_add_left (Nat.mul_le_mul hcard (Nat.add_le_add_left hsum 1)) 1 | |
| end AC0Circuit | |
| end TwoPointCorrelations | |
| end OAI | |