Documentation

Studies.HoulihanEtAl2023

Houlihan et al. (2023): Emotion prediction as computation over a generative theory of mind #

This file formalizes the inverse planning and computed appraisal modules of [HKWH+23] for the Split or Steal game. A Player values an outcome by three Fehr–Schmidt base features, money against a reference point and the two inequities, weighted by preferences and passed through a value function; the expected base utility of an action under the player's belief about the opponent is (3.1) (Setting.expectedBaseUtility), the softmax policy is (3.3) (Setting.policy), and the observer's inverse inference (3.4) is the posterior kernel of the plan over a finite prior (Setting.posterior). The public game adds the reputation utilities of (3.2), the base weights an observer of the anonymous game would infer from the action (Setting.expectedPublicUtility).

The direction of the inferences in Figure 2 follows from the covariance form of Bayes' rule: observing cooperation raises the posterior expectation of any statistic that monovaries with the expected-utility gap in favour of cooperating, and in Split or Steal that gap increases in the advantageous-inequity weight and decreases in the money and disadvantageous-inequity weights. The appraisals of Section 4, achieved utility, prediction error and the two counterfactuals, then carry structural signs: a cooperator whose opponent stole has a negative disadvantageous-inequity prediction error and a positive opponent counterfactual, the two loadings of the learned envy concept, and a player who stole from a cooperator has a negative advantageous-inequity utility that cooperating would have spared.

Implementation notes #

References #

The game #

