Download data/lean/OAI/Probability/SATComputability/EffectiveTrialValues.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.85 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/EffectiveTrialValues.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/SATComputability/EffectiveTrialValues.lean
-
curl -L -o EffectiveTrialValues.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/SATComputability/EffectiveTrialValues.lean
4.85 kB
| import OAI.Probability.SATComputability.TrialDescriptions | |
| namespace OAI | |
| namespace FixedClauseThreshold.Computability | |
| open DilutedSpinGlass _root_.MeasureTheory _root_.OAI.MeasureTheory ProbabilityTheory Nat.Partrec FiniteArithmetic | |
| open PeriodicLattice.CertifiedReal RapidForcing.EffectiveArithmetic | |
| open scoped NNReal | |
| local instance effectiveTrialValuesRatPrimcodable : Primcodable β := | |
| PeriodicLattice.RecursiveArithmetic.ratPrimcodable | |
| abbrev TrialData := β Γ β Γ Code Γ List β | |
| noncomputable def guardedSiteExpression (t : TrialData) (k : β) : Code := | |
| if positiveExponents t.2.2.2 then | |
| averagedSiteExpression (t.2.1 : β) t.2.2.1 t.2.2.2 k else .zero | |
| attribute [local irreducible] averagedSiteExpression averagedEdgeExpression positiveExponents | |
| @[fun_prop] theorem guardedSiteExpression_computable : | |
| Computable (fun p : TrialData Γ β => guardedSiteExpression p.1 p.2) := by | |
| have he : Computable (fun p : TrialData Γ β => | |
| averagedSiteExpression (p.1.2.1 : β) p.1.2.2.1 p.1.2.2.2 p.2) := | |
| averagedSiteExpression_computable.comp | |
| (g := fun p : TrialData Γ β => (((p.1.2.1 : β),p.1.2.2.1,p.1.2.2.2),p.2)) | |
| (by fun_prop) | |
| unfold guardedSiteExpression | |
| fun_prop | |
| noncomputable def guardedSiteValue (t : TrialData) (k : β) : β := | |
| expressionValue (guardedSiteExpression t k) | |
| theorem guardedSiteValue_effective : Effective (fun p : TrialData Γ β => guardedSiteValue p.1 p.2) := | |
| expressionValue_effective.comp guardedSiteExpression_computable | |
| theorem guardedSiteValue_bound (t : TrialData) (k : β) : | |
| |guardedSiteValue t k| β€ (t.2.1 : β)*((k : β)+1) := by | |
| unfold guardedSiteValue guardedSiteExpression | |
| split_ifs with h | |
| Β· have hp := (positiveExponents_iff t.2.2.2).mp h | |
| apply (packetSiteValue_bound (Ξ² := (t.2.1 : β)) (by positivity) | |
| t.2.2.1 t.2.2.2 hp k).trans | |
| push_cast | |
| nlinarith [show (0 : β) β€ t.2.1 from Nat.cast_nonneg _] | |
| Β· simp only [expressionValue, abs_zero] | |
| positivity | |
| noncomputable def trialRate (t : TrialData) : β := 3 * max 0 t.1 | |
| @[fun_prop] theorem trialRate_computable : Computable trialRate := by | |
| unfold trialRate | |
| fun_prop | |
| theorem trialRate_nonneg (t : TrialData) : 0 β€ trialRate t := by | |
| unfold trialRate | |
| positivity | |
| noncomputable def trialDensityNN (t : TrialData) : ββ₯0 := | |
| β¨(max 0 t.1 : β), by exact_mod_cast le_max_left (0 : β) t.1β© | |
| noncomputable def trialValue (t : TrialData) : β := | |
| Real.log 2 + | |
| (β« k, guardedSiteValue t k βpoissonMeasure (trialDensityNN t * 3)) - | |
| 2*(max 0 t.1 : β)*packetEdgeValue (t.2.1 : β) t.2.2.1 t.2.2.2 | |
| attribute [local irreducible] guardedSiteValue packetEdgeValue | |
| private theorem siteExpectation_effective : Effective (fun t : TrialData => | |
| β« k, guardedSiteValue t k βpoissonMeasure (trialDensityNN t * 3)) := by | |
| have hs := effective_poisson_expectation trialRate trialRate_computable trialRate_nonneg | |
| (fun t : TrialData => t.2.1) (by fun_prop) guardedSiteValue | |
| guardedSiteValue_effective guardedSiteValue_bound | |
| convert hs using 1 | |
| funext t | |
| congr 1 | |
| congr 1 | |
| apply Subtype.ext | |
| change ((max 0 t.1 : β) : β)*3 = ((3*max 0 t.1 : β) : β) | |
| push_cast | |
| ring | |
| private theorem edgePacket_effective : | |
| Effective (fun t : TrialData => packetEdgeValue (t.2.1 : β) t.2.2.1 t.2.2.2) := by | |
| simpa only [packetEdgeValue] using expressionValue_effective.comp | |
| (averagedEdgeExpression_computable.comp | |
| (g := fun t : TrialData => ((t.2.1 : β),t.2.2.1,t.2.2.2)) (by fun_prop)) | |
| theorem trialValue_effective : Effective trialValue := by | |
| have hlog : Effective (fun _t : TrialData => Real.log 2) := | |
| (rational (Computable.const (2 : β))).log (fun _ => by norm_num) | |
| have ha : Effective (fun t : TrialData => ((2*(max 0 t.1) : β) : β)) := | |
| rational (by fun_prop) | |
| apply ((hlog.add siteExpectation_effective).sub (ha.mul edgePacket_effective)).congr | |
| intro t | |
| simp only [trialValue, Rat.cast_mul, Rat.cast_ofNat] | |
| theorem trialValue_eq_functional (t : TrialData) | |
| (hm : exponentCheck t.2.2.2 = true) : | |
| trialValue t = functional (satModel (trialDensityNN t) (t.2.1 : β)) t.2.2.2.length | |
| (rationalTreeValue (t.2.2.2.length+1) (decodeTree (t.2.2.2.length+1) t.2.2.1)) | |
| (fun i => (t.2.2.2.get i : β)) := by | |
| have hp := exponentCheck_positive hm | |
| have he (k : β) : guardedSiteValue t k = packetSiteValue (t.2.1 : β) t.2.2.1 t.2.2.2 k := by | |
| simp only [guardedSiteValue, guardedSiteExpression, hp, ite_true, packetSiteValue] | |
| have hf := packet_functional (trialDensityNN t) (t.2.1 : β) t.2.2.1 t.2.2.2 | |
| ((positiveExponents_iff _).mp hp) | |
| simp only [Rat.cast_natCast] at hf | |
| rw [hf] | |
| have hc : (trialDensityNN t : β) = (max 0 t.1 : β) := rfl | |
| simp only [trialValue, he, hc] | |
| push_cast | |
| ring | |
| end FixedClauseThreshold.Computability | |
| end OAI | |