Compfiles/Usa1974P4.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned compfiles documentation, Pinned compfiles corpus index
10 declarations, 0 contain sorry, 0 declared as axioms
USA Mathematical Olympiad 1974, Problem 4
A, B, C play a series of games. Each game is between two players. The next game is between the winner and the person who was not playing. The series continues until one player has won two games. He wins the series. A is the weakest player, C the strongest. Each player has a fixed probability of winning against a given opponent. A chooses who plays the first game. Show that he should choose to play himself against B.
Imported by 1 file
- inductive
Usa1974P4.PlayerThe three players of the series line 32 sourceSource documentation
The three players of the series.
no axioms what this means
inductive Player | A | B | C deriving DecidableEq /-- The player who sits out a game between `x` and `y`. Only meaningful for `x ≠ y`; returns `A` on the diagonal. -/
- def
Usa1974P4.thirdThe player who sits out a game betweenxandyline 37 sourceSource documentation
The player who sits out a game between
xandy. Only meaningful forx ≠ y; returnsAon the diagonal.standard axioms: propext what this means
Statement uses: Usa1974P4.Player
Proof uses:
Usa1974P4.third.match_1,Unit,Usa1974P4.Player.C,Usa1974P4.Player.B,Usa1974P4.Player.Adef third : Player → Player → Player | .A, .B => .C | .B, .A => .C | .A, .C => .B | .C, .A => .B | .B, .C => .A | .C, .B => .A | _, _ => .A /-- The probability that player `A` wins the series, where * `win x y` is the probability that `x` beats `y` in a single game,
Mentions: Usa1974P4.Player
- def
Usa1974P4.probWinADocumented declaration: probWinA line 59 sourceSource documentation
The probability that player
Awins the series, wherewin x yis the probability thatxbeatsyin a single game,- the next game is played between
w(the winner of the previous game) andi(the player who sat out the previous game); the loser of a game sits out the next one, histis the list of winners of the games played so far, andnis a fuel bounding the number of games still to be played.
The series ends as soon as some player has won two games in total, so it lasts at most four games: if no one has won twice after three games then the three winners so far are three distinct players, and the fourth game is played between two of them, so its winner reaches two wins.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
Real,Nat,List2 instances, coercions and auxiliary constants left out.
def probWinA (win : Player → Player → ℝ) : ℕ → Player → Player → List Player → ℝ | 0, _, _, _ => 0 | n + 1, w, i, hist => win w i * (if w ∈ hist then (if w = .A then 1 else 0) else probWinA win n w (third w i) (w :: hist)) + win i w * (if i ∈ hist then (if i = .A then 1 else 0) else probWinA win n i (third w i) (i :: hist)) /-- The probability that A wins the series when the first game is A against B. -/Mentions: Usa1974P4.Player, Usa1974P4.third
- def
Usa1974P4.probFirstABThe probability that A wins the series when the first game is A against B line 69 sourceSource documentation
The probability that A wins the series when the first game is A against B.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
RealProof uses: Usa1974P4.probWinA,
OfNat.ofNat,Nat,Usa1974P4.Player.A,Usa1974P4.Player.B,List.nil1 instances, coercions and auxiliary constants left out.
def probFirstAB (win : Player → Player → ℝ) : ℝ := probWinA win 4 .A .B []
Mentions: Usa1974P4.Player, Usa1974P4.probWinA
- def
Usa1974P4.probFirstACThe probability that A wins the series when the first game is A against C line 72 sourceSource documentation
The probability that A wins the series when the first game is A against C.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
RealProof uses: Usa1974P4.probWinA,
OfNat.ofNat,Nat,Usa1974P4.Player.A,Usa1974P4.Player.C,List.nil1 instances, coercions and auxiliary constants left out.
def probFirstAC (win : Player → Player → ℝ) : ℝ := probWinA win 4 .A .C []
Mentions: Usa1974P4.Player, Usa1974P4.probWinA
- def
Usa1974P4.probFirstBCThe probability that A wins the series when the first game is B against C line 75 sourceSource documentation
The probability that A wins the series when the first game is B against C.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
RealProof uses: Usa1974P4.probWinA,
OfNat.ofNat,Nat,Usa1974P4.Player.B,Usa1974P4.Player.C,List.nil1 instances, coercions and auxiliary constants left out.
def probFirstBC (win : Player → Player → ℝ) : ℝ := probWinA win 4 .B .C [] …
Mentions: Usa1974P4.Player, Usa1974P4.probWinA
- lemma
Usa1974P4.probFirstAB_eqDocumented declaration: probFirstAB_eq line 82 sourceSource documentation
Expanding the game tree when the first game is A against B: writing XbY for "X beats Y", A wins the series exactly via the outcome sequences AbB · AbC, AbB · CbA · BbC · AbB, and BbA · CbB · AbC · AbB.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
Real,Eq,Usa1974P4.Player.B,Usa1974P4.Player.A,HSub.hSub,OfNat.ofNat,Usa1974P4.Player.C, Usa1974P4.probFirstAB,HAdd.hAdd,HMul.hMulProof uses:
Eq.mpr,id,congrFun',congrArg,congr,ite,Membership.mem,List,List.nil, Usa1974P4.probWinA, Usa1974P4.third,List.cons,Eq.trans,ite_eq_right_of_eq_false,ite_eq_left_of_eq_true,Or,True,False,eq_self,or_falseand 62 more57 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma probFirstAB_eq (win : Player → Player → ℝ) (hBA : win .B .A = 1 - win .A .B) (hCA : win .C .A = 1 - win .A .C) (hCB : win .C .B = 1 - win .B .C) : probFirstAB win = win .A .B * win .A .C + win .A .B * (1 - win .A .C) * win .B .C * win .A .B + (1 - win .A .B) * (1 - win .B .C) * win .A .C * win .A .B := by …Mentions: Usa1974P4.Player, Usa1974P4.probFirstAB
- lemma
Usa1974P4.probFirstAC_eqExpanding the game tree when the first game is A against C: A wins the series exactly via the outcome sequences AbC · AbB, AbC · BbA · CbB · AbC, and CbA · BbC · AbB · AbC line 94 sourceSource documentation
Expanding the game tree when the first game is A against C: A wins the series exactly via the outcome sequences AbC · AbB, AbC · BbA · CbB · AbC, and CbA · BbC · AbB · AbC.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
Real,Eq,Usa1974P4.Player.B,Usa1974P4.Player.A,HSub.hSub,OfNat.ofNat,Usa1974P4.Player.C, Usa1974P4.probFirstAC,HAdd.hAdd,HMul.hMulProof uses:
Eq.mpr,id,congrFun',congrArg,congr,ite,Membership.mem,List,List.nil, Usa1974P4.probWinA, Usa1974P4.third,List.cons,Eq.trans,ite_eq_right_of_eq_false,ite_eq_left_of_eq_true,Or,True,False,eq_self,or_falseand 60 more57 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma probFirstAC_eq (win : Player → Player → ℝ) (hBA : win .B .A = 1 - win .A .B) (hCA : win .C .A = 1 - win .A .C) (hCB : win .C .B = 1 - win .B .C) : probFirstAC win = win .A .C * win .A .B + win .A .C * (1 - win .A .B) * (1 - win .B .C) * win .A .C + (1 - win .A .C) * win .B .C * win .A .B * win .A .C := by …Mentions: Usa1974P4.Player, Usa1974P4.probFirstAC
- lemma
Usa1974P4.probFirstBC_eqExpanding the game tree when the first game is B against C: A wins the series exactly via the outcome sequences BbC · AbB · AbC and CbB · AbC · AbB line 105 sourceSource documentation
Expanding the game tree when the first game is B against C: A wins the series exactly via the outcome sequences BbC · AbB · AbC and CbB · AbC · AbB.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
Real,Eq,Usa1974P4.Player.B,Usa1974P4.Player.A,HSub.hSub,OfNat.ofNat,Usa1974P4.Player.C, Usa1974P4.probFirstBC,HAdd.hAdd,HMul.hMulProof uses:
Eq.mpr,id,congrFun',congrArg,congr,ite,Membership.mem,List,List.nil, Usa1974P4.probWinA, Usa1974P4.third,List.cons,Eq.trans,ite_eq_right_of_eq_false,ite_eq_left_of_eq_true,Or,True,False,eq_self,or_falseand 57 more57 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
lemma probFirstBC_eq (win : Player → Player → ℝ) (hBA : win .B .A = 1 - win .A .B) (hCA : win .C .A = 1 - win .A .C) (hCB : win .C .B = 1 - win .B .C) : probFirstBC win = win .B .C * win .A .B * win .A .C + (1 - win .B .C) * win .A .C * win .A .B := by …Mentions: Usa1974P4.Player, Usa1974P4.probFirstBC
- problem
Usa1974P4.usa1974_p4line 115 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses: Usa1974P4.Player,
Real,Ne,And,LT.lt,OfNat.ofNat,Eq,HAdd.hAdd,Usa1974P4.Player.A,Usa1974P4.Player.C,Usa1974P4.Player.B, Usa1974P4.probFirstBC, Usa1974P4.probFirstAB, Usa1974P4.probFirstACProof uses:
HSub.hSub,And.right,of_decide_eq_true,id,Bool,Decidable.decide,Bool.true,Eq.refl,Mathlib.Tactic.Linarith.eq_of_not_lt_of_not_gt,Not.intro,Mathlib.Tactic.Linarith.lt_irrefl,Eq.mp,Neg.neg,congrArg,Mathlib.Tactic.Ring.of_eq,Mathlib.Tactic.Ring.Common.add_congr,Nat.rawCast,Mathlib.Meta.NormNum.instAddMonoidWithOne,inferInstance,Ringand 67 more90 instances, coercions and auxiliary constants left out.
Tactic trace: 44 steps
Open to load the checked before-and-after goal states.