Split (cooperate) or steal (defect).

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    @[instance_reducible]
    Equations
    theorem HoulihanEtAl2023.sum_action {β : Type u_1} [AddCommMonoid β] (f : Action → β) :
    theorem HoulihanEtAl2023.payoff_cooperate_le_defect {pot : ℝ} (hpot : 0 ≤ pot) (a₂ : Action) :

    Stealing weakly dominates in money.

    The three base features of an outcome: money and the two inequities of Fehr and Schmidt's utility.

    Instances For
      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.
      theorem HoulihanEtAl2023.sum_domain {β : Type u_1} [AddCommMonoid β] (f : Domain → β) :
      ∑ d : Domain, f d = f Domain.money + f Domain.aia + f Domain.dia
      noncomputable def HoulihanEtAl2023.Domain.feature (pot ref : ℝ) (a₁ a₂ : Action) :
      Domain → ℝ

      The base feature of an outcome in a domain, money measured against the reference point ref.

      Equations
      Instances For

        Money is sought and the inequities are avoided: the signs of (3.1).

        Equations
        Instances For

          The reputation utilities of (3.2) carry the opposite signs: players want to be seen as motivated by equality rather than by money.

          Equations
          Instances For
            theorem HoulihanEtAl2023.feature_aia_cooperate {pot ref : ℝ} (hpot : 0 ≤ pot) (a₂ : Action) :
            theorem HoulihanEtAl2023.feature_dia_defect {pot ref : ℝ} (hpot : 0 ≤ pot) (a₂ : Action) :
            theorem HoulihanEtAl2023.feature_money {pot ref : ℝ} (a₁ a₂ : Action) :
            Domain.feature pot ref a₁ a₂ Domain.money = payoff pot a₁ a₂ - ref

            Players and the forward model #

            A simulated player: base preference weights, reputation weights, the belief π_{a₂} that the opponent cooperates, and the reference point π_Money.

            • base : Domain → ℝ
            • repu : Domain → ℝ
            • belief : ℝ
            • reference : ℝ
            Instances For

              The belief as a distribution over the opponent's action.

              Equations
              Instances For

                The player after learning the opponent's action (footnote 3).

                Equations
                Instances For

                  The fixed parameters of a game: the value function ν, the rationality lam of the softmax (the paper's λ) and the pot.

                  • ν : ℝ → ℝ
                  • ν_zero : self.ν 0 = 0
                  • ν_strictMono : StrictMono self.ν
                  • lam : ℝ
                  • lam_pos : 0 < self.lam
                  • pot : ℝ
                  • pot_pos : 0 < self.pot
                  Instances For
                    noncomputable def HoulihanEtAl2023.Setting.domainUtility (S : Setting) (q : Player) (a₁ a₂ : Action) (d : Domain) :
                    ℝ

                    The subjective utility of an outcome in one domain: the signed, weighted value of its feature, the summands of (3.1).

                    Equations
                    Instances For
                      noncomputable def HoulihanEtAl2023.Setting.baseUtility (S : Setting) (q : Player) (a₁ a₂ : Action) :
                      ℝ

                      The base utility of an outcome, summed over the domains.

                      Equations
                      Instances For
                        noncomputable def HoulihanEtAl2023.Setting.expectedBaseUtility (S : Setting) (q : Player) (a₁ : Action) :
                        ℝ

                        (3.1): the expected base utility of an action under the belief about the opponent.

                        Equations
                        Instances For

                          The expected-utility gap in favour of cooperating: cooperation forgoes money and risks disadvantageous inequity, and avoids advantageous inequity.

                          noncomputable def HoulihanEtAl2023.Setting.policy (S : Setting) (U : Player → Action → ℝ) (q : Player) (a : Action) :
                          ℝ

                          (3.3): the softmax policy at rationality lam for a utility U.

                          Equations
                          Instances For
                            theorem HoulihanEtAl2023.Setting.policy_eq_sigmoid (S : Setting) (U : Player → Action → ℝ) (q : Player) (a : Action) :
                            S.policy U q a = (S.lam * (U q a - U q a.other)).sigmoid

                            With two actions the softmax is the logistic function of the scaled utility gap.

                            theorem HoulihanEtAl2023.Setting.policy_pos (S : Setting) (U : Player → Action → ℝ) (q : Player) (a : Action) :
                            0 < S.policy U q a
                            @[simp]
                            theorem HoulihanEtAl2023.Setting.toReal_ofReal_policy (S : Setting) (U : Player → Action → ℝ) (q : Player) (a : Action) :
                            (ENNReal.ofReal (S.policy U q a)).toReal = S.policy U q a

                            A player certain that the opponent will steal cooperates at most half the time: the gap of (3.1) is then the disadvantageous-inequity cost of cooperating.

                            A player certain that the opponent will split prefers to cooperate exactly when the advantageous-inequity cost of stealing outweighs the money it gains: the Fehr–Schmidt account of cooperation.

                            Inverse planning #

                            noncomputable def HoulihanEtAl2023.Setting.plan (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) :
                            ProbabilityTheory.Kernel Ω Action

                            The forward model as a kernel from the prior's support to actions.

                            Equations
                            Instances For
                              theorem HoulihanEtAl2023.Setting.plan_real (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) (ω : Ω) (a : Action) :
                              ((S.plan U p) ω).real {a} = S.policy U (p ω) a
                              theorem HoulihanEtAl2023.Setting.plan_apply_singleton_ne_zero (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) (ω : Ω) (a : Action) :
                              ((S.plan U p) ω) {a} ≠ 0
                              instance HoulihanEtAl2023.Setting.instIsMarkovKernelActionPlan (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) :
                              ProbabilityTheory.IsMarkovKernel (S.plan U p)
                              theorem HoulihanEtAl2023.Setting.comp_plan_ne_zero (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (a : Action) :
                              (μ.bind ⇑(S.plan U p)) {a} ≠ 0
                              noncomputable def HoulihanEtAl2023.Setting.posterior (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty Ω] :
                              ProbabilityTheory.Kernel Action Ω

                              (3.4): the observer's inverse inference, the posterior kernel of the plan.

                              Equations
                              Instances For
                                noncomputable def HoulihanEtAl2023.Setting.expectation (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] [Nonempty Ω] (f : Player → ℝ) (a : Action) :
                                ℝ

                                The posterior expectation of a statistic of the player after observing an action.

                                Equations
                                Instances For
                                  noncomputable def HoulihanEtAl2023.priorExpectation {Ω : Type u_1} [MeasurableSpace Ω] (μ : MeasureTheory.Measure Ω) (p : Ω → Player) (f : Player → ℝ) :
                                  ℝ

                                  The prior expectation of a statistic of the player.

                                  Equations
                                  Instances For
                                    theorem HoulihanEtAl2023.Setting.priorExpectation_le_expectation_cooperate (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] {f : Player → ℝ} (hf : Monovary (f ∘ p) fun (ω : Ω) => U (p ω) Action.cooperate - U (p ω) Action.defect) :

                                    Observing cooperation raises the expectation of any statistic that monovaries with the utility gap in favour of cooperating: Bayes' rule reweights the prior by the policy, which is increasing in the gap.

                                    theorem HoulihanEtAl2023.Setting.expectation_defect_le_priorExpectation (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] {f : Player → ℝ} (hf : Monovary (f ∘ p) fun (ω : Ω) => U (p ω) Action.cooperate - U (p ω) Action.defect) :

                                    Observing defection lowers it.

                                    theorem HoulihanEtAl2023.Setting.expectation_defect_le_expectation_cooperate (S : Setting) (U : Player → Action → ℝ) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] {f : Player → ℝ} (hf : Monovary (f ∘ p) fun (ω : Ω) => U (p ω) Action.cooperate - U (p ω) Action.defect) :
                                    def HoulihanEtAl2023.Setting.VariesOnly {Ω : Type u_1} (p : Ω → Player) (d : Domain) :

                                    A prior that varies only in the weight of one domain.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem HoulihanEtAl2023.Setting.expectation_aia_defect_le_cooperate (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (h : VariesOnly p Domain.aia) (hb : ∀ (ω : Ω), 0 ≤ (p ω).belief) :

                                      Figure 2: a cooperator is inferred to be more averse to advantageous inequity.

                                      theorem HoulihanEtAl2023.Setting.expectation_money_cooperate_le_defect (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (h : VariesOnly p Domain.money) (hb : ∀ (ω : Ω), 0 ≤ (p ω).belief) :

                                      Figure 2: a cooperator is inferred to be less motivated by money.

                                      theorem HoulihanEtAl2023.Setting.expectation_dia_cooperate_le_defect (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (h : VariesOnly p Domain.dia) (hb : ∀ (ω : Ω), (p ω).belief ≤ 1) :

                                      Figure 2: a cooperator is inferred to be less averse to disadvantageous inequity.

                                      The public game #

                                      noncomputable def HoulihanEtAl2023.Setting.reputation (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (d : Domain) (a₁ : Action) :
                                      ℝ

                                      The expected reputation in a domain: the base weight an observer of the anonymous game would infer from the action.

                                      Equations
                                      Instances For
                                        noncomputable def HoulihanEtAl2023.Setting.expectedPublicUtility (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (q : Player) (a₁ : Action) :
                                        ℝ

                                        (3.2): the expected utility of an action in the public game, the base utility plus the reputation utilities, each the value of the inferred base weight scaled by the pot.

                                        Equations
                                        Instances For
                                          theorem HoulihanEtAl2023.Setting.policy_cooperate_le_policy_public (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (q : Player) (hm : q.repu Domain.money = 0) (hd : q.repu Domain.dia = 0) (ha : 0 ≤ q.repu Domain.aia) (hrep : S.reputation p μ Domain.aia Action.defect ≤ S.reputation p μ Domain.aia Action.cooperate) :

                                          A player whose reputation concern is to be seen as averse to advantageous inequity cooperates at least as often in public as in private, since cooperating is inferred to reflect more of that aversion.

                                          theorem HoulihanEtAl2023.Setting.policy_public_le_policy_cooperate (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (q : Player) (hm : q.repu Domain.money = 0) (ha : q.repu Domain.aia = 0) (hd : 0 ≤ q.repu Domain.dia) (hrep : S.reputation p μ Domain.dia Action.cooperate ≤ S.reputation p μ Domain.dia Action.defect) :

                                          A player whose reputation concern is to be seen as averse to disadvantageous inequity cooperates at most as often in public, since stealing is inferred to reflect more of it.

                                          noncomputable def HoulihanEtAl2023.Setting.publicPosterior (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] :
                                          ProbabilityTheory.Kernel Action Ω

                                          (3.4) for the public game: the inverse inference over the six weights and the belief.

                                          Equations
                                          Instances For

                                            Computed appraisals (Section 4) #

                                            noncomputable def HoulihanEtAl2023.Setting.expectedDomainUtility (S : Setting) (q : Player) (a₁ : Action) (d : Domain) :
                                            ℝ

                                            The expected utility of an action in a domain during planning.

                                            Equations
                                            Instances For
                                              noncomputable def HoulihanEtAl2023.Setting.predictionError (S : Setting) (q : Player) (a₁ a₂ : Action) (d : Domain) :
                                              ℝ

                                              Prediction error: the achieved utility of the outcome less the utility expected during planning.

                                              Equations
                                              Instances For
                                                noncomputable def HoulihanEtAl2023.Setting.opponentCounterfactual (S : Setting) (q : Player) (a₁ a₂ : Action) (d : Domain) :
                                                ℝ

                                                The opponent counterfactual CFa₂: the utility the opponent's other choice would have brought, weighted by the belief that the opponent would make it.

                                                Equations
                                                Instances For
                                                  noncomputable def HoulihanEtAl2023.Setting.agentCounterfactual (S : Setting) (q : Player) (U : Player → Action → ℝ) (a₁ a₂ : Action) (d : Domain) :
                                                  ℝ

                                                  The agent counterfactual CFa₁: the utility the player's other choice would have brought, weighted by the probability of that choice under the policy of the player who knows the opponent's action (footnote 3).

                                                  Equations
                                                  Instances For

                                                    The absolute prediction error of the opponent's action, |PE_{π_{a₂}}|.

                                                    Equations
                                                    Instances For

                                                      Envy's first loading (Figure 5b): a cooperator whose opponent stole is in a more disadvantageous position than expected.

                                                      Envy's second loading (Figure 5b): had the opponent split, the cooperator would have been in a less disadvantageous position.

                                                      Guilt's structural condition: stealing from a splitter costs advantageous-inequity utility.

                                                      Guilt's structural condition: splitting would have spared that cost.

                                                      Gratitude's structural condition: had the opponent stolen from a splitter, the money would have been worse.

                                                      When both steal, a defector who had split would have been left with nothing against a full pot: the base agent counterfactual is relief rather than regret in the disadvantageous domain, so regret after mutual stealing must come from reputation.

                                                      noncomputable def HoulihanEtAl2023.Setting.reputationUtility (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (q : Player) (a₁ : Action) (d : Domain) :
                                                      ℝ

                                                      The reputation utility of an action in a domain, the summands of (3.2).

                                                      Equations
                                                      Instances For
                                                        noncomputable def HoulihanEtAl2023.Setting.reputationAgentCounterfactual (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (q : Player) (U : Player → Action → ℝ) (a₁ a₂ : Action) (d : Domain) :
                                                        ℝ

                                                        The agent counterfactual over reputation.

                                                        Equations
                                                        Instances For
                                                          theorem HoulihanEtAl2023.Setting.reputationAgentCounterfactual_aia_defect_nonneg (S : Setting) {Ω : Type u_1} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Fintype Ω] [Nonempty Ω] (p : Ω → Player) (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsProbabilityMeasure μ] (q : Player) (U : Player → Action → ℝ) (ha : 0 ≤ q.repu Domain.aia) (hrep : S.reputation p μ Domain.aia Action.defect ≤ S.reputation p μ Domain.aia Action.cooperate) (a₂ : Action) :

                                                          Regret and guilt over reputation: whatever the opponent did, a defector who cares to be seen as averse to advantageous inequity would have been seen as more so had they split.

                                                          Lesions (Section 5) #

                                                          The social lesion keeps only the money appraisals; a reader of monetary achieved utility then ranks stealing from a splitter above splitting with one, whereas observers predict similar joy for both.

                                                          def HoulihanEtAl2023.lesionedPosterior {Ω : Type u_1} [MeasurableSpace Ω] (μ : MeasureTheory.Measure Ω) :
                                                          ProbabilityTheory.Kernel Action Ω

                                                          The inverse planning lesion: the posterior of (3.4) replaced by the prior, so that the inferred preferences and beliefs no longer depend on the action.

                                                          Equations
                                                          Instances For
                                                            theorem HoulihanEtAl2023.lesionedPosterior_expectation {Ω : Type u_1} [MeasurableSpace Ω] (μ : MeasureTheory.Measure Ω) (p : Ω → Player) (f : Player → ℝ) (a : Action) :
                                                            ∫ (ω : Ω), f (p ω) ∂(lesionedPosterior μ) a = priorExpectation μ p f