                                        Safety-Polarized and Prioritized Reinforcement Learning



B. Theortical Proofs

B.1. Proofs of Lemma 3.1

Proof : For the contraction property, ∀(s, a) ∈ S × A, we have



               Bζ Q1 (s, a) − Bζ Q2 (s, a)



               = r(s, a) + γEs′ ∼P (·|s,a) ′ max ′ Q1 (s′ , a′ ) − r(s, a) − γEs′ ∼P (·|s,a) ′ max ′ Q2 (s′ , a′ ) ,

                                              a ∈Cζ (s )                                    a ∈Cζ (s )

                                 h                                           i

                                                    ′ ′                  ′ ′

               = γEs′ ∼P (·|s,a) ′ max ′ Q1 (s , a ) − ′ max ′ Q2 (s , a )

                                   a ∈Cζ (s )            a ∈Cζ (s )

                                h                                    i                                              

                                                    ′ ′

               ≤ γEs′ ∼P (·|s,a) ′ max ′ Q1 (s , a ) − Q2 (s′ , a′ )      max Q1 − max Q2 ≤ max Q1 − Q2

                                     a ∈Cζ (s )                                  a           a            a



               ≤ γ max

                    ′ ′

                        Q1 (s′ , a′ ) − Q2 (s′ , a′ ) ,

                     s ,a







and thus

                                                   ∥Bζ Q1 − Bζ Q2 ∥∞ ≤ γ∥Q1 − Q2 ∥∞ ,



where ∥Q∥∞ := maxs,a |Q(s, a)| is the L∞ -norm. Therefore Bζ is a γ-contraction (with respect to the L∞ -norm).

Let Q∗ζ be the unique fixed point of Bζ and πζ∗ (s) := arg maxa∈Cζ (s) Q∗ζ (s, a) be the corresponding policy induced by Q∗ζ .

For the safety optimality of πζ∗ , since πζ∗ (s) always chooses actions among the optimal action mask Cζ (s), ∀s ∈ S, which

masks out the action with non-minimal unsafe probability, the unsafe probability of πζ∗ is the same as π ∗ and thus safety

optimal, i.e.,

                                                  πζ∗ ∈ arg min s Pr

                                                                  ∼ρ,

                                                                      [∃st ∈ τ : st ∈ Su ].

                                                             π     0

                                                                 τ ∼(π,P )





For the reward optimality, this follows from the fact that π ∗ will only select actions in Cζ (s) since π ∗ ∈

                                                                            ∗

arg minπ Pr s0 ∼ρ, [∃st ∈ τ : st ∈ Su ]. Therefore the Bellman backup of Qπ is the same as that of Q∗ζ , which

               τ ∼(π,P )

implies that

                                                     ∗

                                                  Qπ (s, a) = Q∗ζ (s, a), ∀s ∈ S, a ∈ Cζ (s).



As a result, πζ∗ is reward optimal.







B.2. Proof of Lemma 4.2

Proof : First, if s ∈ Su , then ψ π (s, a) = 1 by definition and the result holds clearly. Therefore we assume s ∈        / Su . Let

τ = {s0 = s, a0 = a, s1 , · · · , st , at , · · · } ∼ (π, P ) be a sampling trajectory starting from state s0 = s and action a0 = a

using policy π with transition function P . Then we have

                                                   h                                      i

                           ψ π (s, a) = Eτ ∼(π,P ) max I[st ∈ Su ] s0 = s, a0 = a

                                                     st ∈τ

                                                                   h                                              i

                                      = Es′ ∼P (·|s,a),a′ ∼π(·|s′ ) Eτ1 ∼(π,P ) max I[st ∈ Su ] s1 = s′ , a1 = a′

                                                                                   st ∈τ1

                                                                   h              i

                                      = Es′ ∼P (·|s,a),a′ ∼π(·|s′ ) ψ π (s′ , a′ )



where τ1 = {s1 = s′ , a1 = a′ , . . . , st , . . . } ∼ (π, P ) is the sampling trajectory starting from state s′ and action a′ . This

completes the proof.







                                                                       13

