File size: 1,742 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import Mathlib

namespace OAI

/-!
Proper clauses choose distinct variables with independent fair signs. Formulas are
independent clause draws with replacement, and their satisfiability probability is
the literal finite cardinality ratio. The empty formula is satisfiable. When
there are fewer variables than literals, nonempty formula lengths have probability
zero by the convention that division by zero is zero.
The threshold assertion concerns fixed clause size and fixed density only, with
no assertion at the critical density.
-/

namespace FixedClauseThreshold

abbrev Assignment (n : β„•) := Fin n β†’ Bool

abbrev ProperClause (n k : β„•) :=
  { C : Fin n β†’ Option Bool // (Finset.univ.filter fun i => (C i).isSome).card = k }

abbrev Formula (n k m : β„•) := Fin m β†’ ProperClause n k

def SatisfiesClause {n k : β„•} (Οƒ : Assignment n) (C : ProperClause n k) : Prop :=
  βˆƒ i : Fin n, C.val i = some (Οƒ i)

def Satisfies {n k m : β„•} (Οƒ : Assignment n) (F : Formula n k m) : Prop :=
  βˆ€ j, SatisfiesClause Οƒ (F j)

def Satisfiable {n k m : β„•} (F : Formula n k m) : Prop :=
  βˆƒ Οƒ : Assignment n, Satisfies Οƒ F

noncomputable def properSATProbability (n k m : β„•) : ℝ := by
  classical
  exact (Fintype.card { F : Formula n k m // Satisfiable F } : ℝ) /
    (Fintype.card (Formula n k m) : ℝ)

def HasLimitingThreshold (k : β„•) : Prop :=
  βˆƒ Ξ± : ℝ, 0 < Ξ± ∧
    (βˆ€ c : ℝ, 0 ≀ c β†’ c < Ξ± β†’
      Filter.Tendsto (fun n : β„• => properSATProbability n k ⌊c * (n : ℝ)βŒ‹β‚Š)
        Filter.atTop (nhds 1)) ∧
    (βˆ€ c : ℝ, Ξ± < c β†’
      Filter.Tendsto (fun n : β„• => properSATProbability n k ⌊c * (n : ℝ)βŒ‹β‚Š)
        Filter.atTop (nhds 0))

end FixedClauseThreshold

end OAI