While this submission is a draft, it cannot be used by other submissions.

Reusing a one-bit encryption pad — definitions

Lax755887.ReusedKey · concepts/Lax755887/ReusedKey.lean · lax-755887

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    Equal marginal distributions do not determine a joint distribution. The composition contract deliberately omits a condition on joint randomness.

    Concept map
    1 concept; 3 descendants hidden
    100%
    Proven claimOpen claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib
    2
    3/-!
    4---
    5title: Reusing a one-bit encryption pad — definitions
    6type: definition
    7---
    8Equal marginal distributions do not determine a joint distribution. The composition contract deliberately omits a condition on joint randomness.
    9-/
    10
    11namespace Lax755887.ReusedKey
    12
    13def probability (event : Bool → Bool) : ℚ :=
    14 ((if event false then 1 else 0) + (if event true then 1 else 0)) / 2
    15
    16def SameLaw {α : Type} (X Y : Bool → α) : Prop :=
    17 ∀ test : α → Bool, probability (fun k => test (X k)) = probability (fun k => test (Y k))
    18
    19def transcript (secret key : Bool) : Bool × Bool := (key, Bool.xor key secret)
    20
    21def success (guess : Bool × Bool → Bool) : ℚ :=
    22 (probability (fun k => !(guess (transcript false k))) +
    23 probability (fun k => guess (transcript true k))) / 2
    24
    25end Lax755887.ReusedKey
    26

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…