Skip to content

Independence -- Lean issues #43

@EmilyARussell

Description

@EmilyARussell

Here is the draft of the basic definitions and theorems for the independence and covariance sections of the Defs file. They do not work. I'm not sure what im not understanding about the notation for definitions and theorems but there are red lines for so many things. Specifically, I cannot figure out how to write the hypothesis properly using correct variables. And also it seems a different FinRV is necessary for probability and expectation. I'm at a loss. I will bring this all to class to discuss with Marek I just wanted to post to show what ive worked on without submitting a pull request full of errors.
------------------------------ Independence ---------------------------

section independence
variable {n : ℕ} {P : Findist n}
variable {X Y : FinRV n Bool}

def indpRV (X Y : FinRV n Bool) :=
ℙ[X * Y // P ] == ℙ[X//P]*ℙ[Y//P]

theorem indpCond (h: indpRV A B): ℙ[A|B//P] = ℙ[A//P] := !!! ERRORS
by sorry --unfold probability_cnd
-- ℙ[A | B // P] = ℙ[A * B // P] / ℙ[ B // P ]
-- this proof will have the dividing by 0 issue
-- with indp definition, otherwise simple

theorem indpExpectation (h: indp A B): 𝔼[AB // P] = 𝔼[A // P] * 𝔼[B // P] :=
by sorry
-- (xy) * v ℙ[X
Y] by defn expectation
-- (xy) * v ℙ[X] * ℙ[Y] := by hypothesis of independence
-- will need properties of dot products here

end independence

------------------------------ Covariance ---------------------------
section covariance
variable {n : ℕ} (P : Findist n) (X Y : FinRV n ℚ)

def covar : ℚ := 𝔼[X*Y // P] - 𝔼[X // P] * 𝔼[Y // P]

notation "cov[" X "," Y "//" P "]" => covar P X Y

theorem indpCov0 (h: indpRV X Y) : cov[X,Y//P] = 0 :=
by sorry
-- very simple given expectation theorem works, just use defn and its good

end covariance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